-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathgo.js
More file actions
2051 lines (2051 loc) · 850 KB
/
go.js
File metadata and controls
2051 lines (2051 loc) · 850 KB
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
/*
* GoJS v1.7.0 JavaScript Library for HTML Diagrams
* Northwoods Software, https://www.nwoods.com/
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
* Copyright (C) 1998-2017 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.7.0/doc/license.html.
*/
(function(window) { var g,da={};if(!window.document||void 0===window.document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return f.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),f=this;c.prototype=this.prototype;b.prototype=new c;return b});
(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=(new Date).getTime(),f=Math.max(8,16-(c-a)),h=window.setTimeout(function(){b(c+f)},f);a=c+f;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(a){window.clearTimeout(a)})})();da.Debug=null;
var v={md:1,Tc:2,bd:4,ad:8,Dn:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),ZE:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),$E:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),YK:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Edge/"),Dk:void 0!==window.navigator&&void 0!==window.navigator.platform&&0<=window.navigator.platform.toUpperCase().indexOf("MAC"),
aF:void 0!==window.navigator&&void 0!==window.navigator.platform&&null!==window.navigator.platform.match(/(iPhone|iPod|iPad)/i),lE:function(a,b,c){var d=-1;return function(){var e=this,f=arguments;-1!==d&&v.clearTimeout(d);d=v.setTimeout(function(){d=-1;c||a.apply(e,f)},b);c&&!d&&a.apply(e,f)}},setTimeout:function(a,b){return window.setTimeout(a,b)},clearTimeout:function(a){window.clearTimeout(a)},createElement:function(a){return window.document.createElement(a)},k:function(a){throw Error(a);},ma:function(a,
b){var c="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(c+=" to value: "+b);v.k(c)},F:function(a,b,c,d){a instanceof b||(c=v.getTypeName(c),void 0!==d&&(c+="."+d),v.yd(a,b,c))},j:function(a,b,c,d){typeof a!==b&&(c=v.getTypeName(c),void 0!==d&&(c+="."+d),v.yd(a,b,c))},Zd:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=v.getTypeName(b),void 0!==c&&(b+="."+c),v.k(b+" must be a real number type, and not NaN or Infinity: "+a))},nb:function(a,b,c,d){a instanceof
ea&&a.Ge===b||(c=v.getTypeName(c),void 0!==d&&(c+="."+d),v.yd(a,"a constant of class "+v.lf(b),c))},xK:function(a,b){"string"===typeof a?ga(a)||v.k('Color "'+a+'" is not a valid color string for '+b):a instanceof ha||v.k("Value for "+b+" must be a color string or a Brush, not "+a)},yd:function(a,b,c,d){b=v.getTypeName(b);c=v.getTypeName(c);void 0!==d&&(c+="."+d);"string"===typeof a?v.k(c+" value is not an instance of "+b+': "'+a+'"'):v.k(c+" value is not an instance of "+b+": "+a)},Fa:function(a,
b,c,d){c=v.getTypeName(c);void 0!==d&&(c+="."+d);v.k(c+" is not in the range "+b+": "+a)},ld:function(a){v.k(v.lf(a)+" constructor cannot take any arguments.")},Oa:function(a){v.k("Collection was modified during iteration: "+a.toString()+"\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.")},Aj:function(a,b){v.k("No property to set for this enum value: "+b+" on "+a.toString())},trace:function(a){window.console&&
window.console.log(a)},Ww:{},Ct:function(a,b){!0!==v.Ww[a]&&(v.Ww[a]=!0,window.console&&window.console.log(a+" is deprecated in "+b+", see the GoJS change log for more information."))},Ta:function(a){return"object"===typeof a&&null!==a},isArray:function(a){return Array.isArray(a)||a instanceof NodeList||a instanceof HTMLCollection},pI:function(a){return Array.isArray(a)},Kz:function(a,b,c){v.isArray(a)||v.yd(a,"Array or NodeList or HTMLCollection",b,c)},Xa:function(a){return a.length},Fl:function(a){return Array.prototype.slice.call(a)},
Ea:function(a,b){Array.isArray(a);return a[b]},bE:function(a,b,c){Array.isArray(a)?a[b]=c:v.k("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Cl:function(a,b){if(Array.isArray(a))return a.indexOf(b);for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1},ph:function(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):v.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Eg:function(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):
v.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},ly:[],K:function(){var a=v.ly.pop();return void 0===a?new y:a},xb:function(a,b){var c=v.ly.pop();if(void 0===c)return new y(a,b);c.x=a;c.y=b;return c},v:function(a){v.ly.push(a)},xB:[],gm:function(){var a=v.xB.pop();return void 0===a?new ia:a},yk:function(a){v.xB.push(a)},my:[],Ef:function(){var a=v.my.pop();return void 0===a?new B:a},Ug:function(a,b,c,d){var e=v.my.pop();if(void 0===e)return new B(a,b,c,d);e.x=a;e.y=b;e.width=
c;e.height=d;return e},Gb:function(a){v.my.push(a)},yB:[],Ff:function(){var a=v.yB.pop();return void 0===a?new ja:a},we:function(a){v.yB.push(a)},ny:null,s:function(){var a=v.ny;return null!==a?(v.ny=null,a):new ka},q:function(a){a.reset();v.ny=a},wB:[],lb:function(){var a=v.wB.pop();return void 0===a?[]:a},wa:function(a){a.length=0;v.wB.push(a)},Jk:Object.freeze([]),km:1,pc:function(a){a.__gohashid=v.km++},Up:function(a){var b=a.__gohashid;void 0===b&&(b=v.km++,a.__gohashid=b);return b},Kd:function(a){return a.__gohashid},
ga:function(a,b){b.xy=a;da[a]=b},Ma:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},ii:function(a){a.MG=!0},defineProperty:function(a,b,c,d,e){v.j(a,"function","Util.defineProperty:classfunc");v.j(b,"object","Util.defineProperty:propobj");v.j(c,"function","Util.defineProperty:getter");v.j(d,"function","Util.defineProperty:setter");for(var f in b){b=b[f];c={get:c,set:d,enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,
f,c);e=Object.getOwnPropertyDescriptor(a.prototype,f);b&&e&&Object.defineProperty(a.prototype,b,e);break}},YJ:!1,u:function(a,b,c,d){v.j(a,"function","Util.defineReadOnlyProperty:classfunc");v.j(b,"object","Util.defineReadOnlyProperty:propobj");v.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var f=b[e];b={get:c,set:function(a){v.k('The property "'+f+'" is read-only and cannot be set to '+a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,
e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);f&&d&&Object.defineProperty(a.prototype,f,d);break}},ae:function(a,b){for(var c in b)b[c]=!0;a.prototype.IG=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?v.lf(a):null===a?"*":""},lf:function(a){if("function"===typeof a){if(a.xy)return a.xy;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,c).trim();if(""!==b)return a.xy=b}else if("object"===typeof a&&a.constructor)return v.lf(a.constructor);
return typeof a},p:function(a,b,c){v.j(a,"function","Util.defineEnumValue:classfunc");v.j(b,"string","Util.defineEnumValue:name");v.j(c,"number","Util.defineEnumValue:num");c=new ea(a,b,c);Object.freeze(c);a[b]=c;var d=a.Nu;d instanceof la||(d=new la("string",ea),a.Nu=d);d.add(b,c);return c},sb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute?(c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c},Na:function(a,b,c){if(a&&
b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}},Bu:function(a,b){v.j(a,"object","Setting properties requires Objects as arguments");v.j(b,"object","Setting properties requires Objects as arguments");var c=a instanceof D,d=a instanceof E,e;for(e in b){""===e&&v.k("Setting properties requires non-empty property names");var f=a,h=e;if(c||d){var k=e.indexOf(".");if(0<k){var l=e.substring(0,k);if(c)f=a.ud(l);else if(f=a[l],void 0===f||null===
f)f=a.$a[l];v.Ta(f)?h=e.substr(k+1):v.k("Unable to find object named: "+l+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==h[0]&&!v.QE(f,h))if(d&&"ModelChanged"===h){a.$G(b[h]);continue}else if(d&&"Changed"===h){a.fn(b[h]);continue}else if(d&&v.QE(a.$a,h))f=a.$a;else if(d&&pa(a,h)){a.Fz(h,b[h]);continue}else if(a instanceof F&&"Changed"===h){a.fn(b[h]);continue}else v.k('Trying to set undefined property "'+h+'" on object: '+f.toString());f[h]=b[e];"_"===h[0]&&f instanceof G&&f.XG(h)}},
QE:function(a,b){if(a.hasOwnProperty(b))return!0;for(var c=Object.getPrototypeOf(a);c&&c!==Function;){if(c.hasOwnProperty(b))return!0;var d=c.IG;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},fJ:function(a){for(var b=[],c=0;256>c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0,f="",h=0;h<a.length;h++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(h)^b[(b[c]+b[d])%256]);return f},dI:function(a){for(var b=
[],c=0;256>c;c++)b["0123456789abcdef".charAt(c>>4)+"0123456789abcdef".charAt(c&15)]=String.fromCharCode(c);a.length%2&&(a="0"+a);for(var d=[],e=0,c=0;c<a.length;c+=2)d[e++]=b[a.substr(c,2)];a=d.join("");return""===a?"0":a},Fg:function(a){return v.fJ(v.dI(a))},im:null,adym:"7da71ca0ad381e90",vfo:"2be641fdb3",mH:"@COLOR1",nH:"@COLOR2"};
v.im=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[v.Fg("7ca11abfd022028846")]=v.Fg("398c3597c01238");for(var c=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22422913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[v.Fg("7ca11abfd7330390")](v.Fg(c[d-1]),10,15*d+0);b[v.Fg("7ca11abfd022028846")]=v.Fg("39f046ebb36e4b");for(d=1;5>d;d++)b[v.Fg("7ca11abfd7330390")](v.Fg(c[d-
1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])v.p=function(a,b){var c=new ea(a,b,2);Object.freeze(c);a[b]=c;var d=a.Nu;d instanceof la||(d=new la("string",ea),a.Nu=d);d.add(b,c);return c};return a}();function ea(a,b,c){v.pc(this);this.MB=a;this.Qb=b;this.RG=c}v.ga("EnumValue",ea);ea.prototype.toString=function(){return v.lf(this.MB)+"."+this.Qb};v.u(ea,{Ge:"classType"},function(){return this.MB});v.u(ea,{name:"name"},function(){return this.Qb});v.u(ea,{value:"value"},function(){return this.RG});
var qa;ea.findName=qa=function(a,b){if(void 0===b||null===b||""===b)return null;v.j(a,"function","findName:classfunc");v.j(b,"string","EnumValue.findName:name");var c=a.Nu;return c instanceof la?c.na(b):null};function sa(){this.KB=[]}sa.prototype.toString=function(){return this.KB.join("")};sa.prototype.add=function(a){""!==a&&this.KB.push(a)};function ua(){}
function va(a){void 0===a&&(a=42);this.seed=a;this.hy=48271;this.Mu=2147483647;this.vB=this.Mu/this.hy;this.uG=this.Mu%this.hy;this.tG=1/this.Mu;this.random()}va.prototype.random=function(){var a=this.seed%this.vB*this.hy-this.seed/this.vB*this.uG;this.seed=0<a?a:a+this.Mu;return this.seed*this.tG};function wa(){}v.u(wa,{i:"iterator"},function(){return this});wa.prototype.reset=wa.prototype.reset=function(){};wa.prototype.next=wa.prototype.hasNext=wa.prototype.next=function(){return!1};
wa.prototype.first=wa.prototype.first=function(){return null};wa.prototype.any=function(){return!1};wa.prototype.all=function(){return!0};wa.prototype.each=function(){return this};wa.prototype.map=function(){return this};wa.prototype.filter=function(){return this};wa.prototype.concat=function(a){return a.i};v.u(wa,{count:"count"},function(){return 0});wa.prototype.Hf=function(){};wa.prototype.toString=function(){return"EmptyIterator"};var xa=new wa;function ya(a){this.key=-1;this.value=a}
v.ae(ya,{key:!0,value:!0});v.u(ya,{i:"iterator"},function(){return this});ya.prototype.reset=ya.prototype.reset=function(){this.key=-1};ya.prototype.next=ya.prototype.hasNext=ya.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};ya.prototype.first=ya.prototype.first=function(){this.key=0;return this.value};ya.prototype.any=function(a){this.key=-1;return a(this.value)};ya.prototype.all=function(a){this.key=-1;return a(this.value)};
ya.prototype.each=function(a){this.key=-1;a(this.value);return this};ya.prototype.map=function(a){return new ya(a(this.value))};ya.prototype.filter=function(a){return a(this.value)?new ya(this.value):xa};ya.prototype.concat=function(a){return new za(this,a.i)};v.u(ya,{count:"count"},function(){return 1});ya.prototype.Hf=function(){this.value=null};ya.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function za(a,b){this.hl=a;this.il=b;this.Ou=!1}v.ae(za,{key:!0,value:!0});
v.u(za,{i:"iterator"},function(){return this});za.prototype.reset=za.prototype.reset=function(){this.hl.reset();this.il.reset();this.Ou=!1};za.prototype.next=za.prototype.hasNext=za.prototype.next=function(){if(!this.Ou){var a=this.hl;if(a.next())return this.key=a.key,this.value=a.value,!0;this.Ou=!0}return this.Ou&&(a=this.il,a.next())?(this.key=a.key,this.value=a.value,!0):!1};za.prototype.first=za.prototype.first=function(){this.reset();return this.next()?this.value:null};
za.prototype.any=function(a){return this.hl.any(a)||this.il.any(a)?!0:!1};za.prototype.all=function(a){return this.hl.all(a)&&this.il.all(a)?!0:!1};za.prototype.each=function(a){this.hl.each(a);this.il.each(a);return this};za.prototype.map=function(a){return new za(this.hl.map(a),this.il.map(a))};za.prototype.filter=function(a){return new za(this.hl.filter(a),this.il.filter(a))};za.prototype.concat=function(a){return new za(this,a.i)};v.u(za,{count:"count"},function(){return this.hl.count+this.il.count});
za.prototype.Hf=function(){this.value=this.key=null};za.prototype.toString=function(){return"ConcatIterator()"};function Aa(a){this.wc=a;this.Vh=null;this.reset()}v.ae(Aa,{key:!0,value:!0});v.u(Aa,{i:"iterator"},function(){return this});v.defineProperty(Aa,{On:"predicate"},function(){return this.Vh},function(a){this.Vh=a});Aa.prototype.reset=Aa.prototype.reset=function(){var a=this.wc;a.$b=null;this.ib=a.G;this.Uc=-1};
Aa.prototype.next=Aa.prototype.hasNext=Aa.prototype.next=function(){var a=this.wc;if(a.G!==this.ib){if(0>this.key)return!1;v.Oa(a)}var a=a.n,b=a.length,c=++this.Uc,d=this.Vh;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Uc=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Hf()}return!1};
Aa.prototype.first=Aa.prototype.first=function(){var a=this.wc;this.ib=a.G;this.Uc=0;var a=a.n,b=a.length,c=this.Vh;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Uc=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};Aa.prototype.any=function(a){var b=this.wc;b.$b=null;var c=b.G;this.Uc=-1;for(var d=b.n,e=d.length,f=this.Vh,h=0;h<e;h++){var k=d[h];if(null===f||f(k)){if(a(k))return!0;b.G!==c&&v.Oa(b)}}return!1};
Aa.prototype.all=function(a){var b=this.wc;b.$b=null;var c=b.G;this.Uc=-1;for(var d=b.n,e=d.length,f=this.Vh,h=0;h<e;h++){var k=d[h];if(null===f||f(k)){if(!a(k))return!1;b.G!==c&&v.Oa(b)}}return!0};Aa.prototype.each=function(a){var b=this.wc;b.$b=null;var c=b.G;this.Uc=-1;for(var d=b.n,e=d.length,f=this.Vh,h=0;h<e;h++){var k=d[h];if(null===f||f(k))a(k),b.G!==c&&v.Oa(b)}return this};
Aa.prototype.map=function(a){var b=this.wc;b.$b=null;var c=b.G;this.Uc=-1;for(var d=[],e=b.n,f=e.length,h=this.Vh,k=0;k<f;k++){var l=e[k];if(null===h||h(l))d.push(a(l)),b.G!==c&&v.Oa(b)}a=new I;a.n=d;a.Hc();return a.i};Aa.prototype.filter=function(a){var b=this.wc;b.$b=null;var c=b.G;this.Uc=-1;for(var d=[],e=b.n,f=e.length,h=this.Vh,k=0;k<f;k++){var l=e[k];if(null===h||h(l))a(l)&&d.push(l),b.G!==c&&v.Oa(b)}a=new I(b.ka);a.n=d;a.Hc();return a.i};
Aa.prototype.concat=function(a){this.wc.$b=null;return new za(this,a.i)};v.u(Aa,{count:"count"},function(){var a=this.Vh;if(null!==a){for(var b=0,c=this.wc.n,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.wc.n.length});Aa.prototype.Hf=function(){this.key=-1;this.value=null;this.ib=-1;this.Vh=null;this.wc.$b=this};Aa.prototype.toString=function(){return"ListIterator@"+this.Uc+"/"+this.wc.count};function Ba(a){this.wc=a;this.reset()}v.ae(Ba,{key:!0,value:!0});v.u(Ba,{i:"iterator"},function(){return this});
Ba.prototype.reset=Ba.prototype.reset=function(){var a=this.wc;a.Wj=null;this.ib=a.G;this.Uc=a.n.length};Ba.prototype.next=Ba.prototype.hasNext=Ba.prototype.next=function(){var a=this.wc;if(a.G!==this.ib){if(0>this.key)return!1;v.Oa(a)}var b=--this.Uc;if(0<=b)return this.key=b,this.value=a.n[b],!0;this.Hf();return!1};Ba.prototype.first=Ba.prototype.first=function(){var a=this.wc;this.ib=a.G;var b=a.n;this.Uc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};
Ba.prototype.any=function(a){var b=this.wc;b.Wj=null;var c=b.G,d=b.n,e=d.length;this.Uc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.G!==c&&v.Oa(b)}return!1};Ba.prototype.all=function(a){var b=this.wc;b.Wj=null;var c=b.G,d=b.n,e=d.length;this.Uc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.G!==c&&v.Oa(b)}return!0};Ba.prototype.each=function(a){var b=this.wc;b.Wj=null;var c=b.G,d=b.n,e=d.length;this.Uc=e;for(e-=1;0<=e;e--)a(d[e]),b.G!==c&&v.Oa(b);return this};
Ba.prototype.map=function(a){var b=this.wc;b.Wj=null;var c=b.G,d=[],e=b.n,f=e.length;this.Uc=f;for(f-=1;0<=f;f--)d.push(a(e[f])),b.G!==c&&v.Oa(b);a=new I;a.n=d;a.Hc();return a.i};Ba.prototype.filter=function(a){var b=this.wc;b.Wj=null;var c=b.G,d=[],e=b.n,f=e.length;this.Uc=f;for(f-=1;0<=f;f--){var h=e[f];a(h)&&d.push(h);b.G!==c&&v.Oa(b)}a=new I(b.ka);a.n=d;a.Hc();return a.i};Ba.prototype.concat=function(a){this.wc.Wj=null;return new za(this,a.i)};v.u(Ba,{count:"count"},function(){return this.wc.n.length});
Ba.prototype.Hf=function(){this.key=-1;this.value=null;this.ib=-1;this.wc.Wj=this};Ba.prototype.toString=function(){return"ListIteratorBackwards("+this.Uc+"/"+this.wc.count+")"};
function I(a){v.pc(this);this.Q=!1;this.n=[];this.G=0;this.Wj=this.$b=null;void 0===a||null===a?this.ka=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ka=a:v.Fa(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ka=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:v.Fa(a,"null, a primitive type name, or a class type",
"List constructor: type")}v.ga("List",I);I.prototype.Hc=function(){var a=this.G;a++;999999999<a&&(a=0);this.G=a};I.prototype.freeze=I.prototype.freeze=function(){this.Q=!0;return this};I.prototype.thaw=I.prototype.Ra=function(){this.Q=!1;return this};I.prototype.toString=function(){return"List("+v.getTypeName(this.ka)+")#"+v.Kd(this)};I.prototype.add=I.prototype.push=I.prototype.add=function(a){null!==a&&(this.Q&&v.ma(this,a),this.n.push(a),this.Hc())};
I.prototype.addAll=I.prototype.Kc=function(a){if(null===a)return this;this.Q&&v.ma(this);var b=this.n;if(v.isArray(a))for(var c=v.Xa(a),d=0;d<c;d++){var e=v.Ea(a,d);b.push(e)}else for(a=a.i;a.next();)e=a.value,b.push(e);this.Hc();return this};I.prototype.clear=I.prototype.clear=function(){this.Q&&v.ma(this);this.n.length=0;this.Hc()};I.prototype.contains=I.prototype.has=I.prototype.contains=function(a){return null===a?!1:-1!==this.n.indexOf(a)};
I.prototype.indexOf=I.prototype.indexOf=function(a){return null===a?-1:this.n.indexOf(a)};I.prototype.elt=I.prototype.get=I.prototype.fa=function(a){var b=this.n;(0>a||a>=b.length)&&v.Fa(a,"0 <= i < length",I,"elt:i");return b[a]};I.prototype.setElt=I.prototype.set=I.prototype.Rg=function(a,b){var c=this.n;(0>a||a>=c.length)&&v.Fa(a,"0 <= i < length",I,"setElt:i");this.Q&&v.ma(this,a);c[a]=b};I.prototype.first=I.prototype.first=function(){var a=this.n;return 0===a.length?null:a[0]};
I.prototype.last=I.prototype.fe=function(){var a=this.n,b=a.length;return 0<b?a[b-1]:null};I.prototype.pop=I.prototype.pop=function(){this.Q&&v.ma(this);var a=this.n;return 0<a.length?a.pop():null};I.prototype.any=function(a){for(var b=this.n,c=this.G,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.G!==c&&v.Oa(this)}return!1};I.prototype.all=function(a){for(var b=this.n,c=this.G,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.G!==c&&v.Oa(this)}return!0};
I.prototype.each=function(a){for(var b=this.n,c=this.G,d=b.length,e=0;e<d;e++)a(b[e]),this.G!==c&&v.Oa(this);return this};I.prototype.map=function(a){for(var b=new I,c=[],d=this.n,e=this.G,f=d.length,h=0;h<f;h++)c.push(a(d[h])),this.G!==e&&v.Oa(this);b.n=c;b.Hc();return b};I.prototype.filter=function(a){for(var b=new I(this.ka),c=[],d=this.n,e=this.G,f=d.length,h=0;h<f;h++){var k=d[h];a(k)&&c.push(k);this.G!==e&&v.Oa(this)}b.n=c;b.Hc();return b};I.prototype.concat=function(a){return this.copy().Kc(a)};
I.prototype.insertAt=I.prototype.Md=function(a,b){0>a&&v.Fa(a,">= 0",I,"insertAt:i");this.Q&&v.ma(this,a);var c=this.n;a>=c.length?c.push(b):c.splice(a,0,b);this.Hc();return!0};I.prototype.remove=I.prototype["delete"]=I.prototype.remove=function(a){if(null===a)return!1;this.Q&&v.ma(this,a);var b=this.n;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Hc();return!0};
I.prototype.removeAt=I.prototype.$c=function(a){var b=this.n;(0>a||a>=b.length)&&v.Fa(a,"0 <= i < length",I,"removeAt:i");this.Q&&v.ma(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Hc()};I.prototype.removeRange=I.prototype.removeRange=function(a,b){var c=this.n,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.Q&&v.ma(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.Hc();return this};
I.prototype.copy=function(){var a=new I(this.ka),b=this.n;0<b.length&&(a.n=Array.prototype.slice.call(b));return a};I.prototype.toArray=I.prototype.fc=function(){for(var a=this.n,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};I.prototype.toSet=I.prototype.eG=function(){for(var a=new J(this.ka),b=this.n,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};I.prototype.sort=I.prototype.sort=function(a){this.Q&&v.ma(this);this.n.sort(a);this.Hc();return this};
I.prototype.sortRange=I.prototype.xq=function(a,b,c){var d=this.n,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.Q&&v.ma(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&v.Fa(b,"0 <= from < length",I,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.Hc()),this;if(0===b)if(c>=e)d.sort(a);else for(f=d.slice(0,c),f.sort(a),a=0;a<c;a++)d[a]=f[a];else if(c>=e)for(f=d.slice(b),f.sort(a),a=b;a<e;a++)d[a]=f[a-b];else for(f=d.slice(b,c),f.sort(a),a=b;a<c;a++)d[a]=f[a-
b];this.Hc();return this};I.prototype.reverse=I.prototype.reverse=function(){this.Q&&v.ma(this);this.n.reverse();this.Hc();return this};v.u(I,{count:"count"},function(){return this.n.length});v.u(I,{size:"size"},function(){return this.n.length});v.u(I,{length:"length"},function(){return this.n.length});v.u(I,{i:"iterator"},function(){if(0>=this.n.length)return xa;var a=this.$b;return null!==a?(a.reset(),a):new Aa(this)});
v.u(I,{Gn:"iteratorBackwards"},function(){if(0>=this.n.length)return xa;var a=this.Wj;return null!==a?(a.reset(),a):new Ba(this)});function Ca(a){this.Xh=a;this.reset()}v.ae(Ca,{key:!0,value:!0});v.u(Ca,{i:"iterator"},function(){return this});Ca.prototype.reset=Ca.prototype.reset=function(){var a=this.Xh;a.$b=null;this.ib=a.G;this.hb=null};
Ca.prototype.next=Ca.prototype.hasNext=Ca.prototype.next=function(){var a=this.Xh;if(a.G!==this.ib){if(null===this.key)return!1;v.Oa(a)}var b=this.hb,b=null===b?a.Da:b.Wa;if(null!==b)return this.hb=b,this.value=b.value,this.key=b.key,!0;this.Hf();return!1};Ca.prototype.first=Ca.prototype.first=function(){var a=this.Xh;this.ib=a.G;a=a.Da;if(null!==a){this.hb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
Ca.prototype.any=function(a){var b=this.Xh;b.$b=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(a(d.value))return!0;b.G!==c&&v.Oa(b);d=d.Wa}return!1};Ca.prototype.all=function(a){var b=this.Xh;b.$b=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(!a(d.value))return!1;b.G!==c&&v.Oa(b);d=d.Wa}return!0};Ca.prototype.each=function(a){var b=this.Xh;b.$b=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;)a(d.value),b.G!==c&&v.Oa(b),d=d.Wa;return this};
Ca.prototype.map=function(a){var b=this.Xh;b.$b=null;for(var c=new I,d=b.G,e=b.Da;null!==e;)c.add(a(e.value)),b.G!==d&&v.Oa(b),e=e.Wa;return c.i};Ca.prototype.filter=function(a){var b=this.Xh;b.$b=null;for(var c=new I(b.ka),d=b.G,e=b.Da;null!==e;){var f=e.value;a(f)&&c.add(f);b.G!==d&&v.Oa(b);e=e.Wa}return c.i};Ca.prototype.concat=function(a){this.Xh.$b=null;return new za(this,a.i)};v.u(Ca,{count:"count"},function(){return this.Xh.od});
Ca.prototype.Hf=function(){this.value=this.key=null;this.ib=-1;this.Xh.$b=this};Ca.prototype.toString=function(){return null!==this.hb?"SetIterator@"+this.hb.value:"SetIterator"};
function J(a){v.pc(this);this.Q=!1;void 0===a||null===a?this.ka=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ka=a:v.Fa(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ka=a===Object?"object":a===String?"string":a===Number?"number":a:v.Fa(a,"null, a primitive type name, or a class type","Set constructor: type");this.pd={};this.od=0;this.$b=null;this.G=0;this.Qh=this.Da=null}v.ga("Set",J);
J.prototype.Hc=function(){var a=this.G;a++;999999999<a&&(a=0);this.G=a};J.prototype.freeze=J.prototype.freeze=function(){this.Q=!0;return this};J.prototype.thaw=J.prototype.Ra=function(){this.Q=!1;return this};J.prototype.toString=function(){return"Set("+v.getTypeName(this.ka)+")#"+v.Kd(this)};
J.prototype.add=J.prototype.add=function(a){if(null===a)return!1;this.Q&&v.ma(this,a);var b=a;v.Ta(a)&&(b=v.Up(a));return void 0===this.pd[b]?(this.od++,a=new Da(a,a),this.pd[b]=a,b=this.Qh,null===b?this.Da=a:(a.ep=b,b.Wa=a),this.Qh=a,this.Hc(),!0):!1};J.prototype.addAll=J.prototype.Kc=function(a){if(null===a)return this;this.Q&&v.ma(this);if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++)this.add(v.Ea(a,c));else for(a=a.i;a.next();)this.add(a.value);return this};
J.prototype.contains=J.prototype.has=J.prototype.contains=function(a){if(null===a)return!1;var b=a;return v.Ta(a)&&(b=v.Kd(a),void 0===b)?!1:void 0!==this.pd[b]};J.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(!this.contains(a.value))return!1;return!0};J.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(this.contains(a.value))return!0;return!1};J.prototype.first=J.prototype.first=function(){var a=this.Da;return null===a?null:a.value};
J.prototype.any=function(a){for(var b=this.G,c=this.Da;null!==c;){if(a(c.value))return!0;this.G!==b&&v.Oa(this);c=c.Wa}return!1};J.prototype.all=function(a){for(var b=this.G,c=this.Da;null!==c;){if(!a(c.value))return!1;this.G!==b&&v.Oa(this);c=c.Wa}return!0};J.prototype.each=function(a){for(var b=this.G,c=this.Da;null!==c;)a(c.value),this.G!==b&&v.Oa(this),c=c.Wa;return this};J.prototype.map=function(a){for(var b=new J,c=this.G,d=this.Da;null!==d;)b.add(a(d.value)),this.G!==c&&v.Oa(this),d=d.Wa;return b};
J.prototype.filter=function(a){for(var b=new J(this.ka),c=this.G,d=this.Da;null!==d;){var e=d.value;a(e)&&b.add(e);this.G!==c&&v.Oa(this);d=d.Wa}return b};J.prototype.concat=function(a){return this.copy().Kc(a)};
J.prototype.remove=J.prototype["delete"]=J.prototype.remove=function(a){if(null===a)return!1;this.Q&&v.ma(this,a);var b=a;if(v.Ta(a)&&(b=v.Kd(a),void 0===b))return!1;a=this.pd[b];if(void 0===a)return!1;var c=a.Wa,d=a.ep;null!==c&&(c.ep=d);null!==d&&(d.Wa=c);this.Da===a&&(this.Da=c);this.Qh===a&&(this.Qh=d);delete this.pd[b];this.od--;this.Hc();return!0};
J.prototype.removeAll=J.prototype.Ox=function(a){if(null===a)return this;this.Q&&v.ma(this);if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++)this.remove(v.Ea(a,c));else for(a=a.i;a.next();)this.remove(a.value);return this};J.prototype.retainAll=function(a){if(null===a||0===this.count)return this;this.Q&&v.ma(this);var b=new J(this.ka);b.Kc(a);a=[];for(var c=this.i;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.Ox(a);return this};
J.prototype.clear=J.prototype.clear=function(){this.Q&&v.ma(this);this.pd={};this.od=0;this.Qh=this.Da=null;this.Hc()};J.prototype.copy=function(){var a=new J(this.ka),b=this.pd,c;for(c in b)a.add(b[c].value);return a};J.prototype.toArray=J.prototype.fc=function(){var a=Array(this.od),b=this.pd,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};J.prototype.toList=function(){var a=new I(this.ka),b=this.pd,c;for(c in b)a.add(b[c].value);return a};v.u(J,{count:"count"},function(){return this.od});
v.u(J,{size:"size"},function(){return this.od});v.u(J,{i:"iterator"},function(){if(0>=this.od)return xa;var a=this.$b;return null!==a?(a.reset(),a):new Ca(this)});function Ea(a){this.Ia=a;this.reset()}v.ae(Ea,{key:!0,value:!0});v.u(Ea,{i:"iterator"},function(){return this});Ea.prototype.reset=Ea.prototype.reset=function(){this.ib=this.Ia.G;this.hb=null};
Ea.prototype.next=Ea.prototype.hasNext=Ea.prototype.next=function(){var a=this.Ia;if(a.G!==this.ib){if(null===this.key)return!1;v.Oa(a)}var b=this.hb,b=null===b?a.Da:b.Wa;if(null!==b)return this.hb=b,this.value=this.key=a=b.key,!0;this.Hf();return!1};Ea.prototype.first=Ea.prototype.first=function(){var a=this.Ia;this.ib=a.G;a=a.Da;return null!==a?(this.hb=a,this.value=this.key=a=a.key):null};
Ea.prototype.any=function(a){var b=this.Ia,c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(a(d.key))return!0;b.G!==c&&v.Oa(b);d=d.Wa}return!1};Ea.prototype.all=function(a){var b=this.Ia,c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(!a(d.key))return!1;b.G!==c&&v.Oa(b);d=d.Wa}return!0};Ea.prototype.each=function(a){var b=this.Ia,c=b.G;this.hb=null;for(var d=b.Da;null!==d;)a(d.key),b.G!==c&&v.Oa(b),d=d.Wa;return this};
Ea.prototype.map=function(a){var b=this.Ia,c=b.G;this.hb=null;for(var d=new I,e=b.Da;null!==e;)d.add(a(e.key)),b.G!==c&&v.Oa(b),e=e.Wa;return d.i};Ea.prototype.filter=function(a){var b=this.Ia,c=b.G;this.hb=null;for(var d=new I(b.Ki),e=b.Da;null!==e;){var f=e.key;a(f)&&d.add(f);b.G!==c&&v.Oa(b);e=e.Wa}return d.i};Ea.prototype.concat=function(a){return new za(this,a.i)};v.u(Ea,{count:"count"},function(){return this.Ia.od});Ea.prototype.Hf=function(){this.value=this.key=null;this.ib=-1};
Ea.prototype.toString=function(){return null!==this.hb?"MapKeySetIterator@"+this.hb.value:"MapKeySetIterator"};function Fa(a){v.pc(this);this.Q=!0;this.Ia=a}v.Ma(Fa,J);Fa.prototype.freeze=function(){return this};Fa.prototype.Ra=function(){return this};Fa.prototype.toString=function(){return"MapKeySet("+this.Ia.toString()+")"};Fa.prototype.add=Fa.prototype.set=Fa.prototype.add=function(){v.k("This Set is read-only: "+this.toString());return!1};
Fa.prototype.contains=Fa.prototype.has=Fa.prototype.contains=function(a){return this.Ia.contains(a)};Fa.prototype.remove=Fa.prototype["delete"]=Fa.prototype.remove=function(){v.k("This Set is read-only: "+this.toString());return!1};Fa.prototype.clear=Fa.prototype.clear=function(){v.k("This Set is read-only: "+this.toString())};Fa.prototype.first=Fa.prototype.first=function(){var a=this.Ia.Da;return null!==a?a.key:null};
Fa.prototype.any=function(a){for(var b=this.Ia.Da;null!==b;){if(a(b.key))return!0;b=b.Wa}return!1};Fa.prototype.all=function(a){for(var b=this.Ia.Da;null!==b;){if(!a(b.key))return!1;b=b.Wa}return!0};Fa.prototype.each=function(a){for(var b=this.Ia.Da;null!==b;)a(b.key),b=b.Wa;return this};Fa.prototype.map=function(a){for(var b=new J,c=this.Ia.Da;null!==c;)b.add(a(c.key)),c=c.Wa;return b};
Fa.prototype.filter=function(a){for(var b=new J(this.Ia.Ki),c=this.Ia.Da;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Wa}return b};Fa.prototype.concat=function(a){return this.eG().Kc(a)};Fa.prototype.copy=function(){return new Fa(this.Ia)};Fa.prototype.toSet=Fa.prototype.eG=function(){var a=new J(this.Ia.Ki),b=this.Ia.pd,c;for(c in b)a.add(b[c].key);return a};Fa.prototype.toArray=Fa.prototype.fc=function(){var a=this.Ia.pd,b=Array(this.Ia.od),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};
Fa.prototype.toList=function(){var a=new I(this.ka),b=this.Ia.pd,c;for(c in b)a.add(b[c].key);return a};v.u(Fa,{count:"count"},function(){return this.Ia.od});v.u(Fa,{size:"size"},function(){return this.Ia.od});v.u(Fa,{i:"iterator"},function(){return 0>=this.Ia.od?xa:new Ea(this.Ia)});function Ha(a){this.Ia=a;this.reset()}v.ae(Ha,{key:!0,value:!0});v.u(Ha,{i:"iterator"},function(){return this});Ha.prototype.reset=Ha.prototype.reset=function(){var a=this.Ia;a.Xj=null;this.ib=a.G;this.hb=null};
Ha.prototype.next=Ha.prototype.hasNext=Ha.prototype.next=function(){var a=this.Ia;if(a.G!==this.ib){if(null===this.key)return!1;v.Oa(a)}var b=this.hb,b=null===b?a.Da:b.Wa;if(null!==b)return this.hb=b,this.value=b.value,this.key=b.key,!0;this.Hf();return!1};Ha.prototype.first=Ha.prototype.first=function(){var a=this.Ia;this.ib=a.G;a=a.Da;if(null!==a){this.hb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
Ha.prototype.any=function(a){var b=this.Ia;b.Xj=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(a(d.value))return!0;b.G!==c&&v.Oa(b);d=d.Wa}return!1};Ha.prototype.all=function(a){var b=this.Ia;b.Xj=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(!a(d.value))return!1;b.G!==c&&v.Oa(b);d=d.Wa}return!0};Ha.prototype.each=function(a){var b=this.Ia;b.Xj=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;)a(d.value),b.G!==c&&v.Oa(b),d=d.Wa;return this};
Ha.prototype.map=function(a){var b=this.Ia;b.Xj=null;var c=b.G;this.hb=null;for(var d=new I,e=b.Da;null!==e;)d.add(a(e.value)),b.G!==c&&v.Oa(b),e=e.Wa;return d.i};Ha.prototype.filter=function(a){var b=this.Ia;b.Xj=null;var c=b.G;this.hb=null;for(var d=new I(b.Ki),e=b.Da;null!==e;){var f=e.value;a(f)&&d.add(f);b.G!==c&&v.Oa(b);e=e.Wa}return d.i};Ha.prototype.concat=function(a){this.Ia.Xj=null;return new za(this,a.i)};v.u(Ha,{count:"count"},function(){return this.Ia.od});
Ha.prototype.Hf=function(){this.value=this.key=null;this.ib=-1;this.Ia.Xj=this};Ha.prototype.toString=function(){return null!==this.hb?"MapValueSetIterator@"+this.hb.value:"MapValueSetIterator"};function Da(a,b){this.key=a;this.value=b;this.ep=this.Wa=null}v.ae(Da,{key:!0,value:!0});Da.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};function Ka(a){this.Ia=a;this.reset()}v.ae(Ka,{key:!0,value:!0});v.u(Ka,{i:"iterator"},function(){return this});
Ka.prototype.reset=Ka.prototype.reset=function(){var a=this.Ia;a.$b=null;this.ib=a.G;this.hb=null};Ka.prototype.next=Ka.prototype.hasNext=Ka.prototype.next=function(){var a=this.Ia;if(a.G!==this.ib){if(null===this.key)return!1;v.Oa(a)}var b=this.hb,b=null===b?a.Da:b.Wa;if(null!==b)return this.hb=b,this.key=b.key,this.value=b.value,!0;this.Hf();return!1};
Ka.prototype.first=Ka.prototype.first=function(){var a=this.Ia;this.ib=a.G;a=a.Da;return null!==a?(this.hb=a,this.key=a.key,this.value=a.value,a):null};Ka.prototype.any=function(a){var b=this.Ia;b.$b=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(a(d))return!0;b.G!==c&&v.Oa(b);d=d.Wa}return!1};Ka.prototype.all=function(a){var b=this.Ia;b.$b=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;){if(!a(d))return!1;b.G!==c&&v.Oa(b);d=d.Wa}return!0};
Ka.prototype.each=function(a){var b=this.Ia;b.$b=null;var c=b.G;this.hb=null;for(var d=b.Da;null!==d;)a(d),b.G!==c&&v.Oa(b),d=d.Wa;return this};Ka.prototype.map=function(a){var b=this.Ia;b.$b=null;var c=b.G;this.hb=null;for(var d=new I,e=b.Da;null!==e;)d.add(a(e)),b.G!==c&&v.Oa(b),e=e.Wa;return d.i};Ka.prototype.filter=function(a){var b=this.Ia;b.$b=null;var c=b.G;this.hb=null;for(var d=new I,e=b.Da;null!==e;)a(e)&&d.add(e),b.G!==c&&v.Oa(b),e=e.Wa;return d.i};
Ka.prototype.concat=function(a){this.Ia.$b=null;return new za(this,a.i)};v.u(Ka,{count:"count"},function(){return this.Ia.od});Ka.prototype.Hf=function(){this.value=this.key=null;this.ib=-1;this.Ia.$b=this};Ka.prototype.toString=function(){return null!==this.hb?"MapIterator@"+this.hb:"MapIterator"};
function la(a,b){v.pc(this);this.Q=!1;void 0===a||null===a?this.Ki=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.Ki=a:v.Fa(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.Ki=a===Object?"object":a===String?"string":a===Number?"number":a:v.Fa(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.lt=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
b||"function"===b?this.lt=b:v.Fa(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.lt=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:v.Fa(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.pd={};this.od=0;this.Xj=this.$b=null;this.G=0;this.Qh=this.Da=null}v.ga("Map",la);
la.prototype.Hc=function(){var a=this.G;a++;999999999<a&&(a=0);this.G=a};la.prototype.freeze=la.prototype.freeze=function(){this.Q=!0;return this};la.prototype.thaw=la.prototype.Ra=function(){this.Q=!1;return this};la.prototype.toString=function(){return"Map("+v.getTypeName(this.Ki)+","+v.getTypeName(this.lt)+")#"+v.Kd(this)};
la.prototype.add=la.prototype.set=la.prototype.add=function(a,b){this.Q&&v.ma(this,a);var c=a;v.Ta(a)&&(c=v.Up(a));var d=this.pd[c];if(void 0===d)return this.od++,d=new Da(a,b),this.pd[c]=d,c=this.Qh,null===c?this.Da=d:(d.ep=c,c.Wa=d),this.Qh=d,this.Hc(),!0;d.value=b;return!1};la.prototype.addAll=la.prototype.Kc=function(a){if(null===a)return this;if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++){var d=v.Ea(a,c);this.add(d.key,d.value)}else for(a=a.i;a.next();)this.add(a.key,a.value);return this};
la.prototype.first=la.prototype.first=function(){return this.Da};la.prototype.any=function(a){for(var b=this.G,c=this.Da;null!==c;){if(a(c))return!0;this.G!==b&&v.Oa(this);c=c.Wa}return!1};la.prototype.all=function(a){for(var b=this.G,c=this.Da;null!==c;){if(!a(c))return!1;this.G!==b&&v.Oa(this);c=c.Wa}return!0};la.prototype.each=function(a){for(var b=this.G,c=this.Da;null!==c;)a(c),this.G!==b&&v.Oa(this),c=c.Wa;return this};
la.prototype.map=function(a){for(var b=new la(this.Ki),c=this.G,d=this.Da;null!==d;)b.add(d.key,a(d)),this.G!==c&&v.Oa(this),d=d.Wa;return b};la.prototype.filter=function(a){for(var b=new la(this.Ki,this.lt),c=this.G,d=this.Da;null!==d;)a(d)&&b.add(d.key,d.value),this.G!==c&&v.Oa(this),d=d.Wa;return b};la.prototype.concat=function(a){return this.copy().Kc(a)};la.prototype.contains=la.prototype.has=la.prototype.contains=function(a){var b=a;return v.Ta(a)&&(b=v.Kd(a),void 0===b)?!1:void 0!==this.pd[b]};
la.prototype.getValue=la.prototype.get=la.prototype.na=function(a){var b=a;if(v.Ta(a)&&(b=v.Kd(a),void 0===b))return null;a=this.pd[b];return void 0===a?null:a.value};
la.prototype.remove=la.prototype["delete"]=la.prototype.remove=function(a){if(null===a)return!1;this.Q&&v.ma(this,a);var b=a;if(v.Ta(a)&&(b=v.Kd(a),void 0===b))return!1;a=this.pd[b];if(void 0===a)return!1;var c=a.Wa,d=a.ep;null!==c&&(c.ep=d);null!==d&&(d.Wa=c);this.Da===a&&(this.Da=c);this.Qh===a&&(this.Qh=d);delete this.pd[b];this.od--;this.Hc();return!0};la.prototype.clear=la.prototype.clear=function(){this.Q&&v.ma(this);this.pd={};this.od=0;this.Qh=this.Da=null;this.Hc()};
la.prototype.copy=function(){var a=new la(this.Ki,this.lt),b=this.pd,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};la.prototype.toArray=la.prototype.fc=function(){var a=this.pd,b=Array(this.od),c=0,d;for(d in a){var e=a[d];b[c]=new Da(e.key,e.value);c++}return b};la.prototype.toKeySet=la.prototype.Bj=function(){return new Fa(this)};v.u(la,{count:"count"},function(){return this.od});v.u(la,{size:"size"},function(){return this.od});
v.u(la,{i:"iterator"},function(){if(0>=this.count)return xa;var a=this.$b;return null!==a?(a.reset(),a):new Ka(this)});v.u(la,{hF:"iteratorKeys"},function(){return 0>=this.count?xa:new Ea(this)});v.u(la,{iF:"iteratorValues"},function(){if(0>=this.count)return xa;var a=this.Xj;return null!==a?(a.reset(),a):new Ha(this)});function y(a,b){void 0===a?this.y=this.x=0:(this.x=a,this.y=b)}v.ga("Point",y);v.ii(y);v.ae(y,{x:!0,y:!0});y.prototype.assign=function(a){this.x=a.x;this.y=a.y};
y.prototype.setTo=y.prototype.l=function(a,b){this.x=a;this.y=b;return this};y.prototype.set=y.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};y.prototype.copy=function(){var a=new y;a.x=this.x;a.y=this.y;return a};y.prototype.Ga=function(){Object.freeze(this);return this};y.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};y.prototype.freeze=function(){return this};y.prototype.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);return this};
y.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new y(c,e)}return new y};y.stringify=function(a){return a instanceof y?a.x.toString()+" "+a.y.toString():a.toString()};y.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};y.prototype.equals=y.prototype.L=function(a){return a instanceof y?this.x===a.x&&this.y===a.y:!1};
y.prototype.equalTo=y.prototype.Zw=function(a,b){return this.x===a&&this.y===b};y.prototype.equalsApprox=y.prototype.Lc=function(a){return K(this.x,a.x)&&K(this.y,a.y)};y.prototype.add=y.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};y.prototype.subtract=y.prototype.Vn=function(a){this.x-=a.x;this.y-=a.y;return this};y.prototype.offset=y.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};
y.prototype.rotate=y.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.x=d*b-e*c;this.y=e*b+d*c;return this};y.prototype.scale=y.prototype.scale=function(a,b){this.x*=a;this.y*=b;return this};y.prototype.distanceSquaredPoint=y.prototype.wf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};
y.prototype.distanceSquared=y.prototype.Op=function(a,b){var c=a-this.x,d=b-this.y;return c*c+d*d};y.prototype.normalize=y.prototype.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};y.prototype.directionPoint=y.prototype.Ac=function(a){return La(a.x-this.x,a.y-this.y)};y.prototype.direction=y.prototype.direction=function(a,b){return La(a-this.x,b-this.y)};
function La(a,b){if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}y.prototype.projectOntoLineSegment=function(a,b,c,d){Oa(a,b,c,d,this.x,this.y,this);return this};y.prototype.projectOntoLineSegmentPoint=function(a,b){Oa(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};y.prototype.snapToGrid=function(a,b,c,d){Pa(this.x,this.y,a,b,c,d,this);return this};
y.prototype.snapToGridPoint=function(a,b){Pa(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};y.prototype.setRectSpot=y.prototype.Sn=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};y.prototype.setSpot=y.prototype.Du=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};y.prototype.transform=function(a){a.ob(this);return this};function Ra(a,b){b.ki(a);return a}var Sa;
y.distanceLineSegmentSquared=Sa=function(a,b,c,d,e,f){var h=e-c,k=f-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=f-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var Ta;y.distanceSquared=Ta=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};var Va;y.direction=Va=function(a,b,c,d){a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};
y.prototype.isReal=y.prototype.H=function(){return isFinite(this.x)&&isFinite(this.y)};function ia(a,b){void 0===a?this.height=this.width=0:(this.width=a,this.height=b)}v.ga("Size",ia);v.ii(ia);v.ae(ia,{width:!0,height:!0});ia.prototype.assign=function(a){this.width=a.width;this.height=a.height};ia.prototype.setTo=ia.prototype.l=function(a,b){this.width=a;this.height=b;return this};ia.prototype.set=ia.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};
ia.prototype.copy=function(){var a=new ia;a.width=this.width;a.height=this.height;return a};ia.prototype.Ga=function(){Object.freeze(this);return this};ia.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};ia.prototype.freeze=function(){return this};ia.prototype.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);return this};
ia.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new ia(c,e)}return new ia};ia.stringify=function(a){return a instanceof ia?a.width.toString()+" "+a.height.toString():a.toString()};ia.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};
ia.prototype.equals=ia.prototype.L=function(a){return a instanceof ia?this.width===a.width&&this.height===a.height:!1};ia.prototype.equalTo=ia.prototype.Zw=function(a,b){return this.width===a&&this.height===b};ia.prototype.equalsApprox=ia.prototype.Lc=function(a){return K(this.width,a.width)&&K(this.height,a.height)};ia.prototype.isReal=ia.prototype.H=function(){return isFinite(this.width)&&isFinite(this.height)};
function B(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof y?b instanceof y?(this.x=Math.min(a.x,b.x),this.y=Math.min(a.y,b.y),this.width=Math.abs(a.x-b.x),this.height=Math.abs(a.y-b.y)):b instanceof ia?(this.x=a.x,this.y=a.y,this.width=b.width,this.height=b.height):v.k("Incorrect arguments supplied to Rect constructor"):(this.x=a,this.y=b,this.width=c,this.height=d)}v.ga("Rect",B);v.ii(B);v.ae(B,{x:!0,y:!0,width:!0,height:!0});
B.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height};function Wa(a,b,c){a.width=b;a.height=c}B.prototype.setTo=B.prototype.l=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};B.prototype.set=B.prototype.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};B.prototype.setPoint=B.prototype.Sg=function(a){this.x=a.x;this.y=a.y;return this};
B.prototype.setSize=function(a){this.width=a.width;this.height=a.height;return this};B.prototype.copy=function(){var a=new B;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};B.prototype.Ga=function(){Object.freeze(this);return this};B.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};B.prototype.freeze=function(){return this};B.prototype.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);return this};
B.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new B(c,e,f,h)}return new B};B.stringify=function(a){return a instanceof B?a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString():a.toString()};
B.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};B.prototype.equals=B.prototype.L=function(a){return a instanceof B?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};B.prototype.equalTo=B.prototype.Zw=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};B.prototype.equalsApprox=B.prototype.Lc=function(a){return K(this.x,a.x)&&K(this.y,a.y)&&K(this.width,a.width)&&K(this.height,a.height)};
function Xa(a,b){return $a(a.x,b.x)&&$a(a.y,b.y)&&$a(a.width,b.width)&&$a(a.height,b.height)}B.prototype.containsPoint=B.prototype.Ha=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};B.prototype.containsRect=B.prototype.tk=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};
B.prototype.contains=B.prototype.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};B.prototype.reset=function(){this.height=this.width=this.y=this.x=0};B.prototype.offset=B.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};B.prototype.inflate=B.prototype.Tf=function(a,b){return db(this,b,a,b,a)};B.prototype.addMargin=B.prototype.Fw=function(a){return db(this,a.top,a.right,a.bottom,a.left)};
B.prototype.subtractMargin=B.prototype.HJ=function(a){return db(this,-a.top,-a.right,-a.bottom,-a.left)};B.prototype.grow=function(a,b,c,d){return db(this,a,b,c,d)};function db(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}B.prototype.intersectRect=function(a){return eb(this,a.x,a.y,a.width,a.height)};B.prototype.intersect=B.prototype.SE=function(a,b,c,d){return eb(this,a,b,c,d)};
function eb(a,b,c,d,e){var f=Math.max(a.x,b),h=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=h;a.width=Math.max(0,b-f);a.height=Math.max(0,c-h);return a}B.prototype.intersectsRect=B.prototype.Jg=function(a){return this.TE(a.x,a.y,a.width,a.height)};
B.prototype.intersects=B.prototype.TE=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function gb(a,b){var c=a.width,d=b.width+10+10,e=a.x,f=b.x-10;if(e>d+f||f>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;f=b.y-10;return e>d+f||f>c+e?!1:!0}B.prototype.unionPoint=B.prototype.qi=function(a){return kb(this,a.x,a.y,0,0)};
B.prototype.unionRect=B.prototype.Gh=function(a){return kb(this,a.x,a.y,a.width,a.height)};B.prototype.union=B.prototype.mG=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return kb(this,a,b,c,d)};function kb(a,b,c,d,e){var f=Math.min(a.x,b),h=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=h;a.width=b-f;a.height=c-h;return a}B.prototype.setSpot=B.prototype.Du=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};
var lb;B.contains=lb=function(a,b,c,d,e,f,h,k){void 0===h&&(h=0);void 0===k&&(k=0);return a<=e&&e+h<=a+c&&b<=f&&f+k<=b+d};B.intersects=function(a,b,c,d,e,f,h,k){c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=f;return b>k||f>a?!1:!0};v.defineProperty(B,{left:"left"},function(){return this.x},function(a){this.x=a});v.defineProperty(B,{top:"top"},function(){return this.y},function(a){this.y=a});v.defineProperty(B,{right:"right"},function(){return this.x+this.width},function(a){this.x+=a-(this.x+this.width)});
v.defineProperty(B,{bottom:"bottom"},function(){return this.y+this.height},function(a){this.y+=a-(this.y+this.height)});v.defineProperty(B,{position:"position"},function(){return new y(this.x,this.y)},function(a){this.x=a.x;this.y=a.y});v.defineProperty(B,{size:"size"},function(){return new ia(this.width,this.height)},function(a){this.width=a.width;this.height=a.height});
v.defineProperty(B,{El:"center"},function(){return new y(this.x+this.width/2,this.y+this.height/2)},function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2});v.defineProperty(B,{la:"centerX"},function(){return this.x+this.width/2},function(a){this.x=a-this.width/2});v.defineProperty(B,{sa:"centerY"},function(){return this.y+this.height/2},function(a){this.y=a-this.height/2});B.prototype.isReal=B.prototype.H=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};
B.prototype.isEmpty=function(){return 0===this.width&&0===this.height};function mb(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):v.k("Invalid arguments to Margin constructor")}v.ga("Margin",mb);v.ii(mb);v.ae(mb,{top:!0,right:!0,bottom:!0,left:!0});
mb.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};mb.prototype.setTo=mb.prototype.l=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};mb.prototype.set=mb.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};mb.prototype.copy=function(){var a=new mb;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};
mb.prototype.Ga=function(){Object.freeze(this);return this};mb.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};mb.prototype.freeze=function(){return this};mb.prototype.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);return this};
mb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new mb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new mb(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new mb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new mb(c,e):new mb(c,e,f,h)}return new mb};
mb.stringify=function(a){return a instanceof mb?a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString():a.toString()};mb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};mb.prototype.equals=mb.prototype.L=function(a){return a instanceof mb?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};
mb.prototype.equalTo=mb.prototype.Zw=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};mb.prototype.equalsApprox=mb.prototype.Lc=function(a){return K(this.top,a.top)&&K(this.right,a.right)&&K(this.bottom,a.bottom)&&K(this.left,a.left)};mb.prototype.isReal=mb.prototype.H=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ja(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}v.ii(ja);
v.ae(ja,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});ja.prototype.set=ja.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};ja.prototype.copy=function(){var a=new ja;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};ja.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
ja.prototype.equals=ja.prototype.L=function(a){return a instanceof ja?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};ja.prototype.isIdentity=ja.prototype.$t=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};ja.prototype.reset=ja.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
ja.prototype.multiply=ja.prototype.multiply=function(a){var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,f=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
ja.prototype.multiplyInverted=ja.prototype.qF=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;f=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=f;this.dy=h;return this};
ja.prototype.invert=ja.prototype.mx=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
ja.prototype.rotate=ja.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var f=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=f;this.m22=h;this.translate(-b,-c);return this};
ja.prototype.translate=ja.prototype.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};ja.prototype.scale=ja.prototype.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};ja.prototype.transformPoint=ja.prototype.ob=function(a){var b=a.x,c=a.y;a.x=b*this.m11+c*this.m21+this.dx;a.y=b*this.m12+c*this.m22+this.dy;return a};
ja.prototype.invertedTransformPoint=ja.prototype.ki=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),f=a.x,h=a.y;a.x=f*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.y=f*c+h*d+e;return a};
ja.prototype.transformRect=ja.prototype.lG=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*f+c*k+m,q=b*h+c*l+n,r=d*f+c*k+m,c=d*h+c*l+n,s=b*f+e*k+m,b=b*h+e*l+n,f=d*f+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,f),e=Math.max(e,f),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=h;a.width=e-p;a.height=q-h;return a};
function L(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d)}v.ga("Spot",L);v.ii(L);v.ae(L,{x:!0,y:!0,offsetX:!0,offsetY:!0});L.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};L.prototype.setTo=L.prototype.l=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};
L.prototype.set=L.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};L.prototype.copy=function(){var a=new L;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};L.prototype.Ga=function(){Object.freeze(this);return this};L.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};L.prototype.freeze=function(){return this};
L.prototype.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);return this};function rb(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}var ub;
L.parse=ub=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return vb;if("TopLeft"===a)return xb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return yb;if("TopRight"===a)return Ab;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Fb;if("Center"===a)return Gb;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Hb;if("BottomLeft"===a)return Kb;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Lb;if("BottomRight"===a)return Mb;if("TopSide"===a)return Sb;if("LeftSide"===
a)return Tb;if("RightSide"===a)return Ub;if("BottomSide"===a)return $b;if("TopBottomSides"===a)return ac;if("LeftRightSides"===a)return bc;if("TopLeftSides"===a)return cc;if("TopRightSides"===a)return dc;if("BottomLeftSides"===a)return gc;if("BottomRightSides"===a)return hc;if("NotTopSide"===a)return ic;if("NotLeftSide"===a)return jc;if("NotRightSide"===a)return kc;if("NotBottomSide"===a)return lc;if("AllSides"===a)return mc;if("Default"===a)return nc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;
var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(f=parseFloat(d));for(var h=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(h=parseFloat(d));return new L(c,e,f,h)}return new L};L.stringify=function(a){return a instanceof L?a.jd()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString():a.toString()};
L.prototype.toString=function(){return this.jd()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.L(vb)?"None":this.L(xb)?"TopLeft":this.L(yb)?"Top":this.L(Ab)?"TopRight":this.L(Fb)?"Left":this.L(Gb)?"Center":this.L(Hb)?"Right":this.L(Kb)?"BottomLeft":this.L(Lb)?"Bottom":this.L(Mb)?"BottomRight":this.L(Sb)?"TopSide":this.L(Tb)?"LeftSide":this.L(Ub)?"RightSide":this.L($b)?"BottomSide":this.L(ac)?"TopBottomSides":this.L(bc)?
"LeftRightSides":this.L(cc)?"TopLeftSides":this.L(dc)?"TopRightSides":this.L(gc)?"BottomLeftSides":this.L(hc)?"BottomRightSides":this.L(ic)?"NotTopSide":this.L(jc)?"NotLeftSide":this.L(kc)?"NotRightSide":this.L(lc)?"NotBottomSide":this.L(mc)?"AllSides":this.L(nc)?"Default":"None"};L.prototype.equals=L.prototype.L=function(a){return a instanceof L?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1};
L.prototype.opposite=L.prototype.uF=function(){return new L(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};L.prototype.includesSide=L.prototype.nj=function(a){if(!this.oj())return!1;if(!a.oj())if(a.L(oc))a=Tb;else if(a.L(uc))a=Ub;else if(a.L(vc))a=Sb;else if(a.L(yc))a=$b;else return!1;a=a.offsetY;return(this.offsetY&a)===a};L.prototype.isSpot=L.prototype.jd=function(){return!isNaN(this.x)&&!isNaN(this.y)};L.prototype.isNoSpot=L.prototype.Od=function(){return isNaN(this.x)||isNaN(this.y)};
L.prototype.isSide=L.prototype.oj=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY};L.prototype.isNone=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};L.prototype.isDefault=L.prototype.Xc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var vb;L.None=vb=rb(new L(0,0,0,0),0).Ga();var nc;L.Default=nc=rb(new L(0,0,-1,0),-1).Ga();var xb;L.TopLeft=xb=(new L(0,0,0,0)).Ga();var yb;
L.TopCenter=yb=(new L(.5,0,0,0)).Ga();var Ab;L.TopRight=Ab=(new L(1,0,0,0)).Ga();var Fb;L.LeftCenter=Fb=(new L(0,.5,0,0)).Ga();var Gb;L.Center=Gb=(new L(.5,.5,0,0)).Ga();var Hb;L.RightCenter=Hb=(new L(1,.5,0,0)).Ga();var Kb;L.BottomLeft=Kb=(new L(0,1,0,0)).Ga();var Lb;L.BottomCenter=Lb=(new L(.5,1,0,0)).Ga();var Mb;L.BottomRight=Mb=(new L(1,1,0,0)).Ga();var zc;L.MiddleTop=zc=yb;var Ac;L.MiddleLeft=Ac=Fb;var Bc;L.MiddleRight=Bc=Hb;var Cc;L.MiddleBottom=Cc=Lb;var vc;L.Top=vc=yb;var oc;L.Left=oc=Fb;
var uc;L.Right=uc=Hb;var yc;L.Bottom=yc=Lb;var Sb;L.TopSide=Sb=rb(new L(0,0,1,v.md),1).Ga();var Tb;L.LeftSide=Tb=rb(new L(0,0,1,v.Tc),1).Ga();var Ub;L.RightSide=Ub=rb(new L(0,0,1,v.bd),1).Ga();var $b;L.BottomSide=$b=rb(new L(0,0,1,v.ad),1).Ga();var ac;L.TopBottomSides=ac=rb(new L(0,0,1,v.md|v.ad),1).Ga();var bc;L.LeftRightSides=bc=rb(new L(0,0,1,v.Tc|v.bd),1).Ga();var cc;L.TopLeftSides=cc=rb(new L(0,0,1,v.md|v.Tc),1).Ga();var dc;L.TopRightSides=dc=rb(new L(0,0,1,v.md|v.bd),1).Ga();var gc;
L.BottomLeftSides=gc=rb(new L(0,0,1,v.ad|v.Tc),1).Ga();var hc;L.BottomRightSides=hc=rb(new L(0,0,1,v.ad|v.bd),1).Ga();var ic;L.NotTopSide=ic=rb(new L(0,0,1,v.Tc|v.bd|v.ad),1).Ga();var jc;L.NotLeftSide=jc=rb(new L(0,0,1,v.md|v.bd|v.ad),1).Ga();var kc;L.NotRightSide=kc=rb(new L(0,0,1,v.md|v.Tc|v.ad),1).Ga();var lc;L.NotBottomSide=lc=rb(new L(0,0,1,v.md|v.Tc|v.bd),1).Ga();var mc;L.AllSides=mc=rb(new L(0,0,1,v.md|v.Tc|v.bd|v.ad),1).Ga();function Dc(){this.Sb=[1,0,0,1,0,0]}
Dc.prototype.copy=function(){var a=new Dc;a.Sb[0]=this.Sb[0];a.Sb[1]=this.Sb[1];a.Sb[2]=this.Sb[2];a.Sb[3]=this.Sb[3];a.Sb[4]=this.Sb[4];a.Sb[5]=this.Sb[5];return a};Dc.prototype.translate=function(a,b){this.Sb[4]+=this.Sb[0]*a+this.Sb[2]*b;this.Sb[5]+=this.Sb[1]*a+this.Sb[3]*b};Dc.prototype.scale=function(a,b){this.Sb[0]*=a;this.Sb[1]*=a;this.Sb[2]*=b;this.Sb[3]*=b};function Ec(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.eE=[];this.pattern=null}
Ec.prototype.addColorStop=function(a,b){this.eE.push({offset:a,color:b})};
function Jc(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.Hn=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.yt=!1;this.yg=this.Ts=this.Ss=0;this.document=b||document;this.tE=c;this.xx=null;this.path=[];this.th=new Dc;this.stack=[];this.yf=[];this.Xw=a;this.YI="http://www.w3.org/2000/svg";
this.width=this.Xw.width;this.height=this.Xw.height;this.em=Kc(this,"svg",{width:this.width+"px",height:this.height+"px",UL:"0 0 "+this.Xw.width+" "+this.Xw.height});this.em.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.em.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");Lc(this,1,0,0,1,0,0);a=v.km++;b=Kc(this,"clipPath",{id:"mainClip"+a});b.appendChild(Kc(this,"rect",{x:0,y:0,width:this.width,height:this.height}));
this.em.appendChild(b);this.yf[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}g=Jc.prototype;g.arc=function(a,b,c,d,e,f){Mc(this,a,b,c,d,e,f)};g.beginPath=function(){this.path=[]};g.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};g.clearRect=function(){};g.clip=function(){Nc(this,"clipPath",this.path,new Dc)};g.closePath=function(){this.path.push(["z"])};g.createLinearGradient=function(a,b,c,d){var e=new Ec("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};
g.createPattern=function(a){var b=new Ec("pattern");b.pattern=a;return b};g.createRadialGradient=function(a,b,c,d,e,f){var h=new Ec("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=f;return h};
g.drawImage=function(a,b,c,d,e,f,h,k,l){var m="";a instanceof HTMLCanvasElement&&(m=a.toDataURL());a instanceof HTMLImageElement&&(m=a.src);m={x:0,y:0,width:a.naturalWidth,height:a.naturalHeight,href:m};m.preserveAspectRatio=$a(d,k)&&$a(e,l)?"xMidYMid slice":"none";var n="";k/=d;l/=e;if(0!==f||0!==h)n+=" translate("+f+", "+h+")";if(1!==k||1!==l)n+=" scale("+k+", "+l+")";if(0!==b||0!==c)n+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==a.naturalWidth||e!==a.naturalHeight)a="CLIP"+v.km++,f=Kc(this,
"clipPath",{id:a}),f.appendChild(Kc(this,"rect",{x:b,y:c,width:d,height:e})),this.em.appendChild(f),m["clip-path"]="url(#"+a+")";Oc(this,"image",m,this.th,n);this.addElement("image",m)};g.fill=function(){Nc(this,"fill",this.path,this.th)};g.Gg=function(){this.yt?this.clip():this.fill()};g.fillRect=function(a,b,c,d){Pc(this,"fill",[a,b,c,d],this.th)};
g.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};Oc(this,"fill",b,this.th);this.addElement("text",b,a[0])};g.lineTo=function(a,b){this.path.push(["L",a,b])};g.moveTo=function(a,b){this.path.push(["M",a,b])};g.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};g.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])};
g.restore=function(){this.th=this.stack.pop();this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle;this.font=a.font;this.globalAlpha=a.globalAlpha;this.lineCap=a.lineCap;this.Hn=a.Hn;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign};
g.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,Hn:this.Hn,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;b<this.path.length;b++)a.push(this.path[b]);this.stack.push(a);this.stack.push(this.th.copy())};
g.setTransform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||Lc(this,a,b,c,d,e,f)};g.scale=function(a,b){this.th.scale(a,b)};g.translate=function(a,b){this.th.translate(a,b)};g.stroke=function(){Nc(this,"stroke",this.path,this.th)};g.yj=function(){this.ko||this.stroke()};g.strokeRect=function(a,b,c,d){Pc(this,"stroke",[a,b,c,d],this.th)};
function Kc(a,b,c,d){a=a.document.createElementNS(a.YI,b);if(v.Ta(c))for(var e in c)a.setAttributeNS("href"===e?"http://www.w3.org/1999/xlink":"",e,c[e]);void 0!==d&&(a.textContent=d);return a}g.addElement=function(a,b,c){a=Kc(this,a,b,c);0<this.yf.length?this.yf[this.yf.length-1].appendChild(a):this.em.appendChild(a);return this.xx=a};
function Oc(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"===b?(/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",c["fill-opacity"]=a[4]):c.fill=a.fillStyle instanceof Ec?Qc(a,a.fillStyle):a.fillStyle,c.stroke="none"):"stroke"===b&&(c.fill="none",/^rgba\(/.test(a.strokeStyle)?(b=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
c.stroke="rgb("+b[1]+","+b[2]+","+b[3]+")",c["stroke-opacity"]=b[4]):c.stroke=a.strokeStyle instanceof Ec?Qc(a,a.strokeStyle):a.strokeStyle,c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);d=d.Sb;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
function Qc(a,b){var c="GRAD"+v.km++,d;if("linear"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"},d=Kc(a,"linearGradient",d);else if("radial"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c},d=Kc(a,"radialGradient",d);else if("pattern"===b.type){var e=b.pattern;d={width:e.width,height:e.height,id:c,patternUnits:"userSpaceOnUse"};var f="";e instanceof HTMLCanvasElement&&(f=e.toDataURL());e instanceof HTMLImageElement&&(f=e.src);e={x:0,y:0,width:e.width,
height:e.height,href:f};d=Kc(a,"pattern",d);d.appendChild(Kc(a,"image",e))}else throw Error("invalid gradient");for(var e=b.eE,f=e.length,h=[],k=0;k<f;k++){var l=e[k],m=l.color,l={offset:l.offset,"stop-color":m};/^rgba\(/.test(m)&&(m=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m),l["stop-color"]="rgb("+m[1]+","+m[2]+","+m[3]+")",l["stop-opacity"]=m[4]);h.push(l)}h.sort(function(a,b){return a.offset>b.offset?1:-1});for(k=0;k<f;k++)d.appendChild(Kc(a,"stop",
h[k]));a.em.appendChild(d);return"url(#"+c+")"}function Pc(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};Oc(a,b,c,d);a.addElement("rect",c)}
function Nc(a,b,c,d){for(var e=[],f=0;f<c.length;f++){var h=v.Fl(c[f]),k=[h.shift()];if("A"===k[0])k.push(h.shift()+","+h.shift(),h.shift(),h.shift()+","+h.shift(),h.shift()+","+h.shift());else for(;h.length;)k.push(h.shift()+","+h.shift());e.push(k.join(" "))}c={d:e.join(" ")};Oc(a,b,c,d);"clipPath"===b?(b="CLIP"+v.km++,d=Kc(a,"clipPath",{id:b}),d.appendChild(Kc(a,"path",c)),a.em.appendChild(d),0<a.yf.length&&a.yf[a.yf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
c)}function Mc(a,b,c,d,e,f,h){var k=Math.abs(e-f);if(e!==f){var l=b+d*Math.cos(f);f=c+d*Math.sin(f);k>=2*Math.PI?(Mc(a,b,c,d,e,e+Math.PI,h),Mc(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,f])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k===!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,f]))}}function Lc(a,b,c,d,e,f,h){var k=new Dc;k.Sb=[b,c,d,e,f,h];b={};Oc(a,"g",b,k);k=a.addElement("g",b);a.yf.push(k)}
g.Za=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+v.km++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,f,h;c=Kc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",JL:this.shadowBlur/2});d=Kc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=Kc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});f=Kc(this,"feOffset",{"in":"comp",result:"offsetBlur",
dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=Kc(this,"feMerge",{});h.appendChild(Kc(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(Kc(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);b.appendChild(h);0<this.yf.length&&this.yf[this.yf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};g.dB=function(a,b,c){this.Ss=a;this.Ts=b;this.yg=c};g.Tn=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};
g.Un=function(){this.shadowOffsetX=this.Ss;this.shadowOffsetY=this.Ts;this.shadowBlur=this.yg};g.Yz=function(){return!1};g.Vz=function(){};function Rc(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.td=c;this.uk=new Sc(c);c.Z=a;Object.seal(this)}g=Rc.prototype;g.toDataURL=function(a,b){return this.td.toDataURL(a,b)};g.getBoundingClientRect=function(){return this.td.getBoundingClientRect()};g.focus=function(){return this.td.focus()};
g.addEventListener=function(a,b,c){this.td.addEventListener(a,b,c)};g.removeEventListener=function(a,b,c){this.td.removeEventListener(a,b,c)};v.defineProperty(Rc,{width:"width"},function(){return this.td.width},function(a){this.td.width=a});v.defineProperty(Rc,{height:"height"},function(){return this.td.height},function(a){this.td.height=a});v.defineProperty(Rc,{style:"style"},function(){return this.td.style},function(a){this.td.style=a});
function Sc(a){a.getContext&&a.getContext("2d")||v.k("Browser does not support HTML Canvas Element");this.ya=a.getContext("2d");this.uy=this.wy=this.vy="";this.ko=!1;this.yg=this.Ts=this.Ss=0;Object.seal(this)}v.defineProperty(Sc,{fillStyle:"fillStyle"},function(){return this.ya.fillStyle},function(a){this.uy!==a&&(this.uy=this.ya.fillStyle=a)});v.defineProperty(Sc,{font:"font"},function(){return this.ya.font},function(a){this.vy!==a&&(this.vy=this.ya.font=a)});
v.defineProperty(Sc,{globalAlpha:"globalAlpha"},function(){return this.ya.globalAlpha},function(a){this.ya.globalAlpha=a});v.defineProperty(Sc,{lineCap:"lineCap"},function(){return this.ya.lineCap},function(a){this.ya.lineCap=a});v.defineProperty(Sc,{Hn:"lineDashOffset"},function(){return this.ya.Hn},function(a){this.ya.Hn=a});v.defineProperty(Sc,{lineJoin:"lineJoin"},function(){return this.ya.lineJoin},function(a){this.ya.lineJoin=a});
v.defineProperty(Sc,{lineWidth:"lineWidth"},function(){return this.ya.lineWidth},function(a){this.ya.lineWidth=a});v.defineProperty(Sc,{miterLimit:"miterLimit"},function(){return this.ya.miterLimit},function(a){this.ya.miterLimit=a});v.defineProperty(Sc,{shadowBlur:"shadowBlur"},function(){return this.ya.shadowBlur},function(a){this.ya.shadowBlur=a});v.defineProperty(Sc,{shadowColor:"shadowColor"},function(){return this.ya.shadowColor},function(a){this.ya.shadowColor=a});
v.defineProperty(Sc,{shadowOffsetX:"shadowOffsetX"},function(){return this.ya.shadowOffsetX},function(a){this.ya.shadowOffsetX=a});v.defineProperty(Sc,{shadowOffsetY:"shadowOffsetY"},function(){return this.ya.shadowOffsetY},function(a){this.ya.shadowOffsetY=a});v.defineProperty(Sc,{strokeStyle:"strokeStyle"},function(){return this.ya.strokeStyle},function(a){this.wy!==a&&(this.wy=this.ya.strokeStyle=a)});
v.defineProperty(Sc,{textAlign:"textAlign"},function(){return this.ya.textAlign},function(a){this.ya.textAlign=a});v.defineProperty(Sc,{St:"imageSmoothingEnabled"},function(){return this.ya.St},function(a){this.ya.St=a});g=Sc.prototype;g.arc=function(a,b,c,d,e,f){this.ya.arc(a,b,c,d,e,f)};g.beginPath=function(){this.ya.beginPath()};g.bezierCurveTo=function(a,b,c,d,e,f){this.ya.bezierCurveTo(a,b,c,d,e,f)};g.clearRect=function(a,b,c,d){this.ya.clearRect(a,b,c,d)};g.clip=function(){this.ya.clip()};
g.closePath=function(){this.ya.closePath()};g.createLinearGradient=function(a,b,c,d){return this.ya.createLinearGradient(a,b,c,d)};g.createPattern=function(a,b){return this.ya.createPattern(a,b)};g.createRadialGradient=function(a,b,c,d,e,f){return this.ya.createRadialGradient(a,b,c,d,e,f)};g.drawImage=function(a,b,c,d,e,f,h,k,l){void 0===d?this.ya.drawImage(a,b,c):this.ya.drawImage(a,b,c,d,e,f,h,k,l)};g.fill=function(){this.ya.fill()};g.fillRect=function(a,b,c,d){this.ya.fillRect(a,b,c,d)};
g.fillText=function(a,b,c){this.ya.fillText(a,b,c)};g.getImageData=function(a,b,c,d){return this.ya.getImageData(a,b,c,d)};g.lineTo=function(a,b){this.ya.lineTo(a,b)};g.measureText=function(a){return this.ya.measureText(a)};g.moveTo=function(a,b){this.ya.moveTo(a,b)};g.quadraticCurveTo=function(a,b,c,d){this.ya.quadraticCurveTo(a,b,c,d)};g.rect=function(a,b,c,d){this.ya.rect(a,b,c,d)};g.restore=function(){this.ya.restore()};Sc.prototype.rotate=function(a){this.ya.rotate(a)};g=Sc.prototype;
g.save=function(){this.ya.save()};g.setTransform=function(a,b,c,d,e,f){this.ya.setTransform(a,b,c,d,e,f)};g.scale=function(a,b){this.ya.scale(a,b)};g.stroke=function(){this.ya.stroke()};g.transform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||this.ya.transform(a,b,c,d,e,f)};g.translate=function(a,b){this.ya.translate(a,b)};
g.Gg=function(a){if(a instanceof ha&&a.type===Xc){var b=a.no;a=a.zy;a>b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.ko?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.ko?this.clip():this.fill()};g.yj=function(){this.ko||this.stroke()};v.defineProperty(Sc,{yt:"clipInsteadOfFill"},function(){return this.ko},function(a){this.ko=a});g=Sc.prototype;
g.dB=function(a,b,c){this.Ss=a;this.Ts=b;this.yg=c};g.Tn=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};g.Un=function(){this.shadowOffsetX=this.Ss;this.shadowOffsetY=this.Ts;this.shadowBlur=this.yg};g.Yz=function(a,b){var c=this.ya;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else if(void 0!==c.mozDash)c.mozDash=a,c.mozDashOffset=b;else return!1;return!0};
g.Vz=function(){var a=this.ya;void 0!==a.setLineDash?(a.setLineDash(v.Jk),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=v.Jk,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)};function Yc(a,b){b&&(a.vy="");a.wy="";a.uy=""}
var Zc=(Math.sqrt(2)-1)/3*4,$c=(new y(0,0)).Ga(),ad=(new B(0,0,0,0)).Ga(),hd=(new mb(0,0,0,0)).Ga(),id=(new mb(2,2,2,2)).Ga(),jd=(new y(6,6)).Ga(),kd=(new y(-Infinity,-Infinity)).Ga(),ld=(new y(Infinity,Infinity)).Ga(),md=(new ia(0,0)).Ga(),nd=(new ia(1,1)).Ga(),ud=(new ia(6,6)).Ga(),vd=(new ia(8,8)).Ga(),wd=(new ia(10,10)).Ga(),xd=(new ia(Infinity,Infinity)).Ga(),yd=(new y(NaN,NaN)).Ga(),zd=(new ia(NaN,NaN)).Ga(),Jd=(new B(NaN,NaN,NaN,NaN)).Ga(),Kd=(new L(.156,.156)).Ga(),Ld=(new L(.844,.844)).Ga(),
Md=new ua,Nd=new ua,Od=null;function Pd(a){if(0>=a)return 0;var b=Od;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);Od=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function K(a,b){var c=a-b;return.5>c&&-.5<c}function $a(a,b){var c=a-b;return 5E-8>c&&-5E-8<c}
function Qd(a,b,c,d,e,f,h){0>=e&&(e=1E-6);var k=0,l=0,m=0,n=0;a<c?(l=a,k=c):(l=c,k=a);b<d?(n=b,m=d):(n=d,m=b);if(a===c)return n<=h&&h<=m&&a-e<=f&&f<=a+e;if(b===d)return l<=f&&f<=k&&b-e<=h&&h<=b+e;k+=e;l-=e;if(l<=f&&f<=k&&(m+=e,n-=e,n<=h&&h<=m))if(k-l>m-n)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=h&&h<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=f&&f<=h+e)return!0}else return!0;return!1}
function Rd(a,b,c,d,e,f,h,k,l,m,n,p){if(Qd(a,b,h,k,p,c,d)&&Qd(a,b,h,k,p,e,f))return Qd(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+f)/2,t=(d+s)/2,x=(c+u)/2;return Rd(a,b,q,r,d,c,t,x,l,m,n,p)||Rd(t,x,s,u,e,f,h,k,l,m,n,p)}
function Sd(a,b,c,d,e,f,h,k,l,m){if(Qd(a,b,h,k,l,c,d)&&Qd(a,b,h,k,l,e,f))kb(m,a,b,0,0),kb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Sd(a,b,n,p,d,c,s,u,l,m);Sd(s,u,q,r,e,f,h,k,l,m)}}
function Td(a,b,c,d,e,f,h,k,l,m){if(Qd(a,b,h,k,l,c,d)&&Qd(a,b,h,k,l,e,f))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Td(a,b,n,p,d,c,s,u,l,m);Td(s,u,q,r,e,f,h,k,l,m)}}
function de(a,b,c,d,e,f,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+f*l;e=e*s+h*l;f=f*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+f*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=f}function ee(a,b,c,d,e,f,h,k,l,m){if(Qd(a,b,e,f,m,c,d))return Qd(a,b,e,f,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var q=(n+c)/2,r=(p+d)/2;return ee(a,b,n,p,q,r,h,k,l,m)||ee(q,r,c,d,e,f,h,k,l,m)}
function fe(a,b,c,d,e,f,h,k){if(Qd(a,b,e,f,h,c,d))kb(k,a,b,0,0),kb(k,e,f,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;fe(a,b,l,m,n,p,h,k);fe(n,p,c,d,e,f,h,k)}}function ge(a,b,c,d,e,f,h,k){if(Qd(a,b,e,f,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(f);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;ge(a,b,l,m,n,p,h,k);ge(n,p,c,d,e,f,h,k)}}
function he(a,b,c,d,e,f,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(Qd(a,b,h,k,q,c,d)&&Qd(a,b,h,k,q,e,f)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,b<k?(l=b,h=k):(l=k,h=b),s<l||s>h)return!1}else if(a<h?l=a:(l=h,h=a),q<l||q>h)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+h)/2;f=(f+k)/2;var t=(s+c)/2,x=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var w=(t+c)/2,z=(x+d)/2,
A=(n-l)*(n-l)+(p-m)*(p-m),H=!1;he(a,b,s,u,t,x,w,z,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<A&&(A=b,H=!0));a=r.x;s=r.y;he(w,z,c,d,e,f,h,k,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<A?H=!0:(r.x=a,r.y=s));return H}
function ie(a,b,c,d,e,f,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(Qd(a,b,h,k,q,c,d)&&Qd(a,b,h,k,q,e,f)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,b<k?(l=b,a=k):(l=k,a=b),u<l||u>a)return r}else if(a<h?(l=a,a=h):l=h,s<l||s>a)return r;0<q?r++:0>q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,x=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(s+t)/2;c=(u+x)/2;var t=(t+e)/2,x=(x+f)/2,
w=(d+t)/2,z=(c+x)/2,r=r+ie(a,b,s,u,d,c,w,z,l,m,n,p,q),r=r+ie(w,z,t,x,e,f,h,k,l,m,n,p,q)}return r}
function Oa(a,b,c,d,e,f,h){if($a(a,c)){var k=0;c=0;b<d?(k=b,c=d):(k=d,c=b);d=f;if(d<k)return h.x=a,h.y=k,!1;if(d>c)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if($a(b,d)){a<c?k=a:(k=c,c=a);d=e;if(d<k)return h.x=k,h.y=b,!1;if(d>c)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005<k)return h.x=c,h.y=d,!1;h.x=a+k*(c-a);h.y=b+k*(d-b);return!0}
function je(a,b,c,d,e,f,h,k,l){if(K(a,c)&&K(b,d))return l.x=a,l.y=b,!1;if($a(e,h)){if($a(a,c))return Oa(a,b,c,d,e,f,l),!1;f=(d-b)/(c-a)*(e-a)+b;return Oa(a,b,c,d,e,f,l)}k=(k-f)/(h-e);if($a(a,c)){f=k*(a-e)+f;c=h=0;b<d?(h=b,c=d):(h=d,c=b);if(f<h)return l.x=a,l.y=h,!1;if(f>c)return l.x=a,l.y=c,!1;l.x=a;l.y=f;return!0}h=(d-b)/(c-a);if($a(k,h))return Oa(a,b,c,d,e,f,l),!1;e=(h*a-k*e+f-b)/(h-k);if($a(h,0)){a<c?h=a:(h=c,c=a);if(e<h)return l.x=h,l.y=b,!1;if(e>c)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}f=
h*(e-a)+b;return Oa(a,b,c,d,e,f,l)}function ke(a,b,c,d,e,f,h,k,l){var m=1E21,n=a,p=b;if(je(a,b,a,d,e,f,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f);q<m&&(m=q,n=l.x,p=l.y)}je(c,b,c,d,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));je(a,b,c,b,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));je(a,d,c,d,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));l.x=n;l.y=p;return 1E21>m}
function le(a,b,c,d,e,f,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(f-k)/m,h=a,n=k*h+(f-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(f-k)/m,a=b-d*a,h=(f-k*e-a)/(d-k),n=d*h+a);l.l(h,n);return l}
function me(a,b,c){var d=b.x,e=b.y,f=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===f?(f=a=0,e<h?(a=e,f=h):(a=h,f=e),k<=d&&d<=l&&a<=n&&f>=m):e===h?(d<f?a=d:(a=f,f=d),m<=e&&e<=n&&a<=l&&f>=k):a.Ha(b)||a.Ha(c)||ne(k,m,l,m,d,e,f,h)||ne(l,m,l,n,d,e,f,h)||ne(l,n,k,n,d,e,f,h)||ne(k,n,k,m,d,e,f,h)?!0:!1}function ne(a,b,c,d,e,f,h,k){return 0>=te(a,b,c,d,e,f)*te(a,b,c,d,h,k)&&0>=te(e,f,h,k,a,b)*te(e,f,h,k,c,d)}
function te(a,b,c,d,e,f){c-=a;d-=b;a=e-a;b=f-b;f=a*d-b*c;0===f&&(f=a*c+b*d,0<f&&(f=(a-c)*c+(b-d)*d,0>f&&(f=0)));return 0>f?-1:0<f?1:0}function ue(a){0>a&&(a+=360);360<=a&&(a-=360);return a}
function ve(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=b<c?1:-1;var f=[],h=e/2,k=b;for(b=Math.min(2*e,Math.abs(c-b));1E-5<b;){c=k+d*Math.min(b,h);var e=(c-k)/2,l=a*Math.cos(e),m=a*Math.sin(e),n=-m,p=l*l+n*n,q=p+l*l+n*m,p=4/3*(Math.sqrt(2*p*q)-q)/(l*m-n*l),m=l-p*n,l=n+p*l,n=-l,p=e+k,e=Math.cos(p),p=Math.sin(p);f.push([0+a*Math.cos(k),0+a*Math.sin(k),0+m*e-l*p,0+m*p+l*e,0+m*e-n*p,0+m*p+n*e,0+a*Math.cos(c),0+a*Math.sin(c)]);b-=Math.abs(c-k);k=c}return f}
function Pa(a,b,c,d,e,f,h){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/f)*f+d;var k=c;c+e-a<e/2&&(k=c+e);a=d;d+f-b<f/2&&(a=d+f);h.l(k,a)}function we(a,b){var c=Math.max(a,b),d=Math.min(a,b),e=1,f=1;do e=c%d,c=f=d,d=e;while(0<e);return f}
function xe(a,b,c,d){var e=0>c,f=0>d,h=0,k=h=0;a<b?(h=1,k=0):(h=0,k=1);var l=0,m=0,n=0,p=0,l=0===h?a:b,n=0===h?c:d;if(0===h?e:f)n=-n;h=k;m=0===h?a:b;p=0===h?c:d;if(0===h?e:f)p=-p;a=a=0;if(0<p)if(0<n){b=l*l;a=m*m;l*=n;c=m*p;d=-a+c;e=-a+Math.sqrt(l*l+c*c);m=d;for(f=0;9999999999>f;++f){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0<k)d=m;else if(0>k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,a<p?(p=a/p,a=m*Math.sqrt(Math.abs(1-
p*p)),n=l*p-n,a=Math.sqrt(n*n+a*a)):a=Math.abs(n-l);return a}function ye(a){1<arguments.length&&v.k("Geometry constructor can take at most one optional argument, the Geometry type.");v.pc(this);this.Q=!1;void 0===a&&(a=ze);this.ka=a;this.Fb=this.yb=this.Jc=this.yc=0;this.Jj=new I(Ae);this.tv=this.Jj.G;this.dv=(new B).freeze();this.ab=!0;this.Iq=this.eo=null;this.Jq=NaN;this.ci=xb;this.di=Mb;this.Ko=this.Mo=NaN;this.Bi=Be}v.ga("Geometry",ye);v.ii(ye);
ye.prototype.copy=function(){var a=new ye;a.ka=this.ka;a.yc=this.yc;a.Jc=this.Jc;a.yb=this.yb;a.Fb=this.Fb;for(var b=this.Jj.n,c=b.length,d=a.Jj,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.tv=this.tv;a.dv.assign(this.dv);a.ab=this.ab;a.eo=this.eo;a.Iq=this.Iq;a.Jq=this.Jq;a.ci=this.ci.S();a.di=this.di.S();a.Mo=this.Mo;a.Ko=this.Ko;a.Bi=this.Bi;return a};var Ce;ye.Line=Ce=v.p(ye,"Line",0);var De;ye.Rectangle=De=v.p(ye,"Rectangle",1);var Ke;ye.Ellipse=Ke=v.p(ye,"Ellipse",2);var ze;
ye.Path=ze=v.p(ye,"Path",3);ye.prototype.Ga=function(){this.freeze();Object.freeze(this);return this};ye.prototype.freeze=function(){this.Q=!0;var a=this.dc;a.freeze();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].freeze();return this};ye.prototype.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);this.Q=!1;var a=this.dc;a.Ra();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].Ra();return this};
ye.prototype.equalsApprox=ye.prototype.Lc=function(a){if(!(a instanceof ye))return!1;if(this.type!==a.type)return this.type===Ce&&a.type===ze?Le(this,a):a.type===Ce&&this.type===ze?Le(a,this):!1;if(this.type===ze){var b=this.dc.n;a=a.dc.n;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Lc(a[d]))return!1;return!0}return K(this.ja,a.ja)&&K(this.ha,a.ha)&&K(this.C,a.C)&&K(this.D,a.D)};
function Le(a,b){if(a.type!==Ce||b.type!==ze)return!1;if(1===b.dc.count){var c=b.dc.fa(0);if(1===c.vb.count&&K(a.ja,c.ja)&&K(a.ha,c.ha)&&(c=c.vb.fa(0),c.type===Me&&K(a.C,c.C)&&K(a.D,c.D)))return!0}return!1}var Ne;ye.stringify=Ne=function(a){return a.toString()};ye.prototype.ic=function(a){a.Ge===ye?this.type=a:v.Aj(this,a)};
ye.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Ce:return 0>a?"M"+this.ja.toString()+" "+this.ha.toString()+"L"+this.C.toString()+" "+this.D.toString():"M"+this.ja.toFixed(a)+" "+this.ha.toFixed(a)+"L"+this.C.toFixed(a)+" "+this.D.toFixed(a);case De:var b=new B(this.ja,this.ha,0,0);b.mG(this.C,this.D,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+
"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Ke:b=new B(this.ja,this.ha,0,0);b.mG(this.C,this.D,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/
2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case ze:for(var b="",c=this.dc.n,d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.Zt&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}};
ye.fillPath=function(a){"string"!==typeof a&&v.yd(a,"string",ye,"fillPath:str");a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++)var e=a[d],c=null!==e.match(/[Ff]/)?0===d?c+e:c+("X"+(" "===e[0]?"":" ")+e):c+((0===d?"":"X ")+"F"+(" "===e[0]?"":" ")+e);return c};var Oe;
ye.parse=Oe=function(a,b){function c(){return m>=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new y(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function f(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new y(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&v.yd(a,"string",ye,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,
"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=-1,n="",p="",q=new y(0,0),r=new y(0,0),s=new y(0,
0),u=l.length,t=v.s(),x=!1,w=!1,z=!0;!(m>=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":z=!0;w=x=!1;break;case "M":var A=f();null===t.Ub||!0===z?(N(t,A.x,A.y,x,!1,!w),z=!1):t.moveTo(A.x,A.y);for(q=s;!c();)A=f(),t.lineTo(A.x,A.y);break;case "L":for(;!c();)A=f(),t.lineTo(A.x,A.y);break;case "H":for(;!c();)s=A=new y((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),t.lineTo(s.x,s.y);break;case "V":for(;!c();)s=A=new y(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),t.lineTo(s.x,s.y);break;
case "C":for(;!c();){var H=e(),C=h(),A=f();O(t,H.x,H.y,C.x,C.y,A.x,A.y)}break;case "S":for(;!c();)H=k(),C=h(),A=f(),O(t,H.x,H.y,C.x,C.y,A.x,A.y);break;case "Q":for(;!c();)C=h(),A=f(),Pe(t,C.x,C.y,A.x,A.y);break;case "T":for(;!c();)r=C=k(),A=f(),Pe(t,C.x,C.y,A.x,A.y);break;case "B":for(;!c();){var A=parseFloat(d()),H=parseFloat(d()),C=parseFloat(d()),R=parseFloat(d()),ba=parseFloat(d()),U=ba,M=!1;c()||(U=parseFloat(d()),c()||(M=0!==parseFloat(d())));n===n.toLowerCase()&&(C+=s.x,R+=s.y);t.arcTo(A,H,
C,R,ba,U,M)}break;case "A":for(;!c();)H=Math.abs(parseFloat(d())),C=Math.abs(parseFloat(d())),R=parseFloat(d()),ba=!!parseFloat(d()),U=!!parseFloat(d()),A=f(),Qe(t,H,C,R,ba,U,A.x,A.y);break;case "Z":A=t.o.dc.n[t.o.dc.length-1];P(t);s=q;break;case "F":A="";for(H=1;l[m+H];)if(null!==l[m+H].match(/[Uu]/))H++;else if(null===l[m+H].match(/[A-Za-z]/))H++;else{A=l[m+H];break}A.match(/[Mm]/)?x=!0:Re(t);break;case "U":A="";for(H=1;l[m+H];)if(null!==l[m+H].match(/[Ff]/))H++;else if(null===l[m+H].match(/[A-Za-z]/))H++;
else{A=l[m+H];break}A.match(/[Mm]/)?w=!0:t.Za(!1)}q=t.o;v.q(t);if(b)for(t=q.dc.i;t.next();)A=t.value,A.Zt=!0;return q};function Se(a,b){for(var c=a.length,d=v.K(),e=0;e<c;e++){var f=a[e];d.x=f[0];d.y=f[1];b.ob(d);f[0]=d.x;f[1]=d.y;d.x=f[2];d.y=f[3];b.ob(d);f[2]=d.x;f[3]=d.y;d.x=f[4];d.y=f[5];b.ob(d);f[4]=d.x;f[5]=d.y;d.x=f[6];d.y=f[7];b.ob(d);f[6]=d.x;f[7]=d.y}v.v(d)}
ye.prototype.sx=function(){if(this.ab||this.tv!==this.dc.G)return!0;for(var a=this.dc.n,b=a.length,c=0;c<b;c++)if(a[c].sx())return!0;return!1};ye.prototype.ey=function(){this.ab=!1;this.Iq=this.eo=null;this.Jq=NaN;this.tv=this.dc.G;for(var a=this.dc.n,b=a.length,c=0;c<b;c++)a[c].ey()};ye.prototype.rh=function(){var a=this.dv;a.Ra();isNaN(this.Mo)||isNaN(this.Ko)?a.l(0,0,0,0):a.l(0,0,this.Mo,this.Ko);Te(this,a,!1);kb(a,0,0,0,0);a.freeze()};
ye.prototype.computeBoundsWithoutOrigin=ye.prototype.qH=function(){var a=new B;Te(this,a,!0);return a};
function Te(a,b,c){switch(a.type){case Ce:case De:case Ke:c?b.l(a.yc,a.Jc,0,0):kb(b,a.yc,a.Jc,0,0);kb(b,a.yb,a.Fb,0,0);break;case ze:var d=a.dc;a=d.n;for(var d=d.length,e=0;e<d;e++){var f=a[e];c&&0===e?b.l(f.ja,f.ha,0,0):kb(b,f.ja,f.ha,0,0);for(var h=f.vb.n,k=h.length,l=f.ja,m=f.ha,n=0;n<k;n++){var p=h[n];switch(p.type){case Me:case cf:l=p.C;m=p.D;kb(b,l,m,0,0);break;case df:Sd(l,m,p.uc,p.Rc,p.Ah,p.Bh,p.C,p.D,.5,b);l=p.C;m=p.D;break;case ef:fe(l,m,p.uc,p.Rc,p.C,p.D,.5,b);l=p.C;m=p.D;break;case ff:case gf:var q=
p.type===ff?hf(p,f):jf(p,f,l,m),r=q.length;if(0===r){l=p.la;m=p.sa;kb(b,l,m,0,0);break}for(var p=null,s=0;s<r;s++)p=q[s],Sd(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],.5,b);null!==p&&(l=p[6],m=p[7]);break;default:v.k("Unknown Segment type: "+p.type)}}}break;default:v.k("Unknown Geometry type: "+a.type)}}ye.prototype.normalize=ye.prototype.normalize=function(){this.Q&&v.ma(this);var a=this.qH();this.offset(-a.x,-a.y);return new y(-a.x,-a.y)};
ye.prototype.offset=ye.prototype.offset=function(a,b){this.Q&&v.ma(this);this.transform(1,0,0,1,a,b);return this};ye.prototype.scale=ye.prototype.scale=function(a,b){this.Q&&v.ma(this);this.transform(a,0,0,b,0,0);return this};ye.prototype.rotate=ye.prototype.rotate=function(a,b,c){this.Q&&v.ma(this);void 0===b&&(b=0);void 0===c&&(c=0);var d=v.Ff();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);v.we(d);return this};
ye.prototype.transform=ye.prototype.transform=function(a,b,c,d,e,f){var h=0,k=0;switch(this.type){case Ce:case De:case Ke:h=this.yc;k=this.Jc;this.yc=h*a+k*c+e;this.Jc=h*b+k*d+f;h=this.yb;k=this.Fb;this.yb=h*a+k*c+e;this.Fb=h*b+k*d+f;break;case ze:for(var l=this.dc.n,m=l.length,n=0;n<m;n++){var p=l[n],h=p.ja,k=p.ha;p.ja=h*a+k*c+e;p.ha=h*b+k*d+f;for(var p=p.vb.n,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case Me:case cf:h=s.C;k=s.D;s.C=h*a+k*c+e;s.D=h*b+k*d+f;break;case df:h=s.uc;k=s.Rc;s.uc=
h*a+k*c+e;s.Rc=h*b+k*d+f;h=s.Ah;k=s.Bh;s.Ah=h*a+k*c+e;s.Bh=h*b+k*d+f;h=s.C;k=s.D;s.C=h*a+k*c+e;s.D=h*b+k*d+f;break;case ef:h=s.uc;k=s.Rc;s.uc=h*a+k*c+e;s.Rc=h*b+k*d+f;h=s.C;k=s.D;s.C=h*a+k*c+e;s.D=h*b+k*d+f;break;case ff:h=s.la;k=s.sa;s.la=h*a+k*c+e;s.sa=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Ae+=h);0>a&&(s.Ae=180-s.Ae,s.sf=-s.sf);0>d&&(s.Ae=-s.Ae,s.sf=-s.sf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case gf:h=s.C;k=s.D;s.C=h*
a+k*c+e;s.D=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Cj+=h);0>a&&(s.Cj=180-s.Cj,s.Ul=!s.Ul);0>d&&(s.Cj=-s.Cj,s.Ul=!s.Ul);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:v.k("Unknown Segment type: "+s.type)}}}}this.ab=!0;return this};
ye.prototype.Ha=function(a,b,c,d){var e=a.x,f=a.y,h=this.kb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.dc.n,s=r.length,u=0;u<s;u++){var t=r[u];if(t.Zt){if(c&&t.Ha(e,f,b))return!0;for(var x=t.vb,l=t.ja,m=t.ha,w=l,z=m,A=x.n,H=0;H<=x.length;H++){var C,R;H!==x.length?(C=A[H],R=C.type,p=C.C,q=C.D):(R=Me,p=w,q=z);switch(R){case cf:n=kf(e,f,h,a,l,m,w,z);if(isNaN(n))return!0;k+=n;w=p;z=q;break;case Me:n=kf(e,f,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case df:n=ie(l,m,C.uc,C.Rc,C.Ah,C.Bh,p,q,h,
a,e,f,.5);k+=n;break;case ef:n=ie(l,m,(l+2*C.uc)/3,(m+2*C.Rc)/3,(2*C.uc+p)/3,(2*C.Rc+q)/3,p,q,h,a,e,f,.5);k+=n;break;case ff:case gf:R=C.type===ff?hf(C,t):jf(C,t,l,m);var ba=R.length;if(0===ba){n=kf(e,f,h,a,l,m,C.la,C.sa);if(isNaN(n))return!0;k+=n;break}for(var U=null,M=0;M<ba;M++){U=R[M];if(0===M){n=kf(e,f,h,a,l,m,U[0],U[1]);if(isNaN(n))return!0;k+=n}n=ie(U[0],U[1],U[2],U[3],U[4],U[5],U[6],U[7],h,a,e,f,.5);k+=n}null!==U&&(p=U[6],q=U[7]);break;default:v.k("Unknown Segment type: "+C.type)}l=p;m=q}if(0!==
k)return!0;k=0}else if(t.Ha(e,f,d?b:b+2))return!0}return 0!==k};function kf(a,b,c,d,e,f,h,k){if(Qd(e,f,h,k,.05,a,b))return NaN;var l=(a-c)*(f-k);if(0===l)return 0;var m=((a*d-b*c)*(e-h)-(a-c)*(e*k-f*h))/l;b=(a*d-b*c)*(f-k)/l;if(m>=a)return 0;if((e>h?e-h:h-e)<(f>k?f-k:k-f)){if(e=a=0,f<k?(a=f,e=k):(a=k,e=f),b<a||b>e)return 0}else if(e<h?(a=e,e=h):a=h,m<a||m>e)return 0;return 0<l?1:-1}function lf(a,b,c,d){a=a.dc.n;for(var e=a.length,f=0;f<e;f++)if(a[f].Ha(b,c,d))return!0;return!1}
ye.prototype.getPointAlongPath=ye.prototype.WH=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=new y);if(this.type===Ce)return b.l(this.ja+a*(this.C-this.ja),this.ha+a*(this.D-this.ha)),b;for(var c=this.aA,d=this.hx,e=c.length,f=this.bA*a,h=0,k=0;k<e;k++)for(var l=d[k],m=l.length,n=0;n<m;n++){var p=l[n];if(h+p>=f)return d=(f-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.l(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.l(NaN,NaN);return b};
ye.prototype.getFractionForPoint=ye.prototype.SH=function(a){if(this.type===Ce){var b=this.ja,c=this.ha,d=this.C,e=this.D;if(b!==d||c!==e){var f=a.x;a=a.y;var h=0,k=0;return b===d?(c<e?(h=c,k=e):(h=e,k=c),a<=h?h===c?0:1:a>=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b<d?(h=b,k=d):(h=d,k=b),f<=h?h===b?0:1:f>=k?k===b?0:1:Math.abs(f-b)/(k-h)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===De){if(b=this.ja,c=this.ha,d=this.C,e=this.D,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,f=a.x;
a=a.y;f=Math.min(Math.max(f,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(f-b),d=Math.abs(f-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return f/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-f)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.aA,h=this.hx,k=this.bA,l=v.K(),c=Infinity,b=d=0,f=e.length,n=m=0,p=0;p<f;p++)for(var q=e[p],r=h[p],s=q.length,u=0;u<s;u+=2){var t=q[u],x=q[u+1];if(0!==u){Oa(m,n,t,x,a.x,a.y,l);var w=(l.x-a.x)*(l.x-a.x)+(l.y-a.y)*(l.y-a.y);w<c&&(c=w,
d=b,d+=Math.sqrt((l.x-m)*(l.x-m)+(l.y-n)*(l.y-n)));b+=r[(u-2)/2]}m=t;n=x}v.v(l);a=d/k;return 0>a?0:1<a?1:a}return 0};v.u(ye,{aA:null},function(){mf(this);return this.eo});
function mf(a){if(null===a.eo){a.sx()&&a.ey();var b=a.eo=[],c=a.Iq=[],d=[],e=[];if(a.type===Ce)d.push(a.ja),d.push(a.ha),d.push(a.C),d.push(a.D),b.push(d),e.push(Math.sqrt((a.ja-a.C)*(a.ja-a.C)+(a.ha-a.D)*(a.ha-a.D))),c.push(e);else if(a.type===De)d.push(a.ja),d.push(a.ha),d.push(a.C),d.push(a.ha),d.push(a.C),d.push(a.D),d.push(a.ja),d.push(a.D),d.push(a.ja),d.push(a.ha),b.push(d),e.push(Math.abs(a.ja-a.C)),e.push(Math.abs(a.ha-a.D)),e.push(Math.abs(a.ja-a.C)),e.push(Math.abs(a.ha-a.D)),c.push(e);
else if(a.type===Ke){var f=new Ae;f.ja=a.C;f.ha=(a.ha+a.D)/2;var h=new nf(ff);h.Ae=0;h.sf=360;h.la=(a.ja+a.C)/2;h.sa=(a.ha+a.D)/2;h.radiusX=Math.abs(a.ja-a.C)/2;h.radiusY=Math.abs(a.ha-a.D)/2;f.add(h);a=hf(h,f);e=a.length;if(0===e)d.push(h.la),d.push(h.sa);else for(var h=f.ja,f=f.ha,k=0;k<e;k++){var l=a[k];Td(h,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d);h=l[6];f=l[7]}b.push(d);c.push(of(d))}else for(var m=a.dc.i;m.next();){var n=m.value,d=[];d.push(n.ja);d.push(n.ha);for(var h=n.ja,f=n.ha,p=h,q=f,r=n.vb.n,
s=r.length,u=0;u<s;u++){var t=r[u];switch(t.ka){case cf:4<=d.length&&(b.push(d),c.push(of(d)));d=[];d.push(t.C);d.push(t.D);h=t.C;f=t.D;p=h;q=f;break;case Me:d.push(t.C);d.push(t.D);h=t.C;f=t.D;break;case df:Td(h,f,t.Dd,t.We,t.lh,t.xg,t.yb,t.Fb,.5,d);h=t.C;f=t.D;break;case ef:ge(h,f,t.Dd,t.We,t.yb,t.Fb,.5,d);h=t.C;f=t.D;break;case ff:a=hf(t,n);e=a.length;if(0===e){d.push(t.la);d.push(t.sa);h=t.la;f=t.sa;break}for(k=0;k<e;k++)l=a[k],Td(h,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d),h=l[6],f=l[7];break;case gf:a=
jf(t,n,h,f);e=a.length;if(0===e){d.push(t.la);d.push(t.sa);h=t.la;f=t.sa;break}for(k=0;k<e;k++)l=a[k],Td(h,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d),h=l[6],f=l[7];break;default:v.k("Segment not of valid type: "+t.ka)}t.Ph&&(d.push(p),d.push(q))}4<=d.length&&(b.push(d),c.push(of(d)))}}}v.u(ye,{hx:null},function(){mf(this);return this.Iq});
v.u(ye,{bA:null},function(){var a=this.Jq;if(isNaN(a)){if(this.type===Ce)var a=Math.abs(this.C-this.ja),b=Math.abs(this.D-this.ha),a=Math.sqrt(a*a+b*b);else if(this.type===De)a=Math.abs(this.C-this.ja),b=Math.abs(this.D-this.ha),a=2*a+2*b;else for(var b=this.hx,c=b.length,d=a=0;d<c;d++)for(var e=b[d],f=e.length,h=0;h<f;h++)a+=e[h];this.Jq=a}return a});function of(a){for(var b=[],c=0,d=0,e=a.length,f=0;f<e;f+=2){var h=a[f],k=a[f+1];0!==f&&(c=Math.sqrt(Ta(c,d,h,k)),b.push(c));c=h;d=k}return b}
v.defineProperty(ye,{type:"type"},function(){return this.ka},function(a){this.ka!==a&&(this.Q&&v.ma(this,a),this.ka=a,this.ab=!0)});v.defineProperty(ye,{ja:"startX"},function(){return this.yc},function(a){this.yc!==a&&(this.Q&&v.ma(this,a),this.yc=a,this.ab=!0)});v.defineProperty(ye,{ha:"startY"},function(){return this.Jc},function(a){this.Jc!==a&&(this.Q&&v.ma(this,a),this.Jc=a,this.ab=!0)});
v.defineProperty(ye,{C:"endX"},function(){return this.yb},function(a){this.yb!==a&&(this.Q&&v.ma(this,a),this.yb=a,this.ab=!0)});v.defineProperty(ye,{D:"endY"},function(){return this.Fb},function(a){this.Fb!==a&&(this.Q&&v.ma(this,a),this.Fb=a,this.ab=!0)});v.defineProperty(ye,{dc:"figures"},function(){return this.Jj},function(a){this.Jj!==a&&(this.Q&&v.ma(this,a),this.Jj=a,this.ab=!0)});ye.prototype.add=ye.prototype.add=function(a){this.Jj.add(a);return this};
ye.prototype.setSpots=function(a,b,c,d,e,f,h,k){this.Q&&v.ma(this);this.ci=(new L(a,b,e,f)).freeze();this.di=(new L(c,d,h,k)).freeze();return this};v.defineProperty(ye,{A:"spot1"},function(){return this.ci},function(a){this.Q&&v.ma(this,a);this.ci=a.S()});v.defineProperty(ye,{B:"spot2"},function(){return this.di},function(a){this.Q&&v.ma(this,a);this.di=a.S()});v.defineProperty(ye,{$d:"defaultStretch"},function(){return this.Bi},function(a){this.Q&&v.ma(this,a);this.Bi=a});
v.u(ye,{kb:"bounds"},function(){this.sx()&&(this.ey(),this.rh());return this.dv});function Ae(a,b,c,d){v.pc(this);this.Q=!1;void 0===c&&(c=!0);this.zm=c;void 0===d&&(d=!0);this.No=d;this.yc=void 0!==a?a:0;this.Jc=void 0!==b?b:0;this.jp=new I(nf);this.qw=this.jp.G;this.ab=!0}v.ga("PathFigure",Ae);v.ii(Ae);
Ae.prototype.copy=function(){var a=new Ae;a.zm=this.zm;a.No=this.No;a.yc=this.yc;a.Jc=this.Jc;for(var b=this.jp.n,c=b.length,d=a.jp,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.qw=this.qw;a.ab=this.ab;return a};Ae.prototype.equalsApprox=Ae.prototype.Lc=function(a){if(!(a instanceof Ae&&K(this.ja,a.ja)&&K(this.ha,a.ha)))return!1;var b=this.vb.n;a=a.vb.n;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Lc(a[d]))return!1;return!0};g=Ae.prototype;
g.toString=function(a){void 0===a&&(a=-1);for(var b=0>a?"M"+this.ja.toString()+" "+this.ha.toString():"M"+this.ja.toFixed(a)+" "+this.ha.toFixed(a),c=this.vb.n,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};g.freeze=function(){this.Q=!0;var a=this.vb;a.freeze();for(var b=a.n,a=a.length,c=0;c<a;c++)b[c].freeze();return this};g.Ra=function(){this.Q=!1;var a=this.vb;a.Ra();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].Ra();return this};
g.sx=function(){if(this.ab)return!0;var a=this.vb;if(this.qw!==a.G)return!0;for(var a=a.n,b=a.length,c=0;c<b;c++)if(a[c].ab)return!0;return!1};g.ey=function(){this.ab=!1;var a=this.vb;this.qw=a.G;for(var a=a.n,b=a.length,c=0;c<b;c++){var d=a[c];d.ab=!1;d.hg=null}};v.defineProperty(Ae,{Zt:"isFilled"},function(){return this.zm},function(a){this.Q&&v.ma(this,a);this.zm=a});v.defineProperty(Ae,{Xl:"isShadowed"},function(){return this.No},function(a){this.Q&&v.ma(this,a);this.No=a});
v.defineProperty(Ae,{ja:"startX"},function(){return this.yc},function(a){this.Q&&v.ma(this,a);this.yc=a;this.ab=!0});v.defineProperty(Ae,{ha:"startY"},function(){return this.Jc},function(a){this.Q&&v.ma(this,a);this.Jc=a;this.ab=!0});v.defineProperty(Ae,{vb:"segments"},function(){return this.jp},function(a){this.Q&&v.ma(this,a);this.jp=a;this.ab=!0});Ae.prototype.add=Ae.prototype.add=function(a){this.jp.add(a);return this};
Ae.prototype.Ha=function(a,b,c){for(var d=this.ja,e=this.ha,f=d,h=e,k=this.vb.n,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case cf:f=n.C;h=n.D;d=n.C;e=n.D;break;case Me:if(Qd(d,e,n.C,n.D,c,a,b))return!0;d=n.C;e=n.D;break;case df:if(Rd(d,e,n.uc,n.Rc,n.Ah,n.Bh,n.C,n.D,.5,a,b,c))return!0;d=n.C;e=n.D;break;case ef:if(ee(d,e,n.uc,n.Rc,n.C,n.D,.5,a,b,c))return!0;d=n.C;e=n.D;break;case ff:case gf:var p=n.type===ff?hf(n,this):jf(n,this,d,e),q=p.length;if(0===q){if(Qd(d,e,n.la,n.sa,c,a,b))return!0;
d=n.la;e=n.sa;break}for(var r=null,s=0;s<q;s++)if(r=p[s],0===s&&Qd(d,e,r[0],r[1],c,a,b)||Rd(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:v.k("Unknown Segment type: "+n.type)}if(n.ox&&(d!==f||e!==h)&&Qd(d,e,f,h,c,a,b))return!0}return!1};
function nf(a,b,c,d,e,f,h,k){v.pc(this);this.Q=!1;void 0===a&&(a=Me);this.ka=a;this.yb=void 0!==b?b:0;this.Fb=void 0!==c?c:0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===f&&(f=0);void 0===h&&(h=0);a===gf?(a=f%360,0>a&&(a+=360),this.Dd=a,this.We=0,this.lh=Math.max(d,0),this.xg=Math.max(e,0),this.So="boolean"===typeof h?!!h:!1,this.lo=!!k):(this.Dd=d,this.We=e,a===ff&&(f=Math.max(f,0)),this.lh=f,"number"===typeof h?(a===ff&&(h=Math.max(h,0)),this.xg=h):this.xg=0,this.lo=this.So=!1);this.Ph=!1;this.ab=
!0;this.hg=null}v.ga("PathSegment",nf);v.ii(nf);nf.prototype.copy=function(){var a=new nf;a.ka=this.ka;a.yb=this.yb;a.Fb=this.Fb;a.Dd=this.Dd;a.We=this.We;a.lh=this.lh;a.xg=this.xg;a.So=this.So;a.lo=this.lo;a.Ph=this.Ph;a.ab=this.ab;return a};
nf.prototype.equalsApprox=nf.prototype.Lc=function(a){if(!(a instanceof nf)||this.type!==a.type||this.ox!==a.ox)return!1;switch(this.type){case cf:case Me:return K(this.C,a.C)&&K(this.D,a.D);case df:return K(this.C,a.C)&&K(this.D,a.D)&&K(this.uc,a.uc)&&K(this.Rc,a.Rc)&&K(this.Ah,a.Ah)&&K(this.Bh,a.Bh);case ef:return K(this.C,a.C)&&K(this.D,a.D)&&K(this.uc,a.uc)&&K(this.Rc,a.Rc);case ff:return K(this.Ae,a.Ae)&&K(this.sf,a.sf)&&K(this.la,a.la)&&K(this.sa,a.sa)&&K(this.radiusX,a.radiusX)&&K(this.radiusY,
a.radiusY);case gf:return this.Ul===a.Ul&&this.tx===a.tx&&K(this.Cj,a.Cj)&&K(this.C,a.C)&&K(this.D,a.D)&&K(this.radiusX,a.radiusX)&&K(this.radiusY,a.radiusY);default:return!1}};nf.prototype.ic=function(a){a.Ge===nf?this.type=a:v.Aj(this,a)};
nf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case cf:b=0>a?"M"+this.C.toString()+" "+this.D.toString():"M"+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case Me:b=0>a?"L"+this.C.toString()+" "+this.D.toString():"L"+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case df:b=0>a?"C"+this.uc.toString()+" "+this.Rc.toString()+" "+this.Ah.toString()+" "+this.Bh.toString()+" "+this.C.toString()+" "+this.D.toString():"C"+this.uc.toFixed(a)+" "+this.Rc.toFixed(a)+" "+this.Ah.toFixed(a)+
" "+this.Bh.toFixed(a)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case ef:b=0>a?"Q"+this.uc.toString()+" "+this.Rc.toString()+" "+this.C.toString()+" "+this.D.toString():"Q"+this.uc.toFixed(a)+" "+this.Rc.toFixed(a)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case ff:b=0>a?"B"+this.Ae.toString()+" "+this.sf.toString()+" "+this.la.toString()+" "+this.sa.toString()+" "+this.radiusX:"B"+this.Ae.toFixed(a)+" "+this.sf.toFixed(a)+" "+this.la.toFixed(a)+" "+this.sa.toFixed(a)+" "+this.radiusX;
break;case gf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Cj.toString()+" "+(this.tx?1:0)+" "+(this.Ul?1:0)+" "+this.C.toString()+" "+this.D.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Cj.toFixed(a)+" "+(this.tx?1:0)+" "+(this.Ul?1:0)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;default:b=this.type.toString()}return b+(this.Ph?"z":"")};var cf;nf.Move=cf=v.p(nf,"Move",0);var Me;nf.Line=Me=v.p(nf,"Line",1);var df;
nf.Bezier=df=v.p(nf,"Bezier",2);var ef;nf.QuadraticBezier=ef=v.p(nf,"QuadraticBezier",3);var ff;nf.Arc=ff=v.p(nf,"Arc",4);var gf;nf.SvgArc=gf=v.p(nf,"SvgArc",4);nf.prototype.freeze=function(){this.Q=!0;return this};nf.prototype.Ra=function(){this.Q=!1;return this};nf.prototype.close=nf.prototype.close=function(){this.Ph=!0;return this};
function hf(a,b){if(null!==a.hg&&!1===b.ab)return a.hg;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.hg=[],a.hg;var e=a.Dd,f=a.We,h=ve(c<d?c:d,a.Ae,a.Ae+a.sf,!1);if(c!==d){var k=v.Ff();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);Se(h,k);v.we(k)}c=h.length;for(d=0;d<c;d++)k=h[d],k[0]+=e,k[1]+=f,k[2]+=e,k[3]+=f,k[4]+=e,k[5]+=f,k[6]+=e,k[7]+=f;a.hg=h;return a.hg}
function jf(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos((a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d)))}if(null!==a.hg&&!1===b.ab)return a.hg;b=a.lh;var f=a.xg;if(0===b||0===f)return a.hg=[],a.hg;var h=Math.PI/180*a.Dd,k=a.So,l=a.lo,m=a.yb,n=a.Fb,p=Math.cos(h),q=Math.sin(h),r=p*(c-m)/2+q*(d-n)/2,h=-q*(c-m)/2+p*(d-n)/2,s=r*r/(b*b)+h*h/(f*f);1<s&&(b*=Math.sqrt(s),f*=Math.sqrt(s));s=(k===l?-1:1)*Math.sqrt((b*b*f*f-b*b*h*h-f*f*r*r)/(b*b*h*h+f*f*r*r));isNaN(s)&&(s=0);k=s*b*h/f;s=s*-f*
r/b;isNaN(k)&&(k=0);isNaN(s)&&(s=0);c=(c+m)/2+p*k-q*s;d=(d+n)/2+q*k+p*s;n=e(1,0,(r-k)/b,(h-s)/f);p=(r-k)/b;m=(h-s)/f;r=(-r-k)/b;k=(-h-s)/f;h=e(p,m,r,k);r=(p*r+m*k)/(Math.sqrt(p*p+m*m)*Math.sqrt(r*r+k*k));-1>=r?h=Math.PI:1<=r&&(h=0);!l&&0<h&&(h-=2*Math.PI);l&&0>h&&(h+=2*Math.PI);l=b>f?1:b/f;r=b>f?f/b:1;b=ve(b>f?b:f,n,n+h,!0);f=v.Ff();f.reset();f.translate(c,d);f.rotate(a.Dd,0,0);f.scale(l,r);Se(b,f);v.we(f);a.hg=b;return a.hg}
v.defineProperty(nf,{ox:"isClosed"},function(){return this.Ph},function(a){this.Ph!==a&&(this.Ph=a,this.ab=!0)});v.defineProperty(nf,{type:"type"},function(){return this.ka},function(a){this.Q&&v.ma(this,a);this.ka=a;this.ab=!0});v.defineProperty(nf,{C:"endX"},function(){return this.yb},function(a){this.Q&&v.ma(this,a);this.yb=a;this.ab=!0});v.defineProperty(nf,{D:"endY"},function(){return this.Fb},function(a){this.Q&&v.ma(this,a);this.Fb=a;this.ab=!0});
v.defineProperty(nf,{uc:"point1X"},function(){return this.Dd},function(a){this.Q&&v.ma(this,a);this.Dd=a;this.ab=!0});v.defineProperty(nf,{Rc:"point1Y"},function(){return this.We},function(a){this.Q&&v.ma(this,a);this.We=a;this.ab=!0});v.defineProperty(nf,{Ah:"point2X"},function(){return this.lh},function(a){this.Q&&v.ma(this,a);this.lh=a;this.ab=!0});v.defineProperty(nf,{Bh:"point2Y"},function(){return this.xg},function(a){this.Q&&v.ma(this,a);this.xg=a;this.ab=!0});
v.defineProperty(nf,{la:"centerX"},function(){return this.Dd},function(a){this.Q&&v.ma(this,a);this.Dd=a;this.ab=!0});v.defineProperty(nf,{sa:"centerY"},function(){return this.We},function(a){this.Q&&v.ma(this,a);this.We=a;this.ab=!0});v.defineProperty(nf,{radiusX:"radiusX"},function(){return this.lh},function(a){0>a&&v.Fa(a,">= zero",nf,"radiusX");this.Q&&v.ma(this,a);this.lh=a;this.ab=!0});
v.defineProperty(nf,{radiusY:"radiusY"},function(){return this.xg},function(a){0>a&&v.Fa(a,">= zero",nf,"radiusY");this.Q&&v.ma(this,a);this.xg=a;this.ab=!0});v.defineProperty(nf,{Ae:"startAngle"},function(){return this.yb},function(a){this.yb!==a&&(this.Q&&v.ma(this,a),a%=360,0>a&&(a+=360),this.yb=a,this.ab=!0)});v.defineProperty(nf,{sf:"sweepAngle"},function(){return this.Fb},function(a){this.Q&&v.ma(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Fb=a;this.ab=!0});
v.defineProperty(nf,{Ul:"isClockwiseArc"},function(){return this.lo},function(a){this.Q&&v.ma(this,a);this.lo=a;this.ab=!0});v.defineProperty(nf,{tx:"isLargeArc"},function(){return this.So},function(a){this.Q&&v.ma(this,a);this.So=a;this.ab=!0});v.defineProperty(nf,{Cj:"xAxisRotation"},function(){return this.Dd},function(a){a%=360;0>a&&(a+=360);this.Q&&v.ma(this,a);this.Dd=a;this.ab=!0});
function pf(){this.Z=null;this.Bz=(new y(0,0)).freeze();this.Iy=(new y(0,0)).freeze();this.av=this.Vv=0;this.bv=1;this.Lv="";this.Aw=this.qv=!1;this.nv=this.cv=0;this.Ej=this.yv=this.Iv=!1;this.rr=null;this.yw=0;this.Ag=this.xw=null}v.ga("InputEvent",pf);
pf.prototype.copy=function(){var a=new pf;a.Z=this.Z;a.Bz.assign(this.ef);a.Iy.assign(this.da);a.Vv=this.Vv;a.av=this.av;a.bv=this.bv;a.Lv=this.Lv;a.qv=this.qv;a.Aw=this.Aw;a.cv=this.cv;a.nv=this.nv;a.Iv=this.Iv;a.yv=this.yv;a.Ej=this.Ej;a.rr=this.rr;a.yw=this.yw;a.xw=this.xw;a.Ag=this.Ag;return a};
pf.prototype.toString=function(){var a="^";0!==this.wd&&(a+="M:"+this.wd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.He&&(a+="C:"+this.He);0!==this.Kl&&(a+="D:"+this.Kl);this.Cc&&(a+="h");this.bubbles&&(a+="b");null!==this.da&&(a+="@"+this.da.toString());return a};v.defineProperty(pf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});v.defineProperty(pf,{ef:"viewPoint"},function(){return this.Bz},function(a){v.F(a,y,pf,"viewPoint");this.Bz.assign(a)});
v.defineProperty(pf,{da:"documentPoint"},function(){return this.Iy},function(a){v.F(a,y,pf,"documentPoint");this.Iy.assign(a)});pf.prototype.getMultiTouchViewPoint=pf.prototype.jx=function(a,b){var c=this.g;if(null===c)return b;qf(c,this.event,a,b);return b};pf.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;qf(c,this.event,a,b);b.assign(c.kB(b));return b};v.defineProperty(pf,{wd:"modifiers"},function(){return this.Vv},function(a){this.Vv=a});
v.defineProperty(pf,{button:"button"},function(){return this.av},function(a){this.av=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});v.defineProperty(pf,{buttons:"buttons"},function(){return this.bv},function(a){this.bv=a});v.defineProperty(pf,{key:"key"},function(){return this.Lv},function(a){this.Lv=a});v.defineProperty(pf,{Ll:"down"},function(){return this.qv},function(a){this.qv=a});
v.defineProperty(pf,{up:"up"},function(){return this.Aw},function(a){this.Aw=a});v.defineProperty(pf,{He:"clickCount"},function(){return this.cv},function(a){this.cv=a});v.defineProperty(pf,{Kl:"delta"},function(){return this.nv},function(a){this.nv=a});v.defineProperty(pf,{au:"isMultiTouch"},function(){return this.Iv},function(a){this.Iv=a});v.defineProperty(pf,{Cc:"handled"},function(){return this.yv},function(a){this.yv=a});
v.defineProperty(pf,{bubbles:"bubbles"},function(){return this.Ej},function(a){this.Ej=a});v.defineProperty(pf,{event:"event"},function(){return this.rr},function(a){this.rr=a});v.u(pf,{pj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});v.u(pf,{Dk:"isMac"},function(){return v.Dk});v.defineProperty(pf,{timestamp:"timestamp"},function(){return this.yw},function(a){this.yw=a});
v.defineProperty(pf,{Tg:"targetDiagram"},function(){return this.xw},function(a){this.xw=a});v.defineProperty(pf,{Pe:"targetObject"},function(){return this.Ag},function(a){this.Ag=a});v.defineProperty(pf,{control:"control"},function(){return 0!==(this.wd&1)},function(a){this.wd=a?this.wd|1:this.wd&-2});v.defineProperty(pf,{shift:"shift"},function(){return 0!==(this.wd&4)},function(a){this.wd=a?this.wd|4:this.wd&-5});
v.defineProperty(pf,{alt:"alt"},function(){return 0!==(this.wd&2)},function(a){this.wd=a?this.wd|2:this.wd&-3});v.defineProperty(pf,{iu:"meta"},function(){return 0!==(this.wd&8)},function(a){this.wd=a?this.wd|8:this.wd&-9});v.defineProperty(pf,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2});
v.defineProperty(pf,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});v.defineProperty(pf,{nL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5});
function Jf(){this.Z=null;this.Qb="";this.cw=this.vw=null;this.Pq=!1}v.ga("DiagramEvent",Jf);Jf.prototype.copy=function(){var a=new Jf;a.Z=this.Z;a.Qb=this.Qb;a.vw=this.vw;a.cw=this.cw;a.Pq=this.Pq;return a};Jf.prototype.toString=function(){var a="*"+this.name;null!==this.fB&&(a+=":"+this.fB.toString());null!==this.JA&&(a+="("+this.JA.toString()+")");return a};v.defineProperty(Jf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});
v.defineProperty(Jf,{name:"name"},function(){return this.Qb},function(a){this.Qb=a});v.defineProperty(Jf,{fB:"subject"},function(){return this.vw},function(a){this.vw=a});v.defineProperty(Jf,{JA:"parameter"},function(){return this.cw},function(a){this.cw=a});v.defineProperty(Jf,{cancel:"cancel"},function(){return this.Pq},function(a){this.Pq!==a&&v.Ct("DiagramEvent.cancel","2.0");this.Pq=a});function Kf(){this.Qq=Lf;this.Rm=this.Uv="";this.ns=this.os=this.rs=this.ss=this.qs=this.Z=this.me=null}
v.ga("ChangedEvent",Kf);var Mf;Kf.Transaction=Mf=v.p(Kf,"Transaction",-1);var Lf;Kf.Property=Lf=v.p(Kf,"Property",0);var Nf;Kf.Insert=Nf=v.p(Kf,"Insert",1);var Of;Kf.Remove=Of=v.p(Kf,"Remove",2);Kf.prototype.clear=Kf.prototype.clear=function(){this.ns=this.os=this.rs=this.ss=this.qs=this.Z=this.me=null};
Kf.prototype.copy=function(){var a=new Kf;a.Qq=this.Qq;a.Uv=this.Uv;a.Rm=this.Rm;a.me=this.me;a.Z=this.Z;a.qs=this.qs;var b=this.ss;a.ss=v.Ta(b)&&"function"===typeof b.S?b.S():b;b=this.rs;a.rs=v.Ta(b)&&"function"===typeof b.S?b.S():b;b=this.os;a.os=v.Ta(b)&&"function"===typeof b.S?b.S():b;b=this.ns;a.ns=v.Ta(b)&&"function"===typeof b.S?b.S():b;return a};Kf.prototype.ic=function(a){a.Ge===Kf?this.zc=a:v.Aj(this,a)};
Kf.prototype.toString=function(){var a="",a=this.zc===Mf?a+"* ":this.zc===Lf?a+(null!==this.ca?"!m":"!d"):a+((null!==this.ca?"!m":"!d")+this.zc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.rf&&this.rf!==this.propertyName&&(a+=" "+this.rf);a+=": ";this.zc===Mf?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Pf(this.object)),null!==this.oldValue&&(a+=" old: "+Pf(this.oldValue)),null!==this.vj&&(a+=" "+this.vj),null!==this.newValue&&
(a+=" new: "+Pf(this.newValue)),null!==this.uj&&(a+=" "+this.uj));return a};Kf.prototype.getValue=Kf.prototype.na=function(a){return a?this.oldValue:this.newValue};Kf.prototype.getParam=function(a){return a?this.vj:this.uj};Kf.prototype.canUndo=Kf.prototype.canUndo=function(){return null!==this.ca||null!==this.g?!0:!1};Kf.prototype.undo=Kf.prototype.undo=function(){this.canUndo()&&(null!==this.ca?this.ca.ln(this,!0):null!==this.g&&this.g.ln(this,!0))};
Kf.prototype.canRedo=Kf.prototype.canRedo=function(){return null!==this.ca||null!==this.g?!0:!1};Kf.prototype.redo=Kf.prototype.redo=function(){this.canRedo()&&(null!==this.ca?this.ca.ln(this,!1):null!==this.g&&this.g.ln(this,!1))};v.defineProperty(Kf,{ca:"model"},function(){return this.me},function(a){this.me=a});v.defineProperty(Kf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});v.defineProperty(Kf,{zc:"change"},function(){return this.Qq},function(a){this.Qq=a});
v.defineProperty(Kf,{rf:"modelChange"},function(){return this.Uv},function(a){this.Uv=a});v.defineProperty(Kf,{propertyName:"propertyName"},function(){return this.Rm},function(a){this.Rm=a});v.u(Kf,{gF:"isTransactionFinished"},function(){return this.Qq===Mf&&("CommittedTransaction"===this.Rm||"FinishedUndo"===this.Rm||"FinishedRedo"===this.Rm)});v.defineProperty(Kf,{object:"object"},function(){return this.qs},function(a){this.qs=a});
v.defineProperty(Kf,{oldValue:"oldValue"},function(){return this.ss},function(a){this.ss=a});v.defineProperty(Kf,{vj:"oldParam"},function(){return this.rs},function(a){this.rs=a});v.defineProperty(Kf,{newValue:"newValue"},function(){return this.os},function(a){this.os=a});v.defineProperty(Kf,{uj:"newParam"},function(){return this.ns},function(a){this.ns=a});
function F(a){1<arguments.length&&v.k("Model constructor can only take one optional argument, the Array of node data.");v.pc(this);this.cr=this.Qb="";this.Ii=!1;this.hz={};this.Ee=[];this.Gc=new la(null,Object);this.ck="key";this.qo=this.Wo=null;this.Vq=this.fv=!1;this.Hq=null;this.Mm="category";this.Ci=new la(null,J);this.Zj=null;this.aj=!1;this.Az=null;this.pa=new Qf;void 0!==a&&(this.cg=a)}v.ga("Model",F);
F.prototype.cloneProtected=function(a){a.Qb=this.Qb;a.cr=this.cr;a.Ii=this.Ii;a.ck=this.ck;a.Wo=this.Wo;a.qo=this.qo;a.XJ=this.fv;a.Vq=this.Vq;a.Hq=this.Hq;a.Mm=this.Mm};F.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};F.prototype.clear=F.prototype.clear=function(){this.Ee=[];this.Gc.clear();this.Ci.clear();this.pa.clear()};g=F.prototype;
g.toString=function(a){void 0===a&&(a=0);if(1<a)return this.iB();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.cg;for(var c=v.Xa(a),d=0;d<c;d++)var e=v.Ea(a,d),b=b+(" "+this.ub(e)+":"+Pf(e))}return b};
g.Zn=function(){var a="";""!==this.name&&(a+=',\n "name": '+this.quote(this.name));""!==this.Il&&(a+=',\n "dataFormat": '+this.quote(this.Il));this.bb&&(a+=',\n "isReadOnly": '+this.bb);"key"!==this.$l&&"string"===typeof this.$l&&(a+=',\n "nodeKeyProperty": '+this.quote(this.$l));this.Rz&&(a+=',\n "copiesArrays": true');this.Qz&&(a+=',\n "copiesArrayObjects": true');"category"!==this.Nn&&"string"===typeof this.Nn&&(a+=',\n "nodeCategoryProperty": '+this.quote(this.Nn));return a};
g.su=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Il=a.dataFormat);a.isReadOnly&&(this.bb=a.isReadOnly);a.nodeKeyProperty&&(this.$l=a.nodeKeyProperty);a.copiesArrays&&(this.Rz=a.copiesArrays);a.copiesArrayObjects&&(this.Qz=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.Nn=a.nodeCategoryProperty)};function Rf(a){return',\n "modelData": '+Sf(a,a.Ek)}function Tf(a,b){var c=b.modelData;v.Ta(c)&&(a.vu(c),a.Ek=c)}
g.rB=function(){var a=this.Ek,b=!1,c;for(c in a)if(!Uf(c,a[c])){b=!0;break}a="";b&&(a=Rf(this));return a+',\n "nodeDataArray": '+Vf(this,this.cg,!0)};g.MA=function(a){Tf(this,a);a=a.nodeDataArray;v.isArray(a)&&(this.vu(a),this.cg=a)};
function Wf(a,b,c,d){if(b===c)return!0;if(typeof b!==typeof c||"function"===typeof b||"function"===typeof c)return!1;if(Array.isArray(b)&&Array.isArray(c)){if(d.na(b)===c)return!0;d.add(b,c);if(b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!Wf(a,b[e],c[e],d))return!1;return!0}if(v.Ta(b)&&v.Ta(c)){if(d.na(b)===c)return!0;d.add(b,c);for(e in b){var f=b[e];if(!Uf(e,f)){var h=c[e];if(void 0===h||!Wf(a,f,h,d))return!1}}for(var k in c)if(h=c[k],!Uf(k,h)&&(f=b[k],void 0===f||!Wf(a,f,h,d)))return!1;
return!0}return!1}function Xf(a,b,c){a[c]!==b[c]&&v.k("Model.computeJsonDifference: Model."+c+' is not the same in both models: "'+a[c]+'" and "'+b[c]+'"')}
g.sB=function(a){Xf(this,a,"nodeKeyProperty");this instanceof Yf&&Xf(this,a,"nodeParentKeyProperty");for(var b=new J,c=new J,d=(new J).Kc(this.Gc.hF),e=new la,f=a.cg,h=0;h<f.length;h++){var k=f[h],l=a.ub(k);if(void 0!==l){d.remove(l);var m=this.ve(l);null===m?(b.add(l),c.add(k)):Wf(this,m,k,e)||c.add(k)}else this.xA(k),l=this.ub(k),b.add(l),c.add(k)}f="";Wf(this,this.Ek,a.Ek,e)||(f+=Rf(this));0<b.count&&(f+=this.py+Vf(this,b.fc(),!0));0<c.count&&(f+=this.AB+Vf(this,c.fc(),!0));0<d.count&&(f+=this.sy+
Vf(this,d.fc(),!0));return f};F.prototype.computeJsonDifference=F.prototype.computeJSONDifference=function(a,b){v.F(a,F,F,"computeJsonDifference:newmodel");void 0===b&&(b=this.constructor===F?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===Yf?"go.TreeModel":v.lf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.Zn()+this.sB(a)+"}"};g=F.prototype;g.py=',\n "insertedNodeKeys": ';g.AB=',\n "modifiedNodeData": ';g.sy=',\n "removedNodeKeys": ';
g.qB=function(a,b){var c=this,d=!1,e=new J,f=new J,h=new J;a.Qf.each(function(a){a.ca===c&&("nodeDataArray"===a.rf?a.zc===Nf?e.add(a.newValue):a.zc===Of&&h.add(a.oldValue):c.Ie(a.object)?f.add(a.object):c.Ek===a.object&&a.zc===Lf&&(d=!0))});var k=new J;e.each(function(a){k.add(c.ub(a));b||f.add(a)});var l=new J;h.each(function(a){l.add(c.ub(a));b&&f.add(a)});var m="";d&&(m+=Rf(this));0<k.count&&(m+=(b?this.sy:this.py)+Vf(this,k.fc(),!0));0<f.count&&(m+=this.AB+Vf(this,f.fc(),!0));0<l.count&&(m+=(b?
this.py:this.sy)+Vf(this,l.fc(),!0));return m};
g.LA=function(a){Tf(this,a);var b=a.insertedNodeKeys;if(v.isArray(b))for(var c=v.Xa(b),d=0;d<c;d++){var e=v.Ea(b,d),f=this.ve(e);null===f&&(f=this.copyNodeData({}),this.Wx(f,e),this.yl(f))}b=a.modifiedNodeData;if(v.isArray(b))for(c=v.Xa(b),d=0;d<c;d++){var h=v.Ea(b,d),e=this.ub(h),f=this.ve(e);if(null!==f)for(var k in h)"__gohashid"!==k&&k!==this.$l&&this.setDataProperty(f,k,h[k])}a=a.removedNodeKeys;if(v.isArray(a))for(c=v.Xa(a),d=0;d<c;d++)e=v.Ea(a,d),f=this.ve(e),null!==f&&this.Qx(f)};
F.prototype.toIncrementalJson=F.prototype.toIncrementalJSON=function(a,b){v.F(a,Kf,F,"toIncrementalJson:e");a.zc!==Mf&&v.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.gF&&c instanceof lg))return'{ "incremental": 0 }';void 0===b&&(b=this.constructor===F?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===Yf?"go.TreeModel":v.lf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.Zn()+this.qB(c,"FinishedUndo"===
a.propertyName)+"}"};F.prototype.toJson=F.prototype.toJSON=F.prototype.iB=function(a){void 0===a&&(a=this.constructor===F?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===Yf?"go.TreeModel":v.lf(this));return'{ "class": '+this.quote(a)+this.Zn()+this.rB()+"}"};
F.prototype.applyIncrementalJson=F.prototype.applyIncrementalJSON=function(a){var b=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{b=window.JSON.parse(a)}catch(c){}else v.trace("WARNING: no JSON.parse available");else"object"===typeof a?b=a:v.k("Unable to modify a Model from: "+a);var d=b.incremental;"number"!==typeof d&&v.k("Unable to apply non-incremental changes to Model: "+a);0!==d&&(this.Tb("applyIncrementalJson"),this.LA(b),this.Hd("applyIncrementalJson"))};
F.fromJson=F.fromJSON=function(a,b){void 0===b&&(b=null);null!==b&&v.F(b,F,F,"fromJson:model");var c=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){}else v.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:v.k("Unable to construct a Model from: "+a);if(null===b){var e;e=null;var f=c["class"];if("string"===typeof f)try{var h=null;0===f.indexOf("go.")?(f=f.substr(3),h=da[f]):(h=da[f],void 0===h&&(h=window[f]));"function"===typeof h&&
(e=new h)}catch(k){}null===e||e instanceof F?b=e:v.k("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new Q);b.su(c);b.MA(c);return b};
F.prototype.replaceJsonObjects=F.prototype.vu=function(a){if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++){var d=v.Ea(a,c);v.Ta(d)&&v.bE(a,c,this.vu(d))}else if(v.Ta(a)){for(c in a)d=a[c],v.Ta(d)&&(d=this.vu(d),a[c]=d);if("object"===typeof a){d=a;c=a["class"];if("NaN"===c)d=NaN;else if("Date"===c)d=new Date(a.value);else if("go.Point"===c)d=new y(mg(a.x),mg(a.y));else if("go.Size"===c)d=new ia(mg(a.width),mg(a.height));else if("go.Rect"===c)d=new B(mg(a.x),mg(a.y),mg(a.width),mg(a.height));else if("go.Margin"===
c)d=new mb(mg(a.top),mg(a.right),mg(a.bottom),mg(a.left));else if("go.Spot"===c)d="string"===typeof a["enum"]?ub(a["enum"]):new L(mg(a.x),mg(a.y),mg(a.offsetX),mg(a.offsetY));else if("go.Brush"===c){if(d=new ha,d.type=qa(ha,a.type),"string"===typeof a.color&&(d.color=a.color),a.start instanceof L&&(d.start=a.start),a.end instanceof L&&(d.end=a.end),"number"===typeof a.startRadius&&(d.Gu=mg(a.startRadius)),"number"===typeof a.endRadius&&(d.Et=mg(a.endRadius)),a=a.colorStops,v.Ta(a))for(b in a)d.addColorStop(parseFloat(b),
a[b])}else"go.Geometry"===c?(b=null,b="string"===typeof a.path?Oe(a.path):new ye,b.type=qa(ye,a.type),"number"===typeof a.startX&&(b.ja=mg(a.startX)),"number"===typeof a.startY&&(b.ha=mg(a.startY)),"number"===typeof a.endX&&(b.C=mg(a.endX)),"number"===typeof a.endY&&(b.D=mg(a.endY)),a.spot1 instanceof L&&(b.A=a.spot1),a.spot2 instanceof L&&(b.B=a.spot2),d=b):"go.EnumValue"===c&&(b=a.classType,0===b.indexOf("go.")&&(b=b.substr(3)),d=qa(da[b],a.name));a=d}}return a};
F.prototype.quote=function(a){for(var b="",c=a.length,d=0;d<c;d++){var e=a[d];if('"'===e||"\\"===e)b+="\\"+e;else if("\b"===e)b+="\\b";else if("\f"===e)b+="\\f";else if("\n"===e)b+="\\n";else if("\r"===e)b+="\\r";else if("\t"===e)b+="\\t";else var f=a.charCodeAt(d),b=16>f?b+("\\u000"+a.charCodeAt(d).toString(16)):32>f?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===f?b+"\\u2028":8233===f?b+"\\u2029":b+e}return'"'+b+'"'};
F.prototype.writeJsonValue=F.prototype.Lu=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.Lu(a.valueOf()):v.isArray(a)?Vf(this,a):v.Ta(a)?Sf(this,a):"function"===typeof a?"null":a.toString()};
function Vf(a,b,c){void 0===c&&(c=!1);var d=v.Xa(b);if(0>=d)return"[]";var e=new sa;e.add("[ ");c&&1<d&&e.add("\n");for(var f=0;f<d;f++){var h=v.Ea(b,f);void 0!==h&&(0<f&&(e.add(","),c&&e.add("\n")),e.add(a.Lu(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function Uf(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function ng(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
function Sf(a,b){var c=b;if(c instanceof y){var d=c;b={"class":"go.Point",x:ng(d.x),y:ng(d.y)}}else if(c instanceof ia){var e=c;b={"class":"go.Size",width:ng(e.width),height:ng(e.height)}}else if(c instanceof B)b={"class":"go.Rect",x:ng(c.x),y:ng(c.y),width:ng(c.width),height:ng(c.height)};else if(c instanceof mb)b={"class":"go.Margin",top:ng(c.top),right:ng(c.right),bottom:ng(c.bottom),left:ng(c.left)};else if(c instanceof L)e=c,b=e.jd()?{"class":"go.Spot",x:ng(e.x),y:ng(e.y),offsetX:ng(e.offsetX),
offsetY:ng(e.offsetY)}:{"class":"go.Spot","enum":e.toString()};else if(c instanceof ha){b={"class":"go.Brush",type:c.type.name};if(c.type===og)b.color=c.color;else if(c.type===pg||c.type===Xc)b.start=c.start,b.end=c.end,c.type===Xc&&(0!==c.Gu&&(b.startRadius=ng(c.Gu)),isNaN(c.Et)||(b.endRadius=ng(c.Et)));if(null!==c.rk){for(var f={},h=c.rk.i;h.next();)f[h.key]=h.value;b.colorStops=f}}else if(c instanceof ye)b={"class":"go.Geometry",type:c.type.name},0!==c.ja&&(b.startX=ng(c.ja)),0!==c.ha&&(b.startY=
ng(c.ha)),0!==c.C&&(b.endX=ng(c.C)),0!==c.D&&(b.endY=ng(c.D)),c.A.L(xb)||(b.spot1=c.A),c.B.L(Mb)||(b.spot2=c.B),c.type===ze&&(b.path=Ne(c));else if(c instanceof ea)b={"class":"go.EnumValue",classType:v.lf(c.Ge),name:c.name};else if(c instanceof G||c instanceof E||c instanceof qg||c instanceof F||c instanceof rg||c instanceof sg||c instanceof tg||c instanceof ug||c instanceof Qf||c instanceof lg)return v.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+
c.toString()),"{}";f="{";c=!0;for(d in b)if(e=v.sb(b,d),!Uf(d,e))if(c?c=!1:f+=", ",f+='"'+d+'":',"points"===d&&e instanceof I&&e.ka===y){h=e;e="[";for(h=h.i;h.next();){var k=h.value;1<e.length&&(e+=",");e+=a.Lu(k.x);e+=",";e+=a.Lu(k.y)}e+="]";f+=e}else f+=a.Lu(e);return f+"}"}function mg(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}
v.defineProperty(F,{name:"name"},function(){return this.Qb},function(a){var b=this.Qb;b!==a&&(v.j(a,"string",F,"name"),this.Qb=a,this.h("name",b,a))});v.defineProperty(F,{Il:"dataFormat"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(v.j(a,"string",F,"dataFormat"),this.cr=a,this.h("dataFormat",b,a))});v.defineProperty(F,{bb:"isReadOnly"},function(){return this.Ii},function(a){var b=this.Ii;b!==a&&(v.j(a,"boolean",F,"isReadOnly"),this.Ii=a,this.h("isReadOnly",b,a))});
v.defineProperty(F,{Ek:"modelData"},function(){return this.hz},function(a){var b=this.hz;b!==a&&(v.j(a,"object",F,"modelData"),this.hz=a,this.h("modelData",b,a),this.Hb(a))});F.prototype.addChangedListener=F.prototype.fn=function(a){v.j(a,"function",F,"addChangedListener:listener");null===this.Zj&&(this.Zj=new I("function"));this.Zj.add(a)};
F.prototype.removeChangedListener=F.prototype.tu=function(a){v.j(a,"function",F,"removeChangedListener:listener");null!==this.Zj&&(this.Zj.remove(a),0===this.Zj.count&&(this.Zj=null))};F.prototype.Nw=function(a){this.wb||this.pa.PE(a);if(null!==this.Zj){var b=this.Zj,c=b.length;if(1===c)b=b.fa(0),b(a);else if(0!==c)for(var d=b.fc(),e=0;e<c;e++)b=d[e],b(a)}};F.prototype.raiseChangedEvent=F.prototype.Zc=function(a,b,c,d,e,f,h){vg(this,"",a,b,c,d,e,f,h)};
F.prototype.raiseChanged=F.prototype.h=function(a,b,c,d,e){vg(this,"",Lf,a,this,b,c,d,e)};F.prototype.raiseDataChanged=F.prototype.KA=function(a,b,c,d,e,f){vg(this,"",Lf,b,a,c,d,e,f)};function vg(a,b,c,d,e,f,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new Kf;m.ca=a;m.zc=c;m.rf=b;m.propertyName=d;m.object=e;m.oldValue=f;m.vj=k;m.newValue=h;m.uj=l;a.Nw(m)}
v.defineProperty(F,{pa:"undoManager"},function(){return this.Az},function(a){var b=this.Az;b!==a&&(v.F(a,Qf,F,"undoManager"),null!==b&&b.jJ(this),this.Az=a,null!==a&&a.ZG(this))});v.defineProperty(F,{wb:"skipsUndoManager"},function(){return this.aj},function(a){v.j(a,"boolean",F,"skipsUndoManager");this.aj=a});
F.prototype.ln=function(a,b){if(null!==a&&a.ca===this)if(a.zc===Lf){var c=a.object,d=a.propertyName,e=a.na(b);v.Na(c,d,e)}else a.zc===Nf?(c=a.uj,"nodeDataArray"===a.rf?(d=a.newValue,v.Ta(d)&&"number"===typeof c&&(e=this.ub(d),b?(v.Ea(this.Ee,c)===d&&v.Eg(this.Ee,c),void 0!==e&&this.Gc.remove(e)):(v.Ea(this.Ee,c)!==d&&v.ph(this.Ee,c,d),void 0!==e&&this.Gc.add(e,d)))):""===a.rf?(d=a.object,!v.isArray(d)&&a.propertyName&&(d=v.sb(a.object,a.propertyName)),v.isArray(d)&&"number"===typeof c&&(e=a.newValue,
b?v.Eg(d,c):v.ph(d,c,e))):v.k("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.zc===Of?(c=a.vj,"nodeDataArray"===a.rf?(d=a.oldValue,v.Ta(d)&&"number"===typeof c&&(e=this.ub(d),b?(v.Ea(this.Ee,c)!==d&&v.ph(this.Ee,c,d),void 0!==e&&this.Gc.add(e,d)):(v.Ea(this.Ee,c)===d&&v.Eg(this.Ee,c),void 0!==e&&this.Gc.remove(e)))):""===a.rf?(d=a.object,!v.isArray(d)&&a.propertyName&&(d=v.sb(a.object,a.propertyName)),v.isArray(d)&&"number"===typeof c&&(e=a.oldValue,b?v.ph(d,c,e):v.Eg(d,c))):v.k("unknown ChangedEvent.Remove modelChange: "+
a.toString())):a.zc!==Mf&&v.k("unknown ChangedEvent: "+a.toString())};F.prototype.startTransaction=F.prototype.Tb=function(a){return this.pa.Tb(a)};F.prototype.commitTransaction=F.prototype.Hd=function(a){return this.pa.Hd(a)};F.prototype.rollbackTransaction=F.prototype.nq=function(){return this.pa.nq()};F.prototype.updateTargetBindings=F.prototype.Hb=function(a,b){void 0===b&&(b="");vg(this,"SourceChanged",Mf,b,a,null,null)};
v.defineProperty(F,{$l:"nodeKeyProperty"},function(){return this.ck},function(a){var b=this.ck;b!==a&&(wg(a,F,"nodeKeyProperty"),""===a&&v.k("Model.nodeKeyProperty may not be the empty string"),0<this.Gc.count&&v.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.ck=a,this.h("nodeKeyProperty",b,a))});function wg(a,b,c){"string"!==typeof a&&"function"!==typeof a&&v.yd(a,"string or function",b,c)}
F.prototype.getKeyForNodeData=F.prototype.ub=function(a){if(null!==a){var b=this.ck;if(""!==b&&(b=v.sb(a,b),void 0!==b)){if(xg(b))return b;v.k("Key value for node data "+a+" is not a number or a string: "+b)}}};
F.prototype.setKeyForNodeData=F.prototype.Wx=function(a,b){void 0!==b&&null!==b&&xg(b)||v.yd(b,"number or string",F,"setKeyForNodeData:key");if(null!==a){var c=this.ck;if(""!==c)if(this.Ie(a)){var d=v.sb(a,c);d!==b&&null===this.ve(b)&&(v.Na(a,c,b),this.Gc.remove(d),this.Gc.add(b,a),vg(this,"nodeKey",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c),this.uu(d,b))}else v.Na(a,c,b)}};
v.defineProperty(F,{gL:"makeUniqueKeyFunction"},function(){return this.Wo},function(a){var b=this.Wo;b!==a&&(null!==a&&v.j(a,"function",F,"makeUniqueKeyFunction"),this.Wo=a,this.h("makeUniqueKeyFunction",b,a))});function xg(a){return"number"===typeof a||"string"===typeof a}F.prototype.containsNodeData=F.prototype.Ie=function(a){var b=this.ub(a);return void 0===b?!1:this.Gc.na(b)===a};
F.prototype.findNodeDataForKey=F.prototype.ve=function(a){null===a&&v.k("Model.findNodeDataForKey:key must not be null");return void 0!==a&&xg(a)?this.Gc.na(a):null};
v.defineProperty(F,{cg:"nodeDataArray"},function(){return this.Ee},function(a){var b=this.Ee;if(b!==a){v.Kz(a,F,"nodeDataArray");this.Gc.clear();this.mB();for(var c=v.Xa(a),d=0;d<c;d++){var e=v.Ea(a,d);if(!v.Ta(e)){v.k("Model.nodeDataArray must only contain Objects, not: "+e);return}v.Up(e)}this.Ee=a;for(var f=new I(Object),d=0;d<c;d++){var e=v.Ea(a,d),h=this.ub(e);void 0===h?f.add(e):null!==this.Gc.na(h)?f.add(e):this.Gc.add(h,e)}for(d=f.i;d.next();)e=d.value,this.xA(e),f=this.ub(e),void 0!==f&&
this.Gc.add(f,e);vg(this,"nodeDataArray",Lf,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=v.Ea(a,d),this.mq(e),this.lq(e);this.dE();v.pI(a)||(this.bb=!0)}});
F.prototype.makeNodeDataKeyUnique=F.prototype.xA=function(a){if(null!==a){var b=this.ck;if(""!==b){var c=this.ub(a);if(void 0===c||this.Gc.contains(c)){var d=this.Wo;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.Gc.contains(c))){v.Na(a,b,c);return}if("string"===typeof c){for(d=2;this.Gc.contains(c+d);)d++;v.Na(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.Gc.count-1;this.Gc.contains(d);)d--;v.Na(a,b,d)}else v.k("Model.getKeyForNodeData returned something other than a string or a number: "+
c)}}}};F.prototype.addNodeData=F.prototype.yl=function(a){null!==a&&(v.Up(a),this.Ie(a)||yg(this,a,!0))};function yg(a,b,c){var d=a.ub(b);if(void 0===d||a.Gc.na(d)!==b)a.xA(b),d=a.ub(b),void 0===d?v.k("Model.makeNodeDataKeyUnique failed on "+b+". Data not added to Model."):(a.Gc.add(d,b),d=null,c&&(d=v.Xa(a.Ee),v.ph(a.Ee,d,b)),vg(a,"nodeDataArray",Nf,"nodeDataArray",a,null,b,null,d),a.mq(b),a.lq(b))}
F.prototype.addNodeDataCollection=function(a){if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++)this.yl(v.Ea(a,c));else for(a=a.i;a.next();)this.yl(a.value)};F.prototype.removeNodeData=F.prototype.Qx=function(a){null!==a&&zg(this,a,!0)};function zg(a,b,c){var d=a.ub(b);void 0!==d&&a.Gc.remove(d);d=null;if(c){d=v.Cl(a.Ee,b);if(0>d)return;v.Eg(a.Ee,d)}vg(a,"nodeDataArray",Of,"nodeDataArray",a,b,null,d,null);a.Ju(b)}
F.prototype.removeNodeDataCollection=function(a){if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++)this.Qx(v.Ea(a,c));else for(a=a.i;a.next();)this.Qx(a.value)};g=F.prototype;g.uu=function(a,b){var c=Ug(this,a);c instanceof J&&this.Ci.add(b,c)};g.mB=function(){};g.mq=function(){};g.lq=function(){};g.Ju=function(){};function Vg(a,b,c){if(void 0!==b){var d=a.Ci.na(b);null===d&&(d=new J(Object),a.Ci.add(b,d));d.add(c)}}
function Wg(a,b,c){if(void 0!==b){var d=a.Ci.na(b);d instanceof J&&(void 0===c||null===c?a.Ci.remove(b):(d.remove(c),0===d.count&&a.Ci.remove(b)))}}function Ug(a,b){if(void 0===b)return null;var c=a.Ci.na(b);return c instanceof J?c:null}F.prototype.clearUnresolvedReferences=F.prototype.dE=function(a){void 0===a?this.Ci.clear():this.Ci.remove(a)};
v.defineProperty(F,{BK:"copyNodeDataFunction"},function(){return this.qo},function(a){var b=this.qo;b!==a&&(null!==a&&v.j(a,"function",F,"copyNodeDataFunction"),this.qo=a,this.h("copyNodeDataFunction",b,a))});v.defineProperty(F,{Rz:"copiesArrays"},function(){return this.fv},function(a){var b=this.fv;b!==a&&(null!==a&&v.j(a,"boolean",F,"copiesArrays"),this.fv=a,this.h("copiesArrays",b,a))});
v.defineProperty(F,{Qz:"copiesArrayObjects"},function(){return this.Vq},function(a){var b=this.Vq;b!==a&&(null!==a&&v.j(a,"boolean",F,"copiesArrayObjects"),this.Vq=a,this.h("copiesArrayObjects",b,a))});F.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.qo,b=null!==b?b(a,this):Xg(this,a,!0);v.Ta(b)&&v.pc(b);return b};
function Xg(a,b,c){if(a.Rz&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Xg(a,b[c],a.Qz);d.push(e)}v.pc(d);return d}if(c&&v.Ta(b)){c=(c=b.constructor)?new c:{};for(d in b)if("__gohashid"!==d){var e=v.sb(b,d),f;f=e;f instanceof G||f instanceof E||f instanceof qg||f instanceof Yg||f instanceof Zg||f instanceof rg||f instanceof sg||f instanceof tg||f instanceof pf||f instanceof Jf?("_"!==d[0]&&v.trace('Warning: found GraphObject or Diagram reference when copying model data on property "'+
d+'" of data object: '+b.toString()+" \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+f.toString()),f=!0):f=f instanceof F||f instanceof Qf||f instanceof lg||f instanceof Kf?!0:!1;f||(e=Xg(a,e,!1));v.Na(c,d,e)}v.pc(c);return c}return b instanceof y?b.copy():b instanceof ia?b.copy():b instanceof B?b.copy():b instanceof L?b.copy():b instanceof mb?b.copy():b}
v.defineProperty(F,{aH:"afterCopyFunction"},function(){return this.Hq},function(a){var b=this.Hq;b!==a&&(null!==a&&v.j(a,"function",F,"afterCopyFunction"),this.Hq=a,this.h("afterCopyFunction",b,a))});var $g=!1;
F.prototype.setDataProperty=function(a,b,c){if(this.Ie(a))if(b===this.$l)this.Wx(a,c);else{if(b===this.Nn){this.Vx(a,c);return}}else!$g&&a instanceof G&&($g=!0,v.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),v.trace(" Is that really your intent?"));var d=v.sb(a,b);d!==c&&(v.Na(a,b,c),this.KA(a,b,d,c))};F.prototype.addArrayItem=function(a,b){this.mA(a,-1,b)};
F.prototype.insertArrayItem=F.prototype.mA=function(a,b,c){a===this.Ee&&v.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=v.Xa(a));v.ph(a,b,c);vg(this,"",Nf,"",a,null,c,null,b)};F.prototype.removeArrayItem=F.prototype.zF=function(a,b){void 0===b&&(b=-1);a===this.Ee&&v.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=v.Xa(a)-1);var c=v.Ea(a,b);v.Eg(a,b);vg(this,"",Of,"",a,c,null,b,null)};
v.defineProperty(F,{Nn:"nodeCategoryProperty"},function(){return this.Mm},function(a){var b=this.Mm;b!==a&&(wg(a,F,"nodeCategoryProperty"),this.Mm=a,this.h("nodeCategoryProperty",b,a))});F.prototype.getCategoryForNodeData=F.prototype.fA=function(a){if(null===a)return"";var b=this.Mm;if(""===b)return"";b=v.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
F.prototype.setCategoryForNodeData=F.prototype.Vx=function(a,b){v.j(b,"string",F,"setCategoryForNodeData:cat");if(null!==a){var c=this.Mm;if(""!==c)if(this.Ie(a)){var d=v.sb(a,c);void 0===d&&(d="");d!==b&&(v.Na(a,c,b),vg(this,"nodeCategory",Lf,c,a,d,b))}else v.Na(a,c,b)}};
function Q(a,b){2<arguments.length&&v.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");F.call(this);this.gf=[];this.Ni=new J(Object);this.cd=new la(null,Object);this.ll="";this.nm=this.po=this.Xo=null;this.Rh="from";this.Sh="to";this.Im=this.Hm="";this.Gm="category";this.tg="";this.ap="isGroup";this.ih="group";this.Wq=!1;void 0!==a&&(this.cg=a);void 0!==b&&(this.Lg=b)}v.Ma(Q,F);v.ga("GraphLinksModel",Q);
Q.prototype.cloneProtected=function(a){F.prototype.cloneProtected.call(this,a);a.ll=this.ll;a.Xo=this.Xo;a.po=this.po;a.Rh=this.Rh;a.Sh=this.Sh;a.Hm=this.Hm;a.Im=this.Im;a.Gm=this.Gm;a.tg=this.tg;a.ap=this.ap;a.ih=this.ih;a.Wq=this.Wq};Q.prototype.clear=Q.prototype.clear=function(){F.prototype.clear.call(this);this.gf=[];this.cd.clear();this.Ni.clear()};g=Q.prototype;
g.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.iB();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.cg;for(var c=v.Xa(a),d=0,d=0;d<c;d++)var e=v.Ea(a,d),b=b+(" "+this.ub(e)+":"+Pf(e));b+="\n link data:";a=this.Lg;c=v.Xa(a);for(d=0;d<c;d++)e=v.Ea(a,d),b+=" "+this.Ql(e)+"--\x3e"+this.Rl(e)}return b};
g.Zn=function(){var a=F.prototype.Zn.call(this),b="";"category"!==this.eu&&"string"===typeof this.eu&&(b+=',\n "linkCategoryProperty": '+this.quote(this.eu));""!==this.sj&&"string"===typeof this.sj&&(b+=',\n "linkKeyProperty": '+this.quote(this.sj));"from"!==this.In&&"string"===typeof this.In&&(b+=',\n "linkFromKeyProperty": '+this.quote(this.In));"to"!==this.Jn&&"string"===typeof this.Jn&&(b+=',\n "linkToKeyProperty": '+this.quote(this.Jn));""!==this.fu&&"string"===typeof this.fu&&(b+=',\n "linkFromPortIdProperty": '+
this.quote(this.fu));""!==this.hu&&"string"===typeof this.hu&&(b+=',\n "linkToPortIdProperty": '+this.quote(this.hu));""!==this.gu&&"string"===typeof this.gu&&(b+=',\n "linkLabelKeysProperty": '+this.quote(this.gu));"isGroup"!==this.ou&&"string"===typeof this.ou&&(b+=',\n "nodeIsGroupProperty": '+this.quote(this.ou));"group"!==this.nu&&"string"===typeof this.nu&&(b+=',\n "nodeGroupKeyProperty": '+this.quote(this.nu));return a+b};
g.su=function(a){F.prototype.su.call(this,a);a.linkKeyProperty&&(this.sj=a.linkKeyProperty);a.linkFromKeyProperty&&(this.In=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.Jn=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.fu=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.hu=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.eu=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.gu=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.ou=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&
(this.nu=a.nodeGroupKeyProperty)};g.rB=function(){var a=F.prototype.rB.call(this),b=',\n "linkDataArray": '+Vf(this,this.Lg,!0);return a+b};g.MA=function(a){F.prototype.MA.call(this,a);a=a.linkDataArray;v.isArray(a)&&(this.vu(a),this.Lg=a)};
g.sB=function(a){a instanceof Q||v.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel");""===this.sj&&v.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var b=F.prototype.sB.call(this,a);Xf(this,a,"linkKeyProperty");Xf(this,a,"linkFromKeyProperty");Xf(this,a,"linkToKeyProperty");Xf(this,a,"linkLabelKeysProperty");Xf(this,a,"nodeIsGroupProperty");Xf(this,a,"nodeGroupKeyProperty");for(var c=new J,d=new J,e=(new J).Kc(this.cd.hF),
f=new la,h=a.Lg,k=0;k<h.length;k++){var l=h[k],m=a.Sf(l);if(void 0!==m){e.remove(m);var n=this.Qp(m);null===n?(c.add(m),d.add(l)):Wf(this,n,l,f)||d.add(l)}else this.wA(l),m=this.Sf(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.oy+Vf(this,c.fc(),!0));0<d.count&&(a+=this.zB+Vf(this,d.fc(),!0));0<e.count&&(a+=this.qy+Vf(this,e.fc(),!0));return a};g.oy=',\n "insertedLinkKeys": ';g.zB=',\n "modifiedLinkData": ';g.qy=',\n "removedLinkKeys": ';
g.qB=function(a,b){""===this.sj&&v.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=F.prototype.qB.call(this,a,b),d=this,e=new J,f=new J,h=new J;a.Qf.each(function(a){a.ca===d&&("linkDataArray"===a.rf?a.zc===Nf?e.add(a.newValue):a.zc===Of&&h.add(a.oldValue):d.sh(a.object)&&f.add(a.object))});var k=new J;e.each(function(a){k.add(d.Sf(a));b||f.add(a)});var l=new J;h.each(function(a){l.add(d.Sf(a));b&&f.add(a)});0<k.count&&(c+=(b?this.qy:this.oy)+
Vf(this,k.fc(),!0));0<f.count&&(c+=this.zB+Vf(this,f.fc(),!0));0<l.count&&(c+=(b?this.oy:this.qy)+Vf(this,l.fc(),!0));return c};
g.LA=function(a){F.prototype.LA.call(this,a);var b=a.insertedLinkKeys;if(v.isArray(b))for(var c=v.Xa(b),d=0;d<c;d++){var e=v.Ea(b,d),f=this.Qp(e);null===f&&(f=this.Qw({}),this.SF(f,e),this.qt(f))}b=a.modifiedLinkData;if(v.isArray(b))for(c=v.Xa(b),d=0;d<c;d++){var h=v.Ea(b,d),e=this.Sf(h),f=this.Qp(e);if(null!==f)for(var k in h)"__gohashid"!==k&&k!==this.sj&&this.setDataProperty(f,k,h[k])}a=a.removedLinkKeys;if(v.isArray(a))for(c=v.Xa(a),d=0;d<c;d++)e=v.Ea(a,d),f=this.Qp(e),null!==f&&this.Px(f)};
g.ln=function(a,b){if(a.zc===Nf){var c=a.uj;if("linkDataArray"===a.rf){var d=a.newValue;if(v.Ta(d)&&"number"===typeof c){var e=this.Sf(d);b?(this.Ni.remove(d),v.Ea(this.gf,c)===d&&v.Eg(this.gf,c),void 0!==e&&this.cd.remove(e)):(this.Ni.add(d),v.Ea(this.gf,c)!==d&&v.ph(this.gf,c,d),void 0!==e&&this.cd.add(e,d))}return}if("linkLabelKeys"===a.rf){d=this.zk(a.object);v.isArray(d)&&"number"===typeof c&&(b?(c=v.Cl(d,a.newValue),0<=c&&v.Eg(d,c)):0>v.Cl(d,a.newValue)&&v.ph(d,c,a.newValue));return}}else if(a.zc===
Of){c=a.vj;if("linkDataArray"===a.rf){d=a.oldValue;v.Ta(d)&&"number"===typeof c&&(e=this.Sf(d),b?(this.Ni.add(d),v.Ea(this.gf,c)!==d&&v.ph(this.gf,c,d),void 0!==e&&this.cd.add(e,d)):(this.Ni.remove(d),v.Ea(this.gf,c)===d&&v.Eg(this.gf,c),void 0!==e&&this.cd.remove(e)));return}if("linkLabelKeys"===a.rf){d=this.zk(a.object);v.isArray(d)&&"number"===typeof c&&(b?0>v.Cl(d,a.newValue)&&v.ph(d,c,a.newValue):(c=v.Cl(d,a.newValue),0<=c&&v.Eg(d,c)));return}}F.prototype.ln.call(this,a,b)};
v.defineProperty(Q,{Iz:"archetypeNodeData"},function(){return this.nm},function(a){var b=this.nm;b!==a&&(null!==a&&v.F(a,Object,Q,"archetypeNodeData"),this.nm=a,this.h("archetypeNodeData",b,a))});Q.prototype.Ln=function(a){if(void 0!==a){var b=this.nm;if(null!==b){var c=this.ve(a);null===c&&(c=this.copyNodeData(b),v.Na(c,this.ck,a),this.yl(c))}return a}};
v.defineProperty(Q,{In:"linkFromKeyProperty"},function(){return this.Rh},function(a){var b=this.Rh;b!==a&&(wg(a,Q,"linkFromKeyProperty"),this.Rh=a,this.h("linkFromKeyProperty",b,a))});Q.prototype.getFromKeyForLinkData=Q.prototype.Ql=function(a){if(null!==a){var b=this.Rh;if(""!==b&&(b=v.sb(a,b),void 0!==b)){if(xg(b))return b;v.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setFromKeyForLinkData=Q.prototype.WA=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||v.yd(b,"number or string",Q,"setFromKeyForLinkData:key");if(null!==a){var c=this.Rh;if(""!==c)if(b=this.Ln(b),this.sh(a)){var d=v.sb(a,c);d!==b&&(Wg(this,d,a),v.Na(a,c,b),null===this.ve(b)&&Vg(this,b,a),vg(this,"linkFromKey",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
v.defineProperty(Q,{Jn:"linkToKeyProperty"},function(){return this.Sh},function(a){var b=this.Sh;b!==a&&(wg(a,Q,"linkToKeyProperty"),this.Sh=a,this.h("linkToKeyProperty",b,a))});Q.prototype.getToKeyForLinkData=Q.prototype.Rl=function(a){if(null!==a){var b=this.Sh;if(""!==b&&(b=v.sb(a,b),void 0!==b)){if(xg(b))return b;v.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setToKeyForLinkData=Q.prototype.bB=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||v.yd(b,"number or string",Q,"setToKeyForLinkData:key");if(null!==a){var c=this.Sh;if(""!==c)if(b=this.Ln(b),this.sh(a)){var d=v.sb(a,c);d!==b&&(Wg(this,d,a),v.Na(a,c,b),null===this.ve(b)&&Vg(this,b,a),vg(this,"linkToKey",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
v.defineProperty(Q,{fu:"linkFromPortIdProperty"},function(){return this.Hm},function(a){var b=this.Hm;b!==a&&(wg(a,Q,"linkFromPortIdProperty"),a!==this.In&&a!==this.Jn||v.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Hm=a,this.h("linkFromPortIdProperty",b,a))});Q.prototype.getFromPortIdForLinkData=Q.prototype.TH=function(a){if(null===a)return"";var b=this.Hm;if(""===b)return"";a=v.sb(a,b);return void 0===a?"":a};
Q.prototype.setFromPortIdForLinkData=Q.prototype.XA=function(a,b){v.j(b,"string",Q,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Hm;if(""!==c)if(this.sh(a)){var d=v.sb(a,c);void 0===d&&(d="");d!==b&&(v.Na(a,c,b),vg(this,"linkFromPortId",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
v.defineProperty(Q,{hu:"linkToPortIdProperty"},function(){return this.Im},function(a){var b=this.Im;b!==a&&(wg(a,Q,"linkToPortIdProperty"),a!==this.In&&a!==this.Jn||v.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Im=a,this.h("linkToPortIdProperty",b,a))});Q.prototype.getToPortIdForLinkData=Q.prototype.XH=function(a){if(null===a)return"";var b=this.Im;if(""===b)return"";a=v.sb(a,b);return void 0===a?"":a};
Q.prototype.setToPortIdForLinkData=Q.prototype.cB=function(a,b){v.j(b,"string",Q,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Im;if(""!==c)if(this.sh(a)){var d=v.sb(a,c);void 0===d&&(d="");d!==b&&(v.Na(a,c,b),vg(this,"linkToPortId",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};v.defineProperty(Q,{gu:"linkLabelKeysProperty"},function(){return this.tg},function(a){var b=this.tg;b!==a&&(wg(a,Q,"linkLabelKeysProperty"),this.tg=a,this.h("linkLabelKeysProperty",b,a))});
Q.prototype.getLabelKeysForLinkData=Q.prototype.zk=function(a){if(null===a)return v.Jk;var b=this.tg;if(""===b)return v.Jk;a=v.sb(a,b);return void 0===a?v.Jk:a};
Q.prototype.setLabelKeysForLinkData=Q.prototype.TF=function(a,b){v.Kz(b,Q,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.tg;if(""!==c)if(this.sh(a)){var d=v.sb(a,c);void 0===d&&(d=v.Jk);if(d!==b){for(var e=v.Xa(d),f=0;f<e;f++){var h=v.Ea(d,f);Wg(this,h,a)}v.Na(a,c,b);e=v.Xa(b);for(f=0;f<e;f++)h=v.Ea(b,f),null===this.ve(h)&&Vg(this,h,a);vg(this,"linkLabelKeys",Lf,c,a,d,b);"string"===typeof c&&this.Hb(a,c)}}else v.Na(a,c,b)}};
Q.prototype.addLabelKeyForLinkData=Q.prototype.VD=function(a,b){if(null!==b&&void 0!==b&&(xg(b)||v.yd(b,"number or string",Q,"addLabelKeyForLinkData:key"),null!==a)){var c=this.tg;if(""!==c){var d=v.sb(a,c);if(void 0===d)c=[],c.push(b),this.TF(a,c);else if(v.isArray(d)){var e=v.Cl(d,b);0<=e||(e=v.Xa(d),v.ph(d,Infinity,b),this.sh(a)&&(null===this.ve(b)&&Vg(this,b,a),vg(this,"linkLabelKeys",Nf,c,a,null,b,null,e)))}else v.k(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
Q.prototype.removeLabelKeyForLinkData=Q.prototype.iJ=function(a,b){if(null!==b&&void 0!==b&&(xg(b)||v.yd(b,"number or string",Q,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.tg;if(""!==c){var d=v.sb(a,c);if(v.isArray(d)){var e=v.Cl(d,b);0>e||(v.Eg(d,e),this.sh(a)&&(Wg(this,b,a),vg(this,"linkLabelKeys",Of,c,a,b,null,e,null)))}else void 0!==d&&v.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
v.defineProperty(Q,{Lg:"linkDataArray"},function(){return this.gf},function(a){var b=this.gf;if(b!==a){v.Kz(a,Q,"linkDataArray");this.cd.clear();for(var c=v.Xa(a),d=0;d<c;d++){var e=v.Ea(a,d);if(!v.Ta(e)){v.k("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}v.Up(e)}this.gf=a;if(""!==this.sj){for(var f=new I(Object),d=0;d<c;d++){var e=v.Ea(a,d),h=this.Sf(e);void 0===h?f.add(e):null!==this.cd.na(h)?f.add(e):this.cd.add(h,e)}for(d=f.i;d.next();)e=d.value,this.wA(e),f=this.Sf(e),
void 0!==f&&this.cd.add(f,e)}f=new J(Object);for(d=0;d<c;d++)e=v.Ea(a,d),f.add(e);this.Ni=f;vg(this,"linkDataArray",Lf,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=v.Ea(a,d),ah(this,e)}});v.defineProperty(Q,{sj:"linkKeyProperty"},function(){return this.ll},function(a){var b=this.ll;if(b!==a){wg(a,Q,"linkKeyProperty");this.ll=a;this.cd.clear();for(var c=v.Xa(this.Lg),d=0;d<c;d++){var e=v.Ea(this.Lg,d),f=this.Sf(e);void 0!==f&&this.cd.add(f,e)}this.h("linkKeyProperty",b,a)}});
Q.prototype.getKeyForLinkData=Q.prototype.Sf=function(a){if(null!==a){var b=this.ll;if(""!==b&&(b=v.sb(a,b),void 0!==b)){if(xg(b))return b;v.k("Key value for link data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setKeyForLinkData=Q.prototype.SF=function(a,b){void 0!==b&&null!==b&&xg(b)||v.yd(b,"number or string",Q,"setKeyForLinkData:key");if(null!==a){var c=this.ll;if(""!==c)if(this.sh(a)){var d=v.sb(a,c);d!==b&&null===this.Qp(b)&&(v.Na(a,c,b),this.cd.remove(d),this.cd.add(b,a),vg(this,"linkKey",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
v.defineProperty(Q,{hL:"makeUniqueLinkKeyFunction"},function(){return this.Xo},function(a){var b=this.Xo;b!==a&&(null!==a&&v.j(a,"function",Q,"makeUniqueLinkKeyFunction"),this.Xo=a,this.h("makeUniqueLinkKeyFunction",b,a))});Q.prototype.findLinkDataForKey=Q.prototype.Qp=function(a){null===a&&v.k("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&xg(a)?this.cd.na(a):null};
Q.prototype.makeLinkDataKeyUnique=Q.prototype.wA=function(a){if(null!==a){var b=this.ll;if(""!==b){var c=this.Sf(a);if(void 0===c||this.cd.contains(c)){var d=this.Xo;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.cd.contains(c))){v.Na(a,b,c);return}if("string"===typeof c){for(d=2;this.cd.contains(c+d);)d++;v.Na(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.cd.count-1;this.cd.contains(d);)d--;v.Na(a,b,d)}else v.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+
c)}}}};Q.prototype.containsLinkData=Q.prototype.sh=function(a){return null===a?!1:this.Ni.contains(a)};Q.prototype.addLinkData=Q.prototype.qt=function(a){null!==a&&(v.Up(a),this.sh(a)||bh(this,a,!0))};
function bh(a,b,c){if(""!==a.sj){var d=a.Sf(b);if(void 0!==d&&a.cd.na(d)===b)return;a.wA(b);d=a.Sf(b);if(void 0===d){v.k("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.cd.add(d,b)}a.Ni.add(b);d=null;c&&(d=v.Xa(a.gf),v.ph(a.gf,d,b));vg(a,"linkDataArray",Nf,"linkDataArray",a,null,b,null,d);ah(a,b)}Q.prototype.addLinkDataCollection=function(a){if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++)this.qt(v.Ea(a,c));else for(a=a.i;a.next();)this.qt(a.value)};
Q.prototype.removeLinkData=Q.prototype.Px=function(a){null!==a&&ch(this,a,!0)};function ch(a,b,c){a.Ni.remove(b);var d=a.Sf(b);void 0!==d&&a.cd.remove(d);d=null;if(c){d=v.Cl(a.gf,b);if(0>d)return;v.Eg(a.gf,d)}vg(a,"linkDataArray",Of,"linkDataArray",a,b,null,d,null);c=a.Ql(b);Wg(a,c,b);c=a.Rl(b);Wg(a,c,b);d=a.zk(b);if(v.isArray(d))for(var e=v.Xa(d),f=0;f<e;f++)c=v.Ea(d,f),Wg(a,c,b)}
Q.prototype.removeLinkDataCollection=function(a){if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++)this.Px(v.Ea(a,c));else for(a=a.i;a.next();)this.Px(a.value)};function ah(a,b){var c=a.Ql(b),c=a.Ln(c);null===a.ve(c)&&Vg(a,c,b);c=a.Rl(b);c=a.Ln(c);null===a.ve(c)&&Vg(a,c,b);var d=a.zk(b);if(v.isArray(d))for(var e=v.Xa(d),f=0;f<e;f++)c=v.Ea(d,f),null===a.ve(c)&&Vg(a,c,b)}
v.defineProperty(Q,{AK:"copyLinkDataFunction"},function(){return this.po},function(a){var b=this.po;b!==a&&(null!==a&&v.j(a,"function",Q,"copyLinkDataFunction"),this.po=a,this.h("copyLinkDataFunction",b,a))});Q.prototype.copyLinkData=Q.prototype.Qw=function(a){if(null===a)return null;var b=null,b=this.po,b=null!==b?b(a,this):Xg(this,a,!0);v.Ta(b)&&(v.pc(b),""!==this.Rh&&v.Na(b,this.Rh,void 0),""!==this.Sh&&v.Na(b,this.Sh,void 0),""!==this.tg&&v.Na(b,this.tg,[]));return b};
v.defineProperty(Q,{ou:"nodeIsGroupProperty"},function(){return this.ap},function(a){var b=this.ap;b!==a&&(wg(a,Q,"nodeIsGroupProperty"),this.ap=a,this.h("nodeIsGroupProperty",b,a))});Q.prototype.isGroupForNodeData=Q.prototype.pA=function(a){if(null===a)return!1;var b=this.ap;return""===b?!1:v.sb(a,b)?!0:!1};v.defineProperty(Q,{nu:"nodeGroupKeyProperty"},function(){return this.ih},function(a){var b=this.ih;b!==a&&(wg(a,Q,"nodeGroupKeyProperty"),this.ih=a,this.h("nodeGroupKeyProperty",b,a))});
v.defineProperty(Q,{pn:"copiesGroupKeyOfNodeData"},function(){return this.Wq},function(a){this.Wq!==a&&(v.j(a,"boolean",Q,"copiesGroupKeyOfNodeData"),this.Wq=a)});Q.prototype.getGroupKeyForNodeData=Q.prototype.yn=function(a){if(null!==a){var b=this.ih;if(""!==b&&(b=v.sb(a,b),void 0!==b)){if(xg(b))return b;v.k("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
Q.prototype.setGroupKeyForNodeData=Q.prototype.YA=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||v.yd(b,"number or string",Q,"setGroupKeyForNodeData:key");if(null!==a){var c=this.ih;if(""!==c)if(this.Ie(a)){var d=v.sb(a,c);d!==b&&(Wg(this,d,a),v.Na(a,c,b),null===this.ve(b)&&Vg(this,b,a),vg(this,"nodeGroupKey",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
Q.prototype.copyNodeData=function(a){if(null===a)return null;a=F.prototype.copyNodeData.call(this,a);this.pn||""===this.ih||void 0===v.sb(a,this.ih)||v.Na(a,this.ih,void 0);return a};
Q.prototype.setDataProperty=function(a,b,c){if(this.Ie(a))if(b===this.$l)this.Wx(a,c);else{if(b===this.Nn){this.Vx(a,c);return}if(b===this.nu){this.YA(a,c);return}b===this.ou&&v.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.sh(a)){if(b===this.In){this.WA(a,c);return}if(b===this.Jn){this.bB(a,c);return}if(b===this.fu){this.XA(a,c);return}if(b===this.hu){this.cB(a,c);return}if(b===this.sj){this.SF(a,c);return}if(b===this.eu){this.RF(a,c);return}if(b===
this.gu){this.TF(a,c);return}}else!$g&&a instanceof G&&($g=!0,v.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),v.trace(" Is that really your intent?"));var d=v.sb(a,b);d!==c&&(v.Na(a,b,c),this.KA(a,b,d,c))};g=Q.prototype;
g.uu=function(a,b){F.prototype.uu.call(this,a,b);for(var c=this.Gc.i;c.next();)this.QA(c.value,a,b);for(c=this.Ni.i;c.next();){var d=c.value,e=a,f=b;if(this.Ql(d)===e){var h=this.Rh;v.Na(d,h,f);vg(this,"linkFromKey",Lf,h,d,e,f);"string"===typeof h&&this.Hb(d,h)}this.Rl(d)===e&&(h=this.Sh,v.Na(d,h,f),vg(this,"linkToKey",Lf,h,d,e,f),"string"===typeof h&&this.Hb(d,h));var k=this.zk(d);if(v.isArray(k))for(var l=v.Xa(k),h=this.tg,m=0;m<l;m++)v.Ea(k,m)===e&&(v.bE(k,m,f),vg(this,"linkLabelKeys",Nf,h,d,e,
f,m,m))}};g.QA=function(a,b,c){if(this.yn(a)===b){var d=this.ih;v.Na(a,d,c);vg(this,"nodeGroupKey",Lf,d,a,b,c);"string"===typeof d&&this.Hb(a,d)}};g.mB=function(){F.prototype.mB.call(this);for(var a=this.Lg,b=v.Xa(a),c=0;c<b;c++){var d=v.Ea(a,c);ah(this,d)}};
g.mq=function(a){F.prototype.mq.call(this,a);a=this.ub(a);var b=Ug(this,a);if(null!==b){for(var c=new I(Object),b=b.i;b.next();){var d=b.value;if(this.Ie(d)){if(this.yn(d)===a){var e=this.ih;vg(this,"nodeGroupKey",Lf,e,d,a,a);"string"===typeof e&&this.Hb(d,e);c.add(d)}}else{this.Ql(d)===a&&(e=this.Rh,vg(this,"linkFromKey",Lf,e,d,a,a),"string"===typeof e&&this.Hb(d,e),c.add(d));this.Rl(d)===a&&(e=this.Sh,vg(this,"linkToKey",Lf,e,d,a,a),"string"===typeof e&&this.Hb(d,e),c.add(d));var f=this.zk(d);if(v.isArray(f))for(var h=
v.Xa(f),e=this.tg,k=0;k<h;k++)v.Ea(f,k)===a&&(vg(this,"linkLabelKeys",Nf,e,d,a,a,k,k),c.add(d))}}for(c=c.i;c.next();)Wg(this,a,c.value)}};g.lq=function(a){F.prototype.lq.call(this,a);var b=this.yn(a);null===this.ve(b)&&Vg(this,b,a)};g.Ju=function(a){F.prototype.Ju.call(this,a);var b=this.yn(a);Wg(this,b,a)};v.defineProperty(Q,{eu:"linkCategoryProperty"},function(){return this.Gm},function(a){var b=this.Gm;b!==a&&(wg(a,Q,"linkCategoryProperty"),this.Gm=a,this.h("linkCategoryProperty",b,a))});
Q.prototype.getCategoryForLinkData=Q.prototype.ix=function(a){if(null===a)return"";var b=this.Gm;if(""===b)return"";b=v.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v.k("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
Q.prototype.setCategoryForLinkData=Q.prototype.RF=function(a,b){v.j(b,"string",Q,"setCategoryForLinkData:cat");if(null!==a){var c=this.Gm;if(""!==c)if(this.sh(a)){var d=v.sb(a,c);void 0===d&&(d="");d!==b&&(v.Na(a,c,b),vg(this,"linkCategory",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
function Yf(a){1<arguments.length&&v.k("TreeModel constructor can only take one optional argument, the Array of node data.");F.call(this);this.jh="parent";this.Xq=!1;this.Pm="parentLinkCategory";void 0!==a&&(this.cg=a)}v.Ma(Yf,F);v.ga("TreeModel",Yf);Yf.prototype.cloneProtected=function(a){F.prototype.cloneProtected.call(this,a);a.jh=this.jh;a.Xq=this.Xq;a.Pm=this.Pm};
Yf.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.iB();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.cg;for(var c=v.Xa(a),d=0;d<c;d++)var e=v.Ea(a,d),b=b+(" "+this.ub(e)+":"+Pf(e))}return b};Yf.prototype.Zn=function(){var a=F.prototype.Zn.call(this),b="";"parent"!==this.pu&&"string"===typeof this.pu&&(b+=',\n "nodeParentKeyProperty": '+this.quote(this.pu));return a+b};
Yf.prototype.su=function(a){F.prototype.su.call(this,a);a.nodeParentKeyProperty&&(this.pu=a.nodeParentKeyProperty)};Yf.prototype.Ln=function(a){return a};v.defineProperty(Yf,{pu:"nodeParentKeyProperty"},function(){return this.jh},function(a){var b=this.jh;b!==a&&(wg(a,Yf,"nodeParentKeyProperty"),this.jh=a,this.h("nodeParentKeyProperty",b,a))});
v.defineProperty(Yf,{qn:"copiesParentKeyOfNodeData"},function(){return this.Xq},function(a){this.Xq!==a&&(v.j(a,"boolean",Yf,"copiesParentKeyOfNodeData"),this.Xq=a)});Yf.prototype.getParentKeyForNodeData=Yf.prototype.An=function(a){if(null!==a){var b=this.jh;if(""!==b&&(b=v.sb(a,b),void 0!==b)){if(xg(b))return b;v.k("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
Yf.prototype.setParentKeyForNodeData=Yf.prototype.ni=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||v.yd(b,"number or string",Yf,"setParentKeyForNodeData:key");if(null!==a){var c=this.jh;if(""!==c)if(b=this.Ln(b),this.Ie(a)){var d=v.sb(a,c);d!==b&&(Wg(this,d,a),v.Na(a,c,b),null===this.ve(b)&&Vg(this,b,a),vg(this,"nodeParentKey",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
v.defineProperty(Yf,{zL:"parentLinkCategoryProperty"},function(){return this.Pm},function(a){var b=this.Pm;b!==a&&(wg(a,Yf,"parentLinkCategoryProperty"),this.Pm=a,this.h("parentLinkCategoryProperty",b,a))});Yf.prototype.getParentLinkCategoryForNodeData=Yf.prototype.VH=function(a){if(null===a)return"";var b=this.Pm;if(""===b)return"";b=v.sb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v.k("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
Yf.prototype.setParentLinkCategoryForNodeData=Yf.prototype.zJ=function(a,b){v.j(b,"string",Yf,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.Pm;if(""!==c)if(this.Ie(a)){var d=v.sb(a,c);void 0===d&&(d="");d!==b&&(v.Na(a,c,b),vg(this,"parentLinkCategory",Lf,c,a,d,b),"string"===typeof c&&this.Hb(a,c))}else v.Na(a,c,b)}};
Yf.prototype.copyNodeData=function(a){if(null===a)return null;a=F.prototype.copyNodeData.call(this,a);this.qn||""===this.jh||void 0===v.sb(a,this.jh)||v.Na(a,this.jh,void 0);return a};
Yf.prototype.setDataProperty=function(a,b,c){if(this.Ie(a))if(b===this.$l)this.Wx(a,c);else{if(b===this.Nn){this.Vx(a,c);return}if(b===this.pu){this.ni(a,c);return}}else!$g&&a instanceof G&&($g=!0,v.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),v.trace(" Is that really your intent?"));var d=v.sb(a,b);d!==c&&(v.Na(a,b,c),this.KA(a,b,d,c))};g=Yf.prototype;g.uu=function(a,b){F.prototype.uu.call(this,a,b);for(var c=this.Gc.i;c.next();)this.QA(c.value,a,b)};
g.QA=function(a,b,c){if(this.An(a)===b){var d=this.jh;v.Na(a,d,c);vg(this,"nodeParentKey",Lf,d,a,b,c);"string"===typeof d&&this.Hb(a,d)}};g.mq=function(a){F.prototype.mq.call(this,a);a=this.ub(a);var b=Ug(this,a);if(null!==b){for(var c=new I(Object),b=b.i;b.next();){var d=b.value;if(this.Ie(d)&&this.An(d)===a){var e=this.jh;vg(this,"nodeParentKey",Lf,e,d,a,a);"string"===typeof e&&this.Hb(d,e);c.add(d)}}for(c=c.i;c.next();)Wg(this,a,c.value)}};
g.lq=function(a){F.prototype.lq.call(this,a);var b=this.An(a),b=this.Ln(b);null===this.ve(b)&&Vg(this,b,a)};g.Ju=function(a){F.prototype.Ju.call(this,a);var b=this.An(a);Wg(this,b,a)};
function dh(a,b,c){v.pc(this);this.Q=!1;void 0===a?a="":v.j(a,"string",dh,"constructor:targetprop");void 0===b?b=a:v.j(b,"string",dh,"constructor:sourceprop");void 0===c?c=null:null!==c&&v.j(c,"function",dh,"constructor:conv");this.vD=-1;this.Ag=null;this.vp=a;this.tp=this.dt=0;this.sw=null;this.Lr=!1;this.lp=b;this.Uq=c;this.es=eh;this.Oq=null;this.Ry=new J}v.ga("Binding",dh);
dh.prototype.copy=function(){var a=new dh;a.vp=this.vp;a.dt=this.dt;a.tp=this.tp;a.sw=this.sw;a.Lr=this.Lr;a.lp=this.lp;a.Uq=this.Uq;a.es=this.es;a.Oq=this.Oq;return a};var eh;dh.OneWay=eh=v.p(dh,"OneWay",1);var fh;dh.TwoWay=fh=v.p(dh,"TwoWay",2);dh.parseEnum=function(a,b){v.j(a,"function",dh,"parseEnum:ctor");v.nb(b,a,dh,"parseEnum:defval");return function(c){c=qa(a,c);return null===c?b:c}};dh.prototype.ic=function(a){a.Ge===dh?this.mode=a:v.Aj(this,a)};var Pf;
dh.toString=Pf=function(a){var b=a;v.Ta(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()};dh.prototype.toString=function(){return"Binding("+this.$x+":"+this.XF+(-1!==this.fm?" "+this.fm:"")+" "+this.mode.name+")"};dh.prototype.freeze=function(){this.Q=!0;return this};
dh.prototype.Ra=function(){this.Q=!1;return this};v.defineProperty(dh,{fm:null},function(){return this.vD},function(a){this.Q&&v.ma(this);v.j(a,"number",dh,"targetId");this.vD=a});v.defineProperty(dh,{$x:"targetProperty"},function(){return this.vp},function(a){this.Q&&v.ma(this);v.j(a,"string",dh,"targetProperty");this.vp=a});v.defineProperty(dh,{yq:"sourceName"},function(){return this.sw},function(a){this.Q&&v.ma(this);null!==a&&v.j(a,"string",dh,"sourceName");this.sw=a;null!==a&&(this.Lr=!1)});
v.defineProperty(dh,{vx:"isToModel"},function(){return this.Lr},function(a){this.Q&&v.ma(this);v.j(a,"boolean",dh,"isToModel");this.Lr=a});v.defineProperty(dh,{XF:"sourceProperty"},function(){return this.lp},function(a){this.Q&&v.ma(this);v.j(a,"string",dh,"sourceProperty");this.lp=a});v.defineProperty(dh,{tH:"converter"},function(){return this.Uq},function(a){this.Q&&v.ma(this);null!==a&&v.j(a,"function",dh,"converter");this.Uq=a});
v.defineProperty(dh,{gH:"backConverter"},function(){return this.Oq},function(a){this.Q&&v.ma(this);null!==a&&v.j(a,"function",dh,"backConverter");this.Oq=a});v.defineProperty(dh,{mode:"mode"},function(){return this.es},function(a){this.Q&&v.ma(this);v.nb(a,dh,dh,"mode");this.es=a});dh.prototype.makeTwoWay=dh.prototype.FI=function(a){void 0===a&&(a=null);null!==a&&v.j(a,"function",dh,"makeTwoWay");this.mode=fh;this.gH=a;return this};
dh.prototype.ofObject=dh.prototype.Ex=function(a){void 0===a&&(a="");this.yq=a;this.vx=!1;return this};dh.prototype.ofModel=function(){this.yq=null;this.vx=!0;return this};function gh(a,b,c){a=a.yq;var d=null;return d=null===a||""===a?b:"/"===a?c.V:"."===a?c:".."===a?c.N:b.ud(a)}
dh.prototype.updateTarget=dh.prototype.oG=function(a,b,c){var d=this.lp;if(void 0===c||""===d||d===c){c=this.vp;var e=this.Uq;if(null===e&&""===c)v.trace("Binding error: target property is the empty string: "+this.toString());else{var f=b;""!==d&&(f=v.sb(b,d));if(void 0!==f)if(null===e)""!==c&&v.Na(a,c,f);else try{if(""!==c){var h=e(f,a);v.Na(a,c,h)}else e(f,a)}catch(k){}}}};
dh.prototype.updateSource=dh.prototype.ay=function(a,b,c,d){if(this.es===fh){var e=this.vp;if(void 0===c||e===c){c=this.lp;var f=this.Oq,h=a;""!==e&&(h=v.sb(a,e));if(void 0!==h&&!this.Ry.contains(a))try{this.Ry.add(a);var k=null!==d?d.g:null,l=null!==k?k.ca:null;if(null===f)if(""!==c)null!==l?l.setDataProperty(b,c,h):v.Na(b,c,h);else{if(null!==l&&null!==d&&0<=d.cu&&null!==d.N&&Array.isArray(d.N.aq)){var m=d.cu,n=d.N.aq;l.zF(n,m);l.mA(n,m,h)}}else try{if(""!==c){var p=f(h,b,l);null!==l?l.setDataProperty(b,
c,p):v.Na(b,c,p)}else p=f(h,b,l),void 0!==p&&null!==l&&null!==d&&0<=d.cu&&null!==d.N&&Array.isArray(d.N.aq)&&(m=d.cu,n=d.N.aq,l.zF(n,m),l.mA(n,m,p))}catch(q){}}finally{this.Ry.remove(a)}}}};function lg(){this.vG=(new I(Kf)).freeze();this.Qb="";this.BC=!1}v.ga("Transaction",lg);lg.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.Qf.count.toString()+(this.Xt?"":", incomplete");if(void 0!==a&&0<a){a=this.Qf.count;for(var c=0;c<a;c++){var d=this.Qf.fa(c);null!==d&&(b+="\n "+d.toString())}}return b};
lg.prototype.clear=lg.prototype.clear=function(){var a=this.Qf;a.Ra();for(var b=a.count-1;0<=b;b--){var c=a.fa(b);null!==c&&c.clear()}a.clear();a.freeze()};lg.prototype.canUndo=lg.prototype.canUndo=function(){return this.Xt};lg.prototype.undo=lg.prototype.undo=function(){if(this.canUndo())for(var a=this.Qf.count-1;0<=a;a--){var b=this.Qf.fa(a);null!==b&&b.undo()}};lg.prototype.canRedo=lg.prototype.canRedo=function(){return this.Xt};
lg.prototype.redo=lg.prototype.redo=function(){if(this.canRedo())for(var a=this.Qf.count,b=0;b<a;b++){var c=this.Qf.fa(b);null!==c&&c.redo()}};v.u(lg,{Qf:"changes"},function(){return this.vG});v.defineProperty(lg,{name:"name"},function(){return this.Qb},function(a){this.Qb=a});v.defineProperty(lg,{Xt:"isComplete"},function(){return this.BC},function(a){this.BC=a});
function Qf(){this.iz=new J(F);this.ff=!1;this.zG=(new I(lg)).freeze();this.bh=-1;this.QC=999;this.Ji=!1;this.mv=null;this.vl=0;this.LB=!1;this.hh=(new I("string")).freeze();this.$o=new I("number");this.Sy=!0;this.cz=!1}v.ga("UndoManager",Qf);
Qf.prototype.toString=function(a){for(var b="UndoManager "+this.mj+"<"+this.history.count+"<="+this.mF,b=b+"[",c=this.rF.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.rF.fa(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.fa(d).toString(a-1);return b};
Qf.prototype.clear=Qf.prototype.clear=function(){var a=this.history;a.Ra();for(var b=a.count-1;0<=b;b--){var c=a.fa(b);null!==c&&c.clear()}a.clear();this.bh=-1;a.freeze();this.Ji=!1;this.mv=null;this.vl=0;this.hh.Ra();this.hh.clear();this.hh.freeze();this.$o.clear()};Qf.prototype.addModel=Qf.prototype.ZG=function(a){this.iz.add(a)};Qf.prototype.removeModel=Qf.prototype.jJ=function(a){this.iz.remove(a)};
Qf.prototype.startTransaction=Qf.prototype.Tb=function(a){void 0===a&&(a="");null===a&&(a="");if(this.eb)return!1;!0===this.Sy&&(this.Sy=!1,this.vl++,this.ed("StartingFirstTransaction",a,this.hj),0<this.vl&&this.vl--);this.isEnabled&&(this.hh.Ra(),this.hh.add(a),this.hh.freeze(),null===this.hj?this.$o.add(0):this.$o.add(this.hj.Qf.count));this.vl++;var b=1===this.Fh;b&&this.ed("StartedTransaction",a,this.hj);return b};
Qf.prototype.commitTransaction=Qf.prototype.Hd=function(a){void 0===a&&(a="");return hh(this,!0,a)};Qf.prototype.rollbackTransaction=Qf.prototype.nq=function(){return hh(this,!1,"")};
function hh(a,b,c){if(a.eb)return!1;a.Lz&&1>a.Fh&&v.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Fh;d&&b&&a.ed("CommittingTransaction",c,a.hj);var e=0;if(0<a.Fh&&(a.vl--,a.isEnabled)){var f=a.hh.count;0<f&&(""===c&&(c=a.hh.fa(0)),a.hh.Ra(),a.hh.$c(f-1),a.hh.freeze());f=a.$o.count;0<f&&(e=a.$o.fa(f-1),a.$o.$c(f-1))}f=a.hj;if(d){if(b){a.cz=!1;if(a.isEnabled&&null!==f){b=f;b.Xt=!0;b.name=c;d=a.history;d.Ra();for(e=d.count-1;e>a.mj;e--)f=d.fa(e),null!==f&&f.clear(),
d.$c(e),a.cz=!0;e=a.mF;0===e&&(e=1);0<e&&d.count>=e&&(f=d.fa(0),null!==f&&f.clear(),d.$c(0),a.bh--);d.add(b);a.bh++;d.freeze();f=b}a.ed("CommittedTransaction",c,f)}else{a.Ji=!0;try{a.isEnabled&&null!==f&&(f.Xt=!0,f.undo())}finally{a.ed("RolledBackTransaction",c,f),a.Ji=!1}null!==f&&f.clear()}a.mv=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c=f.Qf;for(b=c.count-1;b>=a;b--)d=c.fa(b),null!==d&&d.undo(),c.Ra(),c.$c(b);c.freeze()}return!1}
Qf.prototype.canUndo=Qf.prototype.canUndo=function(){if(!this.isEnabled||0<this.Fh||this.eb)return!1;var a=this.jG;return null!==a&&a.canUndo()?!0:!1};Qf.prototype.undo=Qf.prototype.undo=function(){if(this.canUndo()){var a=this.jG;try{this.ed("StartingUndo","Undo",a),this.Ji=!0,this.bh--,a.undo()}catch(b){v.trace("undo error: "+b.toString())}finally{this.Ji=!1,this.ed("FinishedUndo","Undo",a)}}};
Qf.prototype.canRedo=Qf.prototype.canRedo=function(){if(!this.isEnabled||0<this.Fh||this.eb)return!1;var a=this.iG;return null!==a&&a.canRedo()?!0:!1};Qf.prototype.redo=Qf.prototype.redo=function(){if(this.canRedo()){var a=this.iG;try{this.ed("StartingRedo","Redo",a),this.Ji=!0,this.bh++,a.redo()}catch(b){v.trace("redo error: "+b.toString())}finally{this.Ji=!1,this.ed("FinishedRedo","Redo",a)}}};
Qf.prototype.ed=function(a,b,c){void 0===c&&(c=null);var d=new Kf;d.zc=Mf;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.QI;a.next();)b=a.value,d.ca=b,b.Nw(d)};Qf.prototype.handleChanged=Qf.prototype.PE=function(a){if(this.isEnabled&&!this.eb&&!this.skipsEvent(a)){var b=this.hj;null===b&&(this.mv=b=new lg);var c=a.copy(),b=b.Qf;b.Ra();b.add(c);b.freeze();this.Lz&&0>=this.Fh&&!this.Sy&&(a=a.g,null!==a&&!1===a.Fn||v.trace("Change not within a transaction: "+c.toString()))}};
Qf.prototype.skipsEvent=function(a){if(null===a||0>a.zc.value)return!0;a=a.object;if(a instanceof G){if(a=a.layer,null!==a&&a.Mc)return!0}else if(a instanceof qg&&a.Mc)return!0;return!1};v.u(Qf,{QI:"models"},function(){return this.iz.i});v.defineProperty(Qf,{isEnabled:"isEnabled"},function(){return this.ff},function(a){this.ff=a});v.u(Qf,{jG:"transactionToUndo"},function(){return 0<=this.mj&&this.mj<=this.history.count-1?this.history.fa(this.mj):null});
v.u(Qf,{iG:"transactionToRedo"},function(){return this.mj<this.history.count-1?this.history.fa(this.mj+1):null});v.u(Qf,{eb:"isUndoingRedoing"},function(){return this.Ji});v.u(Qf,{history:"history"},function(){return this.zG});v.defineProperty(Qf,{mF:"maxHistoryLength"},function(){return this.QC},function(a){this.QC=a});v.u(Qf,{mj:"historyIndex"},function(){return this.bh});v.u(Qf,{hj:"currentTransaction"},function(){return this.mv});v.u(Qf,{Fh:"transactionLevel"},function(){return this.vl});
v.u(Qf,{bF:"isInTransaction"},function(){return 0<this.vl});v.defineProperty(Qf,{Lz:"checksTransactionLevel"},function(){return this.LB},function(a){this.LB=a});v.u(Qf,{rF:"nestedTransactionNames"},function(){return this.hh});function sg(){0<arguments.length&&v.ld(sg);v.pc(this);this.Z=null;this.OB=!1;this.iC=this.PB=!0;this.RB=this.SB=this.jC=this.TB=!1;this.ol=this.DB=null;this.PD=1.05;this.fC=1;this.dz=NaN;this.MC=null;this.Ez=NaN;this.Dz=ad;this.$i=null}v.ga("CommandHandler",sg);
var ih=null,jh="";sg.prototype.toString=function(){return"CommandHandler"};v.u(sg,{g:"diagram"},function(){return this.Z});sg.prototype.Sc=function(a){this.Z=a};
sg.prototype.doKeyDown=function(){var a=this.g;if(null!==a){var b=a.R,c=v.Dk?b.iu:b.control,d=b.shift,e=b.alt,f=b.key;!c||"C"!==f&&"Insert"!==f?c&&"X"===f||d&&"Del"===f?this.canCutSelection()&&this.cutSelection():c&&"V"===f||d&&"Insert"===f?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===f||e&&d&&"Backspace"===f?this.canRedo()&&this.redo():c&&"Z"===f||e&&"Backspace"===f?this.canUndo()&&this.undo():"Del"===f||"Backspace"===f?this.canDeleteSelection()&&this.deleteSelection():c&&"A"===f?this.canSelectAll()&&
this.selectAll():"Esc"===f?this.canStopCommand()&&this.stopCommand():"Up"===f?a.pe&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===f?a.pe&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===f?a.oe&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===f?a.oe&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===f?d&&a.oe?a.scroll("page","left"):a.pe&&a.scroll("page","up"):"PageDown"===f?d&&a.oe?a.scroll("page","right"):a.pe&&a.scroll("page","down"):"Home"===
f?c&&a.pe?a.scroll("document","up"):!c&&a.oe&&a.scroll("document","left"):"End"===f?c&&a.pe?a.scroll("document","down"):!c&&a.oe&&a.scroll("document","right"):" "===f?this.canScrollToPart()&&this.scrollToPart():"Subtract"===f?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===f?this.canIncreaseZoom()&&this.increaseZoom():c&&"0"===f?this.canResetZoom()&&this.resetZoom():d&&"Z"===f?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===f?this.canGroupSelection()&&this.groupSelection():c&&d&&"G"===f?this.canUngroupSelection()&&
this.ungroupSelection():b.event&&113===b.event.which?this.canEditTextBlock()&&this.editTextBlock():b.event&&93===b.event.which?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()}};sg.prototype.doKeyUp=function(){var a=this.g;null!==a&&(a.R.bubbles=!0)};sg.prototype.stopCommand=function(){var a=this.g;if(null!==a){var b=a.Ya;b instanceof kh&&a.vf&&a.Ow();null!==b&&b.doCancel()}};sg.prototype.canStopCommand=function(){return!0};
sg.prototype.selectAll=function(){var a=this.g;if(null!==a){a.oa();try{a.cc="wait";a.Ca("ChangingSelection");for(var b=a.Gk;b.next();)b.value.cb=!0;for(var c=a.dg;c.next();)c.value.cb=!0;for(var d=a.links;d.next();)d.value.cb=!0}finally{a.Ca("ChangedSelection"),a.cc=""}}};sg.prototype.canSelectAll=function(){var a=this.g;return null!==a&&a.vf};
sg.prototype.deleteSelection=function(){var a=this.g;if(null!==a&&!a.Ca("SelectionDeleting",a.selection))try{a.cc="wait";a.Tb("Delete");a.Ca("ChangingSelection");for(var b=new J(S),c=a.selection.i;c.next();)lh(b,c.value,!0,this.EH?Infinity:0,this.rE,function(a){return a.canDelete()});a.PA(b,!0);a.Ca("SelectionDeleted",b)}finally{a.Ca("ChangedSelection"),a.Hd("Delete"),a.cc=""}};sg.prototype.canDeleteSelection=function(){var a=this.g;return null===a||a.bb||a.zf||!a.gn||0===a.selection.count?!1:!0};
function lh(a,b,c,d,e,f){void 0===f&&(f=null);if(!(a.contains(b)||null!==f&&!f(b)||b instanceof mh))if(a.add(b),b instanceof T){if(c&&b instanceof V)for(var h=b.Pc;h.next();)lh(a,h.value,c,d,e,f);if(e)for(h=b.ge;h.next();){var k=h.value;if(!a.contains(k)){var l=k.W,m=k.aa;null!==l&&a.contains(l)&&null!==m&&a.contains(m)?lh(a,k,c,d,e,f):null!==l&&null!==m||lh(a,k,c,d,e,f)}}if(1<d)for(b=b.CE();b.next();)lh(a,b.value,c,d-1,e,f)}else if(b instanceof W)for(h=b.Wf;h.next();)lh(a,h.value,c,d,e,f)}
sg.prototype.Jp=function(a,b,c){var d=new la(S,S);for(a=a.i;a.next();)nh(this,a.value,b,d,c);if(null!==b){c=b.ca;a=!1;null!==b.$a.te&&(a=b.$a.te.jj);for(var e=new J(W),f=new la(W,W),h=d.i;h.next();){var k=h.value;if(k instanceof W){var l=k;a||null!==l.W&&null!==l.aa||e.add(l)}else if(c instanceof Yf&&k instanceof T&&null!==k.data){var l=c,m=k,k=h.key,n=k.Ol();null!==n&&(n=d.na(n),null!==n?(l.ni(m.data,l.ub(n.data)),l=b.Rf(m.data),k=k.vn(),null!==k&&null!==l&&f.add(k,l)):l.ni(m.data,void 0))}}0<e.count&&
b.PA(e,!1);if(0<f.count)for(c=f.i;c.next();)d.add(c.key,c.value)}if(null!==b&&null!==this.g&&(b=b.ca,c=b.aH,null!==c)){var p=new la;d.each(function(a){null!==a.key.data&&p.add(a.key.data,a.value.data)});c(p,b,this.g.ca)}for(b=d.i;b.next();)b.value.Hb();return d};
function nh(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.na(b);var f=null,h=b.data;if(null!==h&&null!==c){var k=c.ca;b instanceof W?k instanceof Q&&(h=k.Qw(h),v.Ta(h)&&(k.qt(h),f=c.Rf(h))):(h=k.copyNodeData(h),v.Ta(h)&&(k.yl(h),f=c.uh(h)))}else oh(b),f=b.copy(),null!==f&&(null!==c?c.add(f):null!==h&&null!==a.g&&a.uH&&(k=a.g.ca,h=f instanceof W&&k instanceof Q?k.Qw(h):k.copyNodeData(h),v.Ta(h)&&(f.data=h)));if(!(f instanceof S))return null;f.cb=!1;f.Kg=!1;d.add(b,f);
if(b instanceof T){for(h=b.ge;h.next();){k=h.value;if(k.W===b){var l=d.na(k);null!==l&&(l.W=f)}k.aa===b&&(l=d.na(k),null!==l&&(l.aa=f))}if(b instanceof V&&f instanceof V)for(h=f,b=b.Pc;b.next();)k=nh(a,b.value,c,d,e),k instanceof W||null===k||(k.La=h)}else if(b instanceof W)for(h=b.W,null!==h&&(h=d.na(h),null!==h&&(f.W=h)),h=b.aa,null!==h&&(h=d.na(h),null!==h&&(f.aa=h)),b=b.Wf;b.next();)h=nh(a,b.value,c,d,e),null!==h&&(h.Oc=f);return f}
sg.prototype.copySelection=function(){var a=this.g;if(null!==a){for(var b=new J(S),a=a.selection.i;a.next();)lh(b,a.value,!0,this.xH?Infinity:0,this.vH,function(a){return a.canCopy()});this.copyToClipboard(b)}};sg.prototype.canCopySelection=function(){var a=this.g;return null!==a&&a.qk&&a.Gz&&0!==a.selection.count?!0:!1};sg.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
sg.prototype.canCutSelection=function(){var a=this.g;return null!==a&&!a.bb&&!a.zf&&a.qk&&a.gn&&a.Gz&&0!==a.selection.count?!0:!1};sg.prototype.copyToClipboard=function(a){var b=this.g;if(null!==b){var c=null;if(null===a)ih=null,jh="";else{var c=b.ca,d=!1,e=!1,f=null;try{if(c instanceof Yf){var h=c,d=h.qn;h.qn=this.kE}c instanceof Q&&(h=c,e=h.pn,h.pn=this.jE);f=b.Jp(a,null,!0)}finally{c instanceof Yf&&(c.qn=d),c instanceof Q&&(c.pn=e),c=new I(S),c.Kc(f),ih=c,jh=b.ca.Il}}b.Ca("ClipboardChanged",c)}};
sg.prototype.pasteFromClipboard=function(){var a=new J(S),b=ih;if(null===b)return a;var c=this.g;if(null===c||jh!==c.ca.Il)return a;var d=c.ca,e=!1,f=!1,h=null;try{if(d instanceof Yf){var k=d,e=k.qn;k.qn=this.kE}d instanceof Q&&(k=d,f=k.pn,k.pn=this.jE);h=c.Jp(b,c,!1)}finally{for(d instanceof Yf&&(d.qn=e),d instanceof Q&&(d.pn=f),b=h.i;b.next();)c=b.value,d=b.key,c.location.H()||(d.location.H()?c.location=d.location:!c.position.H()&&d.position.H()&&(c.position=d.position)),a.add(c)}return a};
sg.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.cc="wait";b.Tb("Paste");b.Ca("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&ph(b);for(var d=c.i;d.next();)d.value.cb=!0;b.Ca("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e.H()){var f=b.$a.te;null===f&&(f=new qh,f.Sc(b));var h=f.computeEffectiveCollection(b.selection);f.moveParts(h,new y(a.x-e.la,a.y-e.sa),!1)}}b.Ca("ClipboardPasted",c)}finally{b.Hd("Paste"),b.cc=
""}};sg.prototype.canPasteSelection=function(){var a=this.g;return null===a||a.bb||a.zf||!a.Bp||!a.Gz||null===ih||jh!==a.ca.Il?!1:!0};sg.prototype.undo=function(){var a=this.g;null!==a&&a.pa.undo()};sg.prototype.canUndo=function(){var a=this.g;return null===a||a.bb||a.zf?!1:a.YD&&a.pa.canUndo()};sg.prototype.redo=function(){var a=this.g;null!==a&&a.pa.redo()};sg.prototype.canRedo=function(){var a=this.g;return null===a||a.bb||a.zf?!1:a.YD&&a.pa.canRedo()};
sg.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.gy);v.Zd(a,sg,"decreaseZoom:factor");var b=this.g;null!==b&&b.Dl===Dh&&(a*=b.scale,a<b.xh||a>b.wh||(b.scale=a))};sg.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.gy);v.Zd(a,sg,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.Dl!==Dh)return!1;a*=b.scale;return a<b.xh||a>b.wh?!1:b.Mw};
sg.prototype.increaseZoom=function(a){void 0===a&&(a=this.gy);v.Zd(a,sg,"increaseZoom:factor");var b=this.g;null!==b&&b.Dl===Dh&&(a*=b.scale,a<b.xh||a>b.wh||(b.scale=a))};sg.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.gy);v.Zd(a,sg,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.Dl!==Dh)return!1;a*=b.scale;return a<b.xh||a>b.wh?!1:b.Mw};sg.prototype.resetZoom=function(a){void 0===a&&(a=this.Uw);v.Zd(a,sg,"resetZoom:newscale");var b=this.g;null===b||a<b.xh||a>b.wh||(b.scale=a)};
sg.prototype.canResetZoom=function(a){void 0===a&&(a=this.Uw);v.Zd(a,sg,"canResetZoom:newscale");var b=this.g;return null===b||a<b.xh||a>b.wh?!1:b.Mw};sg.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.Ez&&!isNaN(this.dz)&&a.se.L(this.Dz)?(a.scale=this.dz,a.position=this.MC,this.Ez=NaN,this.Dz=ad):(this.dz=b,this.MC=c.copy(),a.zoomToFit(),this.Ez=a.scale,this.Dz=a.se.copy())}};sg.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Mw};
sg.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&v.F(a,S,sg,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.$i&&(this.$i.next()?a=this.$i.value:this.$i=null)}catch(c){this.$i=null}null===a&&(0<b.Sl.count?this.$i=b.Sl.i:0<b.selection.count&&(this.$i=b.selection.i),null!==this.$i&&this.$i.next()&&(a=this.$i.value))}if(null!==a){var d=b.Qa;d.Pn("Scroll To Part");var e=b.position.copy();b.hH(a.Y);e.Lc(b.position)&&d.oi()}}};
sg.prototype.canScrollToPart=function(a){void 0===a&&(a=null);if(null!==a&&!(a instanceof S))return!1;a=this.g;return null===a||0===a.selection.count&&0===a.Sl.count?!1:a.oe&&a.pe};
sg.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Tb("Collapse Tree");b.Qa.Pn("Collapse Tree");var c=new I(T);if(null!==a&&a.kd)a.collapseTree(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof T&&(a=e,a.kd&&(a.collapseTree(),c.add(a)))}b.Ca("TreeCollapsed",c)}finally{b.Hd("Collapse Tree")}};
sg.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.bb)return!1;if(null!==a){if(!(a instanceof T&&a.kd))return!1;if(0<a.gx().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof T&&b.kd&&0<b.gx().count)return!0;return!1};
sg.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Tb("Expand Tree");b.Qa.Pn("Expand Tree");var c=new I(T);if(null===a||a.kd)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof T&&(a=e,a.kd||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.Ca("TreeExpanded",c)}finally{b.Hd("Expand Tree")}};
sg.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.bb)return!1;if(null!==a){if(!(a instanceof T)||a.kd)return!1;if(0<a.gx().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof T&&!b.kd&&0<b.gx().count)return!0;return!1};
sg.prototype.groupSelection=function(){var a=this.g;if(null!==a){var b=a.ca;if(b instanceof Q){var c=this.ZD;if(null!==c){var d=null;try{a.cc="wait";a.Tb("Group");a.Ca("ChangingSelection");for(var e=new I(S),f=a.selection.i;f.next();){var h=f.value;h.ee()&&h.canGroup()&&e.add(h)}for(var k=new I(S),l=e.i;l.next();){for(var m=l.value,f=!1,n=e.i;n.next();)if(m.li(n.value)){f=!0;break}f||k.add(m)}if(0<k.count){var p=k.first().La;if(null!==p)for(;null!==p;){for(var e=!1,q=k.i;q.next();)if(!q.value.li(p)){e=
!0;break}if(e)p=p.La;else break}if(c instanceof V)oh(c),d=c.copy(),null!==d&&a.add(d);else if(b.pA(c)){var r=b.copyNodeData(c);v.Ta(r)&&(b.yl(r),d=a.ex(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.La=p);for(var s=k.i;s.next();){var u=s.value;this.isValidMember(d,u)&&(u.La=d)}a.select(d)}}a.Ca("ChangedSelection");a.Ca("SelectionGrouped",d)}finally{a.Hd("Group"),a.cc=""}}}}};
sg.prototype.canGroupSelection=function(){var a=this.g;if(null===a||a.bb||a.zf||!a.Bp||!a.Hw||!(a.ca instanceof Q)||null===this.ZD)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canGroup())return!0}return!1};function Eh(a){var b=v.lb();for(a=a.i;a.next();){var c=a.value;c instanceof W||b.push(c)}a=new J(S);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],f=!0,h=0;h<c;h++)if(e.li(b[h])){f=!1;break}f&&a.add(e)}v.wa(b);return a}
sg.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof W)return!1;if(null!==a){if(a===b||a.li(b))return!1;var c=a.zA;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.zA;return null!==c?c(a,b):!0};
sg.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b){var c=b.ca;if(c instanceof Q)try{b.cc="wait";b.Tb("Ungroup");b.Ca("ChangingSelection");var d=new I(V);if(null!==a)d.add(a);else for(var e=b.selection.i;e.next();){var f=e.value;f instanceof V&&(a=f,a.canUngroup()&&d.add(a))}if(0<d.count){b.Ow();for(var h=d.i;h.next();){var k=h.value;k.expandSubGraph();var l=k.La,m=null!==l&&null!==l.data?c.ub(l.data):void 0,n=new I(S);n.Kc(k.Pc);for(var p=n.i;p.next();){var q=
p.value;q.cb=!0;if(!(q instanceof W)){var r=q.data;null!==r?c.YA(r,m):q.La=l}}b.remove(k)}}b.Ca("ChangedSelection");b.Ca("SelectionUngrouped",d,n)}finally{b.Hd("Ungroup"),b.cc=""}}};sg.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.bb||b.zf||!b.gn||!b.Lw||!(b.ca instanceof Q))return!1;if(null!==a){if(!(a instanceof V))return!1;if(a.canUngroup())return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&b.canUngroup())return!0;return!1};
sg.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=Eh(a).i;d.next();){var e=d.value;null!==e.La&&(!b||this.isValidMember(null,e)?e.La=null:c=!1)}return c};
sg.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Tb("Collapse SubGraph");b.Qa.Pn("Collapse SubGraph");var c=new I(V);if(null!==a&&a.ye)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof V&&(a=e,a.ye&&(a.collapseSubGraph(),c.add(a)))}b.Ca("SubGraphCollapsed",c)}finally{b.Hd("Collapse SubGraph")}};
sg.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.bb)return!1;if(null!==a)return a instanceof V&&a.ye?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&b.ye)return!0;return!1};
sg.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Tb("Expand SubGraph");b.Qa.Pn("Expand SubGraph");var c=new I(V);if(null===a||a.ye)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof V&&(a=e,a.ye||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.Ca("SubGraphExpanded",c)}finally{b.Hd("Expand SubGraph")}};
sg.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.bb)return!1;if(null!==a)return a instanceof V&&!a.ye?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&!b.ye)return!0;return!1};
sg.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&v.F(a,Fh,sg,"editTextBlock");var b=this.g;if(null!==b){var c=b.$a.gB;if(null!==c){if(null===a){a=null;for(var d=b.selection.i;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.Gt(function(a){return a instanceof Fh&&a.Xz})}null!==a&&(b.Ya=null,c.Wg=a,b.Ya=c)}}};
sg.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.bb||b.zf||!b.Kw||null===b.$a.gB)return!1;if(null!==a){if(!(a instanceof Fh))return!1;a=a.V;if(null!==a&&a.canEdit())return!0}else for(b=b.selection.i;b.next();)if(a=b.value,a.canEdit()&&(a=a.Gt(function(a){return a instanceof Fh&&a.Xz}),null!==a))return!0;return!1};
sg.prototype.showContextMenu=function(a){var b=this.g;if(null!==b){var c=b.$a.Pz;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new pf,e=null;a instanceof G?e=a.Va(Gb):b.qI||(e=b.tb,e=new y(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.g=b,d.ef=b.kG(e),d.da=e,d.left=!1,d.right=!0,d.up=!0,b.R=d);b.Ya=c;Gh(c,!1,a)}}};
sg.prototype.canShowContextMenu=function(a){var b=this.g;if(null===b)return!1;var c=b.$a.Pz;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};v.defineProperty(sg,{uH:"copiesClipboardData"},function(){return this.OB},function(a){v.j(a,"boolean",sg,"copiesClipboardData");this.OB=a});
v.defineProperty(sg,{vH:"copiesConnectedLinks"},function(){return this.PB},function(a){v.j(a,"boolean",sg,"copiesConnectedLinks");this.PB=a});v.defineProperty(sg,{rE:"deletesConnectedLinks"},function(){return this.iC},function(a){v.j(a,"boolean",sg,"deletesConnectedLinks");this.iC=a});v.defineProperty(sg,{xH:"copiesTree"},function(){return this.TB},function(a){v.j(a,"boolean",sg,"copiesTree");this.TB=a});
v.defineProperty(sg,{EH:"deletesTree"},function(){return this.jC},function(a){v.j(a,"boolean",sg,"deletesTree");this.jC=a});v.defineProperty(sg,{kE:"copiesParentKey"},function(){return this.SB},function(a){v.j(a,"boolean",sg,"copiesParentKey");this.SB=a});v.defineProperty(sg,{jE:"copiesGroupKey"},function(){return this.RB},function(a){v.j(a,"boolean",sg,"copiesGroupKey");this.RB=a});
v.defineProperty(sg,{ZD:"archetypeGroupData"},function(){return this.DB},function(a){null!==a&&v.F(a,Object,sg,"archetypeGroupData");var b=this.g;null!==b&&(b=b.ca,b instanceof Q&&(a instanceof V||b.pA(a)||v.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.DB=a});v.defineProperty(sg,{zA:"memberValidation"},function(){return this.ol},function(a){null!==a&&v.j(a,"function",sg,"memberValidation");this.ol=a});
v.defineProperty(sg,{Uw:"defaultScale"},function(){return this.fC},function(a){v.Zd(a,sg,"defaultScale");0<a||v.k("defaultScale must be larger than zero, not: "+a);this.fC=a});v.defineProperty(sg,{gy:"zoomFactor"},function(){return this.PD},function(a){v.Zd(a,sg,"zoomFactor");1<a||v.k("zoomFactor must be larger than 1.0, not: "+a);this.PD=a});sg.prototype.at=function(a){if(null!==a)for(a=a.i;a.next();){var b=a.key;b instanceof W&&(b.zj=!0)}};
sg.prototype.gp=function(a){if(null!==a)for(a=a.i;a.next();){var b=a.key;b instanceof W&&(b.zj=!1,Hh(b)&&b.Xb())}};function rg(){0<arguments.length&&v.ld(rg);v.pc(this);this.Z=null;this.Qb="";this.ff=!0;this.zC=!1;this.KD=null;this.Dw=-1}v.ga("Tool",rg);rg.prototype.Sc=function(a){this.Z=a};rg.prototype.toString=function(){return""!==this.name?this.name+" Tool":v.lf(Object.getPrototypeOf(this))};rg.prototype.updateAdornments=function(){};rg.prototype.canStart=function(){return this.isEnabled};
rg.prototype.doStart=function(){};rg.prototype.doActivate=function(){this.ta=!0};rg.prototype.doDeactivate=function(){this.ta=!1};rg.prototype.doStop=function(){};rg.prototype.doCancel=function(){this.stopTool()};rg.prototype.stopTool=function(){var a=this.g;null!==a&&a.Ya===this&&(a.Ya=null,a.cc="")};rg.prototype.doMouseDown=function(){!this.ta&&this.canStart()&&this.doActivate()};rg.prototype.doMouseMove=function(){};rg.prototype.doMouseUp=function(){this.stopTool()};rg.prototype.doMouseWheel=function(){};
rg.prototype.canStartMultiTouch=function(){return!0};rg.prototype.standardPinchZoomStart=function(){var a=this.g;if(null!==a){var b=a.R,c=b.jx(0,v.xb(NaN,NaN)),d=b.jx(1,v.xb(NaN,NaN));if(c.H()&&d.H()&&(this.doCancel(),a.Qt("hasGestureZoom"))){a.ZC=a.scale;var e=d.x-c.x,f=d.y-c.y;a.rD=Math.sqrt(e*e+f*f);b.bubbles=!1}v.v(c);v.v(d)}};
rg.prototype.standardPinchZoomMove=function(){var a=this.g;if(null!==a){var b=a.R,c=b.jx(0,v.xb(NaN,NaN)),d=b.jx(1,v.xb(NaN,NaN));if(c.H()&&d.H()&&(this.doCancel(),a.Qt("hasGestureZoom"))){var e=d.x-c.x,f=d.y-c.y,f=Math.sqrt(e*e+f*f)/a.rD,e=new y((Math.min(d.x,c.x)+Math.max(d.x,c.x))/2,(Math.min(d.y,c.y)+Math.max(d.y,c.y))/2),f=a.ZC*f,h=a.pb;if(f!==a.scale&&h.canResetZoom(f)){var k=a.jm;a.jm=e;h.resetZoom(f);a.jm=k}b.bubbles=!1}v.v(c);v.v(d)}};
rg.prototype.doKeyDown=function(){var a=this.g;null!==a&&"Esc"===a.R.key&&this.doCancel()};rg.prototype.doKeyUp=function(){};rg.prototype.startTransaction=rg.prototype.Tb=function(a){void 0===a&&(a=this.name);this.Gf=null;var b=this.g;return null===b?!1:b.Tb(a)};rg.prototype.stopTransaction=rg.prototype.Ik=function(){var a=this.g;return null===a?!1:null===this.Gf?a.nq():a.Hd(this.Gf)};
rg.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.vf){var b=a.R,c=a.Jt(b.da,!1);if(null!==c)if(v.Dk?b.iu:b.control){a.Ca("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.La;null!==b&&(b.cb=!b.cb);a.Ca("ChangedSelection")}else if(b.shift){if(!c.cb){a.Ca("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.La;null!==b&&(b.cb=!0);a.Ca("ChangedSelection")}}else{if(!c.cb){for(b=c;null!==b&&!b.canSelect();)b=b.La;null!==b&&a.select(b)}}else!b.left||(v.Dk?b.iu:b.control)||
b.shift||a.Ow()}};rg.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Mc});var c=this.g;if(null===c)return!1;var d=c.R,e=c.Ke(d.da,a,b);d.Pe=e;Ih(e,d,c);return d.Cc};
function Ih(a,b,c){b.Cc=!1;if(null===a||a.Yt()){var d=0;b.left?d=1===b.He?1:2===b.He?2:1:b.right&&1===b.He&&(d=3);var e="";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.Ca(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.Ca(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.Dt?a.Dt:
a.click;break;case 3:c=a.Oz}if(null!==c&&(c(b,a),b.Cc))break;a=a.N}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.Dt?c.Dt:c.click;break;case 3:a=c.Oz}null!==a&&a(b)}}}
rg.prototype.standardMouseOver=function(){var a=this.g;if(null!==a){var b=a.R;if(null!==b.g&&!0!==a.Qa.rc){var c=a.wb;a.wb=!0;var d=a.Ke(b.da,null,null);b.Pe=d;var e=!1;if(d!==a.ro){var f=a.ro,h=f;a.ro=d;this.doCurrentObjectChanged(f,d);for(b.Cc=!1;null!==f;){var k=f.ku;if(null!==k){if(d===f)break;if(null!==d&&d.Vl(f))break;k(b,f,d);e=!0;if(b.Cc)break}f=f.N}f=h;for(b.Cc=!1;null!==d;){k=d.ju;if(null!==k){if(f===d)break;if(null!==f&&f.Vl(d))break;k(b,d,f);e=!0;if(b.Cc)break}d=d.N}d=a.ro}if(null!==d){f=
d;for(k="";null!==f;){k=f.cursor;if(""!==k)break;f=f.N}a.cc=k;b.Cc=!1;for(f=d;null!==f;){k=f.DA;if(null!==k&&(k(b,f),e=!0,b.Cc))break;f=f.N}}else a.cc="",k=a.DA,null!==k&&(k(b),e=!0);e&&a.Me();a.wb=c}}};rg.prototype.doCurrentObjectChanged=function(){};
rg.prototype.standardMouseWheel=function(){var a=this.g;if(null!==a){var b=a.R,c=b.Kl;if(0!==c&&a.se.H()){var d=a.pb,e=a.$a.lu;if((e===Jh&&!b.shift||e===Kh&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.jm,a.jm=b.ef,0<c?d.increaseZoom():d.decreaseZoom(),a.jm=e,b.bubbles=!1;else if(e===Jh&&b.shift||e===Kh&&!b.control){var d=a.position.copy(),e=0<c?c:-c,f=b.event.deltaX,h=b.event.deltaY;void 0===f||void 0===h||0===f&&0===h||b.shift?!b.shift&&a.pe?(f=a.zu,e=e/40*f,0<c?a.scroll("pixel",
"up",e):a.scroll("pixel","down",e)):b.shift&&a.oe&&(f=a.yu,e=e/40*f,0<c?a.scroll("pixel","left",e):a.scroll("pixel","right",e)):(0!==f&&a.oe&&(0<f?a.scroll("pixel","left",-f):a.scroll("pixel","right",f)),0!==h&&a.pe&&(0<h?a.scroll("pixel","up",-h):a.scroll("pixel","down",h)));a.position.L(d)||(b.bubbles=!1)}}}};rg.prototype.standardWaitAfter=function(a,b){v.j(a,"number",rg,"standardWaitAfter:delay");this.cancelWaitAfter();var c=this,d=b.copy();this.Dw=v.setTimeout(function(){c.doWaitAfter(d)},a)};
rg.prototype.cancelWaitAfter=function(){-1!==this.Dw&&v.clearTimeout(this.Dw);this.Dw=-1};rg.prototype.doWaitAfter=function(){};rg.prototype.findToolHandleAt=function(a,b){var c=this.g;if(null===c)return null;c=c.Ke(a,function(a){for(;null!==a&&!(a.N instanceof mh);)a=a.N;return a});return null===c?null:c.N.kc===b?c:null};
rg.prototype.isBeyondDragSize=function(a,b){var c=this.g;if(null===c)return!1;void 0===a&&(a=c.Bc.ef);void 0===b&&(b=c.R.ef);var d=c.$a.IH,e=d.width,d=d.height;c.Bc.pj&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};v.u(rg,{g:"diagram"},function(){return this.Z});v.defineProperty(rg,{name:"name"},function(){return this.Qb},function(a){v.j(a,"string",rg,"name");this.Qb=a});
v.defineProperty(rg,{isEnabled:"isEnabled"},function(){return this.ff},function(a){v.j(a,"boolean",rg,"isEnabled");this.ff=a});v.defineProperty(rg,{ta:"isActive"},function(){return this.zC},function(a){v.j(a,"boolean",rg,"isActive");this.zC=a});v.defineProperty(rg,{Gf:"transactionResult"},function(){return this.KD},function(a){null!==a&&v.j(a,"string",rg,"transactionResult");this.KD=a});
function qh(){0<arguments.length&&v.ld(qh);rg.call(this);this.name="Dragging";this.QB=this.DC=!0;this.Gr=this.pC=!1;this.HC=!0;this.Ty=(new ia(NaN,NaN)).freeze();this.Uy=xb;this.Vy=(new y(NaN,NaN)).freeze();this.oC=!1;this.mC=this.NB=this.nC=this.YB=this.Yi=null;this.mr=this.FC=!1;this.op=new y(NaN,NaN);this.tw=new y;this.ww=!1;this.CC=!0;this.xo=100;this.Ij=[];this.yG=(new J(S)).freeze()}v.Ma(qh,rg);v.ga("DraggingTool",qh);
v.defineProperty(qh,{XE:"isCopyEnabled"},function(){return this.DC},function(a){v.j(a,"boolean",qh,"isCopyEnabled");this.DC=a});v.defineProperty(qh,{wH:"copiesEffectiveCollection"},function(){return this.QB},function(a){v.j(a,"boolean",qh,"copiesEffectiveCollection");this.QB=a});v.defineProperty(qh,{JH:"dragsTree"},function(){return this.pC},function(a){v.j(a,"boolean",qh,"dragsTree");this.pC=a});
v.defineProperty(qh,{qx:"isGridSnapEnabled"},function(){return this.Gr},function(a){v.j(a,"boolean",qh,"isGridSnapEnabled");this.Gr=a});v.defineProperty(qh,{mI:"isComplexRoutingRealtime"},function(){return this.CC},function(a){v.j(a,"boolean",qh,"isComplexRoutingRealtime");this.CC=a});v.defineProperty(qh,{oI:"isGridSnapRealtime"},function(){return this.HC},function(a){v.j(a,"boolean",qh,"isGridSnapRealtime");this.HC=a});
v.defineProperty(qh,{OE:"gridSnapCellSize"},function(){return this.Ty},function(a){v.F(a,ia,qh,"gridSnapCellSize");this.Ty.L(a)||(this.Ty=a=a.S())});v.defineProperty(qh,{YH:"gridSnapCellSpot"},function(){return this.Uy},function(a){v.F(a,L,qh,"gridSnapCellSpot");this.Uy.L(a)||(this.Uy=a=a.S())});v.defineProperty(qh,{ZH:"gridSnapOrigin"},function(){return this.Vy},function(a){v.F(a,y,qh,"gridSnapOrigin");this.Vy.L(a)||(this.Vy=a=a.S())});
v.defineProperty(qh,{jj:"dragsLink"},function(){return this.oC},function(a){v.j(a,"boolean",qh,"dragsLink");this.oC=a});v.defineProperty(qh,{sn:"currentPart"},function(){return this.YB},function(a){null!==a&&v.F(a,S,qh,"currentPart");this.YB=a});v.defineProperty(qh,{bc:"copiedParts"},function(){return this.NB},function(a){this.NB=a});v.defineProperty(qh,{Wb:"draggedParts"},function(){return this.nC},function(a){this.nC=a});
v.u(qh,{QK:"draggingParts"},function(){return null!==this.bc?this.bc.Bj():null!==this.Wb?this.Wb.Bj():this.yG});v.defineProperty(qh,{gd:"draggedLink"},function(){return this.mC},function(a){null!==a&&v.F(a,W,qh,"draggedLink");this.mC=a});v.defineProperty(qh,{px:"isDragOutStarted"},function(){return this.FC},function(a){this.FC=a});v.defineProperty(qh,{Hk:"startPoint"},function(){return this.tw},function(a){v.F(a,y,qh,"startPoint");this.tw.L(a)||(this.tw=a=a.S())});
v.defineProperty(qh,{nE:"delay"},function(){return this.xo},function(a){v.j(a,"number",qh,"delay");this.xo=a});qh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.bb&&!a.ut||!a.Bl&&!a.qk&&!a.ut||!a.vf)return!1;var b=a.R;return!b.left||a.Ya!==this&&(!this.isBeyondDragSize()||b.pj&&b.timestamp-a.Bc.timestamp<this.xo)?!1:null!==this.findDraggablePart()};
qh.prototype.findDraggablePart=function(){var a=this.g;if(null===a)return null;a=a.Jt(a.Bc.da,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.La;return null!==a&&(a.canMove()||a.canCopy())?a:null};qh.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.vf){var b=a.Jt(a.Bc.da,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.La;this.sn=b;this.sn.cb||(a.Ca("ChangingSelection"),b=a.R,(v.Dk?b.iu:b.control)||b.shift||ph(a),this.sn.cb=!0,a.Ca("ChangedSelection"))}}};
qh.prototype.doActivate=function(){var a=this.g;if(null!==a){null===this.sn&&this.standardMouseSelect();var b=this.sn;null!==b&&(b.canMove()||b.canCopy())&&(this.ta=!0,this.op.set(a.position),Lh(this,a.selection),this.Ij.length=0,this.Wb=this.computeEffectiveCollection(a.selection),a.Fu=!0,this.at(this.Wb),this.Tb("Drag"),this.Hk=a.Bc.da,a.bf=!0,a.ut&&(this.px=!0,this.mr=!1,Mh=this,Nh=this.g,this.doSimulatedDragOut()))}};
function Lh(a,b){if(a.jj){var c=a.g;null!==c&&c.hn&&(c.ca instanceof Q&&1===b.count&&b.first()instanceof W?(a.gd=b.first(),a.gd.canRelinkFrom()&&a.gd.canRelinkTo()&&a.gd.xt(),a.Yi=c.$a.yF,null===a.Yi&&(a.Yi=new Oh,a.Yi.Sc(c))):(a.gd=null,a.Yi=null))}}
qh.prototype.computeEffectiveCollection=function(a){var b=null!==this.g&&this.g.Ya===this,c=new la(S);if(null===a)return c;for(var d=a.i;d.next();)Ph(this,c,d.value,b);if(null!==this.gd&&this.jj)return c;for(d=a.i;d.next();)a=d.value,a instanceof W&&(b=a.W,null===b||c.contains(b)?(b=a.aa,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function Qh(a){return void 0===a?new Rh($c):new Rh(a.copy())}
function Ph(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof T){b.add(c,Qh(c.location));if(c instanceof V)for(var e=c.Pc;e.next();)Ph(a,b,e.value,d);for(e=c.ge;e.next();){var f=e.value;if(!b.contains(f)){var h=f.W,k=f.aa;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&Ph(a,b,f,d)}}if(a.JH)for(c=c.CE();c.next();)Ph(a,b,c.value,d)}else if(c instanceof W)for(f=c,b.add(f,Qh()),e=f.Wf;e.next();)Ph(a,b,e.value,d);else c instanceof mh||b.add(c,Qh(c.location))}
qh.prototype.doDeactivate=function(){this.ta=!1;var a=this.g;null!==a&&Sh(a);Th(this);this.gp(this.Wb);this.Wb=this.sn=null;this.mr=this.px=!1;if(0<Uh.count){for(var b=Uh.length,c=0;c<b;c++){var d=Uh.fa(c);Vh(d);Wh(d);Th(d);null!==d.g&&Sh(d.g)}Uh.clear()}Vh(this);this.op.l(NaN,NaN);Mh=Nh=null;Wh(this);a.bf=!1;a.cc="";a.Fu=!1;this.Ik()};function Th(a){var b=a.g;if(null!==b){var c=b.wb;b.wb=!0;Xh(a,b.R,null);b.wb=c}a.Ij.length=0}
function gi(){var a=Mh;Wh(a);ti(a);var b=a.g;null!==b&&a.op.H()&&(b.position=a.op);null!==b&&Sh(b)}qh.prototype.doCancel=function(){Wh(this);ti(this);var a=this.g;null!==a&&this.op.H()&&(a.position=this.op);this.stopTool()};qh.prototype.at=function(a){if(null!==a)for(this.ww=!0,a=a.i;a.next();){var b=a.key;b instanceof W&&(b.zj=!0)}};qh.prototype.gp=function(a){if(null!==a){for(a=a.i;a.next();){var b=a.key;b instanceof W&&(b.zj=!1,Hh(b)&&b.Xb())}this.ww=!1}};
qh.prototype.doKeyDown=function(){var a=this.g;null!==a&&(a=a.R,null!==a&&this.ta&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};qh.prototype.doKeyUp=function(){var a=this.g;null!==a&&null!==a.R&&this.ta&&this.doMouseMove()};function ui(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,h=a.i;h.next();){var k=h.value;if(k.ee()&&k.isVisible()){var l=k.location,k=l.x,l=l.y;isNaN(k)||isNaN(l)||(k<c&&(c=k),l<d&&(d=l),k>e&&(e=k),l>f&&(f=l))}}Infinity===c?b.l(0,0,0,0):b.l(c,d,e-c,f-d)}
function vi(a,b){if(null===a.bc){var c=a.g;if(!(null===c||b&&(c.bb||c.zf))&&null!==a.Wb){var d=c.pa;d.isEnabled&&d.bF?null!==d.hj&&0<d.hj.Qf.count&&(c.pa.nq(),c.Tb("Drag")):ti(a);c.wb=!b;c.Fq=!b;a.Hk=c.Bc.da;d=a.wH?a.Wb.Bj():c.selection;d=c.Jp(d,c,!0);for(c=d.i;c.next();)c.value.location=c.key.location;c=v.Ef();ui(d,c);v.Gb(c);for(var c=new la(S),e=a.Wb.i;e.next();){var f=e.key;f.ee()&&f.canCopy()&&(f=d.na(f),null!==f&&(f.af(),c.add(f,Qh(f.location))))}for(d=d.i;d.next();)e=d.value,e instanceof W&&
e.canCopy()&&c.add(e,Qh());a.bc=c;Lh(a,c.Bj());null!==a.gd&&(c=a.gd,d=c.Rn,c.Zl(a.Hk.x-(d.x+d.width/2),a.Hk.y-(d.y+d.height/2)))}}}function Wh(a){var b=a.g;if(null!==b){if(null!==a.bc&&(b.PA(a.bc.Bj(),!1),a.bc=null,null!==a.Wb))for(var c=a.Wb.i;c.next();)c.key instanceof W&&(c.value.point=new y(0,0));b.wb=!1;b.Fq=!1;a.Hk=b.Bc.da}}function Vh(a){if(null!==a.gd){if(a.jj&&null!==a.Yi){var b=a.Yi;null!==b.g&&(b.g.remove(b.Rd),b.g.remove(b.Sd))}a.gd=null;a.Yi=null}}
function wi(a,b,c){var d=a.g;if(null!==d){var e=a.Hk,f=v.K();f.assign(d.R.da);a.moveParts(b,f.Vn(e),c);v.v(f)}}
qh.prototype.moveParts=function(a,b,c){if(null!==a&&(v.F(a,la,qh,"moveParts:parts"),0!==a.count)){var d=v.K(),e=v.K();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);(b=this.ww)||this.at(a);for(var f=new I(xi),h=new I(Da),k=a.i;k.next();){var l=k.key;if(l.ee()){var m=yi(this,l,a);if(null!==m)f.add(new xi(l,k.value,m));else if(!c||l.canMove()){m=k.value.point;d.assign(m);var n=v.K(),p=this.computeMove(l,d.add(e),a,n);l.location=p;k.value.UF=n.Vn(m);v.v(n)}}else k.key instanceof W&&h.add(k.hb)}for(c=
f.i;c.next();)f=c.value,m=f.info.point,d.assign(m),f.Qc.location=d.add(f.$H.UF);c=v.K();m=v.K();for(h=h.i;h.next();)if(k=h.value,f=k.key,f instanceof W)if(f.zj)l=f.W,n=f.aa,null!==this.gd&&this.jj?(k=k.value.point,a.add(f,Qh(e)),l=e.x-k.x,k=e.y-k.y,f.Zl(l,k)):(null!==l&&(c.assign(l.location),p=a.na(l),null!==p&&c.Vn(p.point)),null!==n&&(m.assign(n.location),p=a.na(n),null!==p&&m.Vn(p.point)),null!==l&&null!==n?c.Lc(m)?(k=k.value.point,l=d,l.assign(c),l.Vn(k),a.add(f,Qh(c)),f.Zl(l.x,l.y)):(f.zj=!1,
f.Xb()):(k=k.value.point,n=null!==l?c:null!==n?m:e,a.add(f,Qh(n)),l=n.x-k.x,k=n.y-k.y,f.Zl(l,k)));else if(null===f.W||null===f.aa)k=k.value.point,a.add(f,Qh(e)),l=e.x-k.x,k=e.y-k.y,f.Zl(l,k);v.v(d);v.v(e);v.v(c);v.v(m);b||(zi(this.g),this.gp(a))}};function yi(a,b,c){b=b.La;if(null!==b){a=yi(a,b,c);if(null!==a)return a;a=c.na(b);if(null!==a)return a}return null}
function ti(a){if(null!==a.Wb){for(var b=a.g,c=a.Wb.i;c.next();){var d=c.key;d.ee()&&(d.location=c.value.point)}for(c=a.Wb.i;c.next();)if(d=c.key,d instanceof W&&d.zj){var e=c.value.point;a.Wb.add(d,Qh());d.Zl(-e.x,-e.y)}b.Yf()}}
qh.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new y);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.qx&&(this.oI||null===c||null!==this.g&&this.g.R.up)&&(e=v.K(),c=e,c.assign(b),null!==a)){var f=this.g;if(null!==f){var h=f.Bn,k=this.OE,f=k.width,k=k.height,l=this.ZH,m=l.x,l=l.y,n=this.YH;if(null!==h){var p=h.lx;isNaN(f)&&(f=p.width);isNaN(k)&&(k=p.height);h=h.NE;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=v.xb(0,0);h.Du(0,0,f,k,n);Pa(b.x,b.y,m+h.x,l+h.y,f,k,c);v.v(h)}}c=
null!==a.sE?a.sE(a,b,e):e;k=a.OI;f=k.x;isNaN(f)&&(f=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.II;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.l(Math.max(f,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&v.v(e);return d};function Ai(a,b){if(null===b)return!0;var c=b.V;return null===c||c instanceof mh||c.layer.Mc||a.Wb&&a.Wb.contains(c)||a.bc&&a.bc.contains(c)?!0:!1}
function Bi(a,b,c,d){var e=a.g;if(null!==e){a.jj&&(null!==a.gd&&(a.gd.W=null,a.gd.aa=null),Ci(a,!1));var f=Di(e,b,null,function(b){return!Ai(a,b)}),h=e.R;h.Pe=f;var k=e.wb,l=!1;try{e.wb=!0;l=Xh(a,h,f);if(!a.ta&&null===Mh)return;if(null===f){var m=e.TI;null!==m&&(m(h),l=!0)}if(!a.ta&&null===Mh)return;a.doDragOver(b,f);if(!a.ta&&null===Mh)return}finally{e.wb=k,l&&e.Yf()}(e.oe||e.pe)&&(c||d)&&e.Wz(h.ef)}}
function Xh(a,b,c){var d=!1,e=a.Ij.length,f=0<e?a.Ij[0]:null;if(c===f)return!1;b.Cc=!1;for(var h=0;h<e;h++){var k=a.Ij[h],l=k.SI;if(null!==l&&(l(b,k,c),d=!0,b.Cc))break}a.Ij.length=0;if(!a.ta&&null===Mh||null===c)return d;for(b.Cc=!1;null!==c;)a.Ij.push(c),c=Ei(c);e=a.Ij.length;for(h=0;h<e&&(k=a.Ij[h],l=k.RI,null===l||(l(b,k,f),d=!0,!b.Cc));h++);return d}function Ei(a){var b=a.N;return null!==b?b:a instanceof S&&!(a instanceof V)&&(a=a.La,null!==a&&a.cI)?a:null}
function Fi(a,b,c){var d=a.Yi;if(null===d)return null;var e=a.g.un(b,d.wF,function(a){return d.findValidLinkablePort(a,c)});a=v.K();for(var f=Infinity,h=null,e=e.i;e.next();){var k=e.value;if(null!==k.V){var l=k.Va(Gb,a),l=b.wf(l);l<f&&(h=k,f=l)}}v.v(a);return h}
function Ci(a,b){var c=a.gd;if(null!==c&&!(2>c.ra)){var d=a.g;if(null!==d&&!d.bb&&(d=a.Yi,null!==d)){var e=null,f=null;null===c.W&&(e=Fi(a,c.m(0),!1),null!==e&&(f=e.V));var h=null,k=null;null===c.aa&&(h=Fi(a,c.m(c.ra-1),!0),null!==h&&(k=h.V));d.isValidLink(f,e,k,h)?b?(c.Kp=c.m(0),c.Lp=c.m(c.ra-1),c.zj=!1,c.W=f,null!==e&&(c.Ig=e.Qd),c.aa=k,null!==h&&(c.Eh=h.Qd)):Gi(d,f,e,k,h):Gi(d,null,null,null,null)}}}qh.prototype.doDragOver=function(){};
function Hi(a,b){var c=a.g;if(null!==c){a.jj&&Ci(a,!0);Th(a);var d=Di(c,b,null,function(b){return!Ai(a,b)}),e=c.R;e.Pe=d;if(null!==d){e.Cc=!1;for(var f=d;null!==f;){var h=f.AA;if(null!==h&&(h(e,f),e.Cc))break;f=Ei(f)}}else h=c.AA,null!==h&&h(e);if(a.ta||null!==Mh){for(e=(a.bc||a.Wb).i;e.next();)f=e.key,f instanceof T&&f.ge.each(function(a){a.zj=!1});a.doDropOnto(b,d);if(a.ta||null!==Mh){d=v.Ef();for(e=c.selection.i;e.next();)f=e.value,f instanceof T&&Ii(c,f.getAvoidableRect(d));v.Gb(d)}}}}
qh.prototype.doDropOnto=function(){};qh.prototype.doMouseMove=function(){if(this.ta){var a=this.g;if(null!==a&&null!==this.sn&&null!==this.Wb){var b=!1,c=!1;this.mayCopy()?(b=!0,a.cc="copy",vi(this,!1),this.at(this.bc),wi(this,this.bc,!1),this.gp(this.bc)):this.mayMove()?(c=!0,a.cc="default",Wh(this),wi(this,this.Wb,!0)):this.mayDragOut()?(a.cc="no-drop",vi(this,!1),wi(this,this.bc,!1)):Wh(this);Bi(this,a.R.da,c,b)}}};
qh.prototype.doMouseUp=function(){if(this.ta){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.bc?(Wh(this),vi(this,!0),this.at(this.bc),wi(this,this.bc,!1),this.gp(this.bc),null!==this.bc&&a.PF(this.bc.Bj())):(b=!0,Wh(this),this.mayMove()&&(wi(this,this.Wb,!0),Bi(this,a.R.da,!0,!1)));this.mr=!0;Hi(this,a.R.da);if(this.ta){this.bc=null;if(b&&null!==this.Wb)for(b=this.Wb.i;b.next();){var d=b.key;d instanceof T&&(d=d.La,null===d||null===d.placeholder||this.Wb.contains(d)||d.placeholder.I())}a.tc();
this.gp(this.Wb);this.Gf=c?"Copy":"Move";a.Ca(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};qh.prototype.mayCopy=function(){if(!this.XE)return!1;var a=this.g;if(null===a||a.bb||a.zf||!a.Bp||!a.qk||(v.Dk?!a.R.alt:!a.R.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canCopy())return!0}return null!==this.gd&&this.jj&&this.gd.canCopy()?!0:!1};
qh.prototype.mayDragOut=function(){if(!this.XE)return!1;var a=this.g;if(null===a||!a.ut||!a.qk||a.Bl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canCopy())return!0}return null!==this.gd&&this.jj&&this.gd.canCopy()?!0:!1};qh.prototype.mayMove=function(){var a=this.g;if(null===a||a.bb||!a.Bl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canMove())return!0}return null!==this.gd&&this.jj&&this.gd.canMove()?!0:!1};var Uh=new I(qh),Mh=null,Nh=null;
qh.prototype.getDraggingSource=function(){return Mh};qh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.XD||a.bb||a.zf||!a.Bp)return!1;var b=Mh;return null===b||null===b.g||b.g.ca.Il!==a.ca.Il?!1:!0};qh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Qa.oi();Ji(a);a=Mh;null!==a&&null!==a.g&&(a.g.cc="copy")}};qh.prototype.doSimulatedDragLeave=function(){var a=Mh;null!==a&&a.doSimulatedDragOut();this.doCancel()};
qh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Mh;null!==b&&null!==b.Wb&&this.mayDragIn()&&(a.cc="copy",Ki(this,b.Wb.Bj(),!1),wi(this,this.bc,!1),Bi(this,a.R.da,!1,!0))}};
qh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Mh;if(null!==b){var c=b.g;b.mr=!0;Wh(this);this.mayDragIn()&&(this.Tb("Drop"),Ki(this,b.Wb.Bj(),!0),wi(this,this.bc,!1),null!==this.bc&&a.PF(this.bc.Bj()),Hi(this,a.R.da),a.tc(),b=a.selection,null!==this.bc?this.Gf="ExternalCopy":b=new J(S),this.bc=null,a.doFocus(),a.Ca("ExternalObjectsDropped",b,c),this.Ik())}}};
function Ki(a,b,c){if(null===a.bc){var d=a.g;if(null!==d&&!d.bb&&!d.zf){d.wb=!c;d.Fq=!c;a.Hk=d.R.da;d=d.Jp(b,d,!0);c=v.Ef();ui(b,c);var e=c.x+c.width/2,f=c.y+c.height/2;v.Gb(c);var h=a.tw;c=new la(S);var k=v.K();for(b=b.i;b.next();){var l=b.value;if(l.ee()&&l.canCopy()){var m=l.location,l=d.na(l);k.l(h.x-(e-m.x),h.y-(f-m.y));l.location=k;l.af();c.add(l,Qh(k))}}v.v(k);for(d=d.i;d.next();)e=d.value,e instanceof W&&e.canCopy()&&c.add(e,Qh());a.bc=c;Lh(a,c.Bj());null!==a.gd&&(c=a.gd,d=c.Rn,c.Zl(a.Hk.x-
(d.x+d.width/2),a.Hk.y-(d.y+d.height/2)))}}}qh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.cc="":a.cc="no-drop")};function Rh(a){this.point=a;this.UF=$c}v.ga("DraggingInfo",Rh);function xi(a,b,c){this.Qc=a;this.info=b;this.$H=c}
function Li(){0<arguments.length&&v.ld(Li);rg.call(this);this.iD=100;this.KC=!1;var a=new W,b=new X;b.Vf=!0;b.stroke="blue";a.add(b);b=new X;b.zq="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.Xf="Tool";this.BD=a;a=new T;b=new X;b.Qd="";b.Cb="Rectangle";b.fill=null;b.stroke="magenta";b.fb=2;b.Ba=nd;a.add(b);a.bm=!1;a.Xf="Tool";this.zD=a;this.AD=b;a=new T;b=new X;b.Qd="";b.Cb="Rectangle";b.fill=null;b.stroke="magenta";b.fb=2;b.Ba=nd;a.add(b);a.bm=!1;a.Xf="Tool";this.CD=a;this.DD=b;this.gD=this.fD=
this.bD=this.aD=this.cD=null;this.GC=!0;this.QG=new la(G,"boolean");this.jD=this.ml=this.wD=null}v.Ma(Li,rg);v.ga("LinkingBaseTool",Li);Li.prototype.doStop=function(){var a=this.g;null!==a&&Sh(a);this.Pg=this.Og=this.Ng=this.Mg=this.nc=null;this.by.clear();this.Df=null};v.defineProperty(Li,{wF:"portGravity"},function(){return this.iD},function(a){v.j(a,"number",Li,"portGravity");0<=a&&(this.iD=a)});
v.defineProperty(Li,{$p:"isUnconnectedLinkValid"},function(){return this.KC},function(a){v.j(a,"boolean",Li,"isUnconnectedLinkValid");this.KC=a});v.defineProperty(Li,{Vg:"temporaryLink"},function(){return this.BD},function(a){v.F(a,W,Li,"temporaryLink");this.BD=a});v.defineProperty(Li,{Rd:"temporaryFromNode"},function(){return this.zD},function(a){v.F(a,T,Li,"temporaryFromNode");this.zD=a});
v.defineProperty(Li,{Wn:"temporaryFromPort"},function(){return this.AD},function(a){v.F(a,G,Li,"temporaryFromPort");this.AD=a});v.defineProperty(Li,{Sd:"temporaryToNode"},function(){return this.CD},function(a){v.F(a,T,Li,"temporaryToNode");this.CD=a});v.defineProperty(Li,{Xn:"temporaryToPort"},function(){return this.DD},function(a){v.F(a,G,Li,"temporaryToPort");this.DD=a});v.defineProperty(Li,{nc:"originalLink"},function(){return this.cD},function(a){null!==a&&v.F(a,W,Li,"originalLink");this.cD=a});
v.defineProperty(Li,{Mg:"originalFromNode"},function(){return this.aD},function(a){null!==a&&v.F(a,T,Li,"originalFromNode");this.aD=a});v.defineProperty(Li,{Ng:"originalFromPort"},function(){return this.bD},function(a){null!==a&&v.F(a,G,Li,"originalFromPort");this.bD=a});v.defineProperty(Li,{Og:"originalToNode"},function(){return this.fD},function(a){null!==a&&v.F(a,T,Li,"originalToNode");this.fD=a});
v.defineProperty(Li,{Pg:"originalToPort"},function(){return this.gD},function(a){null!==a&&v.F(a,G,Li,"originalToPort");this.gD=a});v.defineProperty(Li,{Nd:"isForwards"},function(){return this.GC},function(a){v.j(a,"boolean",Li,"isForwards");this.GC=a});v.u(Li,{by:"validPortsCache"},function(){return this.QG});v.defineProperty(Li,{Df:"targetPort"},function(){return this.wD},function(a){null!==a&&v.F(a,G,Li,"targetPort");this.wD=a});
Li.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.Ba=b.Y.size;e?(d.Bb=b.Bb,d.hm=b.hm):(d.Ab=b.Ab,d.Pl=b.Pl);c.pf=Gb;var f=v.K();c.location=b.Va(Gb,f);v.v(f);d.angle=b.xn();null!==this.Kx&&this.Kx(a,b,c,d,e)}};Li.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.Ba=nd,b.Ab=vb,b.Bb=vb);null!==a&&null!==this.g&&(a.location=this.g.R.da);null!==this.Kx&&this.Kx(null,null,a,b,c)};Li.prototype.doMouseDown=function(){this.ta&&this.doMouseMove()};
Li.prototype.doMouseMove=function(){if(this.ta){var a=this.g;if(null!==a){this.Df=this.findTargetPort(this.Nd);if(null!==this.Df&&this.Df.V instanceof T){var b=this.Df.V;this.Nd?this.copyPortProperties(b,this.Df,this.Sd,this.Xn,!0):this.copyPortProperties(b,this.Df,this.Rd,this.Wn,!1)}else this.Nd?this.setNoTargetPortProperties(this.Sd,this.Xn,!0):this.setNoTargetPortProperties(this.Rd,this.Wn,!1);(a.oe||a.pe)&&a.Wz(a.R.ef)}}};
Li.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.V;if(!(c instanceof T))return null;for(;null!==a;){var d=b?a.cG:a.EE;if(!0===d&&(null!==a.Qd||a instanceof T)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.N}return null};
Li.prototype.findTargetPort=function(a){var b=this.g,c=b.R.da,d=this.wF;0>=d&&(d=.1);for(var e=this,f=b.un(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,f=f.i;f.next();){var h=f.value,k=h.V;if(k instanceof T){var l=h.Va(Gb,v.K()),m=c.x-l.x,n=c.y-l.y;v.v(l);l=m*m+n*n;l<d&&(m=this.by.na(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.Mg,this.Ng,k,h)||!a&&this.isValidLink(k,h,this.Og,this.Pg)?(this.by.add(h,!0),b=h,d=l):this.by.add(h,!1))}}return null!==b&&(c=b.V,
c instanceof T&&(null===c.layer||c.layer.vt))?b:null};Li.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.$p;if(null!==this.g&&this.g.Ya===this&&(null!==a.layer&&!a.layer.vt||!0!==b.EE))return!1;var c=b.dA;if(Infinity>c){if(null!==this.nc&&a===this.Mg&&b===this.Ng)return!0;var d=b.Qd;null===d&&(d="");if(a.bx(d).count>=c)return!1}return!0};
Li.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.$p;if(null!==this.g&&this.g.Ya===this&&(null!==a.layer&&!a.layer.vt||!0!==b.cG))return!1;var c=b.OJ;if(Infinity>c){if(null!==this.nc&&a===this.Og&&b===this.Pg)return!0;var d=b.Qd;null===d&&(d="");if(a.Hg(d).count>=c)return!1}return!0};Li.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.V,d=b.V;return null!==c&&c===d};
Li.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.V;if(!(c instanceof T))return!1;var d=a.Qd;null===d&&(d="");var e=b.V;if(!(e instanceof T))return!1;var f=b.Qd;null===f&&(f="");for(e=e.Hg(f);e.next();)if(f=e.value,f.W===c&&f.Ig===d)return!0;return!1};
Li.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.QH&&d.NJ||!this.isInSameNode(b,d))&&(b.PH&&d.MJ||!this.isLinked(b,d)))||null!==this.nc&&(null!==a&&this.isLabelDependentOnLink(a,this.nc)||null!==c&&this.isLabelDependentOnLink(c,this.nc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.nc))return!1;if(null!==a){var e=a.Bx;if(null!==e&&!e(a,b,c,d,this.nc))return!1}if(null!==
c&&(e=c.Bx,null!==e&&!e(a,b,c,d,this.nc)))return!1;e=this.Bx;return null!==e?e(a,b,c,d,this.nc):!0};Li.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Oc;if(null===c)return!1;if(c===b)return!0;var d=new J(T);d.add(a);return Mi(this,c,b,d)};function Mi(a,b,c,d){if(b===c)return!0;var e=b.W;if(null!==e&&e.of&&(d.add(e),Mi(a,e.Oc,c,d)))return!0;b=b.aa;return null!==b&&b.of&&(d.add(b),Mi(a,b.Oc,c,d))?!0:!1}
Li.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.$p;var d=null!==this.g?this.g.UJ:Ni;if(d!==Ni){if(d===Oi){if(null!==c&&!c.Nc)return!0;for(d=b.ge;d.next();){var e=d.value;if(e!==c&&e.Nc&&e.aa===b)return!1}return!Pi(this,a,b,c,!0)}if(d===Qi){if(null!==c&&!c.Nc)return!0;for(d=a.ge;d.next();)if(e=d.value,e!==c&&e.Nc&&e.W===a)return!1;return!Pi(this,a,b,c,!0)}if(d===Ri)return a===b?a=!0:(d=new J(T),d.add(b),a=Si(this,d,a,b,c)),!a;if(d===Ti)return!Pi(this,
a,b,c,!1);if(d===Ui)return a===b?a=!0:(d=new J(T),d.add(b),a=Vi(this,d,a,b,c)),!a}return!0};function Pi(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.ge;f.next();){var h=f.value;if(h!==d&&(!e||h.Nc)&&h.aa===b&&(h=h.W,h!==b&&Pi(a,h,c,d,e)))return!0}return!1}function Si(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.ge;f.next();){var h=f.value;if(h!==e&&h.aa===c&&(h=h.W,h!==c&&Si(a,b,h,d,e)))return!0}return!1}
function Vi(a,b,c,d,e){if(c===d)return!0;if(null===c||null===d||b.contains(c))return!1;b.add(c);for(var f=c.ge;f.next();){var h=f.value;if(h!==e){var k=h.W,h=h.aa,k=k===c?h:k;if(k!==c&&Vi(a,b,k,d,e))return!0}}return!1}v.defineProperty(Li,{Bx:"linkValidation"},function(){return this.ml},function(a){null!==a&&v.j(a,"function",Li,"linkValidation");this.ml=a});v.defineProperty(Li,{Kx:"portTargeted"},function(){return this.jD},function(a){null!==a&&v.j(a,"function",Li,"portTargeted");this.jD=a});
function Wi(){0<arguments.length&&v.ld(Wi);Li.call(this);this.name="Linking";this.FB={};this.EB=null;this.ba=Xi;this.sD=null}v.Ma(Wi,Li);v.ga("LinkingTool",Wi);var Xi;Wi.Either=Xi=v.p(Wi,"Either",0);var Yi;Wi.ForwardsOnly=Yi=v.p(Wi,"ForwardsOnly",0);var Zi;Wi.BackwardsOnly=Zi=v.p(Wi,"BackwardsOnly",0);v.defineProperty(Wi,{cH:"archetypeLinkData"},function(){return this.FB},function(a){null!==a&&v.F(a,Object,Wi,"archetypeLinkData");a instanceof G&&v.F(a,W,Wi,"archetypeLinkData");this.FB=a});
v.defineProperty(Wi,{$D:"archetypeLabelNodeData"},function(){return this.EB},function(a){null!==a&&v.F(a,Object,Wi,"archetypeLabelNodeData");a instanceof G&&v.F(a,T,Wi,"archetypeLabelNodeData");this.EB=a});v.defineProperty(Wi,{direction:"direction"},function(){return this.ba},function(a){v.nb(a,Wi,Wi,"direction");this.ba=a});v.defineProperty(Wi,{YF:"startObject"},function(){return this.sD},function(a){null!==a&&v.F(a,G,Wi,"startObject");this.sD=a});
Wi.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.bb||a.zf||!a.vt)return!1;var b=a.ca;return(b instanceof Q||b instanceof Yf)&&a.R.left&&(a.Ya===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
Wi.prototype.findLinkablePort=function(){var a=this.g;if(null===a)return null;var b=this.YF;null===b&&(b=a.Ke(a.Bc.da,null,null));if(null===b||!(b.V instanceof T))return null;a=this.direction;if(a===Xi||a===Yi){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.Nd=!0,c}if(a===Xi||a===Zi)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.Nd=!1,c;return null};
Wi.prototype.doActivate=function(){var a=this.g;if(null!==a){var b=this.findLinkablePort();null!==b&&(this.Tb(this.name),a.bf=!0,a.cc="pointer",this.Nd?(null===this.Sd||this.Sd.location.H()||(this.Sd.location=a.R.da),this.Ng=b,b=this.Ng.V,b instanceof T&&(this.Mg=b),this.copyPortProperties(this.Mg,this.Ng,this.Rd,this.Wn,!1)):(null===this.Rd||this.Rd.location.H()||(this.Rd.location=a.R.da),this.Pg=b,b=this.Pg.V,b instanceof T&&(this.Og=b),this.copyPortProperties(this.Og,this.Pg,this.Sd,this.Xn,!0)),
a.add(this.Rd),a.add(this.Sd),null!==this.Vg&&(null!==this.Rd&&(this.Vg.W=this.Rd),null!==this.Sd&&(this.Vg.aa=this.Sd),this.Vg.Xb(),a.add(this.Vg)),this.ta=!0)}};Wi.prototype.doDeactivate=function(){this.ta=!1;var a=this.g;null!==a&&(a.remove(this.Vg),a.remove(this.Rd),a.remove(this.Sd),a.bf=!1,a.cc="",this.Ik())};Wi.prototype.doStop=function(){Li.prototype.doStop.call(this);this.YF=null};
Wi.prototype.doMouseUp=function(){if(this.ta){var a=this.g;if(null===a)return;var b=this.Gf=null,c=null,d=null,e=null,f=this.Df=this.findTargetPort(this.Nd);if(null!==f){var h=f.V;h instanceof T&&(this.Nd?(null!==this.Mg&&(b=this.Mg,c=this.Ng),d=h,e=f):(b=h,c=f,null!==this.Og&&(d=this.Og,e=this.Pg)))}else this.Nd?null!==this.Mg&&this.$p&&(b=this.Mg,c=this.Ng):null!==this.Og&&this.$p&&(d=this.Og,e=this.Pg);null!==b||null!==d?(h=this.insertLink(b,c,d,e),null!==h?(null===f&&(this.Nd?h.Lp=a.R.da:h.Kp=
a.R.da),a.vf&&a.select(h),this.Gf=this.name,a.Ca("LinkDrawn",h)):(a.ca.dE(),this.doNoLink(b,c,d,e))):this.Nd?this.doNoLink(this.Mg,this.Ng,null,null):this.doNoLink(null,null,this.Og,this.Pg)}this.stopTool()};
Wi.prototype.insertLink=function(a,b,c,d){var e=this.g;if(null===e)return null;var f=e.ca;if(f instanceof Yf){var h=a;b=c;e.Pd||(h=c,b=a);if(null!==h&&null!==b)return f.ni(b.data,f.ub(h.data)),b.vn()}else if(f instanceof Q)if(h="",null!==a&&(null===b&&(b=a),h=b.Qd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.Qd,null===b&&(b="")),d=this.cH,d instanceof W){if(oh(d),f=d.copy(),null!==f)return f.W=a,f.Ig=h,f.aa=c,f.Eh=b,e.add(f),a=this.$D,a instanceof T&&(oh(a),a=a.copy(),null!==a&&(a.Oc=f,e.add(a))),
f}else if(null!==d&&(d=f.Qw(d),v.Ta(d)))return null!==a&&f.WA(d,f.ub(a.data)),f.XA(d,h),null!==c&&f.bB(d,f.ub(c.data)),f.cB(d,b),f.qt(d),a=this.$D,null===a||a instanceof T||(a=f.copyNodeData(a),v.Ta(a)&&(f.yl(a),a=f.ub(a),void 0!==a&&f.VD(d,a))),f=e.Rf(d);return null};Wi.prototype.doNoLink=function(){};
function Oh(){0<arguments.length&&v.ld(Oh);Li.call(this);this.name="Relinking";var a=new X;a.Cb="Diamond";a.Ba=vd;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Ne=0;this.tC=a;a=new X;a.Cb="Diamond";a.Ba=vd;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Ne=-1;this.ED=a;this.gc=null;this.dD=new B}v.Ma(Oh,Li);v.ga("RelinkingTool",Oh);
Oh.prototype.updateAdornments=function(a){if(null!==a&&a instanceof W){var b="RelinkFrom",c=null;if(a.cb&&null!==this.g&&!this.g.bb){var d=a.Au;null!==d&&a.canRelinkFrom()&&a.Y.H()&&a.isVisible()&&d.Y.H()&&d.rj()&&(c=a.Pp(b),null===c&&(c=this.makeAdornment(d,!1),null!==c&&(c.kc=b),a.xl(b,c)))}null===c&&a.wj(b);b="RelinkTo";c=null;a.cb&&null!==this.g&&!this.g.bb&&(d=a.Au,null!==d&&a.canRelinkTo()&&a.Y.H()&&a.isVisible()&&d.Y.H()&&d.rj()&&(c=a.Pp(b),null===c&&(c=this.makeAdornment(d,!0),null!==c&&(c.kc=
b),a.xl(b,c))));null===c&&a.wj(b)}};Oh.prototype.makeAdornment=function(a,b){var c=new mh;c.type=$i;var d=b?this.LJ:this.OH;null!==d&&c.add(d.copy());c.rb=a;return c};v.defineProperty(Oh,{OH:"fromHandleArchetype"},function(){return this.tC},function(a){null!==a&&v.F(a,G,Oh,"fromHandleArchetype");this.tC=a});v.defineProperty(Oh,{LJ:"toHandleArchetype"},function(){return this.ED},function(a){null!==a&&v.F(a,G,Oh,"toHandleArchetype");this.ED=a});v.u(Oh,{handle:"handle"},function(){return this.gc});
Oh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.bb||a.zf||!a.hn)return!1;var b=a.ca;if(!(b instanceof Q||b instanceof Yf)||!a.R.left)return!1;b=this.findToolHandleAt(a.Bc.da,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Bc.da,"RelinkTo"));return null!==b};
Oh.prototype.doActivate=function(){var a=this.g;if(null!==a){if(null===this.nc){var b=this.findToolHandleAt(a.Bc.da,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Bc.da,"RelinkTo"));if(null===b)return;var c=b.V;if(!(c instanceof mh&&c.Of instanceof W))return;this.gc=b;this.Nd=null===c||"RelinkTo"===c.kc;this.nc=c.Of}this.Tb(this.name);a.bf=!0;a.cc="pointer";this.Ng=this.nc.hd;this.Mg=this.nc.W;this.Pg=this.nc.Td;this.Og=this.nc.aa;this.dD.set(this.nc.Y);null!==this.nc&&0<this.nc.ra&&(null===this.nc.W&&
(null!==this.Wn&&(this.Wn.Ba=md),null!==this.Rd&&(this.Rd.location=this.nc.m(0))),null===this.nc.aa&&(null!==this.Xn&&(this.Xn.Ba=md),null!==this.Sd&&(this.Sd.location=this.nc.m(this.nc.ra-1))));this.copyPortProperties(this.Mg,this.Ng,this.Rd,this.Wn,!1);this.copyPortProperties(this.Og,this.Pg,this.Sd,this.Xn,!0);a.add(this.Rd);a.add(this.Sd);null!==this.Vg&&(null!==this.Rd&&(this.Vg.W=this.Rd),null!==this.Sd&&(this.Vg.aa=this.Sd),this.copyLinkProperties(this.nc,this.Vg),this.Vg.Xb(),a.add(this.Vg));
this.ta=!0}};Oh.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.st=a.st;b.Sz=a.Sz;var c=a.Ze;if(c===aj||c===bj)c=cj;b.Ze=c;b.Tw=a.Tw;b.Sx=a.Sx;b.wq=a.wq;b.Ab=a.Ab;b.Pl=a.Pl;b.Ot=a.Ot;b.Pt=a.Pt;b.Bb=a.Bb;b.hm=a.hm;b.Hu=a.Hu;b.Iu=a.Iu}};Oh.prototype.doDeactivate=function(){this.ta=!1;var a=this.g;null!==a&&(a.remove(this.Vg),a.remove(this.Rd),a.remove(this.Sd),a.bf=!1,a.cc="",this.Ik())};Oh.prototype.doStop=function(){Li.prototype.doStop.call(this);this.gc=null};
Oh.prototype.doMouseUp=function(){if(this.ta){var a=this.g;if(null===a)return;this.Gf=null;var b=this.Mg,c=this.Ng,d=this.Og,e=this.Pg,f=this.nc;this.Df=this.findTargetPort(this.Nd);if(null!==this.Df){var h=this.Df.V;h instanceof T&&(this.Nd?(d=h,e=this.Df):(b=h,c=this.Df))}else this.$p?this.Nd?e=d=null:c=b=null:f=null;null!==f?(this.reconnectLink(f,this.Nd?d:b,this.Nd?e:c,this.Nd),null===this.Df&&(this.Nd?f.Lp=a.R.da:f.Kp=a.R.da,f.Xb()),a.vf&&(f.cb=!0),this.Gf=this.name,a.Ca("LinkRelinked",f,this.Nd?
this.Pg:this.Ng)):this.doNoRelink(this.nc,this.Nd);dj(this.nc,this.dD)}this.stopTool()};Oh.prototype.reconnectLink=function(a,b,c,d){if(null===this.g)return!1;c=null!==c&&null!==c.Qd?c.Qd:"";d?(a.aa=b,a.Eh=c):(a.W=b,a.Ig=c);return!0};Oh.prototype.doNoRelink=function(){};function Gi(a,b,c,d,e){null!==a.g&&(null!==b?(a.copyPortProperties(b,c,a.Rd,a.Wn,!1),a.g.add(a.Rd)):a.g.remove(a.Rd),null!==d?(a.copyPortProperties(d,e,a.Sd,a.Xn,!0),a.g.add(a.Sd)):a.g.remove(a.Sd))}
function ej(){0<arguments.length&&v.ld(ej);rg.call(this);this.name="LinkReshaping";var a=new X;a.Cb="Rectangle";a.Ba=ud;a.fill="lightblue";a.stroke="dodgerblue";this.bl=a;a=new X;a.Cb="Diamond";a.Ba=ud;a.fill="lightblue";a.stroke="dodgerblue";this.RC=a;this.kD=3;this.ty=this.gc=null;this.cp=new y;this.$v=null}v.Ma(ej,rg);v.ga("LinkReshapingTool",ej);var fj;ej.None=fj=v.p(ej,"None",0);var gj;ej.Horizontal=gj=v.p(ej,"Horizontal",1);var hj;ej.Vertical=hj=v.p(ej,"Vertical",2);var ij;
ej.All=ij=v.p(ej,"All",3);ej.prototype.getReshapingBehavior=ej.prototype.IE=function(a){return a&&a.lD?a.lD:fj};ej.prototype.setReshapingBehavior=ej.prototype.Cu=function(a,b){v.F(a,G,ej,"setReshapingBehavior:obj");v.nb(b,ej,ej,"setReshapingBehavior:behavior");a.lD=b};
ej.prototype.updateAdornments=function(a){if(null!==a&&a instanceof W){if(a.cb&&null!==this.g&&!this.g.bb){var b=a.path;if(null!==b&&a.canReshape()&&a.Y.H()&&a.isVisible()&&b.Y.H()&&b.rj()){var c=a.Pp(this.name);if(null===c||c.FG!==a.ra||c.SG!==a.wu)c=this.makeAdornment(b),null!==c&&(c.FG=a.ra,c.SG=a.wu,a.xl(this.name,c));if(null!==c){c.location=a.position;return}}}a.wj(this.name)}};
ej.prototype.makeAdornment=function(a){var b=a.V,c=b.ra,d=b.mc,e=null;if(null!==b.points&&1<c){e=new mh;e.type=$i;var c=b.Kt,f=b.yx,h=d?1:0;if(b.wu&&b.Ze!==jj)for(var k=c+h;k<f-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.Ne=k,l.TA=.5,l.dA=999,e.add(l))}for(k=c+1;k<f;k++)if(l=this.makeHandle(a,k),null!==l){l.Ne=k;if(k!==c)if(k===c+1&&d){var h=b.m(c),m=b.m(c+1);K(h.x,m.x)&&K(h.y,m.y)&&(m=b.m(c-1));K(h.x,m.x)?(this.Cu(l,hj),l.cursor="n-resize"):K(h.y,m.y)&&(this.Cu(l,gj),l.cursor="w-resize")}else k===
f-1&&d?(h=b.m(f-1),m=b.m(f),K(h.x,m.x)&&K(h.y,m.y)&&(h=b.m(f+1)),K(h.x,m.x)?(this.Cu(l,hj),l.cursor="n-resize"):K(h.y,m.y)&&(this.Cu(l,gj),l.cursor="w-resize")):k!==f&&(this.Cu(l,ij),l.cursor="move");e.add(l)}e.kc=this.name;e.rb=a}return e};ej.prototype.makeHandle=function(){var a=this.Rt;return null===a?null:a.copy()};v.defineProperty(ej,{Rt:"handleArchetype"},function(){return this.bl},function(a){null!==a&&v.F(a,G,ej,"handleArchetype");this.bl=a});
ej.prototype.makeResegmentHandle=function(){var a=this.NI;return null===a?null:a.copy()};v.defineProperty(ej,{NI:"midHandleArchetype"},function(){return this.RC},function(a){null!==a&&v.F(a,G,ej,"midHandleArchetype");this.RC=a});v.u(ej,{handle:"handle"},function(){return this.gc});v.u(ej,{tt:"adornedLink"},function(){return this.ty});ej.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.bb&&a.Iw&&a.R.left?null!==this.findToolHandleAt(a.Bc.da,this.name):!1};
ej.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.gc=this.findToolHandleAt(a.Bc.da,this.name),null!==this.gc)){var b=this.gc.V.Of;if(b instanceof W){this.ty=b;a.bf=!0;this.Tb(this.name);if(b.wu&&999===this.gc.dA){var c=b.points.copy(),d=this.gc.Va(Gb);c.Md(this.gc.Ne+1,d);b.mc&&c.Md(this.gc.Ne+1,d);b.points=c;b.de();this.gc=this.findToolHandleAt(a.Bc.da,this.name);if(null===this.gc){this.doDeactivate();return}}this.cp=b.m(this.gc.Ne);this.$v=b.points.copy();this.ta=!0}}};
ej.prototype.doDeactivate=function(){this.Ik();this.ty=this.gc=null;var a=this.g;null!==a&&(a.bf=!1);this.ta=!1};ej.prototype.doCancel=function(){var a=this.tt;null!==a&&(a.points=this.$v);this.stopTool()};ej.prototype.doMouseMove=function(){var a=this.g;this.ta&&null!==a&&(a=this.computeReshape(a.R.da),this.reshape(a))};
ej.prototype.doMouseUp=function(){var a=this.g;if(this.ta&&null!==a){var b=this.computeReshape(a.R.da);this.reshape(b);b=this.tt;if(null!==b&&b.wu){var c=this.handle.Ne,d=b.m(c-1),e=b.m(c),f=b.m(c+1);if(b.mc){if(c>b.Kt+1&&c<b.yx-1){var h=b.m(c-2);if(Math.abs(d.x-e.x)<this.Ch&&Math.abs(d.y-e.y)<this.Ch&&(kj(this,h,d,e,f,!0)||kj(this,h,d,e,f,!1))){var k=b.points.copy();kj(this,h,d,e,f,!0)?(k.Rg(c-2,new y(h.x,(f.y+h.y)/2)),k.Rg(c+1,new y(f.x,(f.y+h.y)/2))):(k.Rg(c-2,new y((f.x+h.x)/2,h.y)),k.Rg(c+1,
new y((f.x+h.x)/2,f.y)));k.$c(c);k.$c(c-1);b.points=k;b.de()}else h=b.m(c+2),Math.abs(e.x-f.x)<this.Ch&&Math.abs(e.y-f.y)<this.Ch&&(kj(this,d,e,f,h,!0)||kj(this,d,e,f,h,!1))&&(k=b.points.copy(),kj(this,d,e,f,h,!0)?(k.Rg(c-1,new y(d.x,(d.y+h.y)/2)),k.Rg(c+2,new y(h.x,(d.y+h.y)/2))):(k.Rg(c-1,new y((d.x+h.x)/2,d.y)),k.Rg(c+2,new y((d.x+h.x)/2,h.y))),k.$c(c+1),k.$c(c),b.points=k,b.de())}}else h=v.K(),Oa(d.x,d.y,f.x,f.y,e.x,e.y,h)&&h.wf(e)<this.Ch*this.Ch&&(k=b.points.copy(),k.$c(c),b.points=k,b.de()),
v.v(h)}a.tc();this.Gf=this.name;a.Ca("LinkReshaped",this.tt,this.$v)}this.stopTool()};function kj(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.Ch&&Math.abs(c.y-d.y)<a.Ch&&Math.abs(d.y-e.y)<a.Ch:Math.abs(b.x-c.x)<a.Ch&&Math.abs(c.x-d.x)<a.Ch&&Math.abs(d.x-e.x)<a.Ch}v.defineProperty(ej,{Ch:"resegmentingDistance"},function(){return this.kD},function(a){v.j(a,"number",ej,"resegmentingDistance");this.kD=a});
ej.prototype.reshape=function(a){var b=this.tt;b.dm();var c=this.handle.Ne,d=this.IE(this.handle);if(b.mc)if(c===b.Kt+1)c=b.Kt+1,d===hj?(b.ea(c,b.m(c-1).x,a.y),b.ea(c+1,b.m(c+2).x,a.y)):d===gj&&(b.ea(c,a.x,b.m(c-1).y),b.ea(c+1,a.x,b.m(c+2).y));else if(c===b.yx-1)c=b.yx-1,d===hj?(b.ea(c-1,b.m(c-2).x,a.y),b.ea(c,b.m(c+1).x,a.y)):d===gj&&(b.ea(c-1,a.x,b.m(c-2).y),b.ea(c,a.x,b.m(c+1).y));else{var d=c,e=b.m(d),f=b.m(d-1),h=b.m(d+1);K(f.x,e.x)&&K(e.y,h.y)?(K(f.x,b.m(d-2).x)&&!K(f.y,b.m(d-2).y)?(b.w(d,a.x,
f.y),c++,d++):b.ea(d-1,a.x,f.y),K(h.y,b.m(d+2).y)&&!K(h.x,b.m(d+2).x)?b.w(d+1,h.x,a.y):b.ea(d+1,h.x,a.y)):K(f.y,e.y)&&K(e.x,h.x)?(K(f.y,b.m(d-2).y)&&!K(f.x,b.m(d-2).x)?(b.w(d,f.x,a.y),c++,d++):b.ea(d-1,f.x,a.y),K(h.x,b.m(d+2).x)&&!K(h.y,b.m(d+2).y)?b.w(d+1,a.x,h.y):b.ea(d+1,a.x,h.y)):K(f.x,e.x)&&K(e.x,h.x)?(K(f.x,b.m(d-2).x)&&!K(f.y,b.m(d-2).y)?(b.w(d,a.x,f.y),c++,d++):b.ea(d-1,a.x,f.y),K(h.x,b.m(d+2).x)&&!K(h.y,b.m(d+2).y)?b.w(d+1,a.x,h.y):b.ea(d+1,a.x,h.y)):K(f.y,e.y)&&K(e.y,h.y)&&(K(f.y,b.m(d-
2).y)&&!K(f.x,b.m(d-2).x)?(b.w(d,f.x,a.y),c++,d++):b.ea(d-1,f.x,a.y),K(h.y,b.m(d+2).y)&&!K(h.x,b.m(d+2).x)?b.w(d+1,h.x,a.y):b.ea(d+1,h.x,a.y));b.ea(c,a.x,a.y)}else b.ea(c,a.x,a.y),1===c&&b.computeSpot(!0).Od()&&(e=b.W,f=b.hd,null===e||e.isVisible()||(e=e.findVisibleNode(),e!==b.W&&(f=e.Ml(""))),d=f.Va(Gb,v.K()),e=b.getLinkPointFromPoint(e,f,d,a,!0,v.K()),b.ea(0,e.x,e.y),v.v(d),v.v(e)),c===b.ra-2&&b.computeSpot(!1).Od()&&(c=b.aa,e=b.Td,null===c||c.isVisible()||(c=c.findVisibleNode(),c!==b.aa&&(e=c.Ml(""))),
d=e.Va(Gb,v.K()),e=b.getLinkPointFromPoint(c,e,d,a,!1,v.K()),b.ea(b.ra-1,e.x,e.y),v.v(d),v.v(e));b.gj()};ej.prototype.computeReshape=function(a){var b=this.tt,c=this.handle.Ne;switch(this.IE(this.handle)){case ij:return a;case hj:return b=b.m(c),new y(b.x,a.y);case gj:return b=b.m(c),new y(a.x,b.y);default:case fj:return b.m(c)}};v.u(ej,{vL:"originalPoint"},function(){return this.cp});v.u(ej,{wL:"originalPoints"},function(){return this.$v});
function vj(){0<arguments.length&&v.ld(vj);rg.call(this);this.name="Resizing";this.Uh=(new ia(1,1)).freeze();this.Th=(new ia(9999,9999)).freeze();this.Fj=(new ia(NaN,NaN)).freeze();this.Gr=!1;this.Fc=null;var a=new X;a.nh=Gb;a.Cb="Rectangle";a.Ba=ud;a.fill="lightblue";a.stroke="dodgerblue";a.fb=1;a.cursor="pointer";this.bl=a;this.gc=null;this.cp=new y;this.$C=new ia;this.eD=new y;this.Qy=new ia(0,0);this.Py=new ia(Infinity,Infinity);this.Oy=new ia(1,1);this.XC=!0}v.Ma(vj,rg);v.ga("ResizingTool",vj);
vj.prototype.updateAdornments=function(a){if(!(null===a||a instanceof W)){if(a.cb&&null!==this.g&&!this.g.bb){var b=a.HF;if(null!==b&&a.canResize()&&a.Y.H()&&a.isVisible()&&b.Y.H()&&b.rj()){var c=a.Pp(this.name);if(null===c||c.rb!==b)c=this.makeAdornment(b);if(null!==c){var d=b.xn();c.angle=d;var e=b.Va(c.pf,v.K()),f=b.kj();c.location=e;v.v(e);e=c.placeholder;if(null!==e){var b=b.Ja,h=v.gm();h.l(b.width*f,b.height*f);e.Ba=h;v.yk(h)}this.updateResizeHandles(c,d);a.xl(this.name,c);return}}}a.wj(this.name)}};
vj.prototype.makeAdornment=function(a){var b=null,b=a.V.GF;if(null===b){b=new mh;b.type=wj;b.pf=Gb;var c=new xj;c.Vf=!0;b.add(c);b.add(this.makeHandle(a,xb));b.add(this.makeHandle(a,Ab));b.add(this.makeHandle(a,Mb));b.add(this.makeHandle(a,Kb));b.add(this.makeHandle(a,zc));b.add(this.makeHandle(a,Bc));b.add(this.makeHandle(a,Cc));b.add(this.makeHandle(a,Ac))}else if(oh(b),b=b.copy(),null===b)return null;b.kc=this.name;b.rb=a;return b};
vj.prototype.makeHandle=function(a,b){var c=this.Rt;if(null===c)return null;c=c.copy();c.alignment=b;return c};
vj.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.Xc()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.Od()&&(c=Gb);var d=b;if(0>=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d?
"ne-resize":"e-resize"}else if(a instanceof D)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};v.defineProperty(vj,{Rt:"handleArchetype"},function(){return this.bl},function(a){null!==a&&v.F(a,G,vj,"handleArchetype");this.bl=a});v.u(vj,{handle:"handle"},function(){return this.gc});v.defineProperty(vj,{rb:"adornedObject"},function(){return this.Fc},function(a){null!==a&&v.F(a,G,vj,"adornedObject");this.Fc=a});
vj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.bb&&a.wt&&a.R.left?null!==this.findToolHandleAt(a.Bc.da,this.name):!1};
vj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.gc=this.findToolHandleAt(a.Bc.da,this.name),null!==this.gc&&(this.Fc=this.gc.V.rb,this.cp.set(this.rb.Va(this.handle.alignment.uF())),this.eD.set(this.Fc.V.location),this.$C.set(this.Fc.Ba),this.Oy=this.computeCellSize(),this.Qy=this.computeMinSize(),this.Py=this.computeMaxSize(),a.bf=!0,this.XC=a.Qa.isEnabled,a.Qa.isEnabled=!1,this.Tb(this.name),this.ta=!0))};
vj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Ik(),this.Fc=this.gc=null,this.ta=a.bf=!1,a.Qa.isEnabled=this.XC)};vj.prototype.doCancel=function(){null!==this.rb&&(this.rb.Ba=this.vF,this.rb.V.location=this.ZI);this.stopTool()};vj.prototype.doMouseMove=function(){var a=this.g;if(this.ta&&null!==a){var b=this.Qy,c=this.Py,d=this.Oy,e=this.rb.GE(a.R.da,v.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.Yf();v.v(e)}};
vj.prototype.doMouseUp=function(){var a=this.g;if(this.ta&&null!==a){var b=this.Qy,c=this.Py,d=this.Oy,e=this.rb.GE(a.R.da,v.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);v.v(e);a.tc();this.Gf=this.name;a.Ca("PartResized",this.rb,this.vF)}this.stopTool()};
vj.prototype.resize=function(a){if(null!==this.g){var b=this.rb,c=b.V;b.Ba=a.size;c.af();a=this.rb.Va(this.handle.alignment.uF());c instanceof V?(a=c.position.copy().Vn(a).add(this.cp),c.move(a)):c.location=c.location.copy().Vn(a).add(this.cp)}};
vj.prototype.computeResize=function(a,b,c,d,e,f){b.Od()&&(b=Gb);var h=this.rb.Ja,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!f){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=v.K();Pa(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):(a.width=
a.height/p,a.x=m-a.width))):1<=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,p<b?a.height=p*a.width:(a.width=a.height/p,a.x=m-a.width))):(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=m-a.x,f||(a.height=p*a.width,a.y=l+.5*(n-l-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),
a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):a.width=a.height/p)):1<=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,p<b?a.height=p*a.width:a.width=a.height/p)):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),f||(a.height=p*a.width,a.y=l+.5*(n-l-a.height))):0>=b.y?(a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=n-a.y,f||(a.width=a.height/p,a.x=
k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));v.v(q);return a};vj.prototype.computeReshape=function(){var a=yj;this.rb instanceof X&&(a=Kj(this.rb));return!(a===Lj||a===Mj||null!==this.g&&this.g.R.shift)};vj.prototype.computeMinSize=function(){var a=this.rb.yh.copy(),b=this.yh;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
vj.prototype.computeMaxSize=function(){var a=this.rb.Bf.copy(),b=this.Bf;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
vj.prototype.computeCellSize=function(){var a=new ia(NaN,NaN),b=this.rb.V;if(null!==b){var c=b.mJ;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.Ep;isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width);isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height);b=this.g;(isNaN(a.width)||isNaN(a.height))&&b&&(c=b.$a.te,null!==c&&c.qx&&(c=c.OE,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&
0<c.height&&(a.height=c.height)),b=b.Bn,null!==b&&b.visible&&this.qx&&(c=b.lx,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height)));if(isNaN(a.width)||0===a.width||Infinity===a.width)a.width=1;if(isNaN(a.height)||0===a.height||Infinity===a.height)a.height=1;return a};
v.defineProperty(vj,{yh:"minSize"},function(){return this.Uh},function(a){v.F(a,ia,vj,"minSize");if(!this.Uh.L(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.Uh.l(b,a)}});v.defineProperty(vj,{Bf:"maxSize"},function(){return this.Th},function(a){v.F(a,ia,vj,"maxSize");if(!this.Th.L(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.Th.l(b,a)}});
v.defineProperty(vj,{Ep:"cellSize"},function(){return this.Fj},function(a){v.F(a,ia,vj,"cellSize");this.Fj.L(a)||this.Fj.assign(a)});v.defineProperty(vj,{qx:"isGridSnapEnabled"},function(){return this.Gr},function(a){v.j(a,"boolean",vj,"isGridSnapEnabled");this.Gr=a});v.u(vj,{vF:"originalDesiredSize"},function(){return this.$C});v.u(vj,{ZI:"originalLocation"},function(){return this.eD});
function Nj(){0<arguments.length&&v.ld(Nj);rg.call(this);this.name="Rotating";this.qD=45;this.pD=2;this.Fc=null;var a=new X;a.Cb="Ellipse";a.Ba=vd;a.fill="lightblue";a.stroke="dodgerblue";a.fb=1;a.cursor="pointer";this.bl=a;this.gc=null;this.Zv=0;this.mD=new y}v.Ma(Nj,rg);v.ga("RotatingTool",Nj);
Nj.prototype.updateAdornments=function(a){if(!(null===a||a instanceof W)){if(a.cb&&null!==this.g&&!this.g.bb){var b=a.KF;if(null!==b&&a.canRotate()&&a.Y.H()&&a.isVisible()&&b.Y.H()&&b.rj()){var c=a.Pp(this.name);if(null===c||c.rb!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.xn();var d=null,e=null;b===a||b===a.ec?(d=a.ec,e=a.pf):(d=b,e=Gb);for(var f=d.Ja,e=v.xb(f.width*e.x+e.offsetX,f.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.ob(e),d=d.N;var d=e.y,f=Math.max(e.x-b.Ja.width,0),h=v.K();
c.location=b.Va(new L(1,0,50+f,d),h);v.v(h);v.v(e);a.xl(this.name,c);return}}}a.wj(this.name)}};Nj.prototype.makeAdornment=function(a){var b=null,b=a.V.pJ;if(null===b){b=new mh;b.type=Oj;b.pf=Gb;var c=this.Rt;null!==c&&b.add(c.copy())}else if(oh(b),b=b.copy(),null===b)return null;b.kc=this.name;b.rb=a;return b};v.defineProperty(Nj,{Rt:"handleArchetype"},function(){return this.bl},function(a){null!==a&&v.F(a,G,Nj,"handleArchetype");this.bl=a});v.u(Nj,{handle:"handle"},function(){return this.gc});
v.defineProperty(Nj,{rb:"adornedObject"},function(){return this.Fc},function(a){null!==a&&v.F(a,G,Nj,"adornedObject");this.Fc=a});Nj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.bb&&a.Jw&&a.R.left?null!==this.findToolHandleAt(a.Bc.da,this.name):!1};
Nj.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.gc=this.findToolHandleAt(a.Bc.da,this.name),null!==this.gc)){this.Fc=this.gc.V.rb;var b=this.Fc.V,c=b.ec;this.mD=this.Fc===b||this.Fc===c?c.Va(b.pf):this.Fc.Va(Gb);this.Zv=this.Fc.angle;a.bf=!0;a.Uz=!0;this.Tb(this.name);this.ta=!0}};Nj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Ik(),this.Fc=this.gc=null,this.ta=a.bf=!1)};Nj.prototype.doCancel=function(){var a=this.g;null!==a&&(a.Uz=!1);this.rotate(this.Zv);this.stopTool()};
Nj.prototype.doMouseMove=function(){var a=this.g;this.ta&&null!==a&&(a=this.computeRotate(a.R.da),this.rotate(a))};Nj.prototype.doMouseUp=function(){var a=this.g;if(this.ta&&null!==a){a.Uz=!1;var b=this.computeRotate(a.R.da);this.rotate(b);a.tc();this.Gf=this.name;a.Ca("PartRotated",this.Fc,this.Zv)}this.stopTool()};Nj.prototype.rotate=function(a){null!==this.Fc&&(this.Fc.angle=a)};
Nj.prototype.computeRotate=function(a){a=this.mD.Ac(a);var b=this.Fc.N;null!==b&&(a-=b.xn(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.DJ),180),c=Math.min(Math.abs(this.CJ),b/2);(null===this.g||!this.g.R.shift)&&0<b&&0<c&&(a%b<c?a=Math.floor(a/b)*b:a%b>b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};v.defineProperty(Nj,{DJ:"snapAngleMultiple"},function(){return this.qD},function(a){v.j(a,"number",Nj,"snapAngleMultiple");this.qD=a});
v.defineProperty(Nj,{CJ:"snapAngleEpsilon"},function(){return this.pD},function(a){v.j(a,"number",Nj,"snapAngleEpsilon");this.pD=a});v.u(Nj,{uL:"originalAngle"},function(){return this.Zv});function Pj(){0<arguments.length&&v.ld(Pj);rg.call(this);this.name="ClickSelecting"}v.Ma(Pj,rg);v.ga("ClickSelectingTool",Pj);Pj.prototype.canStart=function(){return!this.isEnabled||null===this.g||this.isBeyondDragSize()?!1:!0};
Pj.prototype.doMouseUp=function(){this.ta&&(this.standardMouseSelect(),!this.standardMouseClick()&&null!==this.g&&this.g.R.pj&&this.g.$a.doToolTip());this.stopTool()};function Qj(){0<arguments.length&&v.ld(Qj);rg.call(this);this.name="Action";this.bo=null}v.Ma(Qj,rg);v.ga("ActionTool",Qj);
Qj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a)return!1;var b=a.R,c=a.Ke(b.da,function(a){for(;null!==a.N&&!a.nx;)a=a.N;return a});if(null!==c){if(!c.nx)return!1;this.bo=c;a.ro=a.Ke(b.da,null,null);return!0}return!1};Qj.prototype.doMouseDown=function(){if(this.ta){var a=this.g.R,b=this.bo;null!==b&&(a.Pe=b,null!==b.RD&&b.RD(a,b))}else this.canStart()&&this.doActivate()};
Qj.prototype.doMouseMove=function(){if(this.ta){var a=this.g.R,b=this.bo;null!==b&&(a.Pe=b,null!==b.SD&&b.SD(a,b))}};Qj.prototype.doMouseUp=function(){if(this.ta){var a=this.g,b=a.R,c=this.bo;if(null===c)return;b.Pe=c;null!==c.TD&&c.TD(b,c);this.isBeyondDragSize()||Ih(c,b,a)}this.stopTool()};Qj.prototype.doCancel=function(){var a=this.g;if(null!==a){var a=a.R,b=this.bo;if(null===b)return;a.Pe=b;null!==b.QD&&b.QD(a,b)}this.stopTool()};Qj.prototype.doStop=function(){this.bo=null};
function Rj(){0<arguments.length&&v.ld(Rj);rg.call(this);this.name="ClickCreating";this.nm=null;this.EC=!0;this.sC=new y(0,0)}v.Ma(Rj,rg);v.ga("ClickCreatingTool",Rj);
Rj.prototype.canStart=function(){if(!this.isEnabled||null===this.Iz)return!1;var a=this.g;if(null===a||a.bb||a.zf||!a.Bp||!a.R.left||this.isBeyondDragSize())return!1;if(this.nI){if(1===a.R.He&&(this.sC=a.R.ef.copy()),2!==a.R.He||this.isBeyondDragSize(this.sC))return!1}else if(1!==a.R.He)return!1;return a.Ya!==this&&null!==a.Jt(a.R.da,!0)?!1:!0};Rj.prototype.doMouseUp=function(){var a=this.g;this.ta&&null!==a&&this.insertPart(a.R.da);this.stopTool()};
Rj.prototype.insertPart=function(a){var b=this.g;if(null===b)return null;var c=this.Iz;if(null===c)return null;this.Tb(this.name);var d=null;c instanceof S?c.ee()&&(oh(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.ca.copyNodeData(c),v.Ta(c)&&(b.ca.yl(c),d=b.uh(c)));null!==d&&(d.location=a,b.vf&&b.select(d));b.tc();this.Gf=this.name;b.Ca("PartCreated",d);this.Ik();return d};
v.defineProperty(Rj,{Iz:"archetypeNodeData"},function(){return this.nm},function(a){null!==a&&v.F(a,Object,Rj,"archetypeNodeData");this.nm=a});v.defineProperty(Rj,{nI:"isDoubleClick"},function(){return this.EC},function(a){v.j(a,"boolean",Rj,"isDoubleClick");this.EC=a});function Sj(){this.MD=this.PC=this.Xy=this.sz=null}v.ga("HTMLInfo",Sj);v.defineProperty(Sj,{vA:"mainElement"},function(){return this.PC},function(a){null!==a&&v.F(a,Element,Sj,"mainElement");this.PC=a});
v.defineProperty(Sj,{show:"show"},function(){return this.sz},function(a){this.sz!==a&&(null!==a&&v.j(a,"function",Sj,"show"),this.sz=a)});v.defineProperty(Sj,{Cn:"hide"},function(){return this.Xy},function(a){this.Xy!==a&&(null!==a&&v.j(a,"function",Sj,"hide"),this.Xy=a)});v.defineProperty(Sj,{oB:"valueFunction"},function(){return this.MD},function(a){this.MD=a});function Tj(a,b,c){this.text=a;this.fE=b;this.visible=c}
function Uj(){0<arguments.length&&v.ld(Uj);rg.call(this);this.name="ContextMenu";this.XB=this.Ay=this.UB=null;this.VC=new y;this.Cy=this.tm=null;Vj(this)}v.Ma(Uj,rg);v.ga("ContextMenuTool",Uj);v.mE=!1;v.zt=null;v.At=null;
function Vj(a){var b=new Sj;b.show=function(a,b,c){c.showDefaultContextMenu()};b.Cn=function(a,b){b.hideDefaultContextMenu()};a.tm=b;a.FD=function(){a.stopTool()};if(!1===v.mE){var b=v.createElement("div"),c=v.createElement("div");b.style.cssText="top: 0px;z-index:300;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";c.style.cssText="z-index:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";
var d=v.createElement("style");window.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".goCXul { list-style: none; }",0);d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);b.addEventListener("contextmenu",Wj,!1);b.addEventListener("selectstart",Wj,!1);
c.addEventListener("contextmenu",Wj,!1);window.document.body&&(window.document.body.appendChild(b),window.document.body.appendChild(c));v.At=b;v.zt=c;v.mE=!0}}function Wj(a){a.preventDefault();return!1}Uj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||this.isBeyondDragSize()||!a.R.right?!1:null!==this.tm&&a.R.pj||null!==this.findObjectWithContextMenu()?!0:!1};Uj.prototype.doStart=function(){var a=this.g;null!==a&&this.VC.set(a.Bc.da)};
Uj.prototype.doStop=function(){this.hideContextMenu();this.Sw=null};Uj.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return null;var c=b.R,d=null;a instanceof E||(d=a instanceof G?a:b.Ke(c.da,null,function(a){return!a.layer.Mc}));if(null!==d){for(a=d;null!==a;){if(null!==a.contextMenu)return a;a=a.N}if(null!==this.tm&&b.R.pj)return d.V}else if(null!==b.contextMenu)return b;return null};Uj.prototype.doActivate=function(){};
Uj.prototype.doMouseDown=function(){rg.prototype.doMouseDown.call(this);null!==this.g&&this.g.$a.cf.contains(this)&&Xj(this)};Uj.prototype.doMouseUp=function(){Xj(this)};function Xj(a){var b=a.g;if(null!==b)if(a.ta){var c=a.Gl;if(null!==c){if(!(c instanceof Sj)){var d=b.Ke(b.R.da,null,null);null!==d&&d.Vl(c)&&a.standardMouseClick(null,null)}a.stopTool();a.canStart()&&(b.Ya=a,a.doMouseUp())}}else a.canStart()&&(Gh(a,!0),a.ta||a.stopTool())}
function Gh(a,b,c){void 0===c&&(c=null);b&&a.standardMouseSelect();if(!a.standardMouseClick())if(a.ta=!0,b=a.tm,null===c&&(c=a.findObjectWithContextMenu()),null!==c){var d=c.contextMenu;null!==d?(a.Sw=c instanceof G?c:null,a.showContextMenu(d,a.Sw)):null!==b&&a.showContextMenu(b,a.Sw)}else null!==b&&a.showContextMenu(b,null)}Uj.prototype.doMouseMove=function(){this.ta&&null!==this.g&&this.g.$a.doMouseMove()};
Uj.prototype.showContextMenu=function(a,b){null!==b&&v.F(b,G,Uj,"showContextMenu:obj");var c=this.g;if(null!==c){a!==this.Gl&&this.hideContextMenu();if(a instanceof mh){a.Xf="Tool";a.bm=!1;a.scale=1/c.scale;a.kc=this.name;null!==a.placeholder&&(a.placeholder.scale=c.scale);c.add(a);if(null!==b){var c=null,d=b.Nl();null!==d&&(c=d.data);a.rb=b;a.data=c}else a.data=c.ca;a.af();this.positionContextMenu(a,b)}else a instanceof Sj&&a.show(b,c,this);this.Gl=a}};
Uj.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.g;if(null!==b){var c=b.R.da.copy(),d=a.Aa,e=b.tb;b.R.pj&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5);c.y<e.y&&(c.y=e.y);a.position=c}}};
Uj.prototype.hideContextMenu=function(){var a=this.g;if(null!==a){var b=this.Gl;null!==b&&(b instanceof mh?(a.remove(b),null!==this.Ay&&this.Ay.wj(b.kc),b.data=null,b.rb=null):b instanceof Sj&&(null!==b.Cn?b.Cn(a,this):null!==b.vA&&(b.vA.style.display="none")),this.Gl=null,this.standardMouseOver())}};
function Yj(a){if(null===a.g)return null;a=new I(Tj);a.add(new Tj("Copy",function(a){a.pb.copySelection()},function(a){return a.pb.canCopySelection()}));a.add(new Tj("Cut",function(a){a.pb.cutSelection()},function(a){return a.pb.canCutSelection()}));a.add(new Tj("Delete",function(a){a.pb.deleteSelection()},function(a){return a.pb.canDeleteSelection()}));a.add(new Tj("Paste",function(a){a.pb.pasteSelection(a.R.da)},function(a){return a.pb.canPasteSelection()}));a.add(new Tj("Select All",function(a){a.pb.selectAll()},
function(a){return a.pb.canSelectAll()}));a.add(new Tj("Undo",function(a){a.pb.undo()},function(a){return a.pb.canUndo()}));a.add(new Tj("Redo",function(a){a.pb.redo()},function(a){return a.pb.canRedo()}));a.add(new Tj("Scroll To Part",function(a){a.pb.scrollToPart()},function(a){return a.pb.canScrollToPart()}));a.add(new Tj("Zoom To Fit",function(a){a.pb.zoomToFit()},function(a){return a.pb.canZoomToFit()}));a.add(new Tj("Reset Zoom",function(a){a.pb.resetZoom()},function(a){return a.pb.canResetZoom()}));
a.add(new Tj("Group Selection",function(a){a.pb.groupSelection()},function(a){return a.pb.canGroupSelection()}));a.add(new Tj("Ungroup Selection",function(a){a.pb.ungroupSelection()},function(a){return a.pb.canUngroupSelection()}));a.add(new Tj("Edit Text",function(a){a.pb.editTextBlock()},function(a){return a.pb.canEditTextBlock()}));return a}
Uj.prototype.showDefaultContextMenu=function(){var a=this.g;if(null!==a){null===this.Cy&&(this.Cy=Yj(this));v.At.innerHTML="";v.zt.addEventListener("click",this.FD,!1);var b=this,c=v.createElement("ul");c.className="goCXul";v.At.appendChild(c);c.innerHTML="";for(var d=this.Cy.i;d.next();){var e=d.value,f=e.visible;if("function"===typeof e.fE&&("function"!==typeof f||f(a))){f=v.createElement("li");f.className="goCXli";var h=v.createElement("a");h.className="goCXa";h.href="#";h.wG=e.fE;h.addEventListener("click",
function(c){this.wG(a);b.stopTool();c.preventDefault();return!1},!1);h.textContent=e.text;f.appendChild(h);c.appendChild(f)}}v.At.style.display="block";v.zt.style.display="block"}};Uj.prototype.hideDefaultContextMenu=function(){null!==this.Gl&&this.Gl===this.tm&&(v.At.style.display="none",v.zt.style.display="none",v.zt.removeEventListener("click",this.FD,!1),this.Gl=null)};v.defineProperty(Uj,{Gl:"currentContextMenu"},function(){return this.UB},function(a){this.UB=a;this.Ay=a instanceof mh?a.Of:null});
v.defineProperty(Uj,{PK:"defaultTouchContextMenu"},function(){return this.tm},function(a){this.tm=a});v.defineProperty(Uj,{Sw:"currentObject"},function(){return this.XB},function(a){null!==a&&v.F(a,G,Uj,"currentObject");this.XB=a});v.u(Uj,{pL:"mouseDownPoint"},function(){return this.VC});
function Zj(){0<arguments.length&&v.ld(Zj);rg.call(this);this.name="DragSelecting";this.xo=175;this.JC=!1;var a=new S;a.Xf="Tool";a.bm=!1;var b=new X;b.name="SHAPE";b.Cb="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.pm=a}v.Ma(Zj,rg);v.ga("DragSelectingTool",Zj);
Zj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.vf)return!1;var b=a.R;return!b.left||a.Ya!==this&&(!this.isBeyondDragSize()||b.timestamp-a.Bc.timestamp<this.nE||null!==a.Jt(b.da,!0))?!1:!0};Zj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.ta=!0,a.bf=!0,a.wb=!0,a.add(this.qh),this.doMouseMove())};Zj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(Sh(a),a.remove(this.qh),a.wb=!1,this.ta=a.bf=!1)};
Zj.prototype.doMouseMove=function(){var a=this.g;if(null!==a&&this.ta&&null!==this.qh){var b=this.computeBoxBounds(),c=this.qh.ud("SHAPE");null===c&&(c=this.qh.Jd());c.Ba=b.size;this.qh.position=b.position;(a.oe||a.pe)&&a.Wz(a.R.ef)}};Zj.prototype.doMouseUp=function(){if(this.ta){var a=this.g;a.remove(this.qh);try{a.cc="wait",this.selectInRect(this.computeBoxBounds())}finally{a.cc=""}}this.stopTool()};
Zj.prototype.computeBoxBounds=function(){var a=this.g;return null===a?new B(0,0,0,0):new B(a.Bc.da,a.R.da)};
Zj.prototype.selectInRect=function(a){var b=this.g;if(null!==b){var c=b.R;b.Ca("ChangingSelection");a=b.xk(a,null,function(a){return a instanceof S?a.canSelect():!1},this.sI);if(v.Dk?c.iu:c.control)if(c.shift)for(a=a.i;a.next();)c=a.value,c.cb&&(c.cb=!1);else for(a=a.i;a.next();)c=a.value,c.cb=!c.cb;else{if(!c.shift){for(var c=new I(S),d=b.selection.i;d.next();){var e=d.value;a.contains(e)||c.add(e)}for(c=c.i;c.next();)c.value.cb=!1}for(a=a.i;a.next();)c=a.value,c.cb||(c.cb=!0)}b.Ca("ChangedSelection")}};
v.defineProperty(Zj,{nE:"delay"},function(){return this.xo},function(a){v.j(a,"number",Zj,"delay");this.xo=a});v.defineProperty(Zj,{sI:"isPartialInclusion"},function(){return this.JC},function(a){v.j(a,"boolean",Zj,"isPartialInclusion");this.JC=a});v.defineProperty(Zj,{qh:"box"},function(){return this.pm},function(a){null!==a&&v.F(a,S,Zj,"box");this.pm=a});
function ak(){0<arguments.length&&v.ld(ak);rg.call(this);this.name="Panning";this.lz=new y;this.Ej=!1;var a=this;this.uD=function(){window.document.removeEventListener("scroll",a.uD,!1);a.stopTool()}}v.Ma(ak,rg);v.ga("PanningTool",ak);ak.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||!a.oe&&!a.pe||!a.R.left||a.Ya!==this&&!this.isBeyondDragSize()?!1:!0};
ak.prototype.doActivate=function(){var a=this.g;null!==a&&(this.Ej?(a.R.bubbles=!0,window.document.addEventListener("scroll",this.uD,!1)):(a.cc="move",a.bf=!0,this.lz=a.position.copy()),this.ta=!0)};ak.prototype.doDeactivate=function(){var a=this.g;null!==a&&(a.cc="",this.ta=a.bf=!1)};ak.prototype.doCancel=function(){var a=this.g;null!==a&&(a.position=this.lz,a.bf=!1);this.stopTool()};ak.prototype.doMouseMove=function(){this.move()};ak.prototype.doMouseUp=function(){this.move();this.stopTool()};
ak.prototype.move=function(){var a=this.g;if(this.ta&&a)if(this.Ej)a.R.bubbles=!0;else{var b=a.position,c=a.Bc.da,d=a.R.da,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.oe||(e=b.x);a.pe||(c=b.y);a.position=new y(e,c)}};v.defineProperty(ak,{bubbles:"bubbles"},function(){return this.Ej},function(a){v.j(a,"boolean",ak,"bubbles");this.Ej=a});v.u(ak,{xL:"originalPosition"},function(){return this.lz});
function bk(){0<arguments.length&&v.ld(bk);rg.call(this);this.name="TextEditing";this.yz=this.ik=null;this.tD=ck;this.tl=null;this.ib=dk;this.ql=null;this.SC=1;this.nD=!0;var a=new Sj;this.ZB=null;this.gC=a;this.Dy=null;ek(this,a)}v.ga("TextEditingTool",bk);v.Ma(bk,rg);var fk;bk.LostFocus=fk=v.p(bk,"LostFocus",0);var gk;bk.MouseDown=gk=v.p(bk,"MouseDown",1);var hk;bk.Tab=hk=v.p(bk,"Tab",2);var ik;bk.Enter=ik=v.p(bk,"Enter",3);bk.SingleClick=v.p(bk,"SingleClick",0);var ck;
bk.SingleClickSelected=ck=v.p(bk,"SingleClickSelected",1);var jk;bk.DoubleClick=jk=v.p(bk,"DoubleClick",2);var dk;bk.StateNone=dk=v.p(bk,"StateNone",0);var kk;bk.StateActive=kk=v.p(bk,"StateActive",1);var lk;bk.StateEditing=lk=v.p(bk,"StateEditing",2);var mk;bk.StateValidating=mk=v.p(bk,"StateValidating",3);var nk;bk.StateInvalid=nk=v.p(bk,"StateInvalid",4);var ok;bk.StateValidated=ok=v.p(bk,"StateValidated",5);
function ek(a,b){var c=v.createElement("textarea");a.Dy=c;c.addEventListener("input",function(){if(null!==a.Wg){var b=a.KI(this.value),c=this.JJ;this.style.width=20+b.Aa.width*c+"px";this.style.height=10+b.Aa.height*c+"px";this.rows=b.zI}},!1);c.addEventListener("keydown",function(b){var c=b.which;null!==a.Wg&&(13===c?(!1===a.Wg.ux&&b.preventDefault(),a.acceptText(ik)):9===c?(a.acceptText(hk),b.preventDefault()):27===c&&(a.doCancel(),null!==a.g&&a.g.doFocus()))},!1);c.addEventListener("focus",function(){pk(a)},
!1);c.addEventListener("blur",function(){qk(a)},!1);b.oB=function(){return c.value};b.vA=c;b.show=function(a,b,f){if(f.state===nk)c.style.border="3px solid red",c.focus();else{var h=a.Va(Gb),k=b.position,l=b.scale,m=a.kj()*l;m<f.pF&&(m=f.pF);var n=a.Ja.width*m+6,p=a.Ja.height*m+2,q=(h.x-k.x)*l,h=(h.y-k.y)*l;c.value=a.text;b.ij.style.font=a.font;c.style.cssText="position: absolute;z-index: 100;font: inherit;fontSize: "+100*m+"%;lineHeight: normal;width: "+n+"px;height: "+p+"px;left: "+((q-n/2|0)-1)+
"px;top: "+((h-p/2|0)-1)+"px;textAlign: "+a.textAlign+";margin: 0;padding: 1px;border: 0;outline: none;white-space: pre-wrap;overflow: hidden;";c.JJ=m;b.ij.appendChild(c);c.focus();f.Ux&&(c.select(),c.setSelectionRange(0,9999))}};b.Cn=function(a){a.ij.removeChild(c)}}v.defineProperty(bk,{Wg:"textBlock"},function(){return this.yz},function(a){null!==a&&v.F(a,Fh,bk,"textBlock");this.yz=a});v.defineProperty(bk,{vk:"currentTextEditor"},function(){return this.ZB},function(a){this.ZB=a});
v.defineProperty(bk,{CH:"defaultTextEditor"},function(){return this.gC},function(a){this.gC=a});v.defineProperty(bk,{ZF:"starting"},function(){return this.tD},function(a){v.nb(a,bk,bk,"starting");this.tD=a});
bk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.bb||!a.R.left||this.isBeyondDragSize())return!1;var b=a.Ke(a.R.da,null,function(a){return a instanceof Fh});if(null===b||!b.Xz||!b.V.canEdit())return!1;b=b.V;return null===b||this.ZF===ck&&!b.cb||this.ZF===jk&&2>a.R.He?!1:!0};bk.prototype.doStart=function(){this.ta||null===this.Wg||this.doActivate()};
bk.prototype.doActivate=function(){if(!this.ta){var a=this.g;if(null!==a){var b=this.Wg;null===b&&(b=a.Ke(a.R.da,function(a){return a instanceof Fh?a:null}));if(null!==b&&(this.Wg=b,null!==b.V)){this.ta=!0;this.ib=kk;var c=this.CH;null!==b.bG&&(c=b.bG);this.ik=this.Wg.copy();var d=new B(this.Wg.Va(xb),this.Wg.Va(Mb));a.uJ(d);if(c instanceof Sj)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex=100;c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();"function"===
typeof c.focus&&c.focus();"function"===typeof c.select&&this.Ux&&(c.select(),c.setSelectionRange(0,9999));a.ij.appendChild(c)}this.vk=c}}}};bk.prototype.doCancel=function(){null!==this.ql&&(this.vk.style.border=this.ql,this.ql=null);this.stopTool()};bk.prototype.doMouseUp=function(){!this.ta&&this.canStart()&&this.doActivate()};bk.prototype.doMouseDown=function(){this.ta&&this.acceptText(gk)};
bk.prototype.acceptText=function(a){switch(a){case gk:if(this.ib===ok)"function"===typeof this.vk.focus&&this.vk.focus();else if(this.ib===kk||this.ib===nk||this.ib===lk)this.ib=mk,rk(this);break;case fk:case ik:case hk:if(ik===a&&!0===this.yz.ux)break;if(this.ib===kk||this.ib===nk||this.ib===lk)this.ib=mk,rk(this)}};
function rk(a){var b=a.Wg,c=a.g,d=a.vk;if(null!==b&&null!==d){var e=b.text,f=d.value,h="";d instanceof Sj?null!==d.oB&&(h=d.oB()):h="function"===typeof f?f():f;a.isValidText(b,e,h)?(a.Tb(a.name),a.ib=ok,d instanceof Sj?d.show(b,c,a):null!==a.ql&&(d.style.border=a.ql,a.ql=null),a.Gf=a.name,b.text=h,null!==b.aG&&b.aG(b,e,h),null!==c&&c.Ca("TextEdited",b,e),a.Ik(),a.stopTool(),null!==c&&c.doFocus()):(a.ib=nk,null!==b.Zz&&b.Zz(a,e,h),d instanceof Sj?d.show(b,c,a):(null===a.ql&&(a.ql=d.style.border,d.style.border=
"3px solid red"),"function"===typeof d.focus&&d.focus()))}}bk.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.ib=dk;this.Wg=null;if(null!==this.vk){var b=this.vk;if(b instanceof Sj)b.Cn(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.ij.removeChild(b)}}this.ta=!1}};bk.prototype.doFocus=function(){pk(this)};bk.prototype.doBlur=function(){qk(this)};
function pk(a){if(null!==a.vk){var b=a.Dy;a.ib===kk&&(a.ib=lk);"function"===typeof b.select&&a.Ux&&(b.select(),b.setSelectionRange(0,9999))}}function qk(a){if(null!==a.vk){var b=a.Dy;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.Ux&&(b.select(),b.setSelectionRange(0,9999))}}bk.prototype.isValidText=function(a,b,c){v.F(a,Fh,bk,"isValidText:textblock");var d=this.hB;if(null!==d&&!d(a,b,c))return!1;d=a.hB;return null===d||d(a,b,c)?!0:!1};
v.defineProperty(bk,{hB:"textValidation"},function(){return this.tl},function(a){null!==a&&v.j(a,"function",bk,"textValidation");this.tl=a});v.defineProperty(bk,{pF:"minimumEditorScale"},function(){return this.SC},function(a){null!==a&&v.j(a,"number",bk,"minimumEditorScale");this.SC=a});v.defineProperty(bk,{Ux:"selectsTextOnActivate"},function(){return this.nD},function(a){null!==a&&v.j(a,"boolean",bk,"selectsTextOnActivate");this.nD=a});
v.defineProperty(bk,{state:"state"},function(){return this.ib},function(a){this.ib!==a&&(v.nb(a,bk,bk,"starting"),this.ib=a)});bk.prototype.measureTemporaryTextBlock=bk.prototype.KI=function(a){var b=this.ik;b.text=a;sk(b,this.Wg.To,Infinity);return b};function kh(){rg.call(this);this.name="ToolManager";this.BG=new I(rg);this.CG=new I(rg);this.DG=new I(rg);this.wC=this.xC=850;this.lC=(new ia(2,2)).Ga();this.GD=5E3;this.WC=Kh;this.uC=tk;this.lv=this.$B=null;this.en=-1}v.Ma(kh,rg);
v.ga("ToolManager",kh);var Kh;kh.WheelScroll=Kh=v.p(kh,"WheelScroll",0);var Jh;kh.WheelZoom=Jh=v.p(kh,"WheelZoom",1);kh.WheelNone=v.p(kh,"WheelNone",2);var tk;kh.GestureZoom=tk=v.p(kh,"GestureZoom",3);var uk;kh.GestureCancel=uk=v.p(kh,"GestureCancel",4);var vk;kh.GestureNone=vk=v.p(kh,"GestureNone",5);v.defineProperty(kh,{lu:"mouseWheelBehavior"},function(){return this.WC},function(a){v.nb(a,kh,kh,"mouseWheelBehavior");this.WC=a});
v.defineProperty(kh,{Tp:"gestureBehavior"},function(){return this.uC},function(a){v.nb(a,kh,kh,"gestureBehavior");this.uC=a});kh.prototype.initializeStandardTools=function(){this.TG=new Qj;this.yF=new Oh;this.CI=new ej;this.JF=new vj;this.rJ=new Nj;this.lF=new Wi;this.te=new qh;this.HH=new Zj;this.$I=new ak;this.Pz=new Uj;this.gB=new bk;this.jH=new Rj;this.kH=new Pj};
kh.prototype.updateAdornments=function(a){var b=this.Hl;if(b instanceof mh&&this.lv===a){var c=b.rb;(null!==a?c.V===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}};
kh.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.R;b.pj&&this.Tp===uk&&(b.bubbles=!1);if(b.au){this.cancelWaitAfter();if(this.Tp===vk){b.bubbles=!0;return}if(this.Tp===uk)return;if(a.Ya.canStartMultiTouch()){a.Ya.standardPinchZoomStart();return}}var c=a.pa;c.Lz&&0!==c.Fh&&v.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.cf.length,d=0;d<c;d++){var e=this.cf.fa(d);null===e.g&&e.Sc(this.g);if(e.canStart()){a.doFocus();a.Ya=e;
a.Ya===e&&(e.ta||e.doActivate(),e.doMouseDown());return}}1===a.R.button&&(this.lu===Kh?this.lu=Jh:this.lu===Jh&&(this.lu=Kh));this.doActivate();this.standardWaitAfter(this.RE,b)}};
kh.prototype.doMouseMove=function(){var a=this.g;if(null!==a){var b=a.R;if(b.au){if(this.Tp===vk){b.bubbles=!0;return}if(this.Tp===uk)return;if(a.Ya.canStartMultiTouch()){a.Ya.standardPinchZoomMove();return}}if(this.ta)for(var c=this.Zf.length,d=0;d<c;d++){var e=this.Zf.fa(d);null===e.g&&e.Sc(this.g);if(e.canStart()){a.doFocus();a.Ya=e;a.Ya===e&&(e.ta||e.doActivate(),e.doMouseMove());return}}wk(this,a);null===b.event||"mousemove"!==b.event.type&&b.event.cancelable||(b.bubbles=!0)}};
function wk(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.ta?a.RE:a.fI,b.R)}kh.prototype.doCurrentObjectChanged=function(a,b){var c=this.Hl;null===c||null!==b&&c instanceof mh&&(b===c||b.Vl(c))||this.hideToolTip()};kh.prototype.doWaitAfter=function(a){var b=this.g;null!==b&&b.Eb&&(this.doMouseHover(),this.ta||this.doToolTip(),a.pj&&!b.R.Cc&&(a=a.copy(),a.button=2,a.buttons=2,b.R=a,b.ct=!0,b.doMouseUp()))};
kh.prototype.doMouseHover=function(){var a=this.g;if(null!==a){var b=a.R;null===b.Pe&&(b.Pe=a.Ke(b.da,null,null));var c=b.Pe;if(null!==c)for(b.Cc=!1;null!==c;){a=this.ta?c.BA:c.CA;if(null!==a&&(a(b,c),b.Cc))break;c=c.N}else a=this.ta?a.BA:a.CA,null!==a&&a(b)}};
kh.prototype.doToolTip=function(){var a=this.g;if(null!==a){var b=a.R;null===b.Pe&&(b.Pe=a.Ke(b.da,null,null));b=b.Pe;if(null!==b){if(a=this.Hl,!(a instanceof mh)||b!==a&&!b.Vl(a)){for(;null!==b;){a=b.jB;if(null!==a){this.showToolTip(a,b);return}b=b.N}this.hideToolTip()}}else a=a.jB,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
kh.prototype.showToolTip=function(a,b){null!==b&&v.F(b,G,kh,"showToolTip:obj");var c=this.g;if(null!==c){a!==this.Hl&&this.hideToolTip();if(a instanceof mh){a.Xf="Tool";a.bm=!1;a.scale=1/c.scale;a.kc="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);c.add(a);if(null!==b){var c=null,d=b.Nl();null!==d&&(c=d.data);a.rb=b;a.data=c}else a.data=c.ca;a.af();this.positionToolTip(a,b)}else a instanceof Sj&&a!==this.Hl&&a.show(b,c,this);this.Hl=a;-1!==this.en&&(v.clearTimeout(this.en),this.en=-1);
c=this.PJ;if(0<c&&Infinity!==c){var e=this;this.en=v.setTimeout(function(){e.hideToolTip()},c)}}};kh.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.g;if(null!==b){var c=b.R.da.copy(),d=a.Aa,e=b.tb;b.R.pj&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y=c.y+20+d.height>e.bottom?c.y-(d.height+5):c.y+20;c.y<e.y&&(c.y=e.y);a.position=c}}};
kh.prototype.hideToolTip=function(){-1!==this.en&&(v.clearTimeout(this.en),this.en=-1);var a=this.g;if(null!==a){var b=this.Hl;null!==b&&(b instanceof mh?(a.remove(b),null!==this.lv&&this.lv.wj(b.kc),b.data=null,b.rb=null):b instanceof Sj&&null!==b.Cn&&b.Cn(a,this),this.Hl=null)}};v.defineProperty(kh,{Hl:"currentToolTip"},function(){return this.$B},function(a){this.$B=a;this.lv=null!==a?a.Of:null});
kh.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.g;if(null!==a){if(this.ta)for(var b=this.$f.length,c=0;c<b;c++){var d=this.$f.fa(c);null===d.g&&d.Sc(this.g);if(d.canStart()){a.doFocus();a.Ya=d;a.Ya===d&&(d.ta||d.doActivate(),d.doMouseUp());return}}a.doFocus();this.doDeactivate()}};kh.prototype.doMouseWheel=function(){this.standardMouseWheel()};kh.prototype.doKeyDown=function(){var a=this.g;null!==a&&a.pb.doKeyDown()};kh.prototype.doKeyUp=function(){var a=this.g;null!==a&&a.pb.doKeyUp()};
kh.prototype.doCancel=function(){null!==Mh&&Mh.doCancel();rg.prototype.doCancel.call(this)};kh.prototype.findTool=function(a){v.j(a,"string",kh,"findTool:name");for(var b=this.cf.length,c=0;c<b;c++){var d=this.cf.fa(c);if(d.name===a)return d}b=this.Zf.length;for(c=0;c<b;c++)if(d=this.Zf.fa(c),d.name===a)return d;b=this.$f.length;for(c=0;c<b;c++)if(d=this.$f.fa(c),d.name===a)return d;return null};
kh.prototype.replaceTool=function(a,b){v.j(a,"string",kh,"replaceTool:name");null!==b&&(v.F(b,rg,kh,"replaceTool:newtool"),b.g&&b.g!==this.g&&v.k("Cannot share tools between Diagrams: "+b.toString()),b.Sc(this.g));for(var c=this.cf.length,d=0;d<c;d++){var e=this.cf.fa(d);if(e.name===a)return null!==b?this.cf.Rg(d,b):this.cf.$c(d),e}c=this.Zf.length;for(d=0;d<c;d++)if(e=this.Zf.fa(d),e.name===a)return null!==b?this.Zf.Rg(d,b):this.Zf.$c(d),e;c=this.$f.length;for(d=0;d<c;d++)if(e=this.$f.fa(d),e.name===
a)return null!==b?this.$f.Rg(d,b):this.$f.$c(d),e;return null};function xk(a,b,c,d){v.j(b,"string",kh,"replaceStandardTool:name");v.F(d,I,kh,"replaceStandardTool:list");null!==c&&(v.F(c,rg,kh,"replaceStandardTool:newtool"),c.g&&c.g!==a.g&&v.k("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.Sc(a.g));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}v.u(kh,{cf:"mouseDownTools"},function(){return this.BG});v.u(kh,{Zf:"mouseMoveTools"},function(){return this.CG});
v.u(kh,{$f:"mouseUpTools"},function(){return this.DG});v.defineProperty(kh,{fI:"hoverDelay"},function(){return this.xC},function(a){v.j(a,"number",kh,"hoverDelay");this.xC=a});v.defineProperty(kh,{RE:"holdDelay"},function(){return this.wC},function(a){v.j(a,"number",kh,"holdDelay");this.wC=a});v.defineProperty(kh,{IH:"dragSize"},function(){return this.lC},function(a){v.F(a,ia,kh,"dragSize");this.lC=a.S()});
v.defineProperty(kh,{PJ:"toolTipDuration"},function(){return this.GD},function(a){v.j(a,"number",kh,"toolTipDuration");this.GD=a});v.defineProperty(kh,{TG:"actionTool"},function(){return this.findTool("Action")},function(a){xk(this,"Action",a,this.cf)});v.defineProperty(kh,{yF:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){xk(this,"Relinking",a,this.cf)});
v.defineProperty(kh,{CI:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){xk(this,"LinkReshaping",a,this.cf)});v.defineProperty(kh,{JF:"resizingTool"},function(){return this.findTool("Resizing")},function(a){xk(this,"Resizing",a,this.cf)});v.defineProperty(kh,{rJ:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){xk(this,"Rotating",a,this.cf)});
v.defineProperty(kh,{lF:"linkingTool"},function(){return this.findTool("Linking")},function(a){xk(this,"Linking",a,this.Zf)});v.defineProperty(kh,{te:"draggingTool"},function(){return this.findTool("Dragging")},function(a){xk(this,"Dragging",a,this.Zf)});v.defineProperty(kh,{HH:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){xk(this,"DragSelecting",a,this.Zf)});
v.defineProperty(kh,{$I:"panningTool"},function(){return this.findTool("Panning")},function(a){xk(this,"Panning",a,this.Zf)});v.defineProperty(kh,{Pz:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){xk(this,"ContextMenu",a,this.$f)});v.defineProperty(kh,{gB:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){xk(this,"TextEditing",a,this.$f)});
v.defineProperty(kh,{jH:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){xk(this,"ClickCreating",a,this.$f)});v.defineProperty(kh,{kH:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){xk(this,"ClickSelecting",a,this.$f)});
function Zg(){this.aC=yk;this.hr=this.ir=this.Z=null;this.fo=this.jr=this.kr=0;this.ho=this.rc=this.Oo=this.Rj=!1;this.Sj=this.ff=!0;this.jv=this.iv=this.WB=null;this.VB=0;this.kv=null;this.Xu=new J("string");this.Ly=600;this.HG=new y(0,0);this.JB=this.IB=this.LD=!1;this.Nm=new la(G,zk)}v.ga("AnimationManager",Zg);Zg.prototype.Sc=function(a){this.Z=a};function yk(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}v.u(Zg,{uK:"animationReasons"},function(){return this.Xu});
Zg.prototype.canStart=function(){return!0};Zg.prototype.prepareAutomaticAnimation=Zg.prototype.Pn=function(a){this.ff&&(this.Sj||this.Z.Fn)&&(this.Xu.add(a),this.canStart(a)&&(this.Rj&&this.oi(),this.rc=!0))};function Ak(a){if(a.ff&&(a.Xu.clear(),a.rc))if(!a.ho)a.rc=!1;else if(0===a.fo){var b=+new Date;a.fo=b;requestAnimationFrame(function(){if(!1!==a.rc&&!a.Rj&&a.fo===b){var c=a.Z;c.lj("temporaryPixelRatio")&&(c.hk=1);Bk(c);a.rc=!1;c.Ca("AnimationStarting");Ck(a,b)}})}}
function Dk(a,b,c,d,e,f){if(!(!a.rc||"position"===c&&d.L(e)||b instanceof S&&!b.VE)){var h=a.Nm;if(h.contains(b)){var h=h.na(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=Ek(d));h.Rw&&void 0!==l[c]?h.Ft[c]=Ek(e):(f||(h.Ft[c]=Ek(e)),l[c]=Ek(e));f&&0===c.indexOf("position:")&&(h.Ft.location=Ek(b.location))}else k=new ua,l=new ua,k[c]=Ek(d),l[c]=Ek(e),d=l,e=k.position,e instanceof y&&!e.H()&&a.Xu.contains("Expand SubGraph")&&e.assign(d.position),k=new zk(k,l,f),f&&0===c.indexOf("position:")&&(k.Ft.location=
Ek(b.location)),h.add(b,k);a.ho=!0}}function Ek(a){return a instanceof y?a.copy():a instanceof ia?a.copy():a}
function Ck(a,b){var c;function d(){if(!1!==f.Rj&&f.fo===b){var a=+new Date,c=a>s?m:a-r;Fk(f);Sk(f,e,q,h,c,m);f.iv&&f.iv();Ji(e);Yk(f);a>s?Zk(f):requestAnimationFrame(d)}}void 0===c&&(c=new ua);var e=a.Z;if(null!==e){a.Rj=!0;var f=a,h=c.SK||a.aC,k=c.sL||null,l=c.tL||null,m=c.duration||a.Ly,n=a.HG;for(c=a.Nm.i;c.next();){var p=c.value.start.position;p instanceof y&&(p.H()||p.assign(n))}a.WB=h;a.iv=k;a.jv=l;a.VB=m;a.kv=a.Nm;var q=a.kv;for(c=q.i;c.next();)k=c.value.end,k["position:placeholder"]&&(l=
k["position:placeholder"],n=l.Va(xb),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);Fk(a);Sk(a,e,q,h,0,m);Ji(a.Z);Yk(a);var r=+new Date,s=r+m;f.fo===b&&requestAnimationFrame(function(){d()})}}
var $k={opacity:function(a,b,c,d,e,f){a.opacity=d(e,b,c-b,f)},position:function(a,b,c,d,e,f){e!==f?a.Xx(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):a.position=new y(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},"position:node":function(a,b,c,d,e,f){var h=a.Y,k=c.Y;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==f?a.Xx(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f)):a.position=new y(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f))},"position:placeholder":function(a,b,c,d,e,f){e!==f?a.Xx(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):
a.position=new y(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},scale:function(a,b,c,d,e,f){a.scale=d(e,b,c-b,f)},visible:function(a,b,c,d,e,f){a.visible=e!==f?b:c}};function Fk(a){if(!a.Oo){var b=a.Z;a.LD=b.wb;a.IB=b.Oe;a.JB=b.Fu;b.wb=!0;b.Oe=!0;b.Fu=!0;a.Oo=!0}}function Yk(a){var b=a.Z;b.wb=a.LD;b.Oe=a.IB;b.Fu=a.JB;a.Oo=!1}
function Sk(a,b,c,d,e,f){for(c=c.i;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==$k[m])$k[m](h,l[m],k[m],d,e,f)}d=b.oA;b.oA=!0;m=a.aC;0!==a.kr&&0!==a.jr&&(c=a.kr,b.Lb=m(e,c,a.jr-c,f));null!==a.ir&&null!==a.hr&&(c=a.ir,a=a.hr,b.mb=new y(m(e,c.x,a.x-c.x,f),m(e,c.y,a.y-c.y,f)));b.oA=d}Zg.prototype.stopAnimation=Zg.prototype.oi=function(){!0===this.rc&&(this.rc=!1,this.ho&&this.Z.Me());this.Rj&&this.ff&&Zk(this)};
function Zk(a){a.Rj=!1;a.ho=!1;Fk(a);for(var b=a.Z,c=a.WB,d=a.VB,e=a.kv.i;e.next();){var f=e.key,h=e.value,k=h.start,l=h.end,m=h.Ft,n;for(n in l)if(void 0!==$k[n]){var p=n;!h.Rw||"position:node"!==p&&"position:placeholder"!==p||(p="position");$k[p](f,k[n],void 0!==m[n]?m[n]:h.Rw?k[n]:l[n],c,d,d)}h.Rw&&void 0!==m.location&&(f.location=m.location);h.Nx&&f.vd(!1)}for(c=a.Z.links;c.next();)d=c.value,null!==d.ip&&(d.points=d.ip,d.ip=null);b.Cx.clear();b.hk=null;b.tc();b.oa();b.Yf();al(b);Yk(a);a.jv&&a.jv();
a.fo=0;a.kv=null;a.jv=null;a.iv=null;a.ir=null;a.hr=null;a.kr=0;a.jr=0;a.Nm=new la(G,zk);b.Ca("AnimationFinished");b.Me()}function bl(a,b,c){var d=b.Y,e=c.Y,f=null;c instanceof V&&(f=c.placeholder);null!==f?(d=f.Va(xb),d.x+=f.padding.left,d.y+=f.padding.top,Dk(a,b,"position",d,b.position,!1)):Dk(a,b,"position",new y(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Dk(a,b,"scale",.01,b.scale,!1);if(b instanceof V)for(b=b.Pc;b.next();)f=b.value,f instanceof T&&bl(a,f,c)}
function cl(a,b,c){if(b.isVisible()){var d=null;c instanceof V&&(d=c.placeholder);null!==d?Dk(a,b,"position:placeholder",b.position,d,!0):Dk(a,b,"position:node",b.position,c,!0);Dk(a,b,"scale",b.scale,.01,!0);a.rc&&(d=a.Nm,d.contains(b)&&(d.na(b).Nx=!0));if(b instanceof V)for(b=b.Pc;b.next();)d=b.value,d instanceof T&&cl(a,d,c)}}function dl(a,b,c){a.rc&&(null===a.ir&&b.H()&&null===a.hr&&(a.ir=b.copy()),a.hr=c.copy(),a.ho=!0)}
function el(a,b,c){a.rc&&a.Z.Fn&&(0===a.kr&&0===a.jr&&(a.kr=b),a.jr=c,a.ho=!0)}v.defineProperty(Zg,{isEnabled:"isEnabled"},function(){return this.ff},function(a){v.j(a,"boolean",Zg,"isEnabled");this.ff=a});v.defineProperty(Zg,{duration:"duration"},function(){return this.Ly},function(a){v.j(a,"number",Zg,"duration");1>a&&v.Fa(a,">= 1",Zg,"duration");this.Ly=a});v.u(Zg,{nf:"isAnimating"},function(){return this.Rj});v.u(Zg,{tI:"isTicking"},function(){return this.Oo});
v.defineProperty(Zg,{cF:"isInitial"},function(){return this.Sj},function(a){v.j(a,"boolean",Zg,"isInitial");this.Sj=a});function zk(a,b,c){this.start=a;this.end=b;this.Ft=new ua;this.Rw=c;this.Nx=!1}function qg(){0<arguments.length&&v.ld(qg);v.pc(this);this.Z=null;this.zb=new I(S);this.Qb="";this.xc=1;this.bz=!1;this.rl=this.Cz=this.Tk=this.Sk=this.Rk=this.Qk=this.Ok=this.Pk=this.Nk=this.Vk=this.Mk=this.Uk=this.Lk=this.Kk=!0;this.Yy=!1;this.aw=[]}v.ga("Layer",qg);
qg.prototype.Sc=function(a){this.Z=a};
qg.prototype.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,f=0,h=0,k=this.zb.i;k.next();){var l=k.value;l instanceof V?e++:l instanceof T?d++:l instanceof W?f++:l instanceof mh?h++:c++}k="";0<c&&(k+=c+" Parts ");0<d&&(k+=d+" Nodes ");0<e&&(k+=e+" Groups ");0<f&&(k+=f+" Links ");0<h&&(k+=h+" Adornments ");if(1<a)for(a=this.zb.i;a.next();)c=a.value,k+="\n "+c.toString(),d=c.data,null!==d&&v.Kd(d)&&(k+=" #"+v.Kd(d)),c instanceof T?k+=" "+
Pf(d):c instanceof W&&(k+=" "+Pf(c.W)+" "+Pf(c.aa));return b+" "+this.zb.count+": "+k};qg.prototype.findObjectAt=qg.prototype.Ke=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.rl)return null;var d=!1;null!==this.g&&this.g.tb.Ha(a)&&(d=!0);for(var e=v.K(),f=this.zb.n,h=f.length;h--;){var k=f[h];if((!0!==d||!1!==fl(k))&&k.isVisible()&&(e.assign(a),Ra(e,k.oh),k=k.Ke(e,b,c),null!==k&&(null!==b&&(k=b(k)),null!==k&&(null===c||c(k)))))return v.v(e),k}v.v(e);return null};
qg.prototype.findObjectsAt=qg.prototype.It=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof I||d instanceof J||(d=new J(G));if(!1===this.rl)return d;var e=!1;null!==this.g&&this.g.tb.Ha(a)&&(e=!0);for(var f=v.K(),h=this.zb.n,k=h.length;k--;){var l=h[k];!0===e&&!1===fl(l)||!l.isVisible()||(f.assign(a),Ra(f,l.oh),l.It(f,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l)))}v.v(f);return d};
qg.prototype.findObjectsIn=qg.prototype.xk=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof I||e instanceof J||(e=new J(G));if(!1===this.rl)return e;var f=!1;null!==this.g&&this.g.tb.tk(a)&&(f=!0);for(var h=this.zb.n,k=h.length;k--;){var l=h[k];(!0!==f||!1!==fl(l))&&l.isVisible()&&l.xk(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}return e};
qg.prototype.$z=function(a,b,c,d,e,f,h){if(!1===this.rl)return e;for(var k=this.zb.n,l=k.length;l--;){var m=k[l];(!0!==h||!1!==fl(m))&&f(m)&&m.isVisible()&&m.xk(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}return e};
qg.prototype.findObjectsNear=qg.prototype.un=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof I||e instanceof J)f=e;e=!0}f instanceof I||f instanceof J||(f=new J(G));if(!1===this.rl)return f;var h=!1;null!==this.g&&this.g.tb.Ha(a)&&(h=!0);for(var k=v.K(),l=v.K(),m=this.zb.n,n=m.length;n--;){var p=m[n];!0===h&&!1===fl(p)||!p.isVisible()||(k.assign(a),Ra(k,p.oh),l.l(a.x+b,a.y),Ra(l,p.oh),p.un(k,l,c,d,e,f)&&(null!==c&&(p=c(p)),null===
p||null!==d&&!d(p)||f.add(p)))}v.v(k);v.v(l);return f};g=qg.prototype;g.Cf=function(a,b){if(this.visible){var c;c=void 0===b?a.tb:b;for(var d=this.zb.n,e=d.length,f=0;f<e;f++){var h=d[f];h.OC=f;if(!(h instanceof W&&!1===h.Yg)){if(h instanceof mh){var k=h;if(null!==k.Of)continue}if(gb(h.Y,c))for(h.Cf(!0),gl(h),h=h.Gw;h.next();)k=h.value,sk(k,Infinity,Infinity),k.jc(),k.Cf(!0);else h.Cf(!1),null!==h.Gw&&0<h.Gw.count&&gl(h)}}}};
g.ue=function(a,b,c){if(this.visible&&0!==this.xc&&(void 0===c&&(c=!0),c||!this.Mc)){c=this.zb.n;var d=c.length;if(0!==d){1!==this.xc&&(a.globalAlpha=this.xc);var e=this.aw;e.length=0;for(var f=b.scale,h=0;h<d;h++){var k=c[h];if(fl(k)){if(k instanceof W){var l=k;l.mc&&e.push(l);if(!1===l.Yg)continue}l=k.Y;1<l.width*f||1<l.height*f?k.ue(a,b):hl(k,a)}}a.globalAlpha=1}}};
function il(a,b,c,d){if(a.visible&&0!==a.xc){1!==a.xc&&(b.globalAlpha=a.xc);var e=a.aw;e.length=0;var f=c.scale;a=a.zb.n;for(var h=a.length,k=d.length,l=0;l<h;l++){var m=a[l];if(fl(m)){if(m instanceof W){var n=m;n.mc&&e.push(n);if(!1===n.Yg)continue}var n=jl(m,m.Y),p;a:{p=n;for(var q=d,r=k,s=2/f,u=4/f,t=0;t<r;t++){var x=q[t];if(0!==x.width&&0!==x.height&&p.TE(x.x-s,x.y-s,x.width+u,x.height+u)){p=!0;break a}}p=!1}p&&(1<n.width*f||1<n.height*f?m.ue(b,c):hl(m,b))}}b.globalAlpha=1}}
g.h=function(a,b,c,d,e){var f=this.g;null!==f&&f.Zc(Lf,a,this,b,c,d,e)};g.Wp=function(a,b,c){var d=this.zb;b.Mv=this;if(a>=d.count)a=d.count;else if(d.fa(a)===b)return-1;d.Md(a,b);b.Tt(c);d=this.g;null!==d&&(c?d.oa():d.Wp(b));kl(this,a,b);return a};
g.mf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.mf(a,b,c);var d=this.zb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.fa(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.Ut(c);d.$c(a);d=this.g;null!==d&&(c?d.oa():d.mf(b));b.Mv=null;return a};
function kl(a,b,c){b=ll(a,b,c);if(c instanceof V&&null!==c&&isNaN(c.ao)){if(0!==c.Pc.count){for(var d=-1,e=a.zb.n,f=e.length,h=0;h<f;h++){var k=e[h];if(k===c&&(b=h,0<=d))break;if(0>d&&k.La===c&&(d=h,0<=b))break}!(0>d)&&d<b&&(e=a.zb,e.$c(b),e.Md(d,c))}c=c.La;null!==c&&kl(a,-1,c)}}
function ll(a,b,c){var d=c.ao;if(isNaN(d))return b;a=a.zb;var e=a.count;if(1>=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var f=b-1,h=NaN;0<=f;){h=a.fa(f).ao;if(!isNaN(h))break;f--}for(var k=b+1,l=NaN;k<e;){l=a.fa(k).ao;if(!isNaN(l))break;k++}if(!isNaN(h)&&h>d)for(;;){if(-1===f||h<=d){f++;if(f===b)break;a.$c(b);a.Md(f,c);return f}for(h=NaN;0<=--f&&(h=a.fa(f).ao,isNaN(h)););}else if(!isNaN(l)&&l<d)for(;;){if(k===e||l>=d){k--;if(k===b)break;a.$c(b);a.Md(k,c);return k}for(l=NaN;++k<e&&(l=a.fa(k).ao,
isNaN(l)););}return b}g.clear=function(){for(var a=this.zb.fc(),b=a.length,c=0;c<b;c++)a[c].Cf(!1),this.mf(-1,a[c],!1)};v.u(qg,{Gk:"parts"},function(){return this.zb.i});v.u(qg,{AL:"partsBackwards"},function(){return this.zb.Gn});v.u(qg,{g:"diagram"},function(){return this.Z});
v.defineProperty(qg,{name:"name"},function(){return this.Qb},function(a){v.j(a,"string",qg,"name");var b=this.Qb;if(b!==a){var c=this.g;if(null!==c)for(""===b&&v.k("Cannot rename default Layer to: "+a),c=c.Ax;c.next();)c.value.name===a&&v.k("Layer.name is already present in this diagram: "+a);this.Qb=a;this.h("name",b,a);for(a=this.zb.i;a.next();)a.value.Xf=this.Qb}});
v.defineProperty(qg,{opacity:"opacity"},function(){return this.xc},function(a){var b=this.xc;b!==a&&(v.j(a,"number",qg,"opacity"),(0>a||1<a)&&v.Fa(a,"0 <= value <= 1",qg,"opacity"),this.xc=a,this.h("opacity",b,a),a=this.g,null!==a&&a.oa())});v.defineProperty(qg,{Mc:"isTemporary"},function(){return this.bz},function(a){var b=this.bz;b!==a&&(v.j(a,"boolean",qg,"isTemporary"),this.bz=a,this.h("isTemporary",b,a))});
v.defineProperty(qg,{visible:"visible"},function(){return this.Cz},function(a){var b=this.Cz;if(b!==a){v.j(a,"boolean",qg,"visible");this.Cz=a;this.h("visible",b,a);for(b=this.zb.i;b.next();)b.value.vd(a);a=this.g;null!==a&&a.oa()}});v.defineProperty(qg,{Qg:"pickable"},function(){return this.rl},function(a){var b=this.rl;b!==a&&(v.j(a,"boolean",qg,"pickable"),this.rl=a,this.h("pickable",b,a))});
v.defineProperty(qg,{WE:"isBoundsIncluded"},function(){return this.Yy},function(a){this.Yy!==a&&(this.Yy=a,null!==this.g&&this.g.tc())});v.defineProperty(qg,{qk:"allowCopy"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(v.j(a,"boolean",qg,"allowCopy"),this.Kk=a,this.h("allowCopy",b,a))});v.defineProperty(qg,{gn:"allowDelete"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(v.j(a,"boolean",qg,"allowDelete"),this.Lk=a,this.h("allowDelete",b,a))});
v.defineProperty(qg,{Kw:"allowTextEdit"},function(){return this.Uk},function(a){var b=this.Uk;b!==a&&(v.j(a,"boolean",qg,"allowTextEdit"),this.Uk=a,this.h("allowTextEdit",b,a))});v.defineProperty(qg,{Hw:"allowGroup"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(v.j(a,"boolean",qg,"allowGroup"),this.Mk=a,this.h("allowGroup",b,a))});
v.defineProperty(qg,{Lw:"allowUngroup"},function(){return this.Vk},function(a){var b=this.Vk;b!==a&&(v.j(a,"boolean",qg,"allowUngroup"),this.Vk=a,this.h("allowUngroup",b,a))});v.defineProperty(qg,{vt:"allowLink"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(v.j(a,"boolean",qg,"allowLink"),this.Nk=a,this.h("allowLink",b,a))});
v.defineProperty(qg,{hn:"allowRelink"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(v.j(a,"boolean",qg,"allowRelink"),this.Pk=a,this.h("allowRelink",b,a))});v.defineProperty(qg,{Bl:"allowMove"},function(){return this.Ok},function(a){var b=this.Ok;b!==a&&(v.j(a,"boolean",qg,"allowMove"),this.Ok=a,this.h("allowMove",b,a))});
v.defineProperty(qg,{Iw:"allowReshape"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(v.j(a,"boolean",qg,"allowReshape"),this.Qk=a,this.h("allowReshape",b,a))});v.defineProperty(qg,{wt:"allowResize"},function(){return this.Rk},function(a){var b=this.Rk;b!==a&&(v.j(a,"boolean",qg,"allowResize"),this.Rk=a,this.h("allowResize",b,a))});
v.defineProperty(qg,{Jw:"allowRotate"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(v.j(a,"boolean",qg,"allowRotate"),this.Sk=a,this.h("allowRotate",b,a))});v.defineProperty(qg,{vf:"allowSelect"},function(){return this.Tk},function(a){var b=this.Tk;b!==a&&(v.j(a,"boolean",qg,"allowSelect"),this.Tk=a,this.h("allowSelect",b,a))});
function E(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);ml(c)}1<arguments.length&&v.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");v.pc(this);nl=[];this.Vc=!0;this.CB=new Zg;this.CB.Sc(this);this.Fd=17;this.Ir=!1;this.nz="default";var c=this;null!==window.document.body?ml(this):window.document.addEventListener("DOMContentLoaded",b,!1);this.ac=new I(qg);this.Mb=this.Ib=0;this.ek=this.Nb=this.uf=this.Eb=null;this.FF();this.Lo=
null;this.EF();this.mb=(new y(NaN,NaN)).freeze();this.Lb=1;this.Dv=(new y(NaN,NaN)).freeze();this.Ev=NaN;this.Tv=1E-4;this.Rv=100;this.fd=new ja;this.Ew=(new y(NaN,NaN)).freeze();this.vv=(new B(NaN,NaN,NaN,NaN)).freeze();this.mw=(new mb(0,0,0,0)).freeze();this.nw=ol;this.jw=this.fw=null;this.om=Dh;this.oo=nc;this.el=Dh;this.Io=nc;this.Fv=this.Cv=xb;this.De=!0;this.Er=!1;this.pg=new J(S);this.Zk=new la(W,B);this.zo=!0;this.HB=250;this.io=-1;this.$u=(new mb(16,16,16,16)).freeze();this.ov=this.Nf=!1;
this.Do=!0;this.Gi=new pf;this.Wc=new pf;this.Pb=new pf;this.fh=this.ui=null;this.ct=!1;this.Gy=this.Hy=null;pl(this);this.bp=new J(T);this.ul=new J(V);this.Vo=new J(W);this.zb=new J(S);this.Kv=!0;this.zw=ql;this.AC=!1;this.Bw=Ni;this.By=this.Ey=this.zz=null;this.hv="";this.gr="auto";this.yi=this.bj=this.Qi=this.Wv=this.Ri=this.Si=this.Ti=this.xi=this.Di=this.vi=null;this.jz=!1;this.hD={};this.ew=0;this.Xi=[null,null];this.yy=null;this.Fq=this.Fy=this.uz=this.oD=this.aj=!1;this.LC=!0;this.$y=this.Xd=
!1;this.me=null;var d=this;this.TC=function(a){if(a.ca===d.ca&&d.Ua){d.Ua=!1;try{var b=a.zc;""===a.rf&&b===Lf&&rl(d,a.object,a.propertyName)}finally{d.Ua=!0}}};this.UC=function(a){sl(d,a)};this.OD=!0;this.bh=-2;this.zi=new la(Object,S);this.Gj=new la(Object,W);this.Cm=new la(Object,Array);this.dp=new la("string",Array);this.mz=new I(tl);this.Ii=!1;this.Lk=this.Kk=this.Pu=this.ff=!0;this.Ru=this.Qu=!1;this.Wu=this.Uu=this.Tk=this.Sk=this.Rk=this.Qk=this.Ok=this.Pk=this.Nk=this.Tu=this.Vk=this.Mk=this.Uk=
!0;this.Am=this.IC=!1;this.Vu=this.Su=this.Av=this.zv=!0;this.pw=this.lw=16;this.pz=this.kw=!1;this.Ls=this.ow=null;this.qz=this.rz=0;this.jf=(new mb(5)).freeze();this.rw=(new J(S)).freeze();this.Sv=999999999;this.Bv=(new J(S)).freeze();this.fl=this.ym=this.Qj=!0;this.cl=this.Pj=!1;this.ke=null;this.Yu=!0;this.dh=!1;this.AG=new J(W);this.yC=new J(ul);this.Ed=null;this.ZC=1;this.rD=0;this.mh={scale:1,position:new y,bounds:new B,isScroll:!1};this.ND=(new B(NaN,NaN,NaN,NaN)).freeze();this.pv=(new B(NaN,
NaN,NaN,NaN)).freeze();this.bw=new J(vl);wl(this);this.Ov=this.xv=this.Xv=this.dC=this.cC=this.eC=this.Yj=this.al=this.Ui=null;xl(this);this.qd=null;this.wv=!1;this.ro=null;this.$a=new kh;this.$a.initializeStandardTools();this.Ya=this.Bt=this.$a;this.pb=new sg;this.ca=new Q;this.aj=!0;this.Rb=new tg;this.aj=!1;this.qC=this.Jy=null;this.Cd=1;this.hk=null;this.dl=new yl;void 0!==a&&zl(this,a);var e=v.vfo.split(".");!0!==v.Ww.licenseKey&&"1"===e[0]&&7>e[1]&&(v.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+
v.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),v.Ww.licenseKey=!0);this.jl=1;this.Em=0;this.NC=new y;this.JD=500;this.Zu=new y;this.Us=null;this.Vc=this.gl=!1}v.ga("Diagram",E);
E.prototype.clear=E.prototype.clear=function(){var a=null;null!==this.qd&&(a=this.qd.V);this.ca.clear();for(var b=this.ac.length,c=0;c<b;c++)this.ac.n[c].clear();this.pg.clear();this.Zk.clear();this.bp.clear();this.ul.clear();this.Vo.clear();this.zb.clear();this.zi.clear();this.Gj.clear();this.Cm.clear();this.rw.Ra();this.rw.clear();this.rw.freeze();this.Bv.Ra();this.Bv.clear();this.Bv.freeze();ih=this.ro=null;jh="";this.pv=(new B(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.zb.remove(a));
this.oa()};
E.prototype.reset=E.prototype.reset=function(){this.Vc=!0;this.clear();this.ac=new I(qg);this.FF();this.EF();this.mb=(new y(NaN,NaN)).freeze();this.Lb=1;this.Dv=(new y(NaN,NaN)).freeze();this.Ev=NaN;this.Tv=1E-4;this.Rv=100;this.Ew=(new y(NaN,NaN)).freeze();this.vv=(new B(NaN,NaN,NaN,NaN)).freeze();this.mw=(new mb(0,0,0,0)).freeze();this.nw=ol;this.jw=this.fw=null;this.om=Dh;this.oo=nc;this.el=Dh;this.Io=nc;this.Fv=this.Cv=xb;this.HB=250;this.$u=(new mb(16,16,16,16)).freeze();this.Kv=!0;this.zw=ql;
this.Bw=Ni;this.gr="auto";this.yi=this.bj=this.Qi=this.Wv=this.Ri=this.Si=this.Ti=this.xi=this.Di=this.vi=null;this.Ii=!1;this.Lk=this.Kk=this.Pu=this.ff=!0;this.Ru=this.Qu=!1;this.Vu=this.Su=this.Av=this.zv=this.Wu=this.Uu=this.Tk=this.Sk=this.Rk=this.Qk=this.Ok=this.Pk=this.Nk=this.Tu=this.Vk=this.Mk=this.Uk=!0;this.pw=this.lw=16;this.jf=(new mb(5)).freeze();this.Sv=999999999;this.ke=null;xl(this);this.qd=null;this.$a=new kh;this.$a.initializeStandardTools();this.Ya=this.Bt=this.$a;this.pb=new sg;
this.aj=!0;wl(this);this.Rb=new tg;this.aj=!1;this.ca=new Q;this.dh=!1;this.Do=!0;this.Vc=this.Nf=!1;this.oa();this.fh=this.ui=null;pl(this);this.hv=""};
function xl(a){a.Ui=new la("string",S);var b=new T,c=new Fh;c.bind(new dh("text","",Pf));b.add(c);a.eC=b;a.Ui.add("",b);b=new T;c=new Fh;c.stroke="brown";c.bind(new dh("text","",Pf));b.add(c);a.Ui.add("Comment",b);b=new T;b.bm=!1;b.Jz=!1;c=new X;c.Cb="Ellipse";c.fill="black";c.stroke=null;c.Ba=(new ia(3,3)).Ga();b.add(c);a.Ui.add("LinkLabel",b);a.al=new la("string",V);b=new V;b.VA="GROUPPANEL";b.type=Al;c=new Fh;c.font="bold 12pt sans-serif";c.bind(new dh("text","",Pf));b.add(c);c=new D(Bl);c.name=
"GROUPPANEL";var d=new X;d.Cb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new xj;d.padding=(new mb(5,5,5,5)).Ga();c.add(d);b.add(c);a.cC=b;a.al.add("",b);a.Yj=new la("string",W);b=new W;c=new X;c.Vf=!0;b.add(c);c=new X;c.zq="Standard";c.fill="black";c.stroke=null;c.fb=0;b.add(c);a.dC=b;a.Yj.add("",b);b=new W;c=new X;c.Vf=!0;c.stroke="brown";b.add(c);a.Yj.add("Comment",b);b=new mh;b.type=Bl;c=new X;c.fill=null;c.stroke="dodgerblue";c.fb=3;b.add(c);c=new xj;c.margin=(new mb(1.5,
1.5,1.5,1.5)).Ga();b.add(c);a.Xv=b;a.xv=b;b=new mh;b.type=$i;c=new X;c.Vf=!0;c.fill=null;c.stroke="dodgerblue";c.fb=3;b.add(c);a.Ov=b}
function ml(a){var b=v.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=v.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.style.boxSizing="content-box";c.appendChild(b);window.document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);window.document.body.removeChild(c);c=d-b;0!==c||v.aF||
(c=11);a.Fd=c;c=v.createElement("div");c.dir="rtl";c.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";c.textContent="A";window.document.body.appendChild(c);d="reverse";0<c.scrollLeft?d="default":(c.scrollLeft=1,0===c.scrollLeft&&(d="negative"));window.document.body.removeChild(c);a.nz=d}E.prototype.ic=function(a){a.Ge===E?this.Dl=a:v.Aj(this,a)};
E.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.id&&(b=this.id);this.ij&&this.ij.id&&(b=this.ij.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.ac.i;c.next();)b+="\n "+c.value.toString(a-1);return b};E.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Z instanceof E?b.Z:null};
v.defineProperty(E,{ij:"div"},function(){return this.Nb},function(a){null!==a&&v.F(a,HTMLDivElement,E,"div");if(this.Nb!==a){nl=[];var b=this.Nb;null!==b?(b.Z=void 0,b.innerHTML="",null!==this.Eb&&(this.Eb.removeEventListener("touchstart",this.hG,!1),this.Eb.removeEventListener("touchmove",this.gG,!1),this.Eb.removeEventListener("touchend",this.fG,!1),this.Eb.td.Z=null),b=this.$a,null!==b&&(b.cf.each(function(a){a.cancelWaitAfter()}),b.Zf.each(function(a){a.cancelWaitAfter()}),b.$f.each(function(a){a.cancelWaitAfter()})),
b.cancelWaitAfter(),this.Ya.doCancel(),this.uf=this.Eb=null,window.removeEventListener("resize",this.qG,!1),window.removeEventListener("mousemove",this.fq,!0),window.removeEventListener("mousedown",this.eq,!0),window.removeEventListener("mouseup",this.hq,!0),window.removeEventListener("mousewheel",this.zh,!0),window.removeEventListener("DOMMouseScroll",this.zh,!0),window.removeEventListener("mouseout",this.gq,!0)):this.dh=!1;this.Nb=null;if(null!==a){if(b=a.Z)b.ij=null;zl(this,a);this.Mx()}}});
function Cl(a){var b=a.Eb;b.addEventListener("touchstart",a.hG,!1);b.addEventListener("touchmove",a.gG,!1);b.addEventListener("touchend",a.fG,!1);b.addEventListener("mousemove",a.fq,!1);b.addEventListener("mousedown",a.eq,!1);b.addEventListener("mouseup",a.hq,!1);b.addEventListener("mousewheel",a.zh,!1);b.addEventListener("DOMMouseScroll",a.zh,!1);b.addEventListener("mouseout",a.gq,!1);b.addEventListener("keydown",a.vI,!1);b.addEventListener("keyup",a.wI,!1);b.addEventListener("selectstart",function(a){a.preventDefault();
return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.$a.Tp===uk&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.aJ,!1);b.addEventListener("pointermove",a.cJ,!1);b.addEventListener("pointerleave",a.bJ,!1);window.addEventListener("resize",a.qG,!1)}E.prototype.computePixelRatio=function(){return null!==this.hk?this.hk:this.EG};E.prototype.doMouseMove=function(){this.Ya.doMouseMove()};
E.prototype.doMouseDown=function(){this.Ya.doMouseDown()};E.prototype.doMouseUp=function(){this.Ya.doMouseUp()};E.prototype.doMouseWheel=function(){this.Ya.doMouseWheel()};E.prototype.doKeyDown=function(){this.Ya.doKeyDown()};E.prototype.doKeyUp=function(){this.Ya.doKeyUp()};E.prototype.doFocus=function(){this.focus()};E.prototype.focus=E.prototype.focus=function(){this.Eb&&this.Eb.focus()};
function Bk(a){if(null!==a.Eb){var b=a.Nb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.cl?a.Fd:0,d=a.Pj?a.Fd:0,e=a.Cd;a.Cd=a.computePixelRatio();a.Cd!==e&&(a.Er=!0,a.Me());if(b.clientWidth!==a.Ib+c||b.clientHeight!==a.Mb+d)a.ym=!0,a.De=!0,b=a.Rb,null!==b&&b.wx&&a.Dl===Dh&&b.J(),a.Xd||a.Me()}}}
function wl(a){var b=new qg;b.name="Background";a.pt(b);b=new qg;b.name="";a.pt(b);b=new qg;b.name="Foreground";a.pt(b);b=new qg;b.name="Adornment";b.Mc=!0;a.pt(b);b=new qg;b.name="Tool";b.Mc=!0;b.WE=!0;a.pt(b);b=new qg;b.name="Grid";b.vf=!1;b.Qg=!1;b.Mc=!0;a.YG(b,a.Ht("Background"))}
function Dl(a){a.qd=new D(El);a.qd.name="GRID";var b=new X;b.Cb="LineH";b.stroke="lightgray";b.fb=.5;b.interval=1;a.qd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.fb=.5;b.interval=5;a.qd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.fb=1;b.interval=10;a.qd.add(b);b=new X;b.Cb="LineV";b.stroke="lightgray";b.fb=.5;b.interval=1;a.qd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.fb=.5;b.interval=5;a.qd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.fb=1;b.interval=10;a.qd.add(b);b=new S;b.add(a.qd);
b.Xf="Grid";b.ao=0;b.qA=!1;b.VE=!1;b.Qg=!1;b.uA="GRID";a.add(b);a.zb.remove(b);a.qd.visible=!1}E.prototype.GG=function(){this.Z.isEnabled?this.Z.GH(this):Fl(this.Z)};E.prototype.YC=function(a){this.Z.isEnabled?(this.Z.pz=!0,this.Z.rz=a.target.scrollTop,this.Z.qz=a.target.scrollLeft):Fl(this.Z)};
E.prototype.diagramScroll=E.prototype.GH=function(a){if(this.pz&&null!==this.Eb){this.kw=!0;var b=this.se,c=this.tb,d=b.width,e=c.width,f=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=this.scale,s;s=a.scrollLeft;if(this.Ir)switch(this.nz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;e<d||h<f?(s=v.xb(this.position.x,this.position.y),this.oe&&this.qz!==u&&(s.x=u/r+p,this.qz=u),this.pe&&this.rz!==
a.scrollTop&&(s.y=a.scrollTop/r+b,this.rz=a.scrollTop),this.position=s,v.v(s),this.ym=this.kw=!1):(s=v.K(),a.KG&&this.oe&&(p<q&&(this.position=s.l(u+p,this.position.y)),k>l&&(this.position=s.l(-(this.ow.scrollWidth-this.Ib)+u-this.Ib/r+k,this.position.y))),a.LG&&this.pe&&(b<c&&(this.position=s.l(this.position.x,a.scrollTop+b)),m>n&&(this.position=s.l(this.position.x,-(this.ow.scrollHeight-this.Mb)+a.scrollTop-this.Mb/r+m))),v.v(s),Gl(this),this.ym=this.kw=!1,b=this.se,c=this.tb,k=b.right,l=c.right,
m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(this.Ls.style.width="1px"),h>=f&&b>=c&&m<=n&&(this.Ls.style.height="1px"))}};E.prototype.computeBounds=E.prototype.rh=function(){0<this.pg.count&&zi(this);return Hl(this)};
function Hl(a){if(a.DE.H()){var b=a.DE.copy();b.Fw(a.padding);return b}for(var c=!0,d=a.ac.n,e=d.length,f=0;f<e;f++){var h=d[f];if(h.visible&&(!h.Mc||h.WE))for(var h=h.zb.n,k=h.length,l=0;l<k;l++){var m=h[l];m.qA&&m.isVisible()&&(m=m.Y,m.H()&&(c?(c=!1,b=m.copy()):b.Gh(m)))}}c&&(b=new B(0,0,0,0));b.Fw(a.padding);return b}
E.prototype.computePartsBounds=function(a,b){void 0===b&&(b=!1);for(var c=null,d=a.i;d.next();){var e=d.value;!b&&e instanceof W||(e.af(),null===c?c=e.Y.copy():c.Gh(e.Y))}return null===c?new B(NaN,NaN,0,0):c};
function Il(a,b){if((b||a.dh)&&!a.Vc&&null!==a.Eb&&!a.Qa.nf&&a.se.H()){a.Vc=!0;var c=a.om;b&&a.el!==Dh&&(c=a.el);var d=c!==Dh?Jl(a,c):a.scale,c=a.tb.copy(),e=a.Ib/d,f=a.Mb/d,h=null,k=a.Qa;k.rc&&(h=a.mb.copy());a.position.Ra();var l=a.oo;b&&!l.jd()&&a.Io.jd()&&(l=a.Io);Kl(a,a.mb,a.se,e,f,l,b);a.position.freeze();null!==h&&dl(k,h,a.mb);e=a.scale;a.scale=d;a.Vc=!1;d=a.tb;d.Lc(c)||a.qu(c,d,e,a.scale,!1)}}
function Jl(a,b){var c=a.pb.Uw;if(null===a.Eb)return c;a.Qj&&Ll(a,a.rh());var d=a.se;if(!d.H())return c;var e=d.width,d=d.height,f=a.Ib,h=a.Mb,k=f/e,l=h/d;return b===Ml?(e=Math.min(l,k),e>c&&(e=c),e<a.xh&&(e=a.xh),e>a.wh&&(e=a.wh),e):b===Nl?(e=l>k?(h-a.Fd)/d:(f-a.Fd)/e,e>c&&(e=c),e<a.xh&&(e=a.xh),e>a.wh&&(e=a.wh),e):a.scale}E.prototype.zoomToFit=E.prototype.zoomToFit=function(){this.scale=Jl(this,Ml)};
E.prototype.zoomToRect=function(a,b){void 0===b&&(b=Ml);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Ml||b===Nl)if(isNaN(c))e=this.tb.height*this.scale/d;else if(isNaN(d))e=this.tb.width*this.scale/c;else var e=this.Ib,f=this.Mb,e=b===Nl?f/d>e/c?(f-(this.Pj?this.Fd:0))/d:(e-(this.cl?this.Fd:0))/c:Math.min(f/d,e/c);this.scale=e;this.position=new y(a.x,a.y)}};v.defineProperty(E,{oA:null},function(){return this.Vc},function(a){this.Vc=a});
E.prototype.alignDocument=function(a,b){this.Qj&&Ll(this,this.rh());var c=this.se,d=this.tb;this.position=new y(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))};
function Kl(a,b,c,d,e,f,h){var k=b.x,l=b.y;if(h||a.SA===ol)f.jd()&&(d>c.width&&(k=c.x+(f.x*c.width+f.offsetX)-(f.x*d-f.offsetX)),e>c.height&&(l=c.y+(f.y*c.height+f.offsetY)-(f.y*e-f.offsetY))),f=a.MF,h=d-c.width,d<c.width+f.left+f.right?(k=Math.min(k+d/2,c.right+Math.max(h,f.right)-d/2),k=Math.max(k,c.left-Math.max(h,f.left)+d/2),k-=d/2):k>c.left?k=c.left:k<c.right-d&&(k=c.right-d),d=e-c.height,e<c.height+f.top+f.bottom?(l=Math.min(l+e/2,c.bottom+Math.max(d,f.bottom)-e/2),l=Math.max(l,c.top-Math.max(d,
f.top)+e/2),l-=e/2):l>c.top?l=c.top:l<c.bottom-e&&(l=c.bottom-e);b.x=isFinite(k)?k:-a.padding.left;b.y=isFinite(l)?l:-a.padding.top;null!==a.xF&&(a=a.xF(a,b),b.x=a.x,b.y=a.y)}E.prototype.findPartAt=E.prototype.Jt=function(a,b){var c=b?Di(this,a,function(a){return a.V},function(a){return a.canSelect()}):Di(this,a,function(a){return a.V});return c instanceof S?c:null};
E.prototype.findObjectAt=E.prototype.Ke=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);zi(this);for(var d=this.ac.Gn;d.next();){var e=d.value;if(e.visible&&(e=e.Ke(a,b,c),null!==e))return e}return null};function Di(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);zi(a);for(a=a.ac.Gn;a.next();){var e=a.value;if(e.visible&&!e.Mc&&(e=e.Ke(b,c,d),null!==e))return e}return null}
E.prototype.findObjectsAt=E.prototype.It=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof I||d instanceof J||(d=new J(G));zi(this);for(var e=this.ac.Gn;e.next();){var f=e.value;f.visible&&f.It(a,b,c,d)}return d};E.prototype.findObjectsIn=E.prototype.xk=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof I||e instanceof J||(e=new J(G));zi(this);for(var f=this.ac.Gn;f.next();){var h=f.value;h.visible&&h.xk(a,b,c,d,e)}return e};
E.prototype.$z=function(a,b,c,d,e,f){var h=new J(G);zi(this);for(var k=this.ac.Gn;k.next();){var l=k.value;l.visible&&l.$z(a,b,c,d,h,e,f)}return h};E.prototype.findObjectsNear=E.prototype.un=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof I||e instanceof J)f=e;e=!0}f instanceof I||f instanceof J||(f=new J(G));zi(this);for(var h=this.ac.Gn;h.next();){var k=h.value;k.visible&&k.un(a,b,c,d,e,f)}return f};
E.prototype.acceptEvent=function(a){var b=this.Wc;this.Wc=this.Pb;this.Pb=b;Ol(this,this,a,b,a instanceof MouseEvent);return b};
function Ol(a,b,c,d,e){d.g=b;d.event=c;e?Pl(a,c,d):(d.ef=b.Pb.ef,d.da=b.Pb.da);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.wd=a;d.button=c.button;c.buttons&&(d.buttons=c.buttons);v.Dk&&0===c.button&&c.ctrlKey&&(d.button=2);d.Ll=!1;d.up=!1;d.He=1;d.Kl=0;d.Cc=!1;d.bubbles=!1;d.timestamp=Date.now();d.au=!1;d.Tg=c.target.Z?c.target.Z:null;d.Pe=null}
function Ql(a,b,c,d,e){d.g=a;Pl(a,c,d);d.wd=0;d.button=0;d.buttons=1;d.Ll=!0;d.up=!1;d.He=1;d.Kl=0;d.Cc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.au=e;d.Tg=b.target.Z?b.target.Z:null;d.Pe=null;a.Gi=d.copy();Mh=null}
function Rl(a,b,c,d,e){var f=null;d.g=a;null!==c?((f=window.document.elementFromPoint(c.clientX,c.clientY))&&f.Z?f=f.Z:(c=b.changedTouches[0],f=a),d.Tg=f,Pl(a,c,d)):null!==a.Wc?(d.da=a.Wc.da,d.ef=a.Wc.ef,d.Tg=a.Wc.Tg):null!==a.Gi&&(d.da=a.Gi.da,d.ef=a.Gi.ef,d.Tg=a.Gi.Tg);d.wd=0;d.button=0;d.buttons=1;d.Ll=!1;d.up=!1;d.He=1;d.Kl=0;d.Cc=!1;d.bubbles=!1;d.event=b;d.timestamp=Date.now();d.au=e;d.Pe=null}
function Sl(a,b){if(a.bubbles)return!0;void 0!==b.stopPropagation&&b.stopPropagation();(void 0===b.touches||2>b.touches.length)&&b.preventDefault();b.cancelBubble=!0;return!1}
E.prototype.vI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Pb;Ol(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.Ll=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key=
"Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.Z.doKeyDown();return 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?Sl(b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)};
E.prototype.wI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Pb;Ol(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 93:a.preventDefault()}this.Z.doKeyUp();
return Sl(b,a)};E.prototype.wr=function(a){var b=this.Eb;if(null===b)return new y(0,0);var c=this.Ib,d=this.Mb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.fd?(a=new y(c,a),Ra(a,this.fd),a):new y(c,a)};function Pl(a,b,c){var d=a.Eb,e=a.Ib,f=a.Mb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-f/d.height*d.top);c.ef.l(h,k);null!==a.fd?(b=v.xb(h,k),a.fd.ki(b),c.da.assign(b),v.v(b)):c.da.l(h,k)}
function qf(a,b,c,d){var e=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.Xi[0])e=a.Xi[c];else return;c=a.Eb;b=a.Ib;a=a.Mb;var f=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),f=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.l(f,h)}E.prototype.invalidateDocumentBounds=E.prototype.tc=function(){this.Qj||(this.Qj=!0,this.Me(!0))};function al(a){a.Xd||zi(a);a.Qj&&Ll(a,a.rh())}
E.prototype.redraw=E.prototype.Mx=function(){this.Vc||this.Xd||(this.oa(),Tl(this),Gl(this),this.tc(),this.Yf())};E.prototype.isUpdateRequested=function(){return this.Nf};E.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Qa,c=b.isEnabled;b.oi();b.isEnabled=!1;Ji(this);this.dh=!1;b.isEnabled=c;null!==a&&v.setTimeout(a,1)};
E.prototype.requestUpdate=E.prototype.Me=function(a){void 0===a&&(a=!1);if(!0!==this.Nf&&!(this.Vc||!1===a&&this.Xd)){this.Nf=!0;var b=this;requestAnimationFrame(function(){b.Nf&&b.Yf()})}};E.prototype.maybeUpdate=E.prototype.Yf=function(){if(!this.Do||this.Nf)this.Do&&(this.Do=!1),Ji(this)};function Ul(a,b){a.Qa.nf||a.Vc||!a.ym||Fl(a)||(b&&zi(a),Il(a,!1))}
function Ji(a){if(!a.Xd&&(a.Nf=!1,null!==a.Nb)){a.Xd=!0;var b=a.Qa,c=a.mz;if(!b.Oo&&0!==c.length){for(var d=c.n,e=d.length,f=0;f<e;f++){var h=d[f];Vl(h,!1);h.I()}c.clear()}c=a.yC;0<c.count&&(c.each(function(a){a.nB()}),c.clear());d=c=!1;b.nf&&(d=!0,c=a.wb,a.wb=!0);b.rc||Bk(a);Ul(a,!1);null!==a.qd&&(a.qd.visible&&!a.wv&&(Wl(a),a.wv=!0),!a.qd.visible&&a.wv&&(a.wv=!1));zi(a);e=!1;if(!a.dh||a.Yu)a.dh?Xl(a,!a.ov):(a.Tb("Initial Layout"),!1===b.isEnabled&&b.oi(),Xl(a,!1)),e=!0;a.ov=!1;zi(a);a.uz||b.nf||
al(a);Ul(a,!0);e&&(a.dh||Yl(a),a.Ca("LayoutCompleted"));zi(a);e&&!a.dh&&(a.dh=!0,a.Hd("Initial Layout"),a.wb||a.pa.clear(),v.setTimeout(function(){a.mi=!1},1));Zl(a);Ak(b);a.ue();d&&(a.wb=c);a.Xd=!1}}v.u(E,{Fn:null},function(){return this.dh});
function Yl(a){var b=a.ac.n;a.Cf(b,b.length,a);a.el!==Dh?a.scale=Jl(a,a.el):a.om!==Dh?a.scale=Jl(a,a.om):(b=a.jI,isFinite(b)&&0<b&&(a.scale=b));b=a.iI;if(b.H())a.position=b;else{b=v.K();b.Sn(a.se,a.hI);var c=a.tb,c=v.Ug(0,0,c.width,c.height),d=v.K();d.Sn(c,a.kI);d.l(b.x-d.x,b.y-d.y);a.position=d;v.Gb(c);v.v(d);v.v(b);Tl(a);Ul(a,!0);Il(a,!0)}a.Ca("InitialLayoutCompleted");Wl(a)}
function zi(a){if((a.Xd||!a.Qa.nf)&&0!==a.pg.count){for(var b=0;23>b;b++){var c=a.pg.i;if(null===c||0===a.pg.count)break;a.pg=new J(G);a.nB(c,a.pg)}a.dg.each(function(a){a instanceof V&&0!==(a.za&65536)!==!1&&(a.za^=65536)})}}
E.prototype.nB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.ee()||c instanceof V||(c.Wl()?(sk(c,Infinity,Infinity),c.jc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof V&&c.isVisible()&&am(this,c);for(a.reset();a.next();)c=a.value,c instanceof W&&c.isVisible()&&(c.Wl()?(sk(c,Infinity,Infinity),c.jc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof mh&&c.isVisible()&&(c.Wl()?(sk(c,Infinity,Infinity),c.jc()):b.add(c))};
function am(a,b){for(var c=v.lb(),d=v.lb(),e=b.Pc;e.next();){var f=e.value;f.isVisible()&&(f instanceof V?(tm(f)||um(f)||vm(f))&&am(a,f):f instanceof W?f.W===b||f.aa===b?d.push(f):c.push(f):(sk(f,Infinity,Infinity),f.jc()))}for(var e=c.length,h=0;h<e;h++)f=c[h],sk(f,Infinity,Infinity),f.jc();v.wa(c);sk(b,Infinity,Infinity);b.jc();e=d.length;for(h=0;h<e;h++)f=d[h],sk(f,Infinity,Infinity),f.jc();v.wa(d)}E.prototype.Cf=function(a,b,c,d){var e=this.Qa;if(this.fl||e.nf)for(e=0;e<b;e++)a[e].Cf(c,d)};
E.prototype.ue=function(a,b){void 0===a&&(a=this.uf);void 0===b&&(b=null);null===this.Nb&&v.k("No div specified");var c=this.Eb;null===c&&v.k("No canvas specified");var d=this.Qa;if(!d.rc&&(wm(this),"0"!==this.Nb.style.opacity)){var e=a!==this.uf,f=this.ac.n,h=f.length,k=this;this.Cf(f,h,k);if(e)Yc(a,!0),Gl(this);else if(!this.De&&null===b&&!d.Rj)return;var h=this.mb,l=this.Lb,m=Math.round(h.x*l)/l,n=Math.round(h.y*l)/l,d=this.fd;d.reset();1!==l&&d.scale(l);0===h.x&&0===h.y||d.translate(-m,-n);l=
this.Cd;v.Dn?(c.width=c.width,Yc(a,!0),a.scale(l,l)):(a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.clearRect(0,0,this.Ib,this.Mb));a.setTransform(1,0,0,1,0,0);a.scale(l,l);a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=null!==b?function(c){var d=a,e=b;if(c.visible&&0!==c.xc){var f=c.zb.n,h=f.length;if(0!==h){1!==c.xc&&(d.globalAlpha=c.xc);c=c.aw;c.length=0;for(var l=k.scale,m=0;m<h;m++){var n=f[m];if(fl(n)&&!e.contains(n)){if(n instanceof W){var z=n;z.mc&&c.push(z);if(!1===z.Yg)continue}z=n.Y;1<z.width*
l||1<z.height*l?n.ue(d,k):hl(n,d)}}d.globalAlpha=1}}}:function(b){b.ue(a,k)};xm(this,a);h=f.length;for(m=0;m<h;m++)a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c(f[m]);this.dl?this.dl.im(this)&&this.Ky():this.wr=function(){return new y(0,0)};e?(Yc(this.uf,!0),Gl(this)):this.De=this.fl=!1}};
function ym(a,b,c,d,e){null===a.Nb&&v.k("No div specified");var f=a.Eb;null===f&&v.k("No canvas specified");if(!a.Qa.rc){var h=a.uf;if(a.De){wm(a);var k=a.Cd;v.Dn?(f.width=f.width,Yc(h,!0)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Ib*k,a.Mb*k));h.St=!1;h.drawImage(a.Jy.td,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.mb;var f=a.Lb,l=Math.round(e.x*f)/f,m=Math.round(e.y*f)/f;d=a.fd;d.reset();1!==f&&d.scale(f);0===e.x&&0===e.y||d.translate(-l,-m);h.save();h.beginPath();e=c.length;for(f=0;f<e;f++)l=
c[f],0!==l.width&&0!==l.height&&h.rect(Math.floor(l.x),Math.floor(l.y),Math.ceil(l.width),Math.ceil(l.height));h.clip();h.setTransform(1,0,0,1,0,0);h.scale(k,k);h.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=a.ac.n;e=c.length;a.Cf(c,e,a);xm(a,h);for(f=0;f<e;f++)il(c[f],h,a,b);h.restore();Yc(h,!0);a.dl?a.dl.im(a)&&a.Ky():a.wr=function(){return new y(0,0)};a.fl=!1;a.De=!1;a.OA()}}}
function zm(a,b,c,d,e,f,h,k,l,m){null===a.Nb&&v.k("No div specified");null===a.Eb&&v.k("No canvas specified");void 0===h&&(h=null);void 0===k&&(k=null);void 0===l&&(l=!1);void 0===m&&(m=!1);wm(a);Yc(a.uf,!0);Gl(a);a.$y=!0;var n=new B(f.x,f.y,d.width/e,d.height/e),p=n.copy();p.Fw(c);Wl(a,p);zi(a);var p=a.ac.n,q=p.length;a.Cf(p,q,a,n);n=a.Cd;b.setTransform(1,0,0,1,0,0);b.scale(n,n);b.clearRect(0,0,d.width,d.height);null!==k&&""!==k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));d=v.Ff();d.reset();
d.translate(c.left,c.top);d.scale(e);0===f.x&&0===f.y||d.translate(-f.x,-f.y);b.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);v.we(d);xm(a,b);if(null!==h){var r=new J(G);c=h.i;for(c.reset();c.next();)e=c.value,!1===m&&"Grid"===e.layer.name||null===e||r.add(e);c=function(c){var d=l;if(c.visible&&0!==c.xc&&(void 0===d&&(d=!0),d||!c.Mc)){var d=c.zb.n,e=d.length;if(0!==e){1!==c.xc&&(b.globalAlpha=c.xc);c=c.aw;c.length=0;for(var f=a.scale,h=0;h<e;h++){var k=d[h];if(fl(k)&&r.contains(k)){if(k instanceof
W){var m=k;m.mc&&c.push(m);if(!1===m.Yg)continue}m=k.Y;1<m.width*f||1<m.height*f?k.ue(b,a):hl(k,b)}}b.globalAlpha=1}}}}else if(!l&&m){var s=a.Bn.V,u=s.layer;c=function(c){c===u?s.ue(b,a):c.ue(b,a,l,m)}}else c=function(c){c.ue(b,a,l,m)};for(e=0;e<q;e++)c(p[e]);a.$y=!1;a.dl?a.dl.im(a)&&a.Ky():a.wr=function(){return new y(0,0)};Yc(a.uf,!0);Gl(a);a.Cf(p,q,a);Wl(a)}E.prototype.getRenderingHint=E.prototype.lj=function(a){return this.ek[a]};
E.prototype.setRenderingHint=E.prototype.AJ=function(a,b){this.ek[a]=b;this.Mx()};E.prototype.resetRenderingHints=E.prototype.FF=function(){this.ek=new ua;this.ek.drawShadows=!0;this.ek.textGreeking=!0;this.ek.viewportOptimizations=v.aF?!1:!0;this.ek.temporaryPixelRatio=!0;this.ek.pictureRatioOptimization=!0};function xm(a,b){var c=a.ek;if(null!==c){if(void 0!==c.imageSmoothingEnabled){var d=!!c.imageSmoothingEnabled;b.St=d;b.qL=d}c=c.defaultFont;void 0!==c&&null!==c&&(b.font=c)}}
E.prototype.getInputOption=E.prototype.Qt=function(a){return this.Lo[a]};E.prototype.setInputOption=function(a,b){this.Lo[a]=b};E.prototype.resetInputOptions=E.prototype.EF=function(){this.Lo=new ua;this.Lo.extraTouchArea=10;this.Lo.extraTouchThreshold=10;this.Lo.hasGestureZoom=!0};E.prototype.setProperties=function(a){v.Bu(this,a)};function Zl(a){if(0===a.pa.Fh&&0!==a.Zk.count){for(;0<a.Zk.count;){var b=a.Zk;a.Zk=new la(W,B);for(b=b.i;b.next();){var c=b.key;dj(c,b.value);c.Le()}}a.oa()}}
E.prototype.oa=function(a){void 0===a&&(a=null);if(null===a)this.De=!0,this.Me();else{var b=this.tb;null!==a&&a.H()&&b.Jg(a)&&(this.De=!0,this.Me())}for(b=this.bw.i;b.next();)b.value.oa(a)};
E.prototype.UE=function(a,b){if(!0!==this.De){this.De=!0;var c=!0===this.lj("temporaryPixelRatio");if(!0===this.lj("viewportOptimizations")&&this.SA!==Am&&this.MF.Zw(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=v.Ef(),f=Math.max(a.x,b.x),h=Math.max(a.y,b.y),k=Math.min(a.x+a.width,b.x+b.width),l=Math.min(a.y+a.height,b.y+b.height);e.x=f;e.y=h;e.width=Math.max(0,k-f)*d;e.height=Math.max(0,l-h)*d;if(0<e.width&&0<e.height){if(!this.Xd&&(this.Nf=!1,null!==this.Nb)){this.Xd=!0;Zl(this);
this.se.H()||Ll(this,this.rh());var m=this.Eb;if(null!==m){var n=this.Cd,h=this.Ib*n,k=this.Mb*n,f=this.scale*n,d=Math.round(Math.round(b.x*f)-Math.round(a.x*f)),f=Math.round(Math.round(b.y*f)-Math.round(a.y*f)),l=this.Jy,p=this.qC;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.Cd,q=70*this.Cd,r=Math.max(d,0),s=Math.max(f,0),u=Math.floor(h-r),t=Math.floor(k-s);p.St=!1;p.drawImage(m.td,r,s,u,t,0,0,u,t);this.dl.im(this)&&p.clearRect(0,0,l,q);var m=v.lb(),p=v.lb(),
t=Math.abs(d),u=Math.abs(f),x=0===r?0:h-t,r=v.xb(x,0),t=v.xb(t+x,k);p.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y)));var w=this.fd;w.reset();w.scale(n,n);1!==this.Lb&&w.scale(this.Lb);n=this.mb;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&w.translate(-n.x,-n.y);Ra(r,w);Ra(t,w);m.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y)));x=0===s?0:k-u;r.l(0,x);t.l(h,u+x);p.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-
t.x),Math.abs(r.y-t.y)));Ra(r,w);Ra(t,w);m.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y)));this.dl.im(this)&&(h=0<d?0:-d,k=0<f?0:-f,r.l(h,k),t.l(l+h,q+k),p.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y))),Ra(r,w),Ra(t,w),m.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y))));v.v(r);v.v(t);Ul(this,!1);ym(this,m,p,d,f);v.wa(m);v.wa(p);this.Xd=!1}}}else this.Yf();v.Gb(e);c&&(this.hk=1,this.Yf(),
this.hk=null,this.OA())}else c?(this.hk=1,this.Yf(),this.hk=null,this.OA()):this.Yf()}};function Tl(a){!1===a.ym&&(a.ym=!0)}function Gl(a){!1===a.fl&&(a.fl=!0)}function wm(a){!1!==a.Er&&(a.Er=!1,Bm(a,a.Ib,a.Mb))}function Bm(a,b,c){var d=a.Eb,e=a.Cd,f=b*e,e=c*e;if(d.width!==f||d.height!==e)d.width=f,d.height=e,d.style.width=b+"px",d.style.height=c+"px",a.De=!0,Yc(a.uf,!0)}
function Fl(a){var b=a.Eb;if(null===b)return!0;var c=a.Nb,d=a.Ib,e=a.Mb,f=a.ND.copy();if(!f.H())return!0;var h=!1,k=a.cl?a.Fd:0,l=a.Pj?a.Fd:0,m=c.clientWidth||d+k,n=c.clientHeight||e+l;if(m!==d+k||n!==e+l)a.cl=!1,a.Pj=!1,l=k=0,a.Ib=m,a.Mb=n,h=a.Er=!0;a.ym=!1;var p=a.tb,c=a.se,m=c.width,n=c.height,q=p.width,r=p.height,s=c.x,u=p.x,t=c.right,x=p.right+k,w=c.y,z=p.y,A=c.bottom,p=p.bottom+l,H="1px",C="1px",c=a.scale;a.SA===ol&&m<q+k&&n<r+l||(a.kA&&a.oe&&(H=1,s+1<u&&(H=Math.max((u-s)*c+a.Ib,H)),t>x+1&&
(H=Math.max((t-x)*c+a.Ib,H)),q+k+1<m&&(H=Math.max((m-q+k)*c+a.Ib,H)),H+="px"),a.lA&&a.pe&&(C=1,w+1<z&&(C=Math.max((z-w)*c+a.Mb,C)),A>p+1&&(C=Math.max((A-p)*c+a.Mb,C)),r+l+1<n&&(C=Math.max((n-r+l)*c+a.Mb,C)),C+="px"));k="1px"!==H;l="1px"!==C;k&&l||!k&&!l||(l&&(x-=a.Fd),k&&(p-=a.Fd),a.kA&&a.oe&&(H=1,s+1<u&&(H=Math.max((u-s)*c+a.Ib,H)),t>x+1&&(H=Math.max((t-x)*c+a.Ib,H)),q+1<m&&(H=Math.max((m-q)*c+a.Ib,H)),H+="px"),k="1px"!==H,l=k!==a.Pj?a.Mb-a.Fd:a.Mb,a.lA&&a.pe&&(C=1,w+1<z&&(C=Math.max((z-w)*c+l,C)),
A>p+1&&(C=Math.max((A-p)*c+l,C)),r+1<n&&(C=Math.max((n-r)*c+l,C)),C+="px"),l="1px"!==C);if(a.kw&&k===a.Pj&&l===a.cl)return d===a.Ib&&e===a.Mb||a.Yf(),!1;k!==a.Pj&&(a.Mb="1px"===H?a.Mb+a.Fd:Math.max(a.Mb-a.Fd,1),h=!0);a.Pj=k;a.Ls.style.width=H;l!==a.cl&&(a.Ib="1px"===C?a.Ib+a.Fd:Math.max(a.Ib-a.Fd,1),h=!0,a.Ir&&(k=v.K(),l?(b.style.left=a.Fd+"px",a.position=k.l(a.mb.x+a.Fd/a.scale,a.mb.y)):(b.style.left="0px",a.position=k.l(a.mb.x-a.Fd/a.scale,a.mb.y)),v.v(k)));a.cl=l;a.Ls.style.height=C;b=a.ow;k=b.scrollLeft;
a.kA&&a.oe&&(q+1<m?k=(a.position.x-s)*c:s+1<u?k=b.scrollWidth-b.clientWidth:t>x+1&&(k=a.position.x*c));if(a.Ir)switch(a.nz){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.lA&&a.pe&&(r+1<n?b.scrollTop=(a.position.y-w)*c:w+1<z?b.scrollTop=b.scrollHeight-b.clientHeight:A>p+1&&(b.scrollTop=a.position.y*c));h&&(a.Er=!0);m=a.Ib;n=a.Mb;b.style.width=m+(a.cl?a.Fd:0)+"px";b.style.height=n+(a.Pj?a.Fd:0)+"px";a.pz=!1;return d!==m||e!==
n||a.Qa.rc?(p=a.tb,a.qu(f,p,c,a.scale,h),!1):!0}
E.prototype.add=E.prototype.add=function(a){v.F(a,S,E,"add:part");var b=a.g;if(b!==this){null!==b&&v.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.Fq&&(a.kl="Tool");var c=a.Xf,b=this.Ht(c);null===b&&(b=this.Ht(""));null===b&&v.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.Wp(99999999,a,a.g===this),0<=c&&this.Zc(Nf,"parts",b,null,a,null,c),b.Mc||this.tc(),a.J(Cm),c=a.zx,null!==
c&&c(a,null,b))}};
E.prototype.Wp=function(a){if(a instanceof T){if(this.bp.add(a),a instanceof V){var b=a.La;null===b?this.ul.add(a):b.Zo.add(a);b=a.Rb;null!==b&&(b.g=this)}}else a instanceof W?this.Vo.add(a):a instanceof mh||this.zb.add(a);var c=this;Dm(a,function(a){Em(c,a)});a.Kb&&a.I();b=a.data;null!==b&&(a instanceof mh||(a instanceof W?this.Gj.add(b,a):this.zi.add(b,a)),Dm(a,function(a){Fm(c,a)}));!0!==um(a)&&!0!==vm(a)||this.pg.add(a);Gm(a,!0,this);Hm(a)?(a.Y.H()&&this.oa(jl(a,a.Y)),this.tc()):a.isVisible()&&
a.Y.H()&&this.oa(jl(a,a.Y));this.Me()};
E.prototype.mf=function(a){a.xt();if(a instanceof T){if(this.bp.remove(a),a instanceof V){var b=a.La;null===b?this.ul.remove(a):b.Zo.remove(a);b=a.Rb;null!==b&&(b.g=null)}}else a instanceof W?this.Vo.remove(a):a instanceof mh||this.zb.remove(a);var c=this;Dm(a,function(a){Im(c,a)});b=a.data;null!==b&&(a instanceof mh||(a instanceof W?this.Gj.remove(b):this.zi.remove(b)),Dm(a,function(a){Jm(c,a)}));this.pg.remove(a);Hm(a)?(a.Y.H()&&this.oa(jl(a,a.Y)),this.tc()):a.isVisible()&&a.Y.H()&&this.oa(jl(a,
a.Y));this.Me()};E.prototype.remove=E.prototype.remove=function(a){v.F(a,S,E,"remove:part");Km(this,a,!0)};function Km(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.cb=!1,b.Kg=!1,b.J(Lm),c&&b.tn(),c=d.mf(-1,b,!1),0<=c&&a.Zc(Of,"parts",d,b,null,c,null),a=b.zx,null!==a&&a(b,d,null))}
E.prototype.removeParts=E.prototype.PA=function(a,b){if(v.isArray(a))for(var c=v.Xa(a),d=0;d<c;d++){var e=v.Ea(a,d);b&&!e.canDelete()||this.remove(e)}else for(e=new J(S),e.Kc(a),c=e.i;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};E.prototype.copyParts=E.prototype.Jp=function(a,b,c){return this.pb.Jp(a,b,c)};
E.prototype.moveParts=E.prototype.moveParts=function(a,b,c){v.F(b,y,E,"moveParts:offset");var d=this.$a;if(null!==d){d=d.te;null===d&&(d=new qh,d.Sc(this));var e=new la(S,Object);if(null!==a)a=a.i;else{for(a=this.Gk;a.next();)Ph(d,e,a.value,c);for(a=this.dg;a.next();)Ph(d,e,a.value,c);a=this.links}for(;a.next();)Ph(d,e,a.value,c);d.moveParts(e,b,c)}};
function Mm(a,b,c){v.F(b,qg,E,"addLayer:layer");null!==b.g&&b.g!==a&&v.k("Cannot share a Layer with another Diagram: "+b+" of "+b.g);null===c?null!==b.g&&v.k("Cannot add an existing Layer to this Diagram again: "+b):(v.F(c,qg,E,"addLayer:existingLayer"),c.g!==a&&v.k("Existing Layer must be in this Diagram: "+c+" not in "+c.g),b===c&&v.k("Cannot move a Layer before or after itself: "+b));if(b.g!==a){b=b.name;a=a.ac;c=a.count;for(var d=0;d<c;d++)a.fa(d).name===b&&v.k("Cannot add Layer with the name '"+
b+"'; a Layer with the same name is already present in this Diagram.")}}E.prototype.addLayer=E.prototype.pt=function(a){Mm(this,a,null);a.Sc(this);var b=this.ac,c=b.count-1;if(!a.Mc)for(;0<=c&&b.fa(c).Mc;)c--;b.Md(c+1,a);null!==this.me&&this.Zc(Nf,"layers",this,null,a,null,c+1);this.oa();this.tc()};
E.prototype.addLayerBefore=E.prototype.YG=function(a,b){Mm(this,a,b);a.Sc(this);var c=this.ac,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.me&&this.Zc(Of,"layers",this,a,null,d,null));for(var e=c.count,f=0;f<e;f++)if(c.fa(f)===b){c.Md(f,a);break}null!==this.me&&this.Zc(Nf,"layers",this,null,a,null,f);this.oa();0>d&&this.tc()};
E.prototype.addLayerAfter=function(a,b){Mm(this,a,b);a.Sc(this);var c=this.ac,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.me&&this.Zc(Of,"layers",this,a,null,d,null));for(var e=c.count,f=0;f<e;f++)if(c.fa(f)===b){c.Md(f+1,a);break}null!==this.me&&this.Zc(Nf,"layers",this,null,a,null,f+1);this.oa();0>d&&this.tc()};
E.prototype.removeLayer=function(a){v.F(a,qg,E,"removeLayer:layer");a.g!==this&&v.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.ac,c=b.indexOf(a);if(b.remove(a)){for(b=a.zb.copy().i;b.next();){var d=b.value,e=d.Xf;d.Xf=e!==a.name?e:""}null!==this.me&&this.Zc(Of,"layers",this,a,null,c,null);this.oa();this.tc()}}};E.prototype.findLayer=E.prototype.Ht=function(a){for(var b=this.Ax;b.next();){var c=b.value;if(c.name===a)return c}return null};
E.prototype.addModelChangedListener=E.prototype.$G=function(a){v.j(a,"function",E,"addModelChangedListener:listener");null===this.fh&&(this.fh=new I("function"));this.fh.add(a);this.ca.fn(a)};E.prototype.removeModelChangedListener=function(a){v.j(a,"function",E,"removeModelChangedListener:listener");null!==this.fh&&(this.fh.remove(a),0===this.fh.count&&(this.fh=null));this.ca.tu(a)};
E.prototype.addChangedListener=E.prototype.fn=function(a){v.j(a,"function",E,"addChangedListener:listener");null===this.ui&&(this.ui=new I("function"));this.ui.add(a)};E.prototype.removeChangedListener=E.prototype.tu=function(a){v.j(a,"function",E,"removeChangedListener:listener");null!==this.ui&&(this.ui.remove(a),0===this.ui.count&&(this.ui=null))};
E.prototype.Nw=function(a){this.wb||this.pa.PE(a);a.zc!==Mf&&(this.mi=!0);if(null!==this.ui){var b=this.ui,c=b.length;if(1===c)b=b.fa(0),b(a);else if(0!==c)for(var d=b.fc(),e=0;e<c;e++)b=d[e],b(a)}};E.prototype.raiseChangedEvent=E.prototype.Zc=function(a,b,c,d,e,f,h){void 0===f&&(f=null);void 0===h&&(h=null);var k=new Kf;k.g=this;k.zc=a;k.propertyName=b;k.object=c;k.oldValue=d;k.vj=f;k.newValue=e;k.uj=h;this.Nw(k)};
E.prototype.raiseChanged=E.prototype.h=function(a,b,c,d,e){this.Zc(Lf,a,this,b,c,d,e)};v.u(E,{Qa:"animationManager"},function(){return this.CB});v.u(E,{pa:"undoManager"},function(){return this.me.pa});v.defineProperty(E,{wb:"skipsUndoManager"},function(){return this.aj},function(a){v.j(a,"boolean",E,"skipsUndoManager");this.aj=a;this.me.aj=a});v.defineProperty(E,{Uz:"delaysLayout"},function(){return this.Fy},function(a){this.Fy=a});
E.prototype.ln=function(a,b){if(null!==a&&a.g===this){var c=this.Oe;try{this.Oe=!0;var d=a.zc,e;if(d===Lf){var f=a.object,h=a.propertyName,k=a.na(b);v.Na(f,h,k);if(f instanceof G){var l,m=f.V;null!==m&&m.de()}this.mi=!0}else if(d===Nf){var n=a.object,p=a.uj,f=a.newValue;if(n instanceof D)if("number"===typeof p&&f instanceof G){l=f;var q=n;b?q.mf(p):q.Md(p,l);m=n.V;null!==m&&m.de()}else{if("number"===typeof p&&f instanceof Yg){var r=f,q=n;b?r.xe?q.DF(p):q.AF(p):(e=r.xe?q.ce(r.index):q.be(r.index),
e.Ip(r))}}else if(n instanceof qg){var s=!0===a.vj;if("number"===typeof p&&f instanceof S){var m=f,u=n;b?(m.cb=!1,m.Kg=!1,m.de(),u.mf(s?p:-1,m,s)):u.Wp(p,m,s)}}else if(n instanceof E){if("number"===typeof p&&f instanceof qg){var t=f;b?this.ac.$c(p):(d=t,d.Sc(this),this.ac.Md(p,d))}}else v.k("unknown ChangedEvent.Insert object: "+a.toString());this.mi=!0}else d===Of?(n=a.object,p=a.vj,f=a.oldValue,n instanceof D?"number"===typeof p&&f instanceof G?(q=n,b?q.Md(p,f):q.mf(p)):"number"===typeof p&&f instanceof
Yg&&(r=f,q=n,b?(e=r.xe?q.ce(r.index):q.be(r.index),e.Ip(r)):r.xe?q.DF(p):q.AF(p)):n instanceof qg?(s=!0===a.uj,"number"===typeof p&&f instanceof S&&(m=f,u=n,b?u.Wp(p,m,s):(m.cb=!1,m.Kg=!1,m.de(),u.mf(s?p:-1,m,s)))):n instanceof E?"number"===typeof p&&f instanceof qg&&(t=f,b?(d=t,d.Sc(this),this.ac.Md(p,d)):this.ac.$c(p)):v.k("unknown ChangedEvent.Remove object: "+a.toString()),this.mi=!0):d!==Mf&&v.k("unknown ChangedEvent: "+a.toString())}finally{this.Oe=c}}};
E.prototype.startTransaction=E.prototype.Tb=function(a){return this.pa.Tb(a)};E.prototype.commitTransaction=E.prototype.Hd=function(a){return this.pa.Hd(a)};E.prototype.rollbackTransaction=E.prototype.nq=function(){return this.pa.nq()};E.prototype.updateAllTargetBindings=E.prototype.nG=function(a){void 0===a&&(a="");for(var b=this.Gk;b.next();)b.value.Hb(a);for(b=this.dg;b.next();)b.value.Hb(a);for(b=this.links;b.next();)b.value.Hb(a)};
E.prototype.updateAllRelationshipsFromData=E.prototype.TJ=function(){for(var a=this.ca,b=new J,c=a.cg,d=0;d<c.length;d++){var e=c[d];b.add(e)}var f=[];this.dg.each(function(a){null===a.data||b.contains(a.data)||f.push(a.data)});this.Gk.each(function(a){null===a.data||b.contains(a.data)||f.push(a.data)});f.forEach(function(b){zg(a,b,!1)});for(d=0;d<c.length;d++){var e=c[d],h=this.uh(e);null===h&&yg(a,e,!1)}if(a instanceof Q){for(var k=new J,c=a.Lg,d=0;d<c.length;d++)e=c[d],k.add(e);var l=[];this.links.each(function(a){null===
a.data||k.contains(a.data)||l.push(a.data)});l.forEach(function(b){ch(a,b,!1)});for(d=0;d<c.length;d++)e=c[d],h=this.Rf(e),null===h&&bh(a,e,!1)}for(d=this.Gk;d.next();)h=d.value,h.updateRelationshipsFromData();for(d=this.dg;d.next();)d.value.updateRelationshipsFromData();for(d=this.links;d.next();)h=d.value,h.updateRelationshipsFromData()};
function Nm(a,b,c){if(a.Vc||a.Xd)a.Lb=c,c=a.Qa,c.rc&&el(c,b,a.Lb);else if(a.Vc=!0,null===a.Eb)a.Lb=c;else{var d=a.tb.copy(),e=a.Ib,f=a.Mb;d.width=a.Ib/b;d.height=a.Mb/b;var h=a.jm.x,k=a.jm.y,l=a.iE;isNaN(h)&&(l.oj()?l.nj(Tb)?h=0:l.nj(Ub)&&(h=e-1):h=l.jd()?l.x*(e-1):e/2);isNaN(k)&&(l.oj()?l.nj(Sb)?k=0:l.nj($b)&&(k=f-1):k=l.jd()?l.y*(f-1):f/2);null!==a.LF&&(c=a.LF(a,c));c<a.xh&&(c=a.xh);c>a.wh&&(c=a.wh);e=v.xb(a.mb.x+h/b-h/c,a.mb.y+k/b-k/c);a.position=e;v.v(e);a.Lb=c;a.qu(d,a.tb,b,c,!1);a.Vc=!1;Il(a,
!1);c=a.Qa;c.rc&&el(c,b,a.Lb);a.oa();Tl(a)}}E.prototype.qu=function(a,b,c,d,e){a.L(b)||(void 0===e&&(e=!1),e||Tl(this),Gl(this),d=this.Rb,null===d||!d.wx||this.Dl!==Dh||e||a.width===b.width&&a.height===b.height||d.J(),d=this.Ya,!0===this.Am&&d instanceof kh&&(this.R.da=this.kB(this.R.ef),wk(d,this)),this.Vc||this.UE(a,b),Wl(this),this.mh.scale=c,this.mh.position.x=a.x,this.mh.position.y=a.y,this.mh.bounds.set(a),this.mh.isScroll=e,this.Ca("ViewportBoundsChanged",this.mh,a))};
function Wl(a,b){void 0===b&&(b=null);var c=a.qd;if(null!==c&&c.visible){for(var d=v.gm(),e=1,f=1,h=c.xa.n,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(Om(m.Cb)?f=f*n/we(f,n):e=e*n/we(e,n))}h=c.lx;d.l(f*h.width,e*h.height);h=f=l=k=0;if(null!==b)k=b.width,l=b.height,f=b.x,h=b.y;else{e=v.Ef();f=a.tb;e.l(f.x,f.y,f.width,f.height);for(h=a.bw.i;h.next();)f=h.value.tb,f.H()&&kb(e,f.x,f.y,f.width,f.height);if(!e.H()){v.Gb(e);return}k=e.width;l=e.height;f=e.x;h=e.y;v.Gb(e)}c.width=k+2*d.width;c.height=
l+2*d.height;e=v.K();Pa(f,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);v.yk(d);c.V.location=e;v.v(e)}}E.prototype.clearSelection=E.prototype.Ow=function(){var a=0<this.selection.count;a&&this.Ca("ChangingSelection");ph(this);a&&this.Ca("ChangedSelection")};function ph(a){a=a.selection;if(0<a.count){for(var b=a.fc(),c=b.length,d=0;d<c;d++)b[d].cb=!1;a.Ra();a.clear();a.freeze()}}
E.prototype.select=E.prototype.select=function(a){null!==a&&(v.F(a,S,E,"select:part"),a.layer.g===this&&(!a.cb||1<this.selection.count)&&(this.Ca("ChangingSelection"),ph(this),a.cb=!0,this.Ca("ChangedSelection")))};
E.prototype.selectCollection=E.prototype.PF=function(a){this.Ca("ChangingSelection");ph(this);if(v.isArray(a))for(var b=v.Xa(a),c=0;c<b;c++){var d=v.Ea(a,c);d instanceof S||v.k("Diagram.selectCollection given something that is not a Part: "+d);d.cb=!0}else for(a=a.i;a.next();)d=a.value,d instanceof S||v.k("Diagram.selectCollection given something that is not a Part: "+d),d.cb=!0;this.Ca("ChangedSelection")};
E.prototype.clearHighlighteds=E.prototype.iH=function(){var a=this.Sl;if(0<a.count){for(var b=a.fc(),c=b.length,d=0;d<c;d++)b[d].Kg=!1;a.Ra();a.clear();a.freeze()}};E.prototype.highlight=function(a){null!==a&&a.layer.g===this&&(v.F(a,S,E,"highlight:part"),!a.Kg||1<this.Sl.count)&&(this.iH(),a.Kg=!0)};
E.prototype.highlightCollection=function(a){for(var b=(new J).Kc(a),c=this.Sl.copy().Ox(b).i;c.next();)a=c.value,a.Kg=!1;for(b=b.i;b.next();)a=b.value,a instanceof S||v.k("Diagram.highlightCollection given something that is not a Part: "+a),a.Kg=!0};
E.prototype.scroll=E.prototype.scroll=function(a,b,c){void 0===c&&(c=1);var d="up"===b||"down"===b,e=0;if("pixel"===a)e=c;else if("line"===a)e=c*(d?this.zu:this.yu);else if("page"===a)a=d?this.tb.height:this.tb.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.zu:this.yu),0),e*=c);else{if("document"===a){e=this.se;d=this.tb;c=v.K();"up"===b?this.position=c.l(d.x,e.y):"left"===b?this.position=c.l(e.x,d.y):"down"===b?this.position=c.l(d.x,e.bottom-d.height):"right"===b&&(this.position=c.l(e.right-d.width,
d.y));v.v(c);return}v.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}e/=this.scale;c=this.position.copy();"up"===b?c.y=this.position.y-e:"down"===b?c.y=this.position.y+e:"left"===b?c.x=this.position.x-e:"right"===b?c.x=this.position.x+e:v.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+b);this.position=c};E.prototype.scrollToRect=E.prototype.uJ=function(a){var b=this.tb;b.tk(a)||(a=a.El,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};
E.prototype.centerRect=E.prototype.hH=function(a){var b=this.tb;a=a.El;a.x-=b.width/2;a.y-=b.height/2;this.position=a};E.prototype.transformDocToView=E.prototype.kG=function(a){var b=this.fd;b.reset();1!==this.Lb&&b.scale(this.Lb);var c=this.mb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.fd)};
E.prototype.transformViewToDoc=E.prototype.kB=function(a){var b=this.fd;b.reset();1!==this.Lb&&b.scale(this.Lb);var c=this.mb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return Ra(a.copy(),this.fd)};var Dh;E.None=Dh=v.p(E,"None",0);var Ml;E.Uniform=Ml=v.p(E,"Uniform",1);var Nl;E.UniformToFill=Nl=v.p(E,"UniformToFill",2);var Ni;E.CycleAll=Ni=v.p(E,"CycleAll",10);var Ri;E.CycleNotDirected=Ri=v.p(E,"CycleNotDirected",11);var Ti;
E.CycleNotDirectedFast=Ti=v.p(E,"CycleNotDirectedFast",12);var Ui;E.CycleNotUndirected=Ui=v.p(E,"CycleNotUndirected",13);var Oi;E.CycleDestinationTree=Oi=v.p(E,"CycleDestinationTree",14);var Qi;E.CycleSourceTree=Qi=v.p(E,"CycleSourceTree",15);var ol;E.DocumentScroll=ol=v.p(E,"DocumentScroll",1);var Am;E.InfiniteScroll=Am=v.p(E,"InfiniteScroll",2);var ql;E.TreeParentCollapsed=ql=v.p(E,"TreeParentCollapsed",21);var Pm;E.AllParentsCollapsed=Pm=v.p(E,"AllParentsCollapsed",22);var Qm;
E.AnyParentsCollapsed=Qm=v.p(E,"AnyParentsCollapsed",23);v.defineProperty(E,{UJ:"validCycle"},function(){return this.Bw},function(a){var b=this.Bw;b!==a&&(v.nb(a,E,E,"validCycle"),this.Bw=a,this.h("validCycle",b,a))});v.u(E,{Ax:"layers"},function(){return this.ac.i});v.defineProperty(E,{zf:"isModelReadOnly"},function(){var a=this.me;return null===a?!1:a.bb},function(a){var b=this.me;null!==b&&(b.bb=a)});
v.defineProperty(E,{bb:"isReadOnly"},function(){return this.Ii},function(a){var b=this.Ii;b!==a&&(v.j(a,"boolean",E,"isReadOnly"),this.Ii=a,this.h("isReadOnly",b,a))});v.defineProperty(E,{isEnabled:"isEnabled"},function(){return this.ff},function(a){var b=this.ff;b!==a&&(v.j(a,"boolean",E,"isEnabled"),this.ff=a,this.h("isEnabled",b,a))});
v.defineProperty(E,{Gz:"allowClipboard"},function(){return this.Pu},function(a){var b=this.Pu;b!==a&&(v.j(a,"boolean",E,"allowClipboard"),this.Pu=a,this.h("allowClipboard",b,a))});v.defineProperty(E,{qk:"allowCopy"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(v.j(a,"boolean",E,"allowCopy"),this.Kk=a,this.h("allowCopy",b,a))});
v.defineProperty(E,{gn:"allowDelete"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(v.j(a,"boolean",E,"allowDelete"),this.Lk=a,this.h("allowDelete",b,a))});v.defineProperty(E,{ut:"allowDragOut"},function(){return this.Qu},function(a){var b=this.Qu;b!==a&&(v.j(a,"boolean",E,"allowDragOut"),this.Qu=a,this.h("allowDragOut",b,a))});
v.defineProperty(E,{XD:"allowDrop"},function(){return this.Ru},function(a){var b=this.Ru;b!==a&&(v.j(a,"boolean",E,"allowDrop"),this.Ru=a,this.h("allowDrop",b,a))});v.defineProperty(E,{Kw:"allowTextEdit"},function(){return this.Uk},function(a){var b=this.Uk;b!==a&&(v.j(a,"boolean",E,"allowTextEdit"),this.Uk=a,this.h("allowTextEdit",b,a))});
v.defineProperty(E,{Hw:"allowGroup"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(v.j(a,"boolean",E,"allowGroup"),this.Mk=a,this.h("allowGroup",b,a))});v.defineProperty(E,{Lw:"allowUngroup"},function(){return this.Vk},function(a){var b=this.Vk;b!==a&&(v.j(a,"boolean",E,"allowUngroup"),this.Vk=a,this.h("allowUngroup",b,a))});
v.defineProperty(E,{Bp:"allowInsert"},function(){return this.Tu},function(a){var b=this.Tu;b!==a&&(v.j(a,"boolean",E,"allowInsert"),this.Tu=a,this.h("allowInsert",b,a))});v.defineProperty(E,{vt:"allowLink"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(v.j(a,"boolean",E,"allowLink"),this.Nk=a,this.h("allowLink",b,a))});
v.defineProperty(E,{hn:"allowRelink"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(v.j(a,"boolean",E,"allowRelink"),this.Pk=a,this.h("allowRelink",b,a))});v.defineProperty(E,{Bl:"allowMove"},function(){return this.Ok},function(a){var b=this.Ok;b!==a&&(v.j(a,"boolean",E,"allowMove"),this.Ok=a,this.h("allowMove",b,a))});
v.defineProperty(E,{Iw:"allowReshape"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(v.j(a,"boolean",E,"allowReshape"),this.Qk=a,this.h("allowReshape",b,a))});v.defineProperty(E,{wt:"allowResize"},function(){return this.Rk},function(a){var b=this.Rk;b!==a&&(v.j(a,"boolean",E,"allowResize"),this.Rk=a,this.h("allowResize",b,a))});
v.defineProperty(E,{Jw:"allowRotate"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(v.j(a,"boolean",E,"allowRotate"),this.Sk=a,this.h("allowRotate",b,a))});v.defineProperty(E,{vf:"allowSelect"},function(){return this.Tk},function(a){var b=this.Tk;b!==a&&(v.j(a,"boolean",E,"allowSelect"),this.Tk=a,this.h("allowSelect",b,a))});
v.defineProperty(E,{YD:"allowUndo"},function(){return this.Uu},function(a){var b=this.Uu;b!==a&&(v.j(a,"boolean",E,"allowUndo"),this.Uu=a,this.h("allowUndo",b,a))});v.defineProperty(E,{Mw:"allowZoom"},function(){return this.Wu},function(a){var b=this.Wu;b!==a&&(v.j(a,"boolean",E,"allowZoom"),this.Wu=a,this.h("allowZoom",b,a))});
v.defineProperty(E,{lA:"hasVerticalScrollbar"},function(){return this.Av},function(a){var b=this.Av;b!==a&&(v.j(a,"boolean",E,"hasVerticalScrollbar"),this.Av=a,Tl(this),this.oa(),this.h("hasVerticalScrollbar",b,a),Il(this,!1))});v.defineProperty(E,{kA:"hasHorizontalScrollbar"},function(){return this.zv},function(a){var b=this.zv;b!==a&&(v.j(a,"boolean",E,"hasHorizontalScrollbar"),this.zv=a,Tl(this),this.oa(),this.h("hasHorizontalScrollbar",b,a),Il(this,!1))});
v.defineProperty(E,{oe:"allowHorizontalScroll"},function(){return this.Su},function(a){var b=this.Su;b!==a&&(v.j(a,"boolean",E,"allowHorizontalScroll"),this.Su=a,this.h("allowHorizontalScroll",b,a),Il(this,!1))});v.defineProperty(E,{pe:"allowVerticalScroll"},function(){return this.Vu},function(a){var b=this.Vu;b!==a&&(v.j(a,"boolean",E,"allowVerticalScroll"),this.Vu=a,this.h("allowVerticalScroll",b,a),Il(this,!1))});
v.defineProperty(E,{yu:"scrollHorizontalLineChange"},function(){return this.lw},function(a){var b=this.lw;b!==a&&(v.j(a,"number",E,"scrollHorizontalLineChange"),0>a&&v.Fa(a,">= 0",E,"scrollHorizontalLineChange"),this.lw=a,this.h("scrollHorizontalLineChange",b,a))});
v.defineProperty(E,{zu:"scrollVerticalLineChange"},function(){return this.pw},function(a){var b=this.pw;b!==a&&(v.j(a,"number",E,"scrollVerticalLineChange"),0>a&&v.Fa(a,">= 0",E,"scrollVerticalLineChange"),this.pw=a,this.h("scrollVerticalLineChange",b,a))});v.defineProperty(E,{R:"lastInput"},function(){return this.Pb},function(a){this.Pb=a});v.defineProperty(E,{Bc:"firstInput"},function(){return this.Gi},function(a){this.Gi=a});
v.defineProperty(E,{cc:"currentCursor"},function(){return this.hv},function(a){""===a&&(a=this.gr);var b=this.hv;if(b!==a){v.j(a,"string",E,"currentCursor");var c=this.Eb,d=this.Nb;null!==c&&(this.hv=a,c.style.cursor=a,d.style.cursor=a,c.style.cursor===b&&(c.style.cursor="-webkit-"+a,d.style.cursor="-webkit-"+a,c.style.cursor===b&&(c.style.cursor="-moz-"+a,d.style.cursor="-moz-"+a,c.style.cursor===b&&(c.style.cursor=a,d.style.cursor=a))))}});
v.defineProperty(E,{GK:"defaultCursor"},function(){return this.gr},function(a){""===a&&(a="auto");var b=this.gr;b!==a&&(v.j(a,"string",E,"defaultCursor"),this.gr=a,this.h("defaultCursor",b,a))});v.defineProperty(E,{click:"click"},function(){return this.vi},function(a){var b=this.vi;b!==a&&(null!==a&&v.j(a,"function",E,"click"),this.vi=a,this.h("click",b,a))});
v.defineProperty(E,{Dt:"doubleClick"},function(){return this.Di},function(a){var b=this.Di;b!==a&&(null!==a&&v.j(a,"function",E,"doubleClick"),this.Di=a,this.h("doubleClick",b,a))});v.defineProperty(E,{Oz:"contextClick"},function(){return this.xi},function(a){var b=this.xi;b!==a&&(null!==a&&v.j(a,"function",E,"contextClick"),this.xi=a,this.h("contextClick",b,a))});
v.defineProperty(E,{DA:"mouseOver"},function(){return this.Ti},function(a){var b=this.Ti;b!==a&&(null!==a&&v.j(a,"function",E,"mouseOver"),this.Ti=a,this.h("mouseOver",b,a))});v.defineProperty(E,{CA:"mouseHover"},function(){return this.Si},function(a){var b=this.Si;b!==a&&(null!==a&&v.j(a,"function",E,"mouseHover"),this.Si=a,this.h("mouseHover",b,a))});
v.defineProperty(E,{BA:"mouseHold"},function(){return this.Ri},function(a){var b=this.Ri;b!==a&&(null!==a&&v.j(a,"function",E,"mouseHold"),this.Ri=a,this.h("mouseHold",b,a))});v.defineProperty(E,{TI:"mouseDragOver"},function(){return this.Wv},function(a){var b=this.Wv;b!==a&&(null!==a&&v.j(a,"function",E,"mouseDragOver"),this.Wv=a,this.h("mouseDragOver",b,a))});
v.defineProperty(E,{AA:"mouseDrop"},function(){return this.Qi},function(a){var b=this.Qi;b!==a&&(null!==a&&v.j(a,"function",E,"mouseDrop"),this.Qi=a,this.h("mouseDrop",b,a))});v.defineProperty(E,{jB:"toolTip"},function(){return this.bj},function(a){var b=this.bj;b!==a&&(this.bj=a,this.h("toolTip",b,a))});v.defineProperty(E,{contextMenu:"contextMenu"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(this.yi=a,this.h("contextMenu",b,a))});
v.defineProperty(E,{pb:"commandHandler"},function(){return this.yy},function(a){var b=this.yy;b!==a&&(v.F(a,sg,E,"commandHandler"),null!==a.g&&v.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Sc(null),this.yy=a,a.Sc(this))});v.defineProperty(E,{$a:"toolManager"},function(){return this.zz},function(a){var b=this.zz;b!==a&&(v.F(a,kh,E,"toolManager"),null!==a.g&&v.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Sc(null),this.zz=a,a.Sc(this))});
v.defineProperty(E,{Bt:"defaultTool"},function(){return this.Ey},function(a){var b=this.Ey;b!==a&&(v.F(a,rg,E,"defaultTool"),this.Ey=a,this.Ya===b&&(this.Ya=a))});v.defineProperty(E,{Ya:"currentTool"},function(){return this.By},function(a){var b=this.By;null!==b&&(b.ta&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.Bt);null!==a&&(v.F(a,rg,E,"currentTool"),this.By=a,a.Sc(this),a.doStart())});v.u(E,{selection:"selection"},function(){return this.rw});
v.defineProperty(E,{JI:"maxSelectionCount"},function(){return this.Sv},function(a){var b=this.Sv;if(b!==a)if(v.j(a,"number",E,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Sv=a,this.h("maxSelectionCount",b,a),!this.pa.eb&&(a=this.selection.count-a,0<a)){this.Ca("ChangingSelection");for(var b=this.selection.fc(),c=0;c<a;c++)b[c].cb=!1;this.Ca("ChangedSelection")}}else v.Fa(a,">= 0",E,"maxSelectionCount")});
v.defineProperty(E,{XI:"nodeSelectionAdornmentTemplate"},function(){return this.Xv},function(a){var b=this.Xv;b!==a&&(v.F(a,mh,E,"nodeSelectionAdornmentTemplate"),this.Xv=a,this.h("nodeSelectionAdornmentTemplate",b,a))});v.defineProperty(E,{aI:"groupSelectionAdornmentTemplate"},function(){return this.xv},function(a){var b=this.xv;b!==a&&(v.F(a,mh,E,"groupSelectionAdornmentTemplate"),this.xv=a,this.h("groupSelectionAdornmentTemplate",b,a))});
v.defineProperty(E,{DI:"linkSelectionAdornmentTemplate"},function(){return this.Ov},function(a){var b=this.Ov;b!==a&&(v.F(a,mh,E,"linkSelectionAdornmentTemplate"),this.Ov=a,this.h("linkSelectionAdornmentTemplate",b,a))});v.u(E,{Sl:"highlighteds"},function(){return this.Bv});
v.defineProperty(E,{mi:"isModified"},function(){var a=this.pa;return a.isEnabled?null!==a.hj?!0:this.az&&this.bh!==a.mj:this.az},function(a){if(this.az!==a){v.j(a,"boolean",E,"isModified");this.az=a;var b=this.pa;!a&&b.isEnabled&&(this.bh=b.mj);a||Rm(this)}});function Rm(a){var b=a.mi;a.OD!==b&&(a.OD=b,a.Ca("Modified"))}
v.defineProperty(E,{ca:"model"},function(){return this.me},function(a){var b=this.me;if(b!==a){v.F(a,F,E,"model");this.Ya.doCancel();null!==b&&b.pa!==a.pa&&b.pa.bF&&v.k("Do not replace a Diagram.model while a transaction is in progress.");this.Qa.oi();this.Ow();this.dh=!1;this.Do=!0;this.bh=-2;this.Nf=!1;var c=this.Xd;this.Xd=!0;this.Qa.Pn("Model");null!==b&&(null!==this.fh&&this.fh.each(function(a){b.tu(a)}),b.tu(this.UC),b instanceof Q&&Sm(this,b.Lg),Sm(this,b.cg));this.me=a;a.fn(this.TC);Tm(this,
a.cg);a instanceof Q&&Um(this,a.Lg);a.tu(this.TC);a.fn(this.UC);null!==this.fh&&this.fh.each(function(b){a.fn(b)});this.Xd=c;this.Vc||this.oa();null!==b&&(a.pa.isEnabled=b.pa.isEnabled)}});v.defineProperty(E,{Ua:null},function(){return this.LC},function(a){this.LC=a});v.u(E,{Cx:null},function(){return this.AG});
function sl(a,b){if(b.ca===a.ca){var c=b.zc,d=b.propertyName;if(c===Mf&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.$a,c.cf.each(function(b){b.Sc(a)}),c.Zf.each(function(b){b.Sc(a)}),c.$f.each(function(b){b.Sc(a)}),a.Xd||a.dh||(a.ov=!0,a.Do&&(a.Nf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Qa;e.nf&&!a.wb&&e.oi();a.Ca("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Qa,e.nf&&!a.wb&&e.oi());else if(a.Ua){a.Ua=!1;try{var f=b.rf;if(""!==f)if(c===Lf){if("linkFromKey"===f){var h=
b.object,k=a.Rf(h);if(null!==k){var l=b.newValue,m=a.Je(l);k.W=m}}else if("linkToKey"===f)h=b.object,k=a.Rf(h),null!==k&&(l=b.newValue,m=a.Je(l),k.aa=m);else if("linkFromPortId"===f){if(h=b.object,k=a.Rf(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.Ig=n)}}else if("linkToPortId"===f)h=b.object,k=a.Rf(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Eh=n));else if("nodeGroupKey"===f){var h=b.object,p=a.uh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Je(q);p.La=r instanceof V?r:
null}else p.La=null}}else if("linkLabelKeys"===f){if(h=b.object,k=a.Rf(h),null!==k){var s=b.oldValue,u=b.newValue;if(v.isArray(s))for(var t=v.Xa(s),x=0;x<t;x++){var w=v.Ea(s,x),m=a.Je(w);null!==m&&(m.Oc=null)}if(v.isArray(u))for(t=v.Xa(u),x=0;x<t;x++)w=v.Ea(u,x),m=a.Je(w),null!==m&&(m.Oc=k)}}else if("nodeParentKey"===f){var z=b.object,A=a.Je(b.newValue),H=a.ex(z);if(null!==H){var C=H.vn();null!==C?null===A?a.remove(C):a.Pd?C.W=A:C.aa=A:Vm(a,A,H)}}else if("parentLinkCategory"===f){var z=b.object,H=
a.ex(z),R=b.newValue;null!==H&&"string"===typeof R&&(C=H.vn(),null!==C&&(C.kc=R))}else if("nodeCategory"===f){var h=b.object,ba=a.uh(h),R=b.newValue;null!==ba&&"string"===typeof R&&(ba.kc=R)}else if("linkCategory"===f){var h=b.object,U=a.Rf(h),R=b.newValue;null!==U&&"string"===typeof R&&(U.kc=R)}else if("nodeDataArray"===f){var M=b.oldValue;Sm(a,M);var Z=b.newValue;Tm(a,Z)}else"linkDataArray"===f&&(M=b.oldValue,Sm(a,M),Z=b.newValue,Um(a,Z));a.mi=!0}else c===Nf?(Z=b.newValue,"nodeDataArray"===f&&v.Ta(Z)?
Wm(a,Z):"linkDataArray"===f&&v.Ta(Z)?Xm(a,Z):"linkLabelKeys"===f&&xg(Z)&&(k=a.Rf(b.object),m=a.Je(Z),null!==k&&null!==m&&(m.Oc=k)),a.mi=!0):c===Of?(M=b.oldValue,"nodeDataArray"===f&&v.Ta(M)?Ym(a,M):"linkDataArray"===f&&v.Ta(M)?Ym(a,M):"linkLabelKeys"===f&&xg(M)&&(m=a.Je(M),null!==m&&(m.Oc=null)),a.mi=!0):c===Mf&&("SourceChanged"===f?null!==b.object?rl(a,b.object,b.propertyName):(a.TJ(),a.nG()):"ModelDisplaced"===f&&a.am());else if(c===Lf){var Ia=b.propertyName,h=b.object;if(h===a.ca){if("nodeKeyProperty"===
Ia||"nodeCategoryProperty"===Ia||"linkFromKeyProperty"===Ia||"linkToKeyProperty"===Ia||"linkFromPortIdProperty"===Ia||"linkToPortIdProperty"===Ia||"linkLabelKeysProperty"===Ia||"nodeIsGroupProperty"===Ia||"nodeGroupKeyProperty"===Ia||"nodeParentKeyProperty"===Ia||"linkCategoryProperty"===Ia)a.pa.eb||a.am()}else rl(a,h,Ia);a.mi=!0}else if(c===Nf||c===Of)Zm(a,b),a.mi=!0;else if(c===Mf){if("FinishedUndo"===d||"FinishedRedo"===d)a.pa.Ji=!0,a.Ca("ChangedSelection"),zi(a),a.pa.Ji=!1;e=a.Qa;"RolledBackTransaction"===
d&&e.oi();a.ov=!0;a.Yf();0===a.pa.Fh&&Ak(e);"CommittedTransaction"===d&&a.pa.cz&&(a.bh=Math.min(a.bh,a.pa.mj-1));var oa=b.gF;oa&&(Rm(a),a.Cx.clear());!a.jz&&oa&&(a.jz=!0,v.setTimeout(function(){a.Ya.standardMouseOver();a.jz=!1},10))}}finally{a.Ua=!0}}}}
function rl(a,b,c){if("string"===typeof c){var d=a.uh(b);if(null!==d)d.Hb(c),a.ca instanceof Yf&&(d=a.Rf(b),null!==d&&d.Hb(c));else{for(var d=null,e=a.Cm.i;e.next();){for(var f=e.value,h=0;h<f.length;h++){var k=f[h].MH(b);null!==k&&(null===d&&(d=v.lb()),d.push(k))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Hb(c);v.wa(d)}}b===a.ca.Ek&&a.nG(c)}}v.defineProperty(E,{Oe:"skipsModelSourceBindings"},function(){return this.oD},function(a){this.oD=a});
v.defineProperty(E,{Fu:null},function(){return this.uz},function(a){this.uz=a});function Zm(a,b){var c=b.zc===Nf,d=c?b.uj:b.vj,e=c?b.newValue:b.oldValue,f=a.Cm.na(b.object);if(Array.isArray(f))for(var h=0;h<f.length;h++){var k=f[h];if(c)$m(k,e,d);else{var l=d;if(!(0>l)){var m=l;an(k)&&m++;k.mf(m);bn(k,m,l)}}}}function Fm(a,b){var c=b.Vj;if(v.isArray(c)){var d=a.Cm.na(c);if(null===d)d=[],d.push(b),a.Cm.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
function Jm(a,b){var c=b.Vj;if(v.isArray(c)){var d=a.Cm.na(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Cm.remove(c);break}}}function Em(a,b){for(var c=b.xa.n,d=c.length,e=0;e<d;e++){var f=c[e];f instanceof tl&&cn(a,f)}}
function cn(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var d=b.Se;null!==d&&(d.Fo instanceof Event&&null!==b.Te&&b.Te(b,d.Fo),!0===d.Hv&&(null!==b.fi&&b.fi(b,d.oz),null!==b.g&&b.g.mz.add(b)));c=c.src;d=a.dp.na(c);if(null===d)d=[],d.push(b),a.dp.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}function Im(a,b){for(var c=b.xa.n,d=c.length,e=0;e<d;e++){var f=c[e];f instanceof tl&&dn(a,f)}}
function dn(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.dp.na(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.dp.remove(c);break}}}
E.prototype.rebuildParts=E.prototype.am=function(){for(var a=this.GA.i;a.next();){var b=a.value,c=a.key;(!b.ee()||b instanceof V)&&v.k('Invalid node template in Diagram.nodeTemplateMap: template for "'+c+'" must be a Node or a simple Part, not a Group or Link: '+b)}for(a=this.jA.i;a.next();)b=a.value,c=a.key,b instanceof V||v.k('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.sA.i;a.next();)b=a.value,c=a.key,b instanceof
W||v.k('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=v.lb();for(b=this.selection.i;b.next();)(c=b.value.data)&&a.push(c);for(var b=v.lb(),d=this.Sl.i;d.next();)(c=d.value.data)&&b.push(c);c=v.lb();for(d=this.dg.i;d.next();){var e=d.value;null!==e.data&&(c.push(e.data),c.push(e.location))}for(d=this.links.i;d.next();)e=d.value,null!==e.data&&(c.push(e.data),c.push(e.location));for(d=this.Gk.i;d.next();)e=d.value,null!==
e.data&&(c.push(e.data),c.push(e.location));d=this.ca;d instanceof Q&&Sm(this,d.Lg);Sm(this,d.cg);Tm(this,d.cg);d instanceof Q&&Um(this,d.Lg);for(d=0;d<a.length;d++)e=this.uh(a[d]),null!==e&&(e.cb=!0);for(d=0;d<b.length;d++)e=this.uh(b[d]),null!==e&&(e.Kg=!0);for(d=0;d<c.length;d+=2)e=this.uh(c[d]),null!==e&&(e.location=c[d+1]);v.wa(a);v.wa(b);v.wa(c)};
function Tm(a,b){if(null!==b){for(var c=a.ca,d=c instanceof Q,e=v.Xa(b),f=0;f<e;f++){var h=v.Ea(b,f);c.Ie(h)?Wm(a,h,!1):d&&Xm(a,h)}if(d||c instanceof Yf){for(f=0;f<e;f++)h=v.Ea(b,f),c.Ie(h)&&en(a,h);if(d)for(c=a.links;c.next();)fn(c.value)}gn(a,!1)}}function Wm(a,b,c){if(void 0!==b&&null!==b&&!a.pa.eb&&!a.zi.contains(b)){void 0===c&&(c=!0);var d=a.fA(b),e=hn(a,b,d);if(null!==e&&(oh(e),e=e.copy(),null!==e)){var f=a.Oe;a.Oe=!0;e.ti=d;e.ie=b;a.add(e);e.ie=null;e.data=b;c&&en(a,b);a.Oe=f}}}
E.prototype.fA=function(a){return this.ca.fA(a)};var jn=!1,kn=!1;function hn(a,b,c){var d=!1,e=a.ca;e instanceof Q&&(d=e.pA(b));d?(b=a.jA.na(c),null===b&&(b=a.jA.na(""),null===b&&(kn||(kn=!0,v.trace('No Group template found for category "'+c+'"'),v.trace(" Using default group template")),b=a.cC))):(b=a.GA.na(c),null===b&&(b=a.GA.na(""),null===b&&(jn||(jn=!0,v.trace('No Node template found for category "'+c+'"'),v.trace(" Using default node template")),b=a.eC)));return b}
function en(a,b){var c=a.ca;if(c instanceof Q||c instanceof Yf){var d=c.ub(b);if(void 0!==d){var e=Ug(c,d),f=a.uh(b);if(null!==e&&null!==f){for(e=e.i;e.next();){var h=e.value;if(c instanceof Q){var k=c;if(k.Ie(h)){if(f instanceof V&&k.yn(h)===d){var l=f,h=a.uh(h);null!==h&&(h.La=l)}}else{var m=a.Rf(h);if(null!==m&&f instanceof T&&(l=f,k.Ql(h)===d&&(m.W=l),k.Rl(h)===d&&(m.aa=l),h=k.zk(h),v.isArray(h)))for(k=0;k<v.Xa(h);k++)if(v.Ea(h,k)===d){l.Oc=m;break}}}else c instanceof Yf&&(m=c,m.Ie(h)&&f instanceof
T&&(l=f,m.An(h)===d&&(h=a.ex(h),Vm(a,l,h))))}Wg(c,d)}c instanceof Q?(c=c.yn(b),void 0!==c&&(c=a.Je(c),c instanceof V&&(f.La=c))):c instanceof Yf&&(c=c.An(b),void 0!==c&&f instanceof T&&(l=f,f=a.Je(c),Vm(a,f,l)))}}}
function Vm(a,b,c){if(null!==b&&null!==c){var d=a.$a.lF,e=b,f=c;if(a.Pd)for(b=f.ge;b.next();){if(b.value.aa===f)return}else for(e=c,f=b,b=e.ge;b.next();)if(b.value.W===e)return;if(null===d||!Pi(d,e,f,null,!0))if(d=a.ix(c.data),b=ln(a,d),null!==b&&(oh(b),b=b.copy(),null!==b)){var h=a.Oe;a.Oe=!0;b.ti=d;b.ie=c.data;b.W=e;b.aa=f;a.add(b);b.ie=null;b.data=c.data;a.Oe=h}}}function Um(a,b){if(null!==b){for(var c=v.Xa(b),d=0;d<c;d++){var e=v.Ea(b,d);Xm(a,e)}gn(a,!1)}}
function Xm(a,b){if(void 0!==b&&null!==b&&!a.pa.eb&&!a.Gj.contains(b)){var c=a.ix(b),d=ln(a,c);if(null!==d&&(oh(d),d=d.copy(),null!==d)){var e=a.Oe;a.Oe=!0;d.ti=c;d.ie=b;var c=a.ca,f=c.TH(b);""!==f&&(d.Ig=f);f=c.Ql(b);void 0!==f&&(f=a.Je(f),f instanceof T&&(d.W=f));f=c.XH(b);""!==f&&(d.Eh=f);f=c.Rl(b);void 0!==f&&(f=a.Je(f),f instanceof T&&(d.aa=f));c=c.zk(b);if(v.isArray(c))for(var f=v.Xa(c),h=0;h<f;h++){var k=v.Ea(c,h),k=a.Je(k);null!==k&&(k.Oc=d)}a.add(d);d.ie=null;d.data=b;a.Oe=e}}}
E.prototype.ix=function(a){var b=this.ca,c="";b instanceof Q?c=b.ix(a):b instanceof Yf&&(c=b.VH(a));return c};var mn=!1;function ln(a,b){var c=a.sA.na(b);null===c&&(c=a.sA.na(""),null===c&&(mn||(mn=!0,v.trace('No Link template found for category "'+b+'"'),v.trace(" Using default link template")),c=a.dC));return c}function Sm(a,b){for(var c=v.Xa(b),d=0;d<c;d++){var e=v.Ea(b,d);Ym(a,e)}}
function Ym(a,b){if(void 0!==b&&null!==b){var c=a.uh(b);if(null!==c){Km(a,c,!1);var d=a.ca;if(d instanceof Q&&c instanceof T){var e=d.ub(c.data);if(void 0!==e){for(var f=c.ge;f.next();)Vg(d,e,f.value.data);c.of&&(f=c.Oc,null!==f&&Vg(d,e,f.data));if(c instanceof V)for(c=c.Pc;c.next();)f=c.value.data,d.Ie(f)&&Vg(d,e,f)}}else if(d instanceof Yf&&c instanceof T){f=a.Rf(c.data);if(null!==f){f.cb=!1;f.Kg=!1;var h=f.layer;if(null!==h){var k=h.mf(-1,f,!1);0<=k&&a.Zc(Of,"parts",h,f,null,k,null);k=f.zx;null!==
k&&k(f,h,null)}}f=a.Pd;for(c=c.ge;c.next();)h=c.value,h=(f?h.aa:h.W).data,d.Ie(h)&&Vg(d,e,h)}}}}E.prototype.findPartForKey=E.prototype.NH=function(a){if(null===a||void 0===a)return null;var b=this.ca.ve(a);return null!==b?this.zi.na(b):this.ca instanceof Q&&(b=this.ca.Qp(a),null!==b)?this.Gj.na(b):null};E.prototype.findNodeForKey=E.prototype.Je=function(a){if(null===a||void 0===a)return null;a=this.ca.ve(a);if(null===a)return null;a=this.zi.na(a);return a instanceof T?a:null};
E.prototype.findPartForData=E.prototype.uh=function(a){if(null===a)return null;var b=this.zi.na(a);return null!==b?b:b=this.Gj.na(a)};E.prototype.findNodeForData=E.prototype.ex=function(a){if(null===a)return null;a=this.zi.na(a);return a instanceof T?a:null};E.prototype.findLinkForData=E.prototype.Rf=function(a){return null===a?null:this.Gj.na(a)};
E.prototype.findNodesByExample=function(a){for(var b=new J,c=this.bp.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var h=arguments[f];if(v.Ta(h)&&nn(this,e,h)){b.add(d);break}}}return b.i};E.prototype.findLinksByExample=function(a){for(var b=new J,c=this.Vo.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var h=arguments[f];if(v.Ta(h)&&nn(this,e,h)){b.add(d);break}}}return b.i};
function nn(a,b,c){for(var d in c){var e=b[d],f=c[d];if(v.isArray(f)){if(!v.isArray(e)||e.length<f.length)return!1;for(var h=0;h<e.length;h++){var k=e[h],l=f[h];if(void 0!==l&&!on(a,k,l))return!1}}else if(!on(a,e,f))return!1}return!0}function on(a,b,c){if("function"===typeof c){if(!c(b))return!1}else if(c instanceof RegExp){if(!b||!c.test(b.toString()))return!1}else if(v.Ta(b)&&v.Ta(c)){if(!nn(a,b,c))return!1}else if(b!==c)return!1;return!0}
v.defineProperty(E,{rL:"nodeTemplate"},function(){return this.Ui.na("")},function(a){var b=this.Ui.na("");b!==a&&(v.F(a,S,E,"nodeTemplate"),this.Ui.add("",a),this.h("nodeTemplate",b,a),this.pa.eb||this.am())});v.defineProperty(E,{GA:"nodeTemplateMap"},function(){return this.Ui},function(a){var b=this.Ui;b!==a&&(v.F(a,la,E,"nodeTemplateMap"),this.Ui=a,this.h("nodeTemplateMap",b,a),this.pa.eb||this.am())});
v.defineProperty(E,{TK:"groupTemplate"},function(){return this.al.na("")},function(a){var b=this.al.na("");b!==a&&(v.F(a,V,E,"groupTemplate"),this.al.add("",a),this.h("groupTemplate",b,a),this.pa.eb||this.am())});v.defineProperty(E,{jA:"groupTemplateMap"},function(){return this.al},function(a){var b=this.al;b!==a&&(v.F(a,la,E,"groupTemplateMap"),this.al=a,this.h("groupTemplateMap",b,a),this.pa.eb||this.am())});
v.defineProperty(E,{fL:"linkTemplate"},function(){return this.Yj.na("")},function(a){var b=this.Yj.na("");b!==a&&(v.F(a,W,E,"linkTemplate"),this.Yj.add("",a),this.h("linkTemplate",b,a),this.pa.eb||this.am())});v.defineProperty(E,{sA:"linkTemplateMap"},function(){return this.Yj},function(a){var b=this.Yj;b!==a&&(v.F(a,la,E,"linkTemplateMap"),this.Yj=a,this.h("linkTemplateMap",b,a),this.pa.eb||this.am())});v.defineProperty(E,{qI:null},function(){return this.Am},function(a){this.Am=a});
v.defineProperty(E,{bf:"isMouseCaptured"},function(){return this.IC},function(a){var b=this.Eb;null!==b&&(a?(this.R.bubbles=!1,b.removeEventListener("mousemove",this.fq,!1),b.removeEventListener("mousedown",this.eq,!1),b.removeEventListener("mouseup",this.hq,!1),b.removeEventListener("mousewheel",this.zh,!1),b.removeEventListener("DOMMouseScroll",this.zh,!1),b.removeEventListener("mouseout",this.gq,!1),window.addEventListener("mousemove",this.fq,!0),window.addEventListener("mousedown",this.eq,!0),
window.addEventListener("mouseup",this.hq,!0),window.addEventListener("mousewheel",this.zh,!0),window.addEventListener("DOMMouseScroll",this.zh,!0),window.addEventListener("mouseout",this.gq,!0),window.addEventListener("selectstart",this.preventDefault,!1)):(window.removeEventListener("mousemove",this.fq,!0),window.removeEventListener("mousedown",this.eq,!0),window.removeEventListener("mouseup",this.hq,!0),window.removeEventListener("mousewheel",this.zh,!0),window.removeEventListener("DOMMouseScroll",
this.zh,!0),window.removeEventListener("mouseout",this.gq,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("mousemove",this.fq,!1),b.addEventListener("mousedown",this.eq,!1),b.addEventListener("mouseup",this.hq,!1),b.addEventListener("mousewheel",this.zh,!1),b.addEventListener("DOMMouseScroll",this.zh,!1),b.addEventListener("mouseout",this.gq,!1)),this.IC=a)});
v.defineProperty(E,{position:"position"},function(){return this.mb},function(a){var b=this.mb;if(!b.L(a)){v.F(a,y,E,"position");var c=this.tb.copy();a=a.copy();if(!this.Vc&&null!==this.Eb){this.Vc=!0;var d=this.scale;Kl(this,a,this.se,this.Ib/d,this.Mb/d,this.oo,!1);this.Vc=!1}this.mb=a.S();a=this.Qa;a.rc&&dl(a,b,this.mb);this.Vc||this.qu(c,this.tb,this.Lb,this.Lb,!1)}});
v.defineProperty(E,{iI:"initialPosition"},function(){return this.Dv},function(a){this.Dv.L(a)||(v.F(a,y,E,"initialPosition"),this.Dv=a.S())});v.defineProperty(E,{jI:"initialScale"},function(){return this.Ev},function(a){this.Ev!==a&&(v.j(a,"number",E,"initialScale"),this.Ev=a)});
v.defineProperty(E,{Bn:"grid"},function(){null===this.qd&&Dl(this);return this.qd},function(a){var b=this.qd;if(b!==a){null===b&&(Dl(this),b=this.qd);v.F(a,D,E,"grid");a.type!==El&&v.k("Diagram.grid must be a Panel of type Panel.Grid");var c=b.N;null!==c&&c.remove(b);this.qd=a;a.name="GRID";null!==c&&c.add(a);Wl(this);this.oa();this.h("grid",b,a)}});
v.u(E,{tb:"viewportBounds"},function(){var a=this.ND;if(null===this.Eb)return a;var b=this.mb,c=this.Lb;a.l(b.x,b.y,Math.max(this.Ib,0)/c,Math.max(this.Mb,0)/c);return a});v.defineProperty(E,{DE:"fixedBounds"},function(){return this.vv},function(a){var b=this.vv;b.L(a)||(v.F(a,B,E,"fixedBounds"),-Infinity!==a.width&&Infinity!==a.height&&-Infinity!==a.height||v.k("fixedBounds width/height must not be Infinity"),this.vv=a=a.S(),this.tc(),this.h("fixedBounds",b,a))});
v.defineProperty(E,{MF:"scrollMargin"},function(){return this.mw},function(a){"number"===typeof a?a=new mb(a):v.F(a,mb,E,"scrollMargin");var b=this.mw;b.L(a)||(this.mw=a=a.S(),this.tc(),this.h("scrollMargin",b,a))});v.defineProperty(E,{SA:"scrollMode"},function(){return this.nw},function(a){var b=this.nw;b!==a&&(v.nb(a,E,E,"scrollMode"),this.nw=a,a===ol&&Il(this,!1),this.h("scrollMode",b,a))});
v.defineProperty(E,{xF:"positionComputation"},function(){return this.fw},function(a){var b=this.fw;b!==a&&(null!==a&&v.j(a,"function",E,"positionComputation"),this.fw=a,Il(this,!1),this.h("positionComputation",b,a))});v.defineProperty(E,{LF:"scaleComputation"},function(){return this.jw},function(a){var b=this.jw;b!==a&&(null!==a&&v.j(a,"function",E,"scaleComputation"),this.jw=a,Nm(this,this.scale,this.scale),this.h("scaleComputation",b,a))});v.u(E,{se:"documentBounds"},function(){return this.pv});
function Ll(a,b){a.Qj=!1;var c=a.pv;c.L(b)||(b=b.S(),a.pv=b,Il(a,!1),a.Ca("DocumentBoundsChanged",null,c.copy()),Tl(a))}v.defineProperty(E,{scale:"scale"},function(){return this.Lb},function(a){var b=this.Lb;v.Zd(a,E,"scale");b!==a&&Nm(this,b,a)});v.defineProperty(E,{Dl:"autoScale"},function(){return this.om},function(a){var b=this.om;b!==a&&(v.nb(a,E,E,"autoScale"),this.om=a,this.h("autoScale",b,a),a!==Dh&&Il(this,!1))});
v.defineProperty(E,{WK:"initialAutoScale"},function(){return this.el},function(a){var b=this.el;b!==a&&(v.nb(a,E,E,"initialAutoScale"),this.el=a,this.h("initialAutoScale",b,a))});v.defineProperty(E,{kI:"initialViewportSpot"},function(){return this.Fv},function(a){var b=this.Fv;b!==a&&(v.F(a,L,E,"initialViewportSpot"),a.jd()||v.k("initialViewportSpot must be a specific Spot: "+a),this.Fv=a,this.h("initialViewportSpot",b,a))});
v.defineProperty(E,{hI:"initialDocumentSpot"},function(){return this.Cv},function(a){var b=this.Cv;b!==a&&(v.F(a,L,E,"initialDocumentSpot"),a.jd()||v.k("initialViewportSpot must be a specific Spot: "+a),this.Cv=a,this.h("initialDocumentSpot",b,a))});v.defineProperty(E,{xh:"minScale"},function(){return this.Tv},function(a){v.Zd(a,E,"minScale");var b=this.Tv;b!==a&&(0<a?(this.Tv=a,this.h("minScale",b,a),a>this.scale&&(this.scale=a)):v.Fa(a,"> 0",E,"minScale"))});
v.defineProperty(E,{wh:"maxScale"},function(){return this.Rv},function(a){v.Zd(a,E,"maxScale");var b=this.Rv;b!==a&&(0<a?(this.Rv=a,this.h("maxScale",b,a),a<this.scale&&(this.scale=a)):v.Fa(a,"> 0",E,"maxScale"))});v.defineProperty(E,{jm:"zoomPoint"},function(){return this.Ew},function(a){this.Ew.L(a)||(v.F(a,y,E,"zoomPoint"),this.Ew=a=a.S())});
v.defineProperty(E,{iE:"contentAlignment"},function(){return this.oo},function(a){var b=this.oo;b.L(a)||(v.F(a,L,E,"contentAlignment"),this.oo=a=a.S(),this.h("contentAlignment",b,a),Il(this,!1))});v.defineProperty(E,{XK:"initialContentAlignment"},function(){return this.Io},function(a){var b=this.Io;b.L(a)||(v.F(a,L,E,"initialContentAlignment"),this.Io=a=a.S(),this.h("initialContentAlignment",b,a))});
v.defineProperty(E,{padding:"padding"},function(){return this.jf},function(a){"number"===typeof a?a=new mb(a):v.F(a,mb,E,"padding");var b=this.jf;b.L(a)||(this.jf=a=a.S(),this.tc(),this.h("padding",b,a))});v.u(E,{dg:"nodes"},function(){return this.bp.i});v.u(E,{links:"links"},function(){return this.Vo.i});v.u(E,{Gk:"parts"},function(){return this.zb.i});
E.prototype.findTopLevelNodesAndLinks=function(){for(var a=new J(S),b=this.bp.i;b.next();){var c=b.value;c.Zp&&a.add(c)}for(b=this.Vo.i;b.next();)c=b.value,c.Zp&&a.add(c);return a.i};E.prototype.findTopLevelGroups=function(){return this.ul.i};v.defineProperty(E,{Rb:"layout"},function(){return this.ke},function(a){var b=this.ke;b!==a&&(v.F(a,tg,E,"layout"),null!==b&&(b.g=null,b.group=null),this.ke=a,a.g=this,a.group=null,this.Yu=!0,this.h("layout",b,a),this.Me())});
E.prototype.layoutDiagram=function(a){zi(this);a&&gn(this,!0);Xl(this,!1)};function gn(a,b){for(var c=a.ul.i;c.next();)pn(a,c.value,b);null!==a.Rb&&(b?a.Rb.Af=!1:a.Rb.J())}function pn(a,b,c){if(null!==b){for(var d=b.Zo.i;d.next();)pn(a,d.value,c);null!==b.Rb&&(c?b.Rb.Af=!1:b.Rb.J())}}
function Xl(a,b){if(!a.Fy){var c=a.Rb,d=a.Ua;a.Ua=!0;try{var e=a.pa.Fh;0===e&&a.Tb("Layout");var f=a.Qa;1!==a.pa.Fh||f.nf||f.rc||b||f.Pn("Layout");for(var h=a.ul.i;h.next();)qn(a,h.value,b);c.Af||b&&!c.fF&&0!==e||(c.doLayout(a),zi(a),c.Af=!0)}finally{0===e&&a.Hd("Layout"),a.Yu=!c.Af,a.Ua=d}}}function qn(a,b,c){if(null!==b){for(var d=b.Zo.i;d.next();)qn(a,d.value,c);d=b.Rb;null===d||d.Af||c&&!d.fF||(b.Mn=!b.location.H(),d.doLayout(b),b.J(rn),d.Af=!0,am(a,b))}}
v.defineProperty(E,{Pd:"isTreePathToChildren"},function(){return this.Kv},function(a){var b=this.Kv;if(b!==a&&(v.j(a,"boolean",E,"isTreePathToChildren"),this.Kv=a,this.h("isTreePathToChildren",b,a),!this.pa.eb))for(a=this.dg;a.next();)sn(a.value)});E.prototype.findTreeRoots=function(){for(var a=new I(T),b=this.dg;b.next();){var c=b.value;c.Zp&&null===c.vn()&&a.add(c)}return a.i};
v.defineProperty(E,{lB:"treeCollapsePolicy"},function(){return this.zw},function(a){var b=this.zw;b!==a&&(a!==ql&&a!==Pm&&a!==Qm&&v.k("Unknown Diagram.treeCollapsePolicy: "+a),this.zw=a,this.h("treeCollapsePolicy",b,a))});v.defineProperty(E,{vh:null},function(){return this.AC},function(a){this.AC=a});
function pl(a){function b(a){var b=a.toLowerCase(),h=new I("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new la("string",I),d=new la("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified");
b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.Hy=c;a.Gy=d}
function pa(a,b){var c=a.Gy.na(b);return null!==c?c:a.Gy.na(b.toLowerCase())}function tn(a,b){var c=a.Hy.na(b);if(null!==c)return c;c=a.Hy.na(b.toLowerCase());if(null!==c)return c;v.k("Unknown DiagramEvent name: "+b);return null}E.prototype.addDiagramListener=E.prototype.Fz=function(a,b){v.j(a,"string",E,"addDiagramListener:name");v.j(b,"function",E,"addDiagramListener:listener");var c=tn(this,a);null!==c&&c.add(b)};
E.prototype.removeDiagramListener=E.prototype.BF=function(a,b){v.j(a,"string",E,"removeDiagramListener:name");v.j(b,"function",E,"addDiagramListener:listener");var c=tn(this,a);null!==c&&c.remove(b)};E.prototype.raiseDiagramEvent=E.prototype.Ca=function(a,b,c){var d=tn(this,a),e=new Jf;e.g=this;e.name=pa(this,a);void 0!==b&&(e.fB=b);void 0!==c&&(e.JA=c);a=d.length;if(1===a)d=d.fa(0),d(e);else if(0!==a)for(b=d.fc(),c=0;c<a;c++)d=b[c],d(e);return e.cancel};
function Ii(a,b){var c=!1;a.tb.tk(b)&&(c=!0);c=a.$z(b,function(a){return a.V},function(a){return a instanceof W},!0,function(a){return a instanceof W},c);if(0!==c.count)for(c=c.i;c.next();){var d=c.value;d.Ck&&d.Xb()}}E.prototype.isUnoccupied=E.prototype.Yl=function(a,b){void 0===b&&(b=null);return un(this,!1,null,b).Yl(a.x,a.y,a.width,a.height)};
function un(a,b,c,d){null===a.Ed&&(a.Ed=new vn);if(a.Ed.Vt||a.Ed.group!==c||a.Ed.eB!==d){if(null===c){b=a.Qj?Hl(a):a.se.copy();b.Tf(100,100);a.Ed.initialize(b);b=v.Ef();for(var e=a.dg;e.next();){var f=e.value,h=f.layer;null!==h&&h.visible&&!h.Mc&&wn(a,f,d,b)}}else for(c.Y.H()||c.af(),b=c.Y.copy(),b.Tf(20,20),a.Ed.initialize(b),b=v.Ef(),e=c.Pc;e.next();)f=e.value,f instanceof T&&wn(a,f,d,b);v.Gb(b);a.Ed.group=c;a.Ed.eB=d;a.Ed.Vt=!1}else b&&xn(a.Ed);return a.Ed}
function wn(a,b,c,d){if(b!==c)if(b.isVisible()&&b.Jz&&!b.of){c=b.getAvoidableRect(d);d=a.Ed.Fp;b=a.Ed.Dp;for(var e=c.x+c.width,f=c.y+c.height,h=c.x;h<e;h+=d){for(var k=c.y;k<f;k+=b)yn(a.Ed,h,k);yn(a.Ed,h,f)}for(k=c.y;k<f;k+=b)yn(a.Ed,e,k);yn(a.Ed,e,f)}else if(b instanceof V)for(b=b.Pc;b.next();)e=b.value,e instanceof T&&wn(a,e,c,d)}function zn(a,b){null===a.Ed||a.Ed.Vt||null!==b&&(!b.Jz||b.of)||(a.Ed.Vt=!0)}
E.prototype.simulatedMouseMove=E.prototype.Yx=function(a,b,c){if(null!==Mh){var d=Mh.g;c instanceof E||(c=null);var e=Nh;c!==e&&(null!==e&&e!==d&&null!==e.$a.te&&(Sh(e),Mh.px=!1,e.$a.te.doSimulatedDragLeave()),Nh=c,null!==c&&c!==d&&null!==c.$a.te&&(gi(),e=c.$a.te,Uh.contains(e)||Uh.add(e),c.$a.te.doSimulatedDragEnter()));if(null===c||c===d||!c.XD||c.bb||!c.Bp)return!1;d=c.$a.te;null!==d&&(null!==a?b=c.wr(a):null===b&&(b=new y),c.Pb.da=b,c.Pb.Ll=!1,c.Pb.up=!1,d.doSimulatedDragOver());return!0}return!1};
E.prototype.simulatedMouseUp=E.prototype.VF=function(a,b,c,d){if(null!==Mh){null===d&&(d=b);b=Nh;var e=Mh.g;if(d!==b){if(null!==b&&b!==e&&null!==b.$a.te)return Sh(b),Mh.px=!1,b.$a.te.doSimulatedDragLeave(),!1;Nh=d;null!==d&&null!==d.$a.te&&(gi(),b=d.$a.te,Uh.contains(b)||Uh.add(b),d.$a.te.doSimulatedDragEnter())}if(null===d)return Mh.doCancel(),!0;if(d!==this)return null!==a&&(c=d.wr(a)),d.Pb.da=c,d.Pb.Ll=!1,d.Pb.up=!0,a=d.$a.te,null!==a&&a.doSimulatedDrop(),a=Mh,null!==a&&(d=a.mayCopy(),a.Gf=d?"Copy":
"Move",a.stopTool()),!0}return!1};v.defineProperty(E,{cE:"autoScrollRegion"},function(){return this.$u},function(a){"number"===typeof a?a=new mb(a):v.F(a,mb,E,"autoScrollRegion");var b=this.$u;b.L(a)||(this.$u=a=a.S(),this.tc(),this.h("autoScrollRegion",b,a))});E.prototype.doAutoScroll=E.prototype.Wz=function(a){this.Zu.assign(a);An(this,this.Zu).Lc(this.position)?Sh(this):Bn(this)};
function Bn(a){-1===a.io&&(a.io=v.setTimeout(function(){if(-1!==a.io){Sh(a);var b=a.R.event;if(null!==b){var c=An(a,a.Zu);c.Lc(a.position)||(a.position=c,a.R.da=a.kB(a.Zu),a.Yx(b,null,b.target.Z)||a.doMouseMove(),a.Qj=!0,Ll(a,a.rh()),a.De=!0,a.Yf(),Bn(a))}}},a.HB))}function Sh(a){-1!==a.io&&(v.clearTimeout(a.io),a.io=-1)}
function An(a,b){var c=a.position,d=a.cE;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.tb,f=a.scale,e=v.Ug(0,0,e.width*f,e.height*f),h=v.xb(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.yu,1),k=k|0;h.x-=k;b.x<e.x+d.left/2&&(h.x-=k);b.x<e.x+d.left/4&&(h.x-=4*k)}else b.x<=e.x+e.width&&b.x>e.x+e.width-d.right&&(k=Math.max(a.yu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.y<e.y+d.top?(k=Math.max(a.zu,1),k|=0,h.y-=k,b.y<e.y+
d.top/2&&(h.y-=k),b.y<e.y+d.top/4&&(h.y-=4*k)):b.y<=e.y+e.height&&b.y>e.y+e.height-d.bottom&&(k=Math.max(a.zu,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Lc($c)||(c=new y(c.x+h.x/f,c.y+h.y/f));v.Gb(e);v.v(h);return c}E.prototype.makeSvg=E.prototype.makeSVG=function(a){void 0===a&&(a=new ua);a.context="svg";a=Cn(this,a);return null!==a?a.em:null};
E.prototype.makeImage=function(a){void 0===a&&(a=new ua);var b=(a.document||document).createElement("img");b.src=this.EI(a);return b};
E.prototype.makeImageData=E.prototype.EI=function(a){void 0===a&&(a=new ua);var b=Cn(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.uk.getImageData(0,0,b.width,b.height);case "blob":b=b.td;c=a.callback;if("function"!==typeof c){v.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.KJ)return b.KJ(c,a.type,a.details),"toBlob";if("function"===
typeof b.VI)return c(b.VI(a.type,a.details)),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var Dn=!1;
function Cn(a,b){a.Qa.oi();a.Yf();if(null===a.Eb)return null;"object"!==typeof b&&v.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var f=b.maxSize;void 0===b.maxSize&&(c=!0,f="svg"===b.context?new ia(Infinity,Infinity):new ia(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r=
b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new mb(l):l instanceof mb||(l=new mb(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.zo=!1;Yc(a.uf,!0);var s=new Rc(null,p),u=s.uk,t=s;if(!(d||e||k||h))return s.width=a.Ib+Math.ceil(l.left+l.right),s.height=a.Mb+Math.ceil(l.top+l.bottom),"svg"===b.context&&(u=t=new Jc(s.td,p,q),u instanceof Jc&&
(a.zo=!0)),zm(a,u,l,new ia(s.width,s.height),a.Lb,a.mb,k,m,r,n),a.zo=!0,t;var x=a.pb.Uw,w=new y(0,0),z=a.se.copy();z.HJ(a.padding);if(r)for(var A=!0,A=a.ac.n,H=A.length,C=0;C<H;C++){var R=A[C];if(R.visible&&R.Mc)for(var ba=R.zb.n,R=ba.length,U=0;U<R;U++){var M=ba[U];M.qA&&M.isVisible()&&(M=M.Y,M.H()&&z.Gh(M))}}w.x=z.x;w.y=z.y;if(null!==k){var Z,A=!0,ba=k.i;for(ba.reset();ba.next();)H=ba.value,H instanceof S&&(M=H,R=M.layer,null!==R&&!R.visible||null!==R&&!r&&R.Mc||!M.isVisible()||(M=M.Y,M.H()&&(A?
(A=!1,Z=M.copy()):Z.Gh(M))));A&&(Z=new B(0,0,0,0));z.width=Z.width;z.height=Z.height;w.x=Z.x;w.y=Z.y}null!==h&&h.H()&&(w=h,e||(e=x));A=ba=0;null!==l&&(ba=l.left+l.right,A=l.top+l.bottom);C=H=0;null!==d&&(H=d.width,C=d.height,isFinite(H)&&(H=Math.max(0,H-ba)),isFinite(C)&&(C=Math.max(0,C-A)));Z=h=0;null!==d&&null!==e?("NaN"===e&&(e=x),d.H()?(h=H,Z=C):isNaN(C)?(h=H,Z=z.height*e):(h=z.width*e,Z=C)):null!==d?d.H()?(e=Math.min(H/z.width,C/z.height),h=H,Z=C):isNaN(C)?(e=H/z.width,h=H,Z=z.height*e):(e=C/
z.height,h=z.width*e,Z=C):null!==e?"NaN"===e&&f.H()?(e=Math.min((f.width-ba)/z.width,(f.height-A)/z.height),e>x?(e=x,h=z.width,Z=z.height):(h=f.width,Z=f.height)):(h=z.width*e,Z=z.height*e):(e=x,h=z.width,Z=z.height);null!==l?(h+=ba,Z+=A):l=new mb(0);null!==f&&(d=f.width,f=f.height,"svg"!==b.context&&c&&!Dn&&(h>d||Z>f)&&(v.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(Z)+" vs 2000x2000) Consider increasing the max size."),
Dn=!0),isNaN(d)&&(d=2E3),isNaN(f)&&(f=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(f)&&(Z=Math.min(Z,f)));s.width=Math.ceil(h);s.height=Math.ceil(Z);"svg"===b.context&&(u=t=new Jc(s.td,p,q),u instanceof Jc&&(a.zo=!0));zm(a,u,l,new ia(Math.ceil(h),Math.ceil(Z)),e,w,k,m,r,n);a.zo=!0;return t}E.inherit=function(a,b){v.j(a,"function",E,"inherit");v.j(b,"function",E,"inherit");b.MG&&v.k("Cannot inherit from "+v.lf(b));v.Ma(a,b)};
function yl(){this.PG="63ad05bbe23a1786468a4c741b6d2";this.Ei=this.PG===this._tk?!0:null}
function En(a){var b="f",c=window[v.Fg("76a715b2f73f148a")][v.Fg("72ba13b5")],d=v.Fg;if(window[d("7da7")]&&window[d("7da7")][d("76a115b6ed251eaf4692")]){a.Ei=!0;var e=window[d("7da7")][d("76a115b6ed251eaf4692")],e=d(e).split(d("39e9"));if(6>e.length)return;var f=d(e[1]).split(".");if("7da71ca0"!==e[4])return;var h=d(v[d("6cae19")]).split(".");if(f[0]>h[0]||f[0]===h[0]&&f[1]>=h[1]){f=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h<f;h++)b+=c[h];f=b[d("73a612b6fb191d")](d(e[2]));0>
f&&d(e[2])!==d("7da71ca0ad381e90")&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));0>f&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Ei=!(0<=f&&f<b[d("73a612b6fb191d")](d("35")));if(!a.Ei)return}else return}f=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h<f;h++)b+=c[h];f=b[d("73a612b6fb191d")](d(v.adym));0>f&&d(v.adym)!==d("7da71ca0ad381e90")&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Ei=!(0<=f&&f<b[d("73a612b6fb191d")](d("35")));a.Ei&&(b=window.document[d("79ba13b2f7333e8846865a7d00")]("div"),
c=d("02cncncn"),"."===c[0]&&(c=c[d("69bd14a0f724128a44")](1)),b[d("79a417a0f0181a8946")]=c,window.document[d("78a712aa")]?(window.document[d("78a712aa")][d("7bb806b6ed32388c4a875b")](b),c=window[d("7dad0290ec3b0b91578e5b40007031bf")](b)[d("7dad0283f1390b81519f4645156528bf")](d("78a704b7e62456904c9b12701b6532a8")),window.document[d("78a712aa")][d("68ad1bbcf533388c4a875b")](b),c&&-1!==c.indexOf(d(v.mH))&&-1!==c.indexOf(d(v.nH))&&(a.Ei=!1)):(a.Ei=null,a.Ei=!1))}
yl.prototype.im=function(a){a.uf.setTransform(a.Cd,0,0,a.Cd,0,0);null===this.Ei&&En(this);return 0<this.Ei&&this!==this.NG?!0:!1};yl.prototype.t=function(){this.NG=null};
function zl(a,b){void 0!==b&&null!==b||v.k("Diagram setup requires an argument DIV.");null!==a.Nb&&v.k("Diagram has already completed setup.");"string"===typeof b?a.Nb=window.document.getElementById(b):b instanceof HTMLDivElement?a.Nb=b:v.k("No DIV or DIV id supplied: "+b);null===a.Nb&&v.k("Invalid DIV id; could not get element with id: "+b);void 0!==a.Nb.Z&&v.k("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Nb,null).position&&(a.Nb.style.position=
"relative");a.Nb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Nb.style["-ms-touch-action"]="none";a.Nb.innerHTML="";a.Nb.Z=a;var c=new Rc(a);c.td.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";void 0!==c.style&&(c.style.position="absolute",c.style.top="0px",c.style.left="0px","rtl"===window.getComputedStyle(a.Nb,null).getPropertyValue("direction")&&(a.Ir=!0),c.style.zIndex="2",c.style.SL="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
"none");a.Ib=a.Nb.clientWidth||1;a.Mb=a.Nb.clientHeight||1;a.Eb=c;a.uf=c.uk;var d=a.uf;a.EG=(window.devicePixelRatio||1)/(d.webkitBackingStorePixelRatio||d.mozBackingStorePixelRatio||d.msBackingStorePixelRatio||d.oBackingStorePixelRatio||d.backingStorePixelRatio||1);a.Cd=a.computePixelRatio();Bm(a,a.Ib,a.Mb);a.Ky=d[v.Fg("7eba17a4ca3b1a8346")][v.Fg("78a118b7")](d,v.im,4,4);a.Nb.insertBefore(c.td,a.Nb.firstChild);c=new Rc(null);c.width=1;c.height=1;a.Jy=c;a.qC=c.uk;var c=v.createElement("div"),e=v.createElement("div");
c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Ib+"px";c.style.height=a.Mb+"px";c.style.zIndex="1";e.style.position="absolute";e.style.width="1px";e.style.height="1px";a.Nb.appendChild(c);c.appendChild(e);c.onscroll=a.GG;c.onmousedown=a.YC;c.ontouchstart=a.YC;c.Z=a;c.KG=!0;c.LG=!0;a.ow=c;a.Ls=e;a.OA=v.lE(function(){a.hk=null;a.oa()},300,!1);a.qG=v.lE(function(){Bk(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.fq=function(b){if(a.isEnabled){a.Am=!0;var c=
a.Wc;v.Dn&&c.pj?(b.preventDefault(),b.simulated=!0,a.Us=b):(a.Wc=a.Pb,a.Pb=c,Ol(a,a,b,c,!0),a.Yx(b,null,b.target.Z)||(a.doMouseMove(),a.Ya.isBeyondDragSize()&&(a.jl=0),Sl(c,b)))}};a.eq=function(b){if(a.isEnabled){a.Am=!0;var c=a.Wc;if(v.Dn&&null!==a.Us)a.Us=b,b.preventDefault();else if(v.Dn&&400>b.timeStamp-a.Em)b.preventDefault();else if(a.gl)b.preventDefault();else{a.Wc=a.Pb;a.Pb=c;Ol(a,a,b,c,!0);c.Ll=!0;c.He=b.detail;if(v.ZE||v.$E)b.timeStamp-a.Em<a.JD&&!a.Ya.isBeyondDragSize()?a.jl++:a.jl=1,a.Em=
b.timeStamp,c.He=a.jl;a.Gi=c;!0===c.rr.simulated?(b.preventDefault(),b.simulated=!0):(Mh=null,a.doMouseDown(),a.Gi=a.Gi.copy(),1===b.button?b.preventDefault():Sl(c,b))}}};a.hq=function(b){if(a.isEnabled)if(a.gl&&2===b.button)b.preventDefault();else if(a.gl&&0===b.button&&(a.gl=!1),a.ct)b.preventDefault();else{a.Am=!0;var c=a.Wc;if(v.Dn){if(400>b.timeStamp-a.Em){b.preventDefault();return}a.Em=b.timeStamp}if(v.Dn&&null!==a.Us)a.Us=null,b.preventDefault();else{a.Wc=a.Pb;a.Pb=c;Ol(a,a,b,c,!0);c.up=!0;
c.He=b.detail;if(v.ZE||v.$E)c.He=a.jl;c.bubbles=b.bubbles;b.target.Z&&(c.Tg=b.target.Z);a.VF(b,null,new y,c.Tg)||(a.doMouseUp(),Sh(a),Sl(c,b))}}};a.zh=function(b){if(a.isEnabled){var c=a.Wc;a.Wc=a.Pb;a.Pb=c;Ol(a,a,b,c,!0);c.bubbles=!0;c.Kl=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();Sl(c,b)}};a.gq=function(){if(a.isEnabled){a.Am=!1;var b=a.Ya;b.cancelWaitAfter();b instanceof kh&&b.hideToolTip()}};a.hG=function(b){if(a.isEnabled){a.ct=!1;a.gl=!0;var c=a.Wc;a.Wc=a.Pb;a.Pb=c;Ql(a,
b,b.targetTouches[0],c,1<b.touches.length);a.doMouseDown();Sl(c,b)}};a.gG=function(b){if(a.isEnabled){var c=a.Wc;a.Wc=a.Pb;a.Pb=c;var d=null;0<b.changedTouches.length?d=b.changedTouches[0]:0<b.targetTouches.length&&(d=b.targetTouches[0]);Rl(a,b,d,c,1<b.touches.length);a.Yx(d?d:b,null,c.Tg)||a.doMouseMove();Sl(c,b)}};a.fG=function(b){if(a.isEnabled)if(a.ct)b.preventDefault();else{var c=a.Wc;a.Wc=a.Pb;a.Pb=c;if(!(1<b.touches.length)){var d=null,e=null;0<b.changedTouches.length?e=b.changedTouches[0]:
0<b.targetTouches.length&&(e=b.targetTouches[0]);c.g=a;c.He=1;if(null!==e){d=window.document.elementFromPoint(e.clientX,e.clientY);null!==d&&d.Z instanceof E&&d.Z!==a&&Pl(d.Z,e,c);Pl(a,b.changedTouches[0],c);var m=e.screenX,n=e.screenY,p=a.NC;b.timeStamp-a.Em<a.JD&&!(25<Math.abs(p.x-m)||25<Math.abs(p.y-n))?a.jl++:a.jl=1;c.He=a.jl;a.Em=b.timeStamp;a.NC.l(m,n)}c.wd=0;c.button=0;c.buttons=1;c.Ll=!1;c.up=!0;c.Kl=0;c.Cc=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.Tg=null===d?b.target.Z:d.Z?d.Z:
null;c.Pe=null;a.VF(e?e:b,null,new y,c.Tg)||a.doMouseUp();Sl(c,b);a.gl=!1}}};a.aJ=function(b){if("touch"===b.pointerType){var c=a.hD;void 0===c[b.pointerId]&&(a.ew++,c[b.pointerId]=b);a.Xi[0]=null;a.Xi[1]=null;for(var d in c)if(null===a.Xi[0])a.Xi[0]=c[d];else if(null===a.Xi[1]){a.Xi[1]=c[d];break}a.isEnabled&&(a.ct=!1,a.gl=!0,c=a.Wc,a.Wc=a.Pb,a.Pb=c,Ql(a,b,b,c,1<a.ew),a.doMouseDown(),Sl(c,b))}};a.cJ=function(b){if("touch"===b.pointerType&&!(2>a.ew)){var c=a.Xi;c[0].pointerId===b.pointerId&&(c[0]=
b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Wc,a.Wc=a.Pb,a.Pb=c,Rl(a,b,b,c,!0),a.Yx(b,null,c.Tg)||(a.doMouseMove(),Sl(c,b)))}};a.bJ=function(b){if("touch"===b.pointerType){var c=a.hD;void 0!==c[b.pointerId]&&(a.ew--,delete c[b.pointerId],c=a.Xi,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};Yc(d,!0);Cl(a)}
function Fn(a){1<arguments.length&&v.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");E.call(this,a);this.ut=!0;this.Bl=!1;this.bb=!0;this.iE=yb;this.Rb=new Gn}v.Ma(Fn,E);v.ga("Palette",Fn);
function vl(a){1<arguments.length&&v.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");E.call(this,a);this.Qa.isEnabled=!1;this.Vc=!0;this.dk=null;this.rv=!0;this.AJ("drawShadows",!1);var b=new S,c=new X;c.stroke="magenta";c.fb=2;c.fill="transparent";c.name="BOXSHAPE";b.bm=!0;b.VA="BOXSHAPE";b.uA="BOXSHAPE";b.IF="BOXSHAPE";b.cursor="move";b.add(c);this.pm=b;c=new mh;c.type=wj;c.pf=Gb;var d=new xj;d.Vf=!0;c.add(d);d=new X;d.nh=Gb;d.Cb="Rectangle";d.Ba=new ia(64,
64);d.cursor="se-resize";d.alignment=Mb;c.add(d);b.GF=c;this.gn=this.qk=!1;this.vf=this.wt=!0;this.cE=0;this.wz=new Rc(null);this.OG=this.wz.uk;this.$a.te=new Hn;this.$a.JF=new In;var e=this;this.click=function(){var a=e.dk;if(null!==a){var b=a.tb,c=e.R.da;a.position=new y(c.x-b.width/2,c.y-b.height/2)}};this.tF=function(){Jn(e)};this.sF=function(){null!==e.dk&&(e.tc(),e.oa())};this.Dl=Ml;this.Vc=!1}v.Ma(vl,E);v.ga("Overview",vl);
function Kn(a){a.Vc||a.Xd||!1!==a.Nf||(a.Nf=!0,requestAnimationFrame(function(){if(a.Nf&&!a.Xd&&(a.Nf=!1,null!==a.Nb)){a.Xd=!0;zi(a);a.se.H()||Ll(a,a.rh());null===a.Nb&&v.k("No div specified");null===a.Eb&&v.k("No canvas specified");if(a.De){var b=a.dk;if(null!==b&&!b.Qa.nf&&!b.Qa.rc){var b=a.uf,c=a.wz;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.Eb.width,a.Eb.height);b.drawImage(c.td,0,0);c=a.fd;c.reset();1!==a.scale&&c.scale(a.scale);0===a.position.x&&0===a.position.y||c.translate(-a.position.x,
-a.position.y);b.scale(a.Cd,a.Cd);b.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.ac.n,d=c.length,e=0;e<d;e++)c[e].ue(b,a);a.fl=!1;a.De=!1}}a.Xd=!1}}))}vl.prototype.computePixelRatio=function(){return 1};
vl.prototype.ue=function(){null===this.Nb&&v.k("No div specified");null===this.Eb&&v.k("No canvas specified");if(this.De){var a=this.dk;if(null!==a&&!a.Qa.nf){wm(this);var b=a.Bn;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&Wl(a);var c=this.Eb,b=this.uf,d=this.wz,e=this.OG;d.width=c.width;d.height=c.height;Yc(b,!0);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,c.width,c.height);d=this.fd;d.reset();1!==this.scale&&d.scale(this.scale);0===this.position.x&&0===this.position.y||d.translate(-this.position.x,
-this.position.y);b.scale(this.Cd,this.Cd);b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);for(var d=this.rv,f=this.tb,h=a.ac.n,k=h.length,a=0;a<k;a++){var l=h[a],m=b,n=f,p=d;if(l.visible&&0!==l.xc&&(void 0===p&&(p=!0),p||!l.Mc)){1!==l.xc&&(m.globalAlpha=l.xc);for(var p=this.scale,l=l.zb.n,q=l.length,r=0;r<q;r++){var s=l[r],u=s.Y;u.Jg(n)&&(1<u.width*p||1<u.height*p?s.ue(m,this):hl(s,m))}m.globalAlpha=1}}e.drawImage(c.td,0,0);c=this.ac.n;e=c.length;for(a=0;a<e;a++)c[a].ue(b,this);this.De=this.fl=!1}}};
v.defineProperty(vl,{IA:"observed"},function(){return this.dk},function(a){var b=this.dk;null!==a&&v.F(a,E,vl,"observed");a instanceof vl&&v.k("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.qh),b.BF("ViewportBoundsChanged",this.tF),b.BF("DocumentBoundsChanged",this.sF),b.bw.remove(this)),this.dk=a,null!==a&&(a.Fz("ViewportBoundsChanged",this.tF),a.Fz("DocumentBoundsChanged",this.sF),a.bw.add(this),this.add(this.qh),Jn(this)),this.tc(),this.h("observed",
b,a))});v.defineProperty(vl,{qh:"box"},function(){return this.pm},function(a){var b=this.pm;b!==a&&(this.pm=a,this.remove(b),this.add(this.pm),Jn(this),this.h("box",b,a))});v.defineProperty(vl,{RK:"drawsTemporaryLayers"},function(){return this.rv},function(a){this.rv!==a&&(this.rv=a,this.Mx())});
function Jn(a){var b=a.qh;if(null!==b){var c=a.dk;if(null!==c){a.De=!0;var c=c.tb,d=b.Au,e=v.gm();e.l(c.width,c.height);d.Ba=e;v.yk(e);a=2/a.scale;d instanceof X&&(d.fb=a);b.location=new y(c.x-a/2,c.y-a/2)}}}vl.prototype.rh=function(){var a=this.dk;return null===a?ad:a.se};vl.prototype.UE=function(){!0!==this.De&&(this.De=!0,Kn(this))};
vl.prototype.qu=function(a,b,c,d,e){this.Vc||(Gl(this),this.oa(),Tl(this),this.tc(),Jn(this),this.mh.scale=c,this.mh.position.x=a.x,this.mh.position.y=a.y,this.mh.bounds.set(a),this.mh.isScroll=e,this.Ca("ViewportBoundsChanged",this.mh,a))};function Hn(){qh.call(this);this.pl=null}v.Ma(Hn,qh);
Hn.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.Bl||!a.vf)return!1;var b=a.IA;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.tb;this.pl=new y(c.width/2,c.height/2);a=a.Bc.da;b.position=new y(a.x-this.pl.x,a.y-this.pl.y)}return!0};Hn.prototype.doActivate=function(){this.pl=null;qh.prototype.doActivate.call(this)};
Hn.prototype.moveParts=function(){var a=this.g,b=a.IA;if(null!==b){var c=a.qh;if(null!==c){if(null===this.pl){var d=a.Bc.da,c=c.location;this.pl=new y(d.x-c.x,d.y-c.y)}a=a.R.da;b.position=new y(a.x-this.pl.x,a.y-this.pl.y)}}};function In(){vj.call(this)}v.Ma(In,vj);In.prototype.resize=function(a){var b=this.g.IA;if(null!==b){var c=b.tb.copy();b.position=a.position;(c.width!==a.width||c.height!==a.height)&&0<a.width&&0<a.height&&(b.scale=Math.min(c.width/a.width,c.height/a.height))}};
function ha(a){1<arguments.length&&v.k("Brush constructor can take at most one optional argument, the Brush type.");v.pc(this);this.Q=!1;void 0===a?(this.ka=og,this.mo="black"):"string"===typeof a?(this.ka=og,this.mo=a):(this.ka=a,this.mo="black");var b=this.ka;b===pg?(this.np=yb,this.Bo=Lb):this.Bo=b===Xc?this.np=Gb:this.np=vb;this.uw=0;this.sv=NaN;this.ah=this.dw=this.$g=null;this.zy=this.no=0}v.ga("Brush",ha);var og;ha.Solid=og=v.p(ha,"Solid",0);var pg;ha.Linear=pg=v.p(ha,"Linear",1);var Xc;
ha.Radial=Xc=v.p(ha,"Radial",2);var Ln;ha.Pattern=Ln=v.p(ha,"Pattern",4);var Mn;ha.Lab=Mn=v.p(ha,"Lab",5);var Nn;ha.HSL=Nn=v.p(ha,"HSL",6);function On(){this.bg=this.Yc=this.xd=this.Dc=0}ha.prototype.copy=function(){var a=new ha;a.ka=this.ka;a.mo=this.mo;a.np=this.np.S();a.Bo=this.Bo.S();a.uw=this.uw;a.sv=this.sv;null!==this.$g&&(a.$g=this.$g.copy());a.dw=this.dw;return a};g=ha.prototype;g.Ga=function(){this.freeze();Object.freeze(this);return this};
g.freeze=function(){this.Q=!0;null!==this.$g&&this.$g.freeze();return this};g.Ra=function(){Object.isFrozen(this)&&v.k("cannot thaw constant: "+this);this.Q=!1;null!==this.$g&&this.$g.Ra();return this};g.ic=function(a){a.Ge===ha?this.type=a:v.Aj(this,a)};
g.toString=function(){var a="Brush(";if(this.type===og)a+=this.color;else if(a=this.type===pg?a+"Linear ":this.type===Xc?a+"Radial ":this.type===Ln?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.rk)for(var b=this.rk.i;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
ha.prototype.addColorStop=ha.prototype.addColorStop=function(a,b){this.Q&&v.ma(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&v.Fa(a,"0 <= loc <= 1",ha,"addColorStop:loc");v.j(b,"string",ha,"addColorStop:color");null===this.$g&&(this.$g=new la("number","string"));this.$g.add(a,b);this.ka===og&&(this.type=pg);this.ah=null};
v.defineProperty(ha,{type:"type"},function(){return this.ka},function(a){this.Q&&v.ma(this,a);v.nb(a,ha,ha,"type");this.ka=a;this.start.Od()&&(a===pg?this.start=yb:a===Xc&&(this.start=Gb));this.end.Od()&&(a===pg?this.end=Lb:a===Xc&&(this.end=Gb));this.ah=null});v.defineProperty(ha,{color:"color"},function(){return this.mo},function(a){this.Q&&v.ma(this,a);this.mo=a;this.ah=null});
v.defineProperty(ha,{start:"start"},function(){return this.np},function(a){this.Q&&v.ma(this,a);v.F(a,L,ha,"start");this.np=a.S();this.ah=null});v.defineProperty(ha,{end:"end"},function(){return this.Bo},function(a){this.Q&&v.ma(this,a);v.F(a,L,ha,"end");this.Bo=a.S();this.ah=null});v.defineProperty(ha,{Gu:"startRadius"},function(){return this.uw},function(a){this.Q&&v.ma(this,a);v.Zd(a,ha,"startRadius");0>a&&v.Fa(a,">= zero",ha,"startRadius");this.uw=a;this.ah=null});
v.defineProperty(ha,{Et:"endRadius"},function(){return this.sv},function(a){this.Q&&v.ma(this,a);v.Zd(a,ha,"endRadius");0>a&&v.Fa(a,">= zero",ha,"endRadius");this.sv=a;this.ah=null});v.defineProperty(ha,{rk:"colorStops"},function(){return this.$g},function(a){this.Q&&v.ma(this,a);this.$g=a;this.ah=null});v.defineProperty(ha,{pattern:"pattern"},function(){return this.dw},function(a){this.Q&&v.ma(this,a);this.dw=a;this.ah=null});
ha.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+d+e+c};var Pn=(new Rc(null)).uk,ga;
ha.isValidColor=ga=function(a){if("black"===a)return!0;if(""===a)return!1;Pn.fillStyle="#000000";var b=Pn.fillStyle;Pn.fillStyle=a;if(Pn.fillStyle!==b)return!0;Pn.fillStyle="#FFFFFF";b=Pn.fillStyle;Pn.fillStyle=a;return Pn.fillStyle!==b};var Qn=new On,Rn=new On,Sn=new On,Tn=new On;ha.lighten=function(a){return Un(a)};
ha.prototype.lightenBy=function(a,b){this.Q&&v.ma(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Mn:b;if(this.type===og)Vn(this.color),this.color=Wn(c,d);else if((this.type===pg||this.type===Xc)&&null!==this.rk)for(var e=this.rk.i;e.next();)Vn(e.value),this.addColorStop(e.key,Wn(c,d));return this};var Un;ha.lightenBy=Un=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Mn:c;Vn(a);return Wn(b,c)};ha.darken=function(a){return Xn(a)};
ha.prototype.darkenBy=function(a,b){this.Q&&v.ma(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Mn:b;if(this.type===og)Vn(this.color),this.color=Wn(-c,d);else if((this.type===pg||this.type===Xc)&&null!==this.rk)for(var e=this.rk.i;e.next();)Vn(e.value),this.addColorStop(e.key,Wn(-c,d));return this};var Xn;ha.darkenBy=Xn=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Mn:c;Vn(a);return Wn(-b,c)};
function Wn(a,b){switch(b){case Mn:var c=100*Yn(Qn.Dc),d=100*Yn(Qn.xd),e=100*Yn(Qn.Yc);Sn.Dc=.4124564*c+.3575761*d+.1804375*e;Sn.xd=.2126729*c+.7151522*d+.072175*e;Sn.Yc=.0193339*c+.119192*d+.9503041*e;Sn.bg=Qn.bg;c=Zn(Sn.Dc/$n[0]);d=Zn(Sn.xd/$n[1]);e=Zn(Sn.Yc/$n[2]);Tn.Dc=116*d-16;Tn.xd=500*(c-d);Tn.Yc=200*(d-e);Tn.bg=Sn.bg;Tn.Dc=Math.min(100,Math.max(0,Tn.Dc+100*a));c=(Tn.Dc+16)/116;d=c-Tn.Yc/200;Sn.Dc=$n[0]*ao(Tn.xd/500+c);Sn.xd=$n[1]*(Tn.Dc>bo*co?Math.pow(c,3):Tn.Dc/bo);Sn.Yc=$n[2]*ao(d);Sn.bg=
Tn.bg;c=-.969266*Sn.Dc+1.8760108*Sn.xd+.041556*Sn.Yc;d=.0556434*Sn.Dc+-.2040259*Sn.xd+1.0572252*Sn.Yc;Qn.Dc=255*eo((3.2404542*Sn.Dc+-1.5371385*Sn.xd+-.4985314*Sn.Yc)/100);Qn.xd=255*eo(c/100);Qn.Yc=255*eo(d/100);Qn.bg=Sn.bg;Qn.Dc=Math.round(Qn.Dc);255<Qn.Dc?Qn.Dc=255:0>Qn.Dc&&(Qn.Dc=0);Qn.xd=Math.round(Qn.xd);255<Qn.xd?Qn.xd=255:0>Qn.xd&&(Qn.xd=0);Qn.Yc=Math.round(Qn.Yc);255<Qn.Yc?Qn.Yc=255:0>Qn.Yc&&(Qn.Yc=0);return"rgba("+Qn.Dc+", "+Qn.xd+", "+Qn.Yc+", "+Qn.bg+")";case Nn:var e=Qn.Dc/255,f=Qn.xd/
255,h=Qn.Yc/255,k=Math.max(e,f,h),d=Math.min(e,f,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(f-h)/l%6;break;case f:c=(h-e)/l+2;break;case h:c=(e-f)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}Rn.Dc=Math.round(c);Rn.xd=Math.round(100*e);Rn.Yc=Math.round(100*d);Rn.bg=Qn.bg;Rn.Yc=Math.min(100,Math.max(0,Rn.Yc+100*a));return"hsla("+Rn.Dc+", "+Rn.xd+"%, "+Rn.Yc+"%, "+Rn.bg+")";default:return v.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}
function Vn(a){Pn.clearRect(0,0,1,1);Pn.fillStyle="#000000";var b=Pn.fillStyle;Pn.fillStyle=a;Pn.fillStyle!==b?(Pn.fillRect(0,0,1,1),a=Pn.getImageData(0,0,1,1).data,Qn.Dc=a[0],Qn.xd=a[1],Qn.Yc=a[2],Qn.bg=a[3]/255):(Pn.fillStyle="#FFFFFF",Pn.fillStyle=a,Qn.Dc=0,Qn.xd=0,Qn.Yc=0,Qn.bg=1)}function Yn(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function eo(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var co=216/24389,bo=24389/27,$n=[95.047,100,108.883];
function Zn(a){return a>co?Math.pow(a,1/3):(bo*a+16)/116}function ao(a){var b=a*a*a;return b>co?b:(116*a-16)/bo}
function G(){v.pc(this);this.P=4225027;this.xc=1;this.kh=null;this.Qb="";this.Zb=this.Db=null;this.mb=(new y(NaN,NaN)).freeze();this.Re=zd;this.Uh=md;this.Th=xd;this.fd=new ja;this.mm=new ja;this.Oi=new ja;this.Lb=this.yo=1;this.fg=0;this.zg=fo;this.Jm=hd;this.rd=(new B(NaN,NaN,NaN,NaN)).freeze();this.qc=(new B(NaN,NaN,NaN,NaN)).freeze();this.Ic=(new B(0,0,NaN,NaN)).freeze();this.U=this.xs=this.ys=null;this.lm=this.he=nc;this.Is=0;this.Zi=1;this.Sq=0;this.wi=1;this.Ys=null;this.Ms=-Infinity;this.Wm=
0;this.Xm=$c;this.Ym=cj;this.$q="";this.vc=this.ia=null;this.jo=-1;this.Qm=this.bn=this.ig=this.Yk=this.mp=null}v.ii(G);v.ga("GraphObject",G);
G.prototype.cloneProtected=function(a){a.P=this.P|6144;a.xc=this.xc;a.Qb=this.Qb;a.Db=this.Db;a.Zb=this.Zb;a.mb.assign(this.mb);a.Re=this.Re.S();a.Uh=this.Uh.S();a.Th=this.Th.S();a.Oi=this.Oi.copy();a.Lb=this.Lb;a.fg=this.fg;a.zg=this.zg;a.Jm=this.Jm.S();a.rd.assign(this.rd);a.qc.assign(this.qc);a.Ic.assign(this.Ic);a.xs=this.xs;null!==this.U&&(a.U=this.U.copy());a.he=this.he.S();a.lm=this.lm.S();a.Is=this.Is;a.Zi=this.Zi;a.Sq=this.Sq;a.wi=this.wi;a.Ys=this.Ys;a.Ms=this.Ms;a.Wm=this.Wm;a.Xm=this.Xm.S();
a.Ym=this.Ym;a.$q=this.$q;null!==this.ia&&(a.ia=this.ia.copy());a.vc=this.vc;a.jo=this.jo;null!==this.Yk&&(a.Yk=v.Fl(this.Yk));null!==this.ig&&(a.ig=this.ig.copy());a.bn=this.bn};G.prototype.addCopyProperty=G.prototype.XG=function(a){var b=this.Yk;if(v.isArray(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.Yk=b=[];b.push(a)};G.prototype.ji=function(a){a.ys=null;a.Qm=null;a.I()};
G.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.Yk)for(var b=0;b<this.Yk.length;b++){var c=this.Yk[b];a[c]=this[c]}return a};G.prototype.copy=function(){return this.clone()};G.prototype.ic=function(a){a.Ge===W?0===a.name.indexOf("Orient")?this.rq=a:v.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.Ge===G?this.stretch=a:v.Aj(this,a)};G.prototype.toString=function(){return v.lf(Object.getPrototypeOf(this))+"#"+v.Kd(this)};
var yj;G.None=yj=v.p(G,"None",0);var fo;G.Default=fo=v.p(G,"Default",0);var ho;G.Vertical=ho=v.p(G,"Vertical",4);var io;G.Horizontal=io=v.p(G,"Horizontal",5);var Be;G.Fill=Be=v.p(G,"Fill",3);var Lj;G.Uniform=Lj=v.p(G,"Uniform",1);var Mj;G.UniformToFill=Mj=v.p(G,"UniformToFill",2);var jo;G.FlipVertical=jo=v.p(G,"FlipVertical",1);var ko;G.FlipHorizontal=ko=v.p(G,"FlipHorizontal",2);var lo;G.FlipBoth=lo=v.p(G,"FlipBoth",3);function mo(a){null===a.ia&&(a.ia=new no)}
G.prototype.Ld=function(){if(null===this.U){var a=new oo;a.Nj=vb;a.mk=vb;a.Lj=10;a.kk=10;a.Kj=po;a.jk=po;a.Mj=0;a.lk=0;this.U=a}};function qo(a,b,c,d,e,f,h){var k=.001,l=f.length;a.moveTo(b,c);d-=b;k=e-c;0===d&&(d=.001);e=k/d;for(var m=Math.sqrt(d*d+k*k),n=0,p=!0,q=0===h?!1:!0;.1<=m;){if(q){k=f[n++%l];for(k-=h;0>k;)k+=f[n++%l],p=!p;q=!1}else k=f[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}}
G.prototype.raiseChangedEvent=G.prototype.Zc=function(a,b,c,d,e,f,h){var k=this.V;if(null!==k&&(k.Qn(a,b,c,d,e,f,h),ro(this)&&c===this&&a===Lf&&so(this,k,b),c===k&&0!==(k.P&16777216)&&null!==k.data))for(a=this.xa.n,c=a.length,d=0;d<c;d++)e=a[d],e instanceof D&&Dm(e,function(a){null!==a.data&&0!==(a.P&16777216)&&a.Hb(b)})};
function so(a,b,c){var d=a.Nl();if(null!==d)for(var e=a.vc.i;e.next();){var f=e.value,h=null;if(null!==f.yq){h=gh(f,d,a);if(null===h)continue;f.ay(a,h,c,null)}else if(f.vx){var k=b.g;null===k||k.Oe||f.ay(a,k.ca.Ek,c,d)}else{var l=d.data;if(null===l)continue;k=b.g;null===k||k.Oe||f.ay(a,l,c,d)}h===a&&(k=d.ax(f.fm),null!==k&&f.oG(k,h,c))}}G.prototype.ax=function(a){return this.jo===a?this:null};G.prototype.raiseChanged=G.prototype.h=function(a,b,c){this.Zc(Lf,a,this,b,c)};
function to(a,b,c,d,e){var f=a.rd,h=a.Oi;h.reset();uo(a,h,b,c,d,e);a.Oi=h;f.x=b;f.y=c;f.width=d;f.height=e;h.$t()||h.lG(f)}function vo(a,b,c,d){if(!1===a.Qg)return!1;d.multiply(a.transform);return c?a.Jg(b,d):a.on(b,d)}
G.prototype.BE=function(a,b,c){if(!1===this.Qg)return!1;var d=this.Ja;b=a.wf(b);var e=!1;c&&(e=Sa(a.x,a.y,0,0,0,d.height)<b||Sa(a.x,a.y,0,d.height,d.width,d.height)<b||Sa(a.x,a.y,d.width,d.height,d.width,0)<b||Sa(a.x,a.y,d.width,0,0,0)<b);c||(e=Sa(a.x,a.y,0,0,0,d.height)<b&&Sa(a.x,a.y,0,d.height,d.width,d.height)<b&&Sa(a.x,a.y,d.width,d.height,d.width,0)<b&&Sa(a.x,a.y,d.width,0,0,0)<b);return e};G.prototype.Xg=function(){return!0};
G.prototype.containsPoint=G.prototype.Ha=function(a){var b=v.K();b.assign(a);this.transform.ob(b);var c=this.Y;if(!c.H())return v.v(b),!1;var d=this.g;if(null!==d&&d.gl){var e=d.Qt("extraTouchThreshold"),f=d.Qt("extraTouchArea"),h=f/2,k=this.Ja,d=this.kj()*d.scale,l=1/d;if(k.width*d<e&&k.height*d<e)return a=lb(c.x-h*l,c.y-h*l,c.width+f*l,c.height+f*l,b.x,b.y),v.v(b),a}if(this instanceof mh||this instanceof X?lb(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Ha(b))return e=!1,e=this.ig&&!this.ig.Ha(b)?
!1:null!==this.Zb&&c.Ha(b)?!0:null!==this.Db&&this.Ic.Ha(a)?!0:this.sk(a),v.v(b),e;v.v(b);return!1};G.prototype.sk=function(a){var b=this.Ja;return lb(0,0,b.width,b.height,a.x,a.y)};G.prototype.containsRect=G.prototype.tk=function(a){if(0===this.angle)return this.Y.tk(a);var b=this.Ja,b=v.Ug(0,0,b.width,b.height),c=this.transform,d=!1,e=v.xb(a.x,a.y);b.Ha(c.ki(e))&&(e.l(a.x,a.bottom),b.Ha(c.ki(e))&&(e.l(a.right,a.bottom),b.Ha(c.ki(e))&&(e.l(a.right,a.y),b.Ha(c.ki(e))&&(d=!0))));v.v(e);v.Gb(b);return d};
G.prototype.containedInRect=G.prototype.on=function(a,b){if(void 0===b)return a.tk(this.Y);var c=this.Ja,d=!1,e=v.xb(0,0);a.Ha(b.ob(e))&&(e.l(0,c.height),a.Ha(b.ob(e))&&(e.l(c.width,c.height),a.Ha(b.ob(e))&&(e.l(c.width,0),a.Ha(b.ob(e))&&(d=!0))));v.v(e);return d};
G.prototype.intersectsRect=G.prototype.Jg=function(a,b){if(void 0===b&&(b=this.transform,0===this.angle))return a.Jg(this.Y);var c=this.Ja,d=b,e=v.xb(0,0),f=v.xb(0,c.height),h=v.xb(c.width,c.height),k=v.xb(c.width,0),l=!1;if(a.Ha(d.ob(e))||a.Ha(d.ob(f))||a.Ha(d.ob(h))||a.Ha(d.ob(k)))l=!0;else{var c=v.Ug(0,0,c.width,c.height),m=v.xb(a.x,a.y);c.Ha(d.ki(m))?l=!0:(m.l(a.x,a.bottom),c.Ha(d.ki(m))?l=!0:(m.l(a.right,a.bottom),c.Ha(d.ki(m))?l=!0:(m.l(a.right,a.y),c.Ha(d.ki(m))&&(l=!0))));v.v(m);v.Gb(c);!l&&
(me(a,e,f)||me(a,f,h)||me(a,h,k)||me(a,k,e))&&(l=!0)}v.v(e);v.v(f);v.v(h);v.v(k);return l};G.prototype.getDocumentPoint=G.prototype.Va=function(a,b){void 0===b&&(b=new y);if(a instanceof L){a.Od()&&v.k("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.Ja;b.l(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY)}else b.set(a);this.oh.ob(b);return b};
G.prototype.getDocumentAngle=G.prototype.xn=function(){var a;a=this.oh;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a};G.prototype.getDocumentScale=G.prototype.kj=function(){if(0!==(this.P&4096)===!1)return this.yo;var a=this.Lb;return null!==this.N?a*this.N.kj():a};G.prototype.getLocalPoint=G.prototype.GE=function(a,b){void 0===b&&(b=new y);b.assign(a);this.oh.ki(b);return b};
G.prototype.getNearestIntersectionPoint=G.prototype.HE=function(a,b,c){return this.zn(a.x,a.y,b.x,b.y,c)};g=G.prototype;g.zn=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy);if(null!==this.jn)return f=this.Y,ke(f.left,f.top,f.right,f.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.l(0,0);d=this.Ja;c=ke(0,0,d.width,d.height,h,a,b,c,e);e.transform(f);return c};