-
Notifications
You must be signed in to change notification settings - Fork 0
/
TheHourglassGrimoire.html
executable file
·2775 lines (2332 loc) · 472 KB
/
TheHourglassGrimoire.html
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
<!doctype html>
<!--
The Hourglass Grimoire
By James Babcock and Vincent Luczkow
Based on The Center for Applied Rationality
April 2015 Applied Rationality Workshop
This is a single-file web page: all Javascript, CSS, and images are embedded in
the file. This is to make it easy to carry around, open from email attachments,
store on your phone for offline use, and whatnot. Open this in a browser for
more metadata, including copyright information and terms of redistribution.
-->
<html>
<head>
<title>The Hourglass Grimoire</title>
<meta charset="UTF-8">
<!-- Favicon {{{ -->
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6AAAdTAAAOpgAAA6lwAAF2+XqZnUAAAO4ElEQVR42s1bCVCURxZmZpgZhvsQkPs+hvuWY0QQEQRvo3KIigqI9y1epYiRRDFGjPFERTbGXZOsmqqUMVq70VSylY3RZNfEqmwsk7geJFoSEyNBefu+nn+QuGiiQv121auZ6fn7/d1fd79+V5sRkdmT0u8UcyZnplCmdKZRTOVMS5heZNrJdIDpINN+pq1MNUyLmCqk59Ol9s4Sv4eWJx5DNwKgYPJmGsv0Cv94X2uuvOhip7sV5ml/LzXEhXJiPGl4kjeNTfOn4r6BVJJ+n/Ab9fgfz6UEuxDaoT34KBRm7zPfbUwTmQKZlM8KAJZMxUyH7K00V+P8nWhUsi/Nzguj5wvjaVNpMr1alko7pqbR7mkG2jO9r/hs6II6/p9uEM+jHdqDD/iNSfWn5CAXcrTR/sDv+6u0SjRyAtCL6S1/VxsqzQyiDROSaEcFD5QHsbPSQNsqUmlrmZFenZJCWx6DXi1L6Wi7rTyVdk41GPkyMBsn9qGJ/D4fZ2uSVoVWLgAW9glyFrPWOCOdO5r22AN9XAL/7QzsgbkZtGh4JPHWQEdGyQXAJndHSxrfL5DWlySKJbyLZ2obZrysGwctrQbMPlYBQKgcGEpuDpboBGi2XABskGaAbHVqGhDlzns1nOrGJ4n921DZV3R4V6VxT28vNy7nreX3t0YHSf9tLzcOFG3QFjzAC9tr8fAoeo7li08vsfRJpVSQhVqF7+vkAmBplI8jjezjS042WtNskKXWnELc7Sgzwo3GpvpRZU4oLRkRRWtYmG1gcLCHIdw2T06m+knJ4jvqAByeqeKBog3a9mceek97AbCJP0BHHeROAMsfrlslFwBpLPlbp2QFU/XYWO60npICe5Gt5f3OdibMmE6jIkdrLbnZ68irlxV5OFlSb/7uwHU6nk0801VbhULBz1nSwGgPXgmRAiSsOD5um/n/ELkACHO2tbgFALIi3fmY8qNVY2J4lhNpxXMxVJYVQvlxXhTr5yQGa8OzqDFXikEqeUCYSRC+m6uUYjnbW2rEs5hh6A7Dk3yobEAILR0ZTWsK4mhGrl6sikGxnrRwaCTZWKi/5H7YyQVAJM/ezzjD981Mp6EJ3mK2nCzMqI+fLRWketOcPD2tGBVNa4vi6YVxCfQ8f64eG/db4oHVFMRTbXEC1fL/1WNiacGQcCofEERjkr3JEGhP7tZKYlVQgDWdQXhjfqaQCwzoP/mdVnIBYKdUKj7FwGfkhlKa3o1WrV5D1TVryNAvkxycXEitVpMKM82vsuDPXjoz8nVQUbCzpoMCnNTkZq0gG5WZcZBM5ioFabRa5uFMCUkpNKV8Ku1qaCC9PoxCelvRhIwgSgzohU7Uy60JLlF02qv79+8nlPb2dmppaaHPP/+cjhx5m7Zu3cbg1NDsufNp3PiJNLqgiMYUFvNnMRUWl1Dl9Jm0ZOlyqtvwEu3dt4/ePXaMzp8/L3jcu3dP8Lx9+zYFBQV1lg13IIfkBiDDz8WmvcjgLzpVtWQJ9VS5fPkyWVnbkL1OJU4AtUr5H36nk9wAxLLR0rpwaIQAICc3t8cAOH78uHiHg5VanAJac9V5/u0gNwDJkd4ObQuHRaKi3dHJ6ddLly71CAA1NTV4x10XO4v2ZXwq8KnxHf92kxuAwbAHaliSq1WK2/z7yx07dvQIAHl5eXjpVVayWqFQ2VlpfubfUXIDMBUKyWbW6KwszNvg5MjOzv6xuwd/4cIFsre3/4X5f5IR3vserE4/F6ESD5EbgHVQWXdVppE3KzD8+2U++o5+8MEH3QrA2rVrwfsc03tFfQOoifWOpEBn1C2UG4BDs/LChEmcYDyXm5gmFBUVddvgb968yee/HrzXsyL0j0Usb/40ixWvRKF4NcoJgC0Lon9By4MmmBfnicrTTJ4ajeajkydPdgsAtbW14AuVN8/BWvMDNECY3jMZeK77lMlaLgACWCJf31Tah/byCoBvj+vgrnJnGsaygO7evftUgz937hy5urqS5FAdAusTpvN2lgEvsOpsqTG/wfVBcgGQwhL5LpwWDWy/Q0fHMcXUV9oer9fX1z/x4Nva2kyS/7jEb3F2lIeYffgQYEp7Olm1c31/uQDIj/d3knx2acJhIZmz46QO+1tbW587evToEwEwb9488LrMFCPx24x9j9Vm8hKxDoJnSuQCoDiFTVZ4e3AsrRwdC/VUuKg6eawz3N3dfzh79uxjDX779u3gcw8CtROvxpxorAAjANgG0kkgm0tsTHKwsxg8aBWbsWpzAcCcB2IGo1iK3/7222//0ODfeecd0ul04LP2AT57koOM7zO50WJ8HfHcIrkA6B/p49iOzsCHB3UY9jrXj+8ieDMrJyeH7ty588jBwwL08fEBj9eYdA/wqIWz5BWWOdh2kD1siOHZCrkACHJz0N1Ah5pm9qNiVlAkEzW5CwAQOdq1atWqhw4eJwZA4uf+JsUcHiwFSpYxVSOi6PU5GUL91qpVELqZcgEQzPR9RXaI8ORIbuqvpVheV8XX0dHx4ldffdUlAFu2bEH7z5j8HtIeobfLWAWTs4JJ72GP589AH5ELgFnxrP0hjufLermtToPKW0wJj4hjrq2rq+ty9lNSUoREf0TbeBayP8KJCs+zJHC/wGqRLTLE57BwTszOD6NkBoLrYBBlPmIQc6uqqv4PgE7enmmPaDsYxyxsD3iGpSNQVkXIg+m88N+plSY31T5pv3dVPCwsLD47depUl1ugoqIC7T9ksnlIey+m7+BB1ph3vO8tRIrlAqA3L8WvyweE0Jz8cOHS5rrDDwEAUeSDjxKCMHm9vLw6LLwuSpxCoWgZnxEkVp0EwrtMarkAKMSyh2YG87QgTfgFYbOndNH5DVOmTPldHaCpqckkRwZ2wWNZmKe90Drxvuwod9P7EuUC4PlCg7/QzaGVrRzToQnOf6DjkzMyMu7dunXrDylChYWF4HFeSoToXA7ABb9nmjFMvmxUNJkbVe9JcgFQj2AoOgNlCPE9hL24fkunTid6eHg0Q8H5o+Wbb74hPz8/kpIgLCQ+KugH41jX6GwM4UTAlpEFANb6Ns0fEtEBAIKd/sZgZZPUaVumUwcPHnxsQ+jw4cOkVIrVVCXxAhCfTO4fLCxPRIyhCYZ62MmqCm9C6spOKZ0FHUJMDxqf1OnlZWVlT2wOV1ZWgtd1CD+J38fIDDECYMwbCPcSR+ECuQCom5ARKPJ7xArgJSmlrVQz6QMCAm5cuXLliQG4du2aSTc4JOUCvQsdYM80Y84AVPBgN1vhLJFNE0SUVuzJ8t/IAJjDexsbG5/aHQYe0nlfwNTQ2SGyiQF3NcqAfLkAyInzMzpEYKIifK01VyE2sNFgMLTAo/O0BSpyeno6XnaSaQe0Pwwepw7sDwu1eF+0XAD4sxT+HtIY+3I2K0OSanr2wIED3eYVfvPNN8G3FQLVwUrbhpUmnKKDwjqML7kAsGBt7CPE8+EVLjQGSNuioqLaoNt3V2ltbaWkpCTwvslqdxvOfyhCSJ7guqPQPOWMC2yb1D+IXpvdj7Ii3MR+XbFiRbeHxdavX98RFkdGCtLyJHfYRrkDIzNyYjyEZA51Yx1AoaLTp093OwAXL14kBwdx5IlMFGw5b2O2WLncAAxCcPQVVoJstWYUGhb+u26vJy25ubkCALxvXUmi8Anw72y5AUhAfgASJdGPsQWFPZYfUF1dLd4R2NtWCEClUkSjI+UGIDjE3a4F/jn0YxV3sqfKiRMnjElY1hrhFOHv15h85AYgggH4ed24BFIrzGj3nr09BkBzczPZOziSjVZJI/uIE+CCyf8oJwC5Cf69hAxAvP7Qkbd7DAAch+ERkWStNjMduYgaecoNwErMxutz+tHoVH868feT1JMlK3sguVgpaOnIKGiBbXJnicFAeX8EA7BkeCT1D3Om16Q0uZ4qo8YUUJKvjQjHSZbni3ICYK/TqM4jIrSMZyQn3Ik2vvxyjwIAt9rwOFeqn5xGQxK8TEEUlVwAxNjo1C2wBaAKF6d6MgCbehSAmTNmUHmGl9A8ywYEoxOXEEiRC4AFdpYake8L1bQo1YvSDQY698X5Hhn8f68206CcgVSZ5S9sAdwdkNTjxXIBUINoMFLYq0bE0NSBepqfH0KTsiNo+fwZdOy9E3Tzx5+eatC/3PmVPj59htavXU2T8vvQgsF6Wl2QQBtKU4UxxOa3yBeWCwA4PsjLyUpEhneLm199aXtZMtU8p6fJmYFUOqwfvVC9jN74y5/pzJmzdJln8XrLT3Trdivd+fUetba1i8+ffmmlGwzW1ebr9O9zX9DbRw5TfV0tVRYNpvGZIbR8aAhtnZwoVhp8AeXZoeR+/8pMqVwATA10syVnOwvhDsfdgLrxiQIEUENlGm0ujafqkaG0eKieZuRFUkV+PM0am0ULSofR4vICqppaTEumFtLCSSNodsEAqhicQNPzo2jR0HBaOTyENpbE0G7m0zidgS1Po7mDw8VtFAwcly+URrd4tlwARDjZaK8gUtvHaJoiWZL6hfdmXV0v8vmRP7iXZ61BXKhKpV0VKbRtchLVT4ijl8bF0IbiaP6MpvrxsVyfKP7fydTAzzaKa3IGcY+gJD2AgqWBgwx6Vxoc72XSBv3kVIRKcGsExgnS1jp3EjdEYLMjYjSPZ662KEHcD9oiJTjAmwyzFmTK+qhnjbKOgUMOAPIN4lnLNMUBkXwR4+skwnC4RWKrU8MWyH0Wrs4auHMforPzhkSI6y1IZnKx0/3m3o9SgUxvjbjoFOXjIMAxhLoKQrJVqIe9CHSo7wc+xRKH739smh8tGhZFU7JCcKUW/x1DpvqzdHfYjqnSXKX4KNrXsW1iRpBIaZ+TH0FFhgARx4v1dey4O6RVK0VYC5FlNRNse1cGTM+DxV2hvFgvkXeI5AvcS8SdJAbnClLvmEY8mD7zLABgKuhYDjy4GnPVWT4hWvrqe7cP4xUBExahLQQ3xvGexhIv5O0Bw6aEB4m7wTjacKwmBvS66+Zg2axVq5B5ukfKO/J+lm+Pd1WskLyAZCppAPNwx8/MTFHHS3sHz3wTr4JG/r4ZSdeIJDFNZxot5Rl5d5Eo1a0A/A889Dh3j820HAAAAABJRU5ErkJggg=="></link>
<!-- }}} -->
<!-- CSS styles {{{ --><style quine="true">
/******************************************************************************
* Polaris *
* This is a little icon that appears in the top-left corner (screen version *
* only), as a reminder to stay oriented with respect to a goal. *
*****************************************************************************/
#Polaris {
display: none;
}
@media screen and (min-width: 1000px) {
#Polaris {
display: block;
}
#Polaris img {
position: fixed;
width: 80px;
left: 20px;
top: 20px;
}
}
/******************************************************************************
* Top-level title and table of contents pages *
*****************************************************************************/
#TitlePage {
text-align: center;
page-break-after: always;
}
#TitlePage H1 {
font-size: 26pt;
}
.titlePageHourglass {
display: block;
padding-top: 50px;
padding-bottom: 50px;
margin: 0 auto;
opacity: 0.2;
}
@media print {
#TitlePage {
padding-top: 2in;
}
}
@media screen {
#TitlePage {
padding-top: 15px;
}
#TableOfContents {
padding-bottom: 40px;
}
}
a.tocPlaceholder {
text-decoration: none;
color: black;
}
/******************************************************************************
* Section title pages *
*****************************************************************************/
@media print {
.sectionTitle {
text-align: center;
}
.sectionTitle ol {
text-align: left;
}
.sectionTitle.againstnessPage H1 {
padding-top: 1.5in;
}
.sectionTitle.againstnessPage .attribution {
padding-bottom: 1.5in;
}
}
.sectionTitle .attribution {
font-style: italic;
}
@media print {
.section {
page-break-after: always;
}
.sectionTitle h1 {
padding-top: 3in;
}
}
@media screen {
.section {
margin-top: 45px;
}
.sectionTitle {
margin-bottom: 45px;
}
}
/******************************************************************************
* Page numbering *
* Page-number cross-references are only meaningful (and only visible) in *
* print. Also, make them line up horizontally in the table of contents. *
*****************************************************************************/
@media screen {
.pageNumber {
display: none;
}
.pageNumberDisplay {
display: none;
}
}
@media print {
.pageNumberContainer {
width: 100%;
text-align: right;
right: 0;
height: 0.5in;
position: relative;
}
.pageNumber {
position: absolute;
right: 0;
bottom: 0.1in;
}
.numberedPage {
page-break-after: always;
}
#TableOfContents a {
position: relative;
text-decoration: none;
}
#TableOfContents .pageNumberDisplay {
position: absolute;
left: 300px;
}
#TableOfContents .pageNumberDisplay::before {
content: "";
}
#TableOfContents .pageNumberDisplay::after {
content: "";
}
.pageNumberDisplay::before {
content: " (";
}
.pageNumberDisplay::after {
content: ")";
}
a {
color: black !important;
}
}
/******************************************************************************
* General formatting *
*****************************************************************************/
@media screen {
body {
margin: 0 auto;
width: 800px;
padding-bottom: 100px;
}
}
.leftColumn {
width: 50%;
float: left;
}
.rightColumn {
width: 50%;
float: right;
}
.clearColumns {
clear: both;
}
.smallSpacer {
height: 40px;
}
.largeSpacer {
height: 80px;
}
.bubble {
border: 1px solid black;
padding-left: 5px;
padding-right: 5px;
padding-top: 5px;
padding-bottom: 5px;
box-sizing: border-box;
border-radius: 5px;
margin: 5px;
background: white;
}
/*
* Due to a bug in WebKit, we can't have box-shadows in print or else the
* element will get covered up by a big black box.
* https://code.google.com/p/chromium/issues/detail?id=174583
*/
@media screen {
.bubble, .techniqueHeading {
box-shadow: 2px 2px 2px rgba(0,0,0,0.5);
}
}
@media print {
body {
margin: 0;
font-size: 12pt;
}
@page {
margin-left: 1in;
margin-right: 1in;
margin-top: 0.5in;
margin-bottom: 0.5in;
}
}
#Flowchart {
font-size: 10pt;
}
H1 {
font-size: 20pt;
}
P {
text-align: justify;
}
.quoteAttribution {
display: block;
padding-left: 9em;
font-style: italic;
}
@media screen {
.step[duration] .stepDescription {
display: block;
margin-right: 60px;
}
.step {
margin-top: 10px;
}
}
H3 {
font-size: inherit;
font-weight: bold;
}
.techniqueHeading {
border: 1px solid black;
height: 35px;
vertical-align: middle;
font-weight: bold;
text-decoration: underline;
padding: 5px;
box-sizing: border-box;
border-radius: 5px;
margin: 5px;
text-align: center;
background: white;
}
.techniqueHeading2 {
font-weight: bold;
text-decoration: underline;
text-align: center;
padding-top: 0;
padding-left: 5px;
}
.techniqueHeading2left {
font-weight: bold;
text-decoration: underline;
padding-top: 0;
padding-left: 5px;
}
.denseList {
margin-top: 0;
margin-bottom: 0;
padding-left: 20px;
}
.timerDisplay {
margin-top: -18px;
text-align: right;
}
.midSheetInstructions {
font-style: italic;
}
.codeBlock {
padding-left: 20px;
display: block;
font-size: 10pt;
}
H4 {
margin-top: 6px;
margin-bottom: 6px;
}
ul {
margin-top: 6px;
margin-bottom: 6px;
}
.buttonContainer {
text-align: right;
}
.saveButton, .feedbackButton {
margin-top: 15px;
}
/******************************************************************************
* Screen/Print Differences *
*****************************************************************************/
@media screen {
textarea {
width: 100%;
}
.worksheet {
display: none;
}
.timerInstructions {
display: none;
}
.onlyPrint {
display: none;
}
}
@media print {
.worksheet, .worksheetPage {
margin-top: 0.5in;
page-break-after: always;
}
textarea {
display: none;
}
.worksheet textarea {
display: none;
}
.noPrint {
display: none;
}
.timerInstructions {
padding-left: 8px;
font-weight: normal;
font-size: 10pt;
}
.timerDisplay {
display: none;
}
}
/******************************************************************************
* Multi-Rendering *
* *
* Each section is rendered three ways: worksheet, instructions, and mixed. *
* Mixed view is used on screen. Instructions view is printed once, with *
* numbering. Worksheet view is printed three times, without numbering. *
*****************************************************************************/
/* Control which views appear on screen and in print */
@media screen {
.instructionsRender {
display: none;
}
.worksheetRender {
display: none;
}
}
@media print {
.mixedRender {
display: none;
}
.blankPage {
opacity: 0;
}
}
/******************************************************************************
* Miscellaneous *
*****************************************************************************/
.inactiveSection {
display: none;
}
.placeholder {
display: none;
}
<!-- }}} --></style>
<!-- jQuery v1.11.3 (minified) - from https://code.jquery.com/jquery-1.11.3.min.js {{{ --><script quine="true">
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}} }function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}} }return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}} },PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}} }function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}} }return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))} }});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)} }}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1} }}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)} }},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c} }}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))} }}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))} }}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)} }}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))} }}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c} } }},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){} }},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)} }}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now} }},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)} }}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}} }}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}} }} }),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}} })),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}} }}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}} }),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}} }return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}} }});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}} }),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}} }});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}} },offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
</script> <!-- }}} -->
<!-- jsPlumb 2.0.4 (minified) {{{ --><script quine="true">
(function(){"undefined"==typeof Math.sgn&&(Math.sgn=function(a){return 0==a?0:a>0?1:-1});var a={subtract:function(a,b){return{x:a.x-b.x,y:a.y-b.y}},dotProduct:function(a,b){return a.x*b.x+a.y*b.y},square:function(a){return Math.sqrt(a.x*a.x+a.y*a.y)},scale:function(a,b){return{x:a.x*b,y:a.y*b}} },b=64,c=Math.pow(2,-b-1),d=function(b,c){for(var d=[],e=f(b,c),h=c.length-1,i=2*h-1,j=g(e,i,d,0),k=a.subtract(b,c[0]),m=a.square(k),n=0,o=0;j>o;o++){k=a.subtract(b,l(c,h,d[o],null,null));var p=a.square(k);m>p&&(m=p,n=d[o])}return k=a.subtract(b,c[h]),p=a.square(k),m>p&&(m=p,n=1),{location:n,distance:m}},e=function(a,b){var c=d(a,b);return{point:l(b,b.length-1,c.location,null,null),location:c.location}},f=function(b,c){for(var d=c.length-1,e=2*d-1,f=[],g=[],h=[],i=[],k=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],l=0;d>=l;l++)f[l]=a.subtract(c[l],b);for(var l=0;d-1>=l;l++)g[l]=a.subtract(c[l+1],c[l]),g[l]=a.scale(g[l],3);for(var m=0;d-1>=m;m++)for(var n=0;d>=n;n++)h[m]||(h[m]=[]),h[m][n]=a.dotProduct(g[m],f[n]);for(l=0;e>=l;l++)i[l]||(i[l]=[]),i[l].y=0,i[l].x=parseFloat(l)/e;for(var o=d,p=d-1,q=0;o+p>=q;q++){var r=Math.max(0,q-p),s=Math.min(q,o);for(l=r;s>=l;l++)j=q-l,i[l+j].y+=h[j][l]*k[j][l]}return i},g=function(a,c,d,e){var f,j,m=[],n=[],o=[],p=[];switch(h(a,c)){case 0:return 0;case 1:if(e>=b)return d[0]=(a[0].x+a[c].x)/2,1;if(i(a,c))return d[0]=k(a,c),1}l(a,c,.5,m,n),f=g(m,c,o,e+1),j=g(n,c,p,e+1);for(var q=0;f>q;q++)d[q]=o[q];for(var q=0;j>q;q++)d[q+f]=p[q];return f+j},h=function(a,b){var c,d,e=0;c=d=Math.sgn(a[0].y);for(var f=1;b>=f;f++)c=Math.sgn(a[f].y),c!=d&&e++,d=c;return e},i=function(a,b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;i=a[0].y-a[b].y,j=a[b].x-a[0].x,k=a[0].x*a[b].y-a[b].x*a[0].y;for(var t=max_distance_below=0,u=1;b>u;u++){var v=i*a[u].x+j*a[u].y+k;v>t?t=v:max_distance_below>v&&(max_distance_below=v)}return n=0,o=1,p=0,q=i,r=j,s=k-t,l=n*r-q*o,m=1/l,e=(o*s-r*p)*m,q=i,r=j,s=k-max_distance_below,l=n*r-q*o,m=1/l,f=(o*s-r*p)*m,g=Math.min(e,f),h=Math.max(e,f),d=h-g,c>d?1:0},k=function(a,b){var c=1,d=0,e=a[b].x-a[0].x,f=a[b].y-a[0].y,g=a[0].x-0,h=a[0].y-0,i=e*d-f*c,j=1/i,k=(e*h-f*g)*j;return 0+c*k},l=function(a,b,c,d,e){for(var f=[[]],g=0;b>=g;g++)f[0][g]=a[g];for(var h=1;b>=h;h++)for(var g=0;b-h>=g;g++)f[h]||(f[h]=[]),f[h][g]||(f[h][g]={}),f[h][g].x=(1-c)*f[h-1][g].x+c*f[h-1][g+1].x,f[h][g].y=(1-c)*f[h-1][g].y+c*f[h-1][g+1].y;if(null!=d)for(g=0;b>=g;g++)d[g]=f[g][0];if(null!=e)for(g=0;b>=g;g++)e[g]=f[b-g][g];return f[b][0]},m={},n=function(a){var b=m[a];if(!b){b=[];var c=function(){return function(b){return Math.pow(b,a)}},d=function(){return function(b){return Math.pow(1-b,a)}},e=function(a){return function(){return a}},f=function(){return function(a){return a}},g=function(){return function(a){return 1-a}},h=function(a){return function(b){for(var c=1,d=0;d<a.length;d++)c*=a[d](b);return c}};b.push(new c);for(var i=1;a>i;i++){for(var j=[new e(a)],k=0;a-i>k;k++)j.push(new f);for(var k=0;i>k;k++)j.push(new g);b.push(new h(j))}b.push(new d),m[a]=b}return b},o=function(a,b){for(var c=n(a.length-1),d=0,e=0,f=0;f<a.length;f++)d+=a[f].x*c[f](b),e+=a[f].y*c[f](b);return{x:d,y:e}},p=function(a,b){return Math.sqrt(Math.pow(a.x-b.x,2)+Math.pow(a.y-b.y,2))},q=function(a){return a[0].x==a[1].x&&a[0].y==a[1].y},r=function(a,b,c){if(q(a))return{point:a[0],location:b};for(var d=o(a,b),e=0,f=b,g=c>0?1:-1,h=null;e<Math.abs(c);)f+=.005*g,h=o(a,f),e+=p(h,d),d=h;return{point:h,location:f}},s=function(a){if(q(a))return 0;for(var b=o(a,0),c=0,d=0,e=1,f=null;1>d;)d+=.005*e,f=o(a,d),c+=p(f,b),b=f;return c},t=function(a,b,c){return r(a,b,c).point},u=function(a,b,c){return r(a,b,c).location},v=function(a,b){var c=o(a,b),d=o(a.slice(0,a.length-1),b),e=d.y-c.y,f=d.x-c.x;return 0==e?1/0:Math.atan(e/f)},w=function(a,b,c){var d=r(a,b,c);return d.location>1&&(d.location=1),d.location<0&&(d.location=0),v(a,d.location)},x=function(a,b,c,d){d=null==d?0:d;var e=r(a,b,d),f=v(a,e.location),g=Math.atan(-1/f),h=c/2*Math.sin(g),i=c/2*Math.cos(g);return[{x:e.point.x+i,y:e.point.y+h},{x:e.point.x-i,y:e.point.y-h}]};this.jsBezier={distanceFromCurve:d,gradientAtPoint:v,gradientAtPointAlongCurveFrom:w,nearestPointOnCurve:e,pointOnCurve:o,pointAlongCurveFrom:t,perpendicularToCurveAt:x,locationAlongCurveFrom:u,getLength:s}}).call(this),function(){"use strict";var a=this.Biltong={},b=function(a){return"[object Array]"===Object.prototype.toString.call(a)},c=function(a,c,d){return a=b(a)?a:[a.x,a.y],c=b(c)?c:[c.x,c.y],d(a,c)},d=a.gradient=function(a,b){return c(a,b,function(a,b){return b[0]==a[0]?b[1]>a[1]?1/0:-1/0:b[1]==a[1]?b[0]>a[0]?0:-0:(b[1]-a[1])/(b[0]-a[0])})},e=(a.normal=function(a,b){return-1/d(a,b)},a.lineLength=function(a,b){return c(a,b,function(a,b){return Math.sqrt(Math.pow(b[1]-a[1],2)+Math.pow(b[0]-a[0],2))})},a.quadrant=function(a,b){return c(a,b,function(a,b){return b[0]>a[0]?b[1]>a[1]?2:1:b[0]==a[0]?b[1]>a[1]?2:1:b[1]>a[1]?3:4})}),f=(a.theta=function(a,b){return c(a,b,function(a,b){var c=d(a,b),f=Math.atan(c),g=e(a,b);return(4==g||3==g)&&(f+=Math.PI),0>f&&(f+=2*Math.PI),f})},a.intersects=function(a,b){var c=a.x,d=a.x+a.w,e=a.y,f=a.y+a.h,g=b.x,h=b.x+b.w,i=b.y,j=b.y+b.h;return g>=c&&d>=g&&i>=e&&f>=i||h>=c&&d>=h&&i>=e&&f>=i||g>=c&&d>=g&&j>=e&&f>=j||h>=c&&d>=g&&j>=e&&f>=j||c>=g&&h>=c&&e>=i&&j>=e||d>=g&&h>=d&&e>=i&&j>=e||c>=g&&h>=c&&f>=i&&j>=f||d>=g&&h>=c&&f>=i&&j>=f},a.encloses=function(a,b,c){var d=a.x,e=a.x+a.w,f=a.y,g=a.y+a.h,h=b.x,i=b.x+b.w,j=b.y,k=b.y+b.h,l=function(a,b,d,e){return c?b>=a&&d>=e:b>a&&d>e};return l(d,h,e,i)&&l(f,j,g,k)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),g=[null,[-1,-1],[-1,1],[1,1],[1,-1]];a.pointOnLine=function(a,b,c){var h=d(a,b),i=e(a,b),j=c>0?f[i]:g[i],k=Math.atan(h),l=Math.abs(c*Math.sin(k))*j[1],m=Math.abs(c*Math.cos(k))*j[0];return{x:a.x+m,y:a.y+l}},a.perpendicularLineTo=function(a,b,c){var e=d(a,b),f=Math.atan(-1/e),g=c/2*Math.sin(f),h=c/2*Math.cos(f);return[{x:b.x+h,y:b.y+g},{x:b.x-h,y:b.y-g}]}}.call(this),function(){"use strict";var a=this,b={android:navigator.userAgent.toLowerCase().indexOf("android")>-1},c=function(a,b,c){c=c||a.parentNode;for(var d=c.querySelectorAll(b),e=0;e<d.length;e++)if(d[e]===a)return!0;return!1},d=function(a){return"string"==typeof a||a.constructor===String?document.getElementById(a):a},e=function(a){return a.srcElement||a.target},f=function(a,b){for(var c=0,d=a.length;d>c&&a[c]!=b;c++);c<a.length&&a.splice(c,1)},g=1,h=function(a,b,c){var d=g++;return a.__ta=a.__ta||{},a.__ta[b]=a.__ta[b]||{},a.__ta[b][d]=c,c.__tauid=d,d},i=function(a,b,c){if(a.__ta&&a.__ta[b]&&delete a.__ta[b][c.__tauid],c.__taExtra){for(var d=0;d<c.__taExtra.length;d++)E(a,c.__taExtra[d][0],c.__taExtra[d][1]);c.__taExtra.length=0}c.__taUnstore&&c.__taUnstore()},j=function(a,b,d,f){if(null==a)return d;var g=a.split(","),h=function(a){h.__tauid=d.__tauid;for(var f=e(a),i=0;i<g.length;i++)c(f,g[i],b)&&d.apply(f,arguments)};return k(d,f,h),h},k=function(a,b,c){a.__taExtra=a.__taExtra||[],a.__taExtra.push([b,c])},l=function(a,b,c,d){if(r&&t[b]){var e=j(d,a,c,t[b]);D(a,t[b],e,c)}"focus"===b&&null==a.getAttribute("tabindex")&&a.setAttribute("tabindex","1"),D(a,b,j(d,a,c,b),c)},m=function(a,b,c,d){if(null==a.__taSmartClicks){var g=function(b){a.__tad=x(b)},h=function(b){a.__tau=x(b)},i=function(b){if(a.__tad&&a.__tau&&a.__tad[0]===a.__tau[0]&&a.__tad[1]===a.__tau[1])for(var c=0;c<a.__taSmartClicks.length;c++)a.__taSmartClicks[c].apply(e(b),[b])};l(a,"mousedown",g,d),l(a,"mouseup",h,d),l(a,"click",i,d),a.__taSmartClicks=[]}a.__taSmartClicks.push(c),c.__taUnstore=function(){f(a.__taSmartClicks,c)}},n={tap:{touches:1,taps:1},dbltap:{touches:1,taps:2},contextmenu:{touches:2,taps:1}},o=function(a,b){return function(d,g,h,i){if("contextmenu"==g&&s)l(d,g,h,i);else{if(null==d.__taTapHandler){var j=d.__taTapHandler={tap:[],dbltap:[],contextmenu:[],down:!1,taps:0,downSelectors:[]},k=function(e){for(var f=e.srcElement||e.target,g=0;g<j.downSelectors.length;g++)if(null==j.downSelectors[g]||c(f,j.downSelectors[g],d)){j.down=!0,setTimeout(o,a),setTimeout(p,b);break}},m=function(a){if(j.down){var b=a.srcElement||a.target;j.taps++;var f=C(a);for(var g in n)if(n.hasOwnProperty(g)){var h=n[g];if(h.touches===f&&(1===h.taps||h.taps===j.taps))for(var i=0;i<j[g].length;i++)(null==j[g][i][1]||c(b,j[g][i][1],d))&&j[g][i][0].apply(e(a),[a])}} },o=function(){j.down=!1},p=function(){j.taps=0};l(d,"mousedown",k),l(d,"mouseup",m)}d.__taTapHandler.downSelectors.push(i),d.__taTapHandler[g].push([h,i]),h.__taUnstore=function(){f(d.__taTapHandler[g],h)}} }},p=function(a,b,c,d){for(var e in c.__tamee[a])c.__tamee[a].hasOwnProperty(e)&&c.__tamee[a][e].apply(d,[b])},q=function(){var a=[];return function(b,d,f,g){if(!b.__tamee){b.__tamee={over:!1,mouseenter:[],mouseexit:[]};var i=function(d){var f=e(d);(null==g&&f==b&&!b.__tamee.over||c(f,g,b)&&(null==f.__tamee||!f.__tamee.over))&&(p("mouseenter",d,b,f),f.__tamee=f.__tamee||{},f.__tamee.over=!0,a.push(f))},k=function(d){for(var f=e(d),g=0;g<a.length;g++)f!=a[g]||c(d.relatedTarget||d.toElement,"*",f)||(f.__tamee.over=!1,a.splice(g,1),p("mouseexit",d,b,f))};D(b,"mouseover",j(g,b,i,"mouseover"),i),D(b,"mouseout",j(g,b,k,"mouseout"),k)}f.__taUnstore=function(){delete b.__tamee[d][f.__tauid]},h(b,d,f),b.__tamee[d][f.__tauid]=f}},r="ontouchstart"in document.documentElement,s="onmousedown"in document.documentElement,t={mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"},u=function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}(),v=u>-1&&9>u,w=function(a,b){if(null==a)return[0,0];var c=B(a),d=A(c,0);return[d[b+"X"],d[b+"Y"]]},x=function(a){return null==a?[0,0]:v?[a.clientX+document.documentElement.scrollLeft,a.clientY+document.documentElement.scrollTop]:w(a,"page")},y=function(a){return w(a,"screen")},z=function(a){return w(a,"client")},A=function(a,b){return a.item?a.item(b):a[b]},B=function(a){return a.touches&&a.touches.length>0?a.touches:a.changedTouches&&a.changedTouches.length>0?a.changedTouches:a.targetTouches&&a.targetTouches.length>0?a.targetTouches:[a]},C=function(a){return B(a).length},D=function(a,b,c,d){if(h(a,b,c),d.__tauid=c.__tauid,a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent){var e=b+c.__tauid;a["e"+e]=c,a[e]=function(){a["e"+e]&&a["e"+e](window.event)},a.attachEvent("on"+b,a[e])}},E=function(a,b,c){null!=c&&F(a,function(){var e=d(this);if(i(e,b,c),null!=c.__tauid)if(e.removeEventListener)e.removeEventListener(b,c,!1),r&&t[b]&&e.removeEventListener(t[b],c,!1);else if(this.detachEvent){var f=b+c.__tauid;e[f]&&e.detachEvent("on"+b,e[f]),e[f]=null,e["e"+f]=null}c.__taTouchProxy&&E(a,c.__taTouchProxy[1],c.__taTouchProxy[0])})},F=function(a,b){if(null!=a){a="undefined"!=typeof Window&&"unknown"!=typeof a.top&&a==a.top?[a]:"string"!=typeof a&&null==a.tagName&&null!=a.length?a:"string"==typeof a?document.querySelectorAll(a):[a];for(var c=0;c<a.length;c++)b.apply(a[c])}};a.Mottle=function(a){a=a||{};var c=a.clickThreshold||150,e=a.dblClickThreshold||350,f=new q,g=new o(c,e),h=a.smartClicks,i=function(a,b,c,e){null!=c&&F(a,function(){var a=d(this);h&&"click"===b?m(a,b,c,e):"tap"===b||"dbltap"===b||"contextmenu"===b?g(a,b,c,e):"mouseenter"===b||"mouseexit"==b?f(a,b,c,e):l(a,b,c,e)})};this.remove=function(a){return F(a,function(){var a=d(this);if(a.__ta)for(var b in a.__ta)if(a.__ta.hasOwnProperty(b))for(var c in a.__ta[b])a.__ta[b].hasOwnProperty(c)&&E(a,b,a.__ta[b][c]);a.parentNode&&a.parentNode.removeChild(a)}),this},this.on=function(){var a=arguments[0],b=4==arguments.length?arguments[2]:null,c=arguments[1],d=arguments[arguments.length-1];return i(a,c,d,b),this},this.off=function(a,b,c){return E(a,b,c),this},this.trigger=function(a,c,e,f){var g=s&&("undefined"==typeof MouseEvent||null==e||e.constructor===MouseEvent),h=r&&!s&&t[c]?t[c]:c,i=!(r&&!s&&t[c]),j=x(e),k=y(e),l=z(e);return F(a,function(){var a,m=d(this);e=e||{screenX:k[0],screenY:k[1],clientX:l[0],clientY:l[1]};var n=function(a){f&&(a.payload=f)},o={TouchEvent:function(a){var b=document.createTouch(window,m,0,j[0],j[1],k[0],k[1],l[0],l[1],0,0,0,0),c=document.createTouchList(b),d=document.createTouchList(b),e=document.createTouchList(b);a.initTouchEvent(h,!0,!0,window,null,k[0],k[1],l[0],l[1],!1,!1,!1,!1,c,d,e,1,0)},MouseEvents:function(a){if(a.initMouseEvent(h,!0,!0,window,0,k[0],k[1],l[0],l[1],!1,!1,!1,!1,1,m),b.android){var c=document.createTouch(window,m,0,j[0],j[1],k[0],k[1],l[0],l[1],0,0,0,0);a.touches=a.targetTouches=a.changedTouches=document.createTouchList(c)}} };if(document.createEvent){var p=!i&&!g&&r&&t[c]&&!b.android,q=p?"TouchEvent":"MouseEvents";a=document.createEvent(q),o[q](a),n(a),m.dispatchEvent(a)}else document.createEventObject&&(a=document.createEventObject(),a.eventType=a.eventName=h,a.screenX=k[0],a.screenY=k[1],a.clientX=l[0],a.clientY=l[1],n(a),m.fireEvent("on"+h,a))}),this}},a.Mottle.consume=function(a,b){a.stopPropagation?a.stopPropagation():a.returnValue=!1,!b&&a.preventDefault&&a.preventDefault()},a.Mottle.pageLocation=x,a.Mottle.setForceTouchEvents=function(a){r=a},a.Mottle.setForceMouseEvents=function(a){s=a}}.call(this),function(){"use strict";Array.prototype.suggest=function(a,b){-1===this.indexOf(a)&&(b?this.unshift(a):this.push(a))},Array.prototype.vanquish=function(a){var b=this.indexOf(a);-1!=b&&this.splice(b,1)};var a=function(a){return null==a?!1:"string"==typeof a||a.constructor==String},b=function(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{top:Math.round(i),left:Math.round(j)}},c=function(a,b,c){c=c||a.parentNode;for(var d=c.querySelectorAll(b),e=0;e<d.length;e++)if(d[e]===a)return!0;return!1},d=function(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}(),e=50,f=50,g=d>-1&&9>d,h=function(a){if(g)return[a.clientX+document.documentElement.scrollLeft,a.clientY+document.documentElement.scrollTop];var b=j(a),c=i(b,0);return[c.pageX,c.pageY]},i=function(a,b){return a.item?a.item(b):a[b]},j=function(a){return a.touches&&a.touches.length>0?a.touches:a.changedTouches&&a.changedTouches.length>0?a.changedTouches:a.targetTouches&&a.targetTouches.length>0?a.targetTouches:[a]},k={draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select"},l="katavorio-drag-scope",m=["stop","start","drag","drop","over","out","beforeStart"],n=function(){},o=function(){return!0},p=function(a,b,c){for(var d=0;d<a.length;d++)a[d]!=c&&b(a[d])},q=function(a,b,c,d){p(a,function(a){a.setActive(b),b&&a.updatePosition(),c&&a.setHover(d,b)})},r=function(b,c){if(null!=b){b=a(b)||null!=b.tagName||null==b.length?[b]:b;for(var d=0;d<b.length;d++)c.apply(b[d],[b[d]])}},s=function(a){a.stopPropagation?(a.stopPropagation(),a.preventDefault()):a.returnValue=!1},t="input,textarea,select,button,option",u=function(a,b,d){var e=a.srcElement||a.target;return!c(e,d.getInputFilterSelector(),b)},v=function(a,b,c,d){this.params=b||{},this.el=a,this.params.addClass(this.el,this._class),this.uuid=y();var e=!0;return this.setEnabled=function(a){e=a},this.isEnabled=function(){return e},this.toggleEnabled=function(){e=!e},this.setScope=function(a){this.scopes=a?a.split(/\s+/):[d]},this.addScope=function(a){var b={};r(this.scopes,function(a){b[a]=!0}),r(a?a.split(/\s+/):[],function(a){b[a]=!0}),this.scopes=[];for(var c in b)this.scopes.push(c)},this.removeScope=function(a){var b={};r(this.scopes,function(a){b[a]=!0}),r(a?a.split(/\s+/):[],function(a){delete b[a]}),this.scopes=[];for(var c in b)this.scopes.push(c)},this.toggleScope=function(a){var b={};r(this.scopes,function(a){b[a]=!0}),r(a?a.split(/\s+/):[],function(a){b[a]?delete b[a]:b[a]=!0}),this.scopes=[];for(var c in b)this.scopes.push(c)},this.setScope(b.scope),this.k=b.katavorio,b.katavorio},w=function(d,g,i){this._class=i.draggable;var j=v.apply(this,arguments);this.rightButtonCanDrag=this.params.rightButtonCanDrag;var k=[0,0],l=null,m=!1,n=this.params.consumeStartEvent!==!1,p=this.el,r=this.params.clone,t=(this.params.scroll,g.multipleDrop!==!1),w=g.snapThreshold||5,x=function(a,b,c,d,e){d=d||w,e=e||w;var f=Math.floor(a[0]/b),g=b*f,h=g+b,i=Math.abs(a[0]-g)<=d?g:Math.abs(h-a[0])<=d?h:a[0],j=Math.floor(a[1]/c),k=c*j,l=k+c,m=Math.abs(a[1]-k)<=e?k:Math.abs(l-a[1])<=e?l:a[1];return[i,m]};this.posses=[],this.posseRoles={},this.toGrid=function(a){return null==this.params.grid?a:x(a,this.params.grid[0],this.params.grid[1])},this.snap=function(a,b){if(null!=p){a=a||(this.params.grid?this.params.grid[0]:e),b=b||(this.params.grid?this.params.grid[1]:f);var c=this.params.getPosition(p);this.params.setPosition(p,x(c,a,b,a,b))}},this.constrain="function"==typeof this.params.constrain?this.params.constrain:this.params.constrain||this.params.containment?function(a){return[Math.max(0,Math.min(D.w-this.size[0],a[0])),Math.max(0,Math.min(D.h-this.size[1],a[1]))]}:function(a){return a};var z=function(a){return"function"==typeof a?(a._katavorioId=y(),a._katavorioId):a},A={},B=function(a){for(var b in A){var c=A[b],d=c[0](a);if(c[1]&&(d=!d),!d)return!1}return!0},C=this.setFilter=function(b,e){if(b){var f=z(b);A[f]=[function(e){var f,g=e.srcElement||e.target;return a(b)?f=c(g,b,d):"function"==typeof b&&(f=b(e,d)),f},e!==!1]}};this.addFilter=C,this.removeFilter=function(a){var b="function"==typeof a?a._katavorioId:a;delete A[b]},this.clearAllFilters=function(){A={}},this.canDrag=this.params.canDrag||o;var D,E=[],F=[];this.downListener=function(a){var c=this.rightButtonCanDrag||3!==a.which&&2!==a.button;if(c&&this.isEnabled()&&this.canDrag()){var d=B(a)&&u(a,this.el,this.k);if(d){if(r){p=this.el.cloneNode(!0),p.setAttribute("id",null),p.style.position="absolute";var e=b(this.el);p.style.left=e.left+"px",p.style.top=e.top+"px",document.body.appendChild(p)}else p=this.el;n&&s(a),k=h(a),this.params.bind(document,"mousemove",this.moveListener),this.params.bind(document,"mouseup",this.upListener),j.markSelection(this),j.markPosses(this),this.params.addClass(document.body,i.noSelect),H("beforeStart",{el:this.el,pos:l,e:a,drag:this})}else this.params.consumeFilteredEvents&&s(a)}}.bind(this),this.moveListener=function(a){if(k){if(!m){var b=H("start",{el:this.el,pos:l,e:a,drag:this});if(b!==!1){if(!k)return;this.mark(!0),m=!0}}if(k){F.length=0;var c=h(a),d=c[0]-k[0],e=c[1]-k[1],f=this.params.ignoreZoom?1:j.getZoom();d/=f,e/=f,this.moveBy(d,e,a),j.updateSelection(d,e,this),j.updatePosses(d,e,this)}} }.bind(this),this.upListener=function(a){k&&(k=null,this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.params.removeClass(document.body,i.noSelect),this.unmark(a),j.unmarkSelection(this,a),j.unmarkPosses(this,a),this.stop(a),j.notifySelectionDragStop(this,a),m=!1,r&&(p&&p.parentNode&&p.parentNode.removeChild(p),p=null))}.bind(this),this.getFilters=function(){return A},this.abort=function(){null!=k&&this.upListener()},this.getDragElement=function(){return p||this.el};var G={start:[],drag:[],stop:[],over:[],out:[],beforeStart:[]};g.events.start&&G.start.push(g.events.start),g.events.beforeStart&&G.beforeStart.push(g.events.beforeStart),g.events.stop&&G.stop.push(g.events.stop),g.events.drag&&G.drag.push(g.events.drag),this.on=function(a,b){G[a]&&G[a].push(b)};var H=function(a,b){if(G[a])for(var c=0;c<G[a].length;c++)try{G[a][c](b)}catch(d){}};this.notifyStart=function(a){H("start",{el:this.el,pos:this.params.getPosition(p),e:a,drag:this})},this.stop=function(a,b){if(b||m){var c=[],d=j.getSelection(),e=this.params.getPosition(p);if(d.length>1)for(var f=0;f<d.length;f++){var g=this.params.getPosition(d[f].el);c.push([d[f].el,{left:g[0],top:g[1]},d[f]])}else c.push([p,{left:e[0],top:e[1]},this]);H("stop",{el:p,pos:e,e:a,drag:this,selection:c})}},this.mark=function(a){if(l=this.params.getPosition(p),this.size=this.params.getSize(p),E=j.getMatchingDroppables(this),q(E,!0,!1,this),this.params.addClass(p,this.params.dragClass||i.drag),this.params.constrain||this.params.containment){var b=this.params.getSize(p.parentNode);D={w:b[0],h:b[1]}}a&&j.notifySelectionDragStart(this)},this.unmark=function(a){q(E,!1,!0,this),this.params.removeClass(p,this.params.dragClass||i.drag),E.length=0;for(var b=0;b<F.length;b++){var c=F[b].drop(this,a);if(c===!0)break}},this.moveBy=function(a,b,c){F.length=0;var d=this.constrain(this.toGrid([l[0]+a,l[1]+b]),p),e={x:d[0],y:d[1],w:this.size[0],h:this.size[1]},f=null;this.params.setPosition(p,d);for(var g=0;g<E.length;g++){var h={x:E[g].position[0],y:E[g].position[1],w:E[g].size[0],h:E[g].size[1]};this.params.intersects(e,h)&&(t||null==f||f==E[g].el)&&E[g].canDrop(this)?(f||(f=E[g].el),F.push(E[g]),E[g].setHover(this,!0,c)):E[g].isHover()&&E[g].setHover(this,!1,c)}H("drag",{el:this.el,pos:d,e:c,drag:this})},this.destroy=function(){this.params.unbind(this.el,"mousedown",this.downListener),this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.downListener=null,this.upListener=null,this.moveListener=null},this.params.bind(this.el,"mousedown",this.downListener),this.params.handle?C(this.params.handle,!1):C(this.params.filter,this.params.filterExclude)},x=function(a,b,c){this._class=c.droppable,this.params=b||{},this._activeClass=this.params.activeClass||c.active,this._hoverClass=this.params.hoverClass||c.hover,v.apply(this,arguments);var d=!1;this.allowLoopback=this.params.allowLoopback!==!1,this.setActive=function(a){this.params[a?"addClass":"removeClass"](this.el,this._activeClass)},this.updatePosition=function(){this.position=this.params.getPosition(this.el),this.size=this.params.getSize(this.el)},this.canDrop=this.params.canDrop||function(){return!0},this.isHover=function(){return d},this.setHover=function(a,b,c){(b||null==this.el._katavorioDragHover||this.el._katavorioDragHover==a.el._katavorio)&&(this.params[b?"addClass":"removeClass"](this.el,this._hoverClass),this.el._katavorioDragHover=b?a.el._katavorio:null,d!==b&&this.params.events[b?"over":"out"]({el:this.el,e:c,drag:a,drop:this}),d=b)},this.drop=function(a,b){return this.params.events.drop({drag:a,e:b,drop:this})},this.destroy=function(){this._class=null,this._activeClass=null,this._hoverClass=null,d=null}},y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(16)})},z=function(a){return null==a?null:(a="string"==typeof a||a.constructor==String?document.getElementById(a):a,null==a?null:(a._katavorio=a._katavorio||y(),a))};this.Katavorio=function(b){var c=[],d={};this._dragsByScope={},this._dropsByScope={};var e=1,f=function(a,b){r(a,function(a){for(var c=0;c<a.scopes.length;c++)b[a.scopes[c]]=b[a.scopes[c]]||[],b[a.scopes[c]].push(a)})},g=function(a,c){var d=0;return r(a,function(a){for(var e=0;e<a.scopes.length;e++)if(c[a.scopes[e]]){var f=b.indexOf(c[a.scopes[e]],a);-1!=f&&(c[a.scopes[e]].splice(f,1),d++)}}),d>0},h=(this.getMatchingDroppables=function(a){for(var b=[],c={},d=0;d<a.scopes.length;d++){var e=this._dropsByScope[a.scopes[d]];if(e)for(var f=0;f<e.length;f++)!e[f].canDrop(a)||c[e[f].uuid]||!e[f].allowLoopback&&e[f].el===a.el||(c[e[f].uuid]=!0,b.push(e[f]))}return b},function(a){a=a||{};var c,d={events:{}};for(c in b)d[c]=b[c];for(c in a)d[c]=a[c];for(c=0;c<m.length;c++)d.events[m[c]]=a[m[c]]||n;return d.katavorio=this,d}.bind(this)),i=function(a,b){for(var c=0;c<m.length;c++)b[m[c]]&&a.on(m[c],b[m[c]])}.bind(this),j={},o=b.css||{},q=b.scope||l;for(var s in k)j[s]=k[s];for(var s in o)j[s]=o[s];var u=b.inputFilterSelector||t;this.getInputFilterSelector=function(){return u},this.setInputFilterSelector=function(a){return u=a,this},this.draggable=function(a,c){var d=[];return r(a,function(a){if(a=z(a),null!=a)if(null==a._katavorioDrag){var e=h(c);a._katavorioDrag=new w(a,e,j,q),f(a._katavorioDrag,this._dragsByScope),d.push(a._katavorioDrag),b.addClass(a,j.draggable)}else i(a._katavorioDrag,c)}.bind(this)),d},this.droppable=function(a,c){var d=[];return r(a,function(a){if(a=z(a),null!=a){var e=new x(a,h(c),j,q);a._katavorioDrop=a._katavorioDrop||[],a._katavorioDrop.push(e),f(e,this._dropsByScope),d.push(e),b.addClass(a,j.droppable)}}.bind(this)),d},this.select=function(a){return r(a,function(){var a=z(this);a&&a._katavorioDrag&&(d[a._katavorio]||(c.push(a._katavorioDrag),d[a._katavorio]=[a,c.length-1],b.addClass(a,j.selected)))}),this},this.deselect=function(a){return r(a,function(){var a=z(this);if(a&&a._katavorio){var e=d[a._katavorio];if(e){for(var f=[],g=0;g<c.length;g++)c[g].el!==a&&f.push(c[g]);c=f,delete d[a._katavorio],b.removeClass(a,j.selected)}} }),this},this.deselectAll=function(){for(var a in d){var e=d[a];b.removeClass(e[0],j.selected)}c.length=0,d={}},this.markSelection=function(a){p(c,function(a){a.mark()},a)},this.markPosses=function(a){a.posses&&r(a.posses,function(b){a.posseRoles[b]&&A[b]&&p(A[b].members,function(a){a.mark()},a)})},this.unmarkSelection=function(a,b){p(c,function(a){a.unmark(b)},a)},this.unmarkPosses=function(a,b){a.posses&&r(a.posses,function(c){a.posseRoles[c]&&A[c]&&p(A[c].members,function(a){a.unmark(b)},a)})},this.getSelection=function(){return c.slice(0)},this.updateSelection=function(a,b,d){p(c,function(c){c.moveBy(a,b)},d)},this.updatePosses=function(a,b,c){c.posses&&r(c.posses,function(d){c.posseRoles[d]&&A[d]&&p(A[d].members,function(c){c.moveBy(a,b)},c)})},this.notifySelectionDragStop=function(a,b){p(c,function(a){a.stop(b,!0)},a)},this.notifySelectionDragStart=function(a,b){p(c,function(a){a.notifyStart(b)},a)},this.setZoom=function(a){e=a},this.getZoom=function(){return e};var v=function(a,b,c,d){r(a,function(a){g(a,c),a[d](b),f(a,c)})};r(["set","add","remove","toggle"],function(a){this[a+"Scope"]=function(b,c){v(b._katavorioDrag,c,this._dragsByScope,a+"Scope"),v(b._katavorioDrop,c,this._dropsByScope,a+"Scope")}.bind(this),this[a+"DragScope"]=function(b,c){v(b._katavorioDrag,c,this._dragsByScope,a+"Scope")}.bind(this),this[a+"DropScope"]=function(b,c){v(b._katavorioDrop,c,this._dropsByScope,a+"Scope")}.bind(this)}.bind(this)),this.snapToGrid=function(a,b){for(var c in this._dragsByScope)p(this._dragsByScope[c],function(c){c.snap(a,b)})},this.getDragsForScope=function(a){return this._dragsByScope[a]},this.getDropsForScope=function(a){return this._dropsByScope[a]};var y=function(a,b,c){a=z(a),a[b]&&(g(a[b],c)&&r(a[b],function(a){a.destroy()}),a[b]=null)};this.elementRemoved=function(a){this.destroyDraggable(a),this.destroyDroppable(a)},this.destroyDraggable=function(a){y(a,"_katavorioDrag",this._dragsByScope)},this.destroyDroppable=function(a){y(a,"_katavorioDrop",this._dropsByScope)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},c=[],d={},A={}};var A={};this.addToPosse=function(b){for(var c,d,e=[],f=function(f){c=a(f)?f:f.id,d=a(f)?!0:f.active!==!1;var g=A[c]||function(){var a={name:c,members:[]};return A[c]=a,a}();r(b,function(a){a._katavorioDrag&&(g.members.suggest(a._katavorioDrag),a._katavorioDrag.posses.suggest(g.name),a._katavorioDrag.posseRoles[g.name]=d)}),e.push(g)},g=1;g<arguments.length;g++)f(arguments[g]);return 1==e.length?e[0]:e},this.removeFromPosse=function(a,b){if(arguments.length<2)throw new TypeError("No posse id provided for remove operation");for(var c=1;c<arguments.length;c++)b=arguments[c],r(a,function(a){if(a._katavorioDrag&&a._katavorioDrag.posses){var c=a._katavorioDrag;r(b,function(a){A[a].members.vanquish(c),c.posses.vanquish(a),delete c.posseRoles[a]})}})},this.removeFromAllPosses=function(a){r(a,function(a){if(a._katavorioDrag&&a._katavorioDrag.posses){var b=a._katavorioDrag;r(b.posses,function(a){A[a].members.vanquish(b)}),b.posses.length=0,b.posseRoles={}} })}} }.call(this),function(){var a=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b=function(a){return"[object Number]"===Object.prototype.toString.call(a)},c=function(a){return"string"==typeof a},d=function(a){return"boolean"==typeof a},e=function(a){return null==a},f=function(a){return null==a?!1:"[object Object]"===Object.prototype.toString.call(a)},g=function(a){return"[object Date]"===Object.prototype.toString.call(a)},h=function(a){return"[object Function]"===Object.prototype.toString.call(a)},i=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},j=this,k=j.jsPlumbUtil={isArray:a,isString:c,isBoolean:d,isNull:e,isObject:f,isDate:g,isFunction:h,isEmpty:i,isNumber:b,clone:function(b){if(c(b))return""+b;if(d(b))return!!b;if(g(b))return new Date(b.getTime());if(h(b))return b;if(a(b)){for(var e=[],i=0;i<b.length;i++)e.push(this.clone(b[i]));return e}if(f(b)){var j={};for(var k in b)j[k]=this.clone(b[k]);return j}return b},merge:function(b,e,g){var h,i,j={};for(g=g||[],i=0;i<g.length;i++)j[g[i]]=!0;var k=this.clone(b);for(i in e)if(null==k[i])k[i]=e[i];else if(c(e[i])||d(e[i]))j[i]?(h=[],h.push.apply(h,a(k[i])?k[i]:[k[i]]),h.push.apply(h,a(e[i])?e[i]:[e[i]]),k[i]=h):k[i]=e[i];else if(a(e[i]))h=[],a(k[i])&&h.push.apply(h,k[i]),h.push.apply(h,e[i]),k[i]=h;else if(f(e[i])){f(k[i])||(k[i]={});for(var l in e[i])k[i][l]=e[i][l]}return k},replace:function(a,b,c){if(null!=a){var d=a,e=d;return b.replace(/([^\.])+/g,function(a,b,d,f){var g=a.match(/([^\[0-9]+){1}(\[)([0-9+])/),h=d+a.length>=f.length,i=function(){return e[g[1]]||function(){return e[g[1]]=[],e[g[1]]}()};if(h)g?i()[g[3]]=c:e[a]=c;else if(g){var j=i();e=j[g[3]]||function(){return j[g[3]]={},j[g[3]]}()}else e=e[a]||function(){return e[a]={},e[a]}()}),a}},functionChain:function(a,b,c){for(var d=0;d<c.length;d++){var e=c[d][0][c[d][1]].apply(c[d][0],c[d][2]);if(e===b)return e}return a},populate:function(b,d){var e=function(a){var b=a.match(/(\${.*?})/g);if(null!=b)for(var c=0;c<b.length;c++){var e=d[b[c].substring(2,b[c].length-1)]||"";null!=e&&(a=a.replace(b[c],e))}return a},g=function(b){if(null!=b){if(c(b))return e(b);if(a(b)){for(var d=[],h=0;h<b.length;h++)d.push(g(b[h]));return d}if(f(b)){var i={};for(var j in b)i[j]=g(b[j]);return i}return b}};return g(b)},findWithFunction:function(a,b){if(a)for(var c=0;c<a.length;c++)if(b(a[c]))return c;return-1},removeWithFunction:function(a,b){var c=k.findWithFunction(a,b);return c>-1&&a.splice(c,1),-1!=c},remove:function(a,b){var c=a.indexOf(b);return c>-1&&a.splice(c,1),-1!=c},addWithFunction:function(a,b,c){-1==k.findWithFunction(a,c)&&a.push(b)},addToList:function(a,b,c,d){var e=a[b];return null==e&&(e=[],a[b]=e),e[d?"unshift":"push"](c),e},extend:function(b,c){var d;for(c=a(c)?c:[c],d=0;d<c.length;d++)for(var e in c[d].prototype)c[d].prototype.hasOwnProperty(e)&&(b.prototype[e]=c[d].prototype[e]);var f=function(a,b){return function(){for(d=0;d<c.length;d++)c[d].prototype[a]&&c[d].prototype[a].apply(this,arguments);return b.apply(this,arguments)}},g=function(a){for(var c in a)b.prototype[c]=f(c,a[c])};if(arguments.length>2)for(d=2;d<arguments.length;d++)g(arguments[d]);return b},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(16)})},logEnabled:!0,log:function(){if(k.logEnabled&&"undefined"!=typeof console)try{var a=arguments[arguments.length-1];console.log(a)}catch(b){}},wrap:function(a,b,c){return a=a||function(){},b=b||function(){},function(){var d=null;try{d=b.apply(this,arguments)}catch(e){k.log("jsPlumb function failed : "+e)}if(null==c||d!==c)try{d=a.apply(this,arguments)}catch(e){k.log("wrapped function failed : "+e)}return d}} };k.EventGenerator=function(){var a={},b=!1,c={ready:!0};this.bind=function(b,c,d){var e=function(b){k.addToList(a,b,c,d),c.__jsPlumb=c.__jsPlumb||{},c.__jsPlumb[jsPlumbUtil.uuid()]=b};if("string"==typeof b)e(b);else if(null!=b.length)for(var f=0;f<b.length;f++)e(b[f]);
return this},this.fire=function(d,e,f){if(!b&&a[d]){var g=a[d].length,h=0,i=!1,j=null;if(!this.shouldFireEvent||this.shouldFireEvent(d,e,f))for(;!i&&g>h&&j!==!1;){if(c[d])a[d][h].apply(this,[e,f]);else try{j=a[d][h].apply(this,[e,f])}catch(l){k.log("jsPlumb: fire failed for event "+d+" : "+l)}h++,(null==a||null==a[d])&&(i=!0)}}return this},this.unbind=function(b,c){if(0===arguments.length)a={};else if(1===arguments.length){if("string"==typeof b)delete a[b];else if(b.__jsPlumb){var d;for(var e in b.__jsPlumb)d=b.__jsPlumb[e],k.remove(a[d]||[],b)}}else 2===arguments.length&&k.remove(a[b]||[],c);return this},this.getListener=function(b){return a[b]},this.setSuspendEvents=function(a){b=a},this.isSuspendEvents=function(){return b},this.silently=function(a){this.setSuspendEvents(!0);try{a()}catch(b){jsPlumbUtil.log("Cannot execute silent function "+b)}this.setSuspendEvents(!1)},this.cleanupListeners=function(){for(var b in a)a[b]=null}},k.EventGenerator.prototype={cleanup:function(){this.cleanupListeners()}} }.call(this),function(){"use strict";var a=this,b=a.jsPlumbUtil;b.matchesSelector=function(a,b,c){c=c||a.parentNode;for(var d=c.querySelectorAll(b),e=0;e<d.length;e++)if(d[e]===a)return!0;return!1},b.consume=function(a,b){a.stopPropagation?a.stopPropagation():a.returnValue=!1,!b&&a.preventDefault&&a.preventDefault()},b.sizeElement=function(a,b,c,d,e){a&&(a.style.height=e+"px",a.height=e,a.style.width=d+"px",a.width=d,a.style.left=b+"px",a.style.top=c+"px")}}.call(this),function(){"use strict";var a,b=this,c=[],d=b.jsPlumbUtil,e=function(){return""+(new Date).getTime()},f=function(a){if(a._jsPlumb.paintStyle&&a._jsPlumb.hoverPaintStyle){var b={};r.extend(b,a._jsPlumb.paintStyle),r.extend(b,a._jsPlumb.hoverPaintStyle),delete a._jsPlumb.hoverPaintStyle,b.gradient&&a._jsPlumb.paintStyle.fillStyle&&delete b.gradient,a._jsPlumb.hoverPaintStyle=b}},g=["tap","dbltap","click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu"],h=function(a,b,c,d){var e=a.getAttachedElements();if(e)for(var f=0,g=e.length;g>f;f++)d&&d==e[f]||e[f].setHover(b,!0,c)},i=function(a){return null==a?null:a.split(" ")},j=function(a,b,c){for(var d in b)a[d]=c},k=function(a,b){b=jsPlumbUtil.isArray(b)||null!=b.length&&!jsPlumbUtil.isString(b)?b:[b];for(var c=0;c<b.length;c++)try{a.apply(b[c],[b[c]])}catch(d){jsPlumbUtil.log(".each iteration failed : "+d)}},l=function(a,b,c){if(a.getDefaultType){var e=a.getTypeDescriptor(),f={},g=a.getDefaultType(),h=d.merge({},g);j(f,g,"__default");for(var i=0,k=a._jsPlumb.types.length;k>i;i++){var l=a._jsPlumb.types[i];if("__default"!==l){var m=a._jsPlumb.instance.getType(l,e);null!=m&&(h=d.merge(h,m,["cssClass"]),j(f,m,l))}}b&&(h=d.populate(h,b)),a.applyType(h,c,f),c||a.repaint()}},m=window.jsPlumbUIComponent=function(a){jsPlumbUtil.EventGenerator.apply(this,arguments);var b=this,c=arguments,e=b.idPrefix,f=e+(new Date).getTime();this._jsPlumb={instance:a._jsPlumb,parameters:a.parameters||{},paintStyle:null,hoverPaintStyle:null,paintStyleInUse:null,hover:!1,beforeDetach:a.beforeDetach,beforeDrop:a.beforeDrop,overlayPlacements:[],hoverClass:a.hoverClass||a._jsPlumb.Defaults.HoverClass,types:[],typeCache:{}},this.cacheTypeItem=function(a,b,c){this._jsPlumb.typeCache[c]=this._jsPlumb.typeCache[c]||{},this._jsPlumb.typeCache[c][a]=b},this.getCachedTypeItem=function(a,b){return this._jsPlumb.typeCache[b]?this._jsPlumb.typeCache[b][a]:null},this.getId=function(){return f};var g=a.overlays||[],h={};if(this.defaultOverlayKeys){for(var i=0;i<this.defaultOverlayKeys.length;i++)Array.prototype.push.apply(g,this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]]||[]);for(i=0;i<g.length;i++){var j=r.convertToFullOverlaySpec(g[i]);h[j[1].id]=j}}var k={overlays:h,parameters:a.parameters||{},scope:a.scope||this._jsPlumb.instance.getDefaultScope()};if(this.getDefaultType=function(){return k},this.appendToDefaultType=function(a){for(var b in a)k[b]=a[b]},a.events)for(i in a.events)b.bind(i,a.events[i]);this.clone=function(){var a={};return this.constructor.apply(a,c),a}.bind(this),this.isDetachAllowed=function(a){var b=!0;if(this._jsPlumb.beforeDetach)try{b=this._jsPlumb.beforeDetach(a)}catch(c){d.log("jsPlumb: beforeDetach callback failed",c)}return b},this.isDropAllowed=function(a,b,c,e,f,g,h){var i=this._jsPlumb.instance.checkCondition("beforeDrop",{sourceId:a,targetId:b,scope:c,connection:e,dropEndpoint:f,source:g,target:h});if(this._jsPlumb.beforeDrop)try{i=this._jsPlumb.beforeDrop({sourceId:a,targetId:b,scope:c,connection:e,dropEndpoint:f,source:g,target:h})}catch(j){d.log("jsPlumb: beforeDrop callback failed",j)}return i};var l=[];this.setListenerComponent=function(a){for(var b=0;b<l.length;b++)l[b][3]=a}},n=function(a,b){var c=a._jsPlumb.types[b],d=a._jsPlumb.instance.getType(c,a.getTypeDescriptor());null!=d&&d.cssClass&&a.canvas&&a._jsPlumb.instance.removeClass(a.canvas,d.cssClass)};jsPlumbUtil.extend(m,jsPlumbUtil.EventGenerator,{getParameter:function(a){return this._jsPlumb.parameters[a]},setParameter:function(a,b){this._jsPlumb.parameters[a]=b},getParameters:function(){return this._jsPlumb.parameters},setParameters:function(a){this._jsPlumb.parameters=a},getClass:function(){return r.getClass(this.canvas)},hasClass:function(a){return r.hasClass(this.canvas,a)},addClass:function(a){r.addClass(this.canvas,a)},removeClass:function(a){r.removeClass(this.canvas,a)},updateClasses:function(a,b){r.updateClasses(this.canvas,a,b)},setType:function(a,b,c){this.clearTypes(),this._jsPlumb.types=i(a)||[],l(this,b,c)},getType:function(){return this._jsPlumb.types},reapplyTypes:function(a,b){l(this,a,b)},hasType:function(a){return-1!=this._jsPlumb.types.indexOf(a)},addType:function(a,b,c){var d=i(a),e=!1;if(null!=d){for(var f=0,g=d.length;g>f;f++)this.hasType(d[f])||(this._jsPlumb.types.push(d[f]),e=!0);e&&l(this,b,c)}},removeType:function(a,b){var c=i(a),d=!1,e=function(a){var b=this._jsPlumb.types.indexOf(a);return-1!=b?(n(this,b),this._jsPlumb.types.splice(b,1),!0):!1}.bind(this);if(null!=c){for(var f=0,g=c.length;g>f;f++)d=e(c[f])||d;d&&l(this,null,b)}},clearTypes:function(a){for(var b=this._jsPlumb.types.length,c=0;b>c;c++)n(this,0),this._jsPlumb.types.splice(0,1);l(this,{},a)},toggleType:function(a,b,c){var d=i(a);if(null!=d){for(var e=0,f=d.length;f>e;e++){var g=this._jsPlumb.types.indexOf(d[e]);-1!=g?(n(this,g),this._jsPlumb.types.splice(g,1)):this._jsPlumb.types.push(d[e])}l(this,b,c)}},applyType:function(a,b){if(this.setPaintStyle(a.paintStyle,b),this.setHoverPaintStyle(a.hoverPaintStyle,b),a.parameters)for(var c in a.parameters)this.setParameter(c,a.parameters[c]);this._jsPlumb.paintStyleInUse=this.getPaintStyle()},setPaintStyle:function(a,b){this._jsPlumb.paintStyle=a,this._jsPlumb.paintStyleInUse=this._jsPlumb.paintStyle,f(this),b||this.repaint()},getPaintStyle:function(){return this._jsPlumb.paintStyle},setHoverPaintStyle:function(a,b){this._jsPlumb.hoverPaintStyle=a,f(this),b||this.repaint()},getHoverPaintStyle:function(){return this._jsPlumb.hoverPaintStyle},destroy:function(a){(a||null==this.typeId)&&(this.cleanupListeners(),this.clone=null,this._jsPlumb=null)},isHover:function(){return this._jsPlumb.hover},setHover:function(a,b,c){if(this._jsPlumb&&!this._jsPlumb.instance.currentlyDragging&&!this._jsPlumb.instance.isHoverSuspended()){if(this._jsPlumb.hover=a,null!=this.canvas){if(null!=this._jsPlumb.instance.hoverClass){var d=a?"addClass":"removeClass";this._jsPlumb.instance[d](this.canvas,this._jsPlumb.instance.hoverClass)}null!=this._jsPlumb.hoverClass&&this._jsPlumb.instance[d](this.canvas,this._jsPlumb.hoverClass)}null!=this._jsPlumb.hoverPaintStyle&&(this._jsPlumb.paintStyleInUse=a?this._jsPlumb.hoverPaintStyle:this._jsPlumb.paintStyle,this._jsPlumb.instance.isSuspendDrawing()||(c=c||e(),this.repaint({timestamp:c,recalc:!1}))),this.getAttachedElements&&!b&&h(this,a,e(),this)}} });var o=0,p=function(){var a=o+1;return o++,a},q=window.jsPlumbInstance=function(b){this.Defaults={Anchor:"Bottom",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DoNotThrowErrors:!1,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fillStyle:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{lineWidth:4,strokeStyle:"#456"},ReattachConnections:!1,RenderMode:"svg",Scope:"jsPlumb_DefaultScope"},b&&r.extend(this.Defaults,b),this.logEnabled=this.Defaults.LogEnabled,this._connectionTypes={},this._endpointTypes={},jsPlumbUtil.EventGenerator.apply(this);var f=this,h=p(),i=f.bind,j={},l=1,n=function(a){if(null==a)return null;if(3==a.nodeType||8==a.nodeType)return{el:a,text:!0};var b=f.getElement(a);return{el:b,id:jsPlumbUtil.isString(a)&&null==b?a:Y(b)}};this.getInstanceIndex=function(){return h},this.setZoom=function(a,b){return l=a,f.fire("zoom",l),b&&f.repaintEverything(),!0},this.getZoom=function(){return l};for(var o in this.Defaults)j[o]=this.Defaults[o];var q,s=[];this.unbindContainer=function(){if(null!=q&&s.length>0)for(var a=0;a<s.length;a++)f.off(q,s[a][0],s[a][1])},this.setContainer=function(a){this.unbindContainer(),a=this.getElement(a),this.select().each(function(b){b.moveParent(a)}),this.selectEndpoints().each(function(b){b.moveParent(a)});var b=q;q=a,s.length=0;for(var c=function(a,b){var c=b.srcElement||b.target,d=(c&&c.parentNode?c.parentNode._jsPlumb:null)||(c?c._jsPlumb:null)||(c&&c.parentNode&&c.parentNode.parentNode?c.parentNode.parentNode._jsPlumb:null);d&&(d.fire(a,d,b),f.fire(a,d.component||d,b))},d=function(a,b,c){s.push([a,c]),f.on(q,a,b,c)},e=function(a){d(a,".jsplumb-connector > *",function(b){c(a,b)}),d(a,".jsplumb-endpoint, .jsplumb-endpoint > *, .jsplumb-endpoint svg *",function(b){c(a,b)}),d(a,".jsplumb-overlay, .jsplumb-overlay *",function(b){c(a,b)})},h=0;h<g.length;h++)e(g[h]);for(var i in y){var j=y[i].el;j.parentNode===b&&(b.removeChild(j),q.appendChild(j))}},this.getContainer=function(){return q},this.bind=function(a,b){"ready"===a&&u?b():i.apply(f,[a,b])},f.importDefaults=function(a){for(var b in a)f.Defaults[b]=a[b];return a.Container&&f.setContainer(a.Container),f},f.restoreDefaults=function(){return f.Defaults=r.extend({},j),f};var t=null,u=!1,v=[],w={},x={},y={},z={},A={},B={},C=!1,D=[],E=!1,F=null,G=this.Defaults.Scope,H=1,I=function(){return""+H++},J=function(a,b){q?q.appendChild(a):b?this.getElement(b).appendChild(a):this.appendToRoot(a)}.bind(this),K=function(a,b,c,d){if(!r.headless&&!E){var g=Y(a),h=f.getDragManager().getElementsForDraggable(g);null==c&&(c=e());var i=qb({elId:g,offset:b,recalc:!1,timestamp:c});if(h)for(var j in h)qb({elId:h[j].id,offset:{left:i.o.left+h[j].offset.left,top:i.o.top+h[j].offset.top},recalc:!1,timestamp:c});if(f.anchorManager.redraw(g,b,c,null,d),h)for(var k in h)f.anchorManager.redraw(h[k].id,b,c,h[k].offset,d,!0)}},L=function(a){return x[a]},M=function(a,b,c,e){if(!r.headless){var g=null==b?!1:b;if(g&&r.isDragSupported(a,f)){var h=c||f.Defaults.DragOptions;if(h=r.extend({},h),r.isAlreadyDraggable(a,f))c.force&&f.initDraggable(a,h);else{var i=r.dragEvents.drag,j=r.dragEvents.stop,k=r.dragEvents.start,l=f.getElement(a),m=f.getDragManager().getDragAncestor(l),n={left:0,top:0},o=n,p=!1;pb(e,a),h[k]=d.wrap(h[k],function(){return o=null!=m?f.getOffset(m):n,f.setHoverSuspended(!0),f.select({source:a}).addClass(f.elementDraggingClass+" "+f.sourceElementDraggingClass,!0),f.select({target:a}).addClass(f.elementDraggingClass+" "+f.targetElementDraggingClass,!0),f.setConnectionBeingDragged(!0),h.canDrag?c.canDrag():void 0},!1),h[i]=d.wrap(h[i],function(){var b=f.getUIPosition(arguments,f.getZoom());b.left+=o.left,b.top+=o.top,K(a,b,null,!0),p&&f.addClass(a,"jsplumb-dragged"),p=!0}),h[j]=d.wrap(h[j],function(){for(var a=arguments[0].selection,b=f.getUIPosition(arguments),c=function(a){K(a[0],b),f.removeClass(a[0],"jsplumb-dragged"),f.select({source:a[0]}).removeClass(f.elementDraggingClass+" "+f.sourceElementDraggingClass,!0),f.select({target:a[0]}).removeClass(f.elementDraggingClass+" "+f.targetElementDraggingClass,!0),f.getDragManager().dragEnded(a[0])},d=0;d<a.length;d++)c(a[d]);p=!1,f.setHoverSuspended(!1),f.setConnectionBeingDragged(!1)});var q=Y(a);B[q]=!0;var s=B[q];h.disabled=null==s?!1:!s,f.initDraggable(a,h),f.getDragManager().register(a)}} }},N=function(a,b){for(var c=a.scope.split(/\s/),d=b.scope.split(/\s/),e=0;e<c.length;e++)for(var f=0;f<d.length;f++)if(d[f]==c[e])return!0;return!1},O=function(a,b){var c=r.extend({},a);if(b&&r.extend(c,b),c.source&&(c.source.endpoint?c.sourceEndpoint=c.source:c.source=f.getElement(c.source)),c.target&&(c.target.endpoint?c.targetEndpoint=c.target:c.target=f.getElement(c.target)),a.uuids&&(c.sourceEndpoint=L(a.uuids[0]),c.targetEndpoint=L(a.uuids[1])),c.sourceEndpoint&&c.sourceEndpoint.isFull())return d.log(f,"could not add connection; source endpoint is full"),void 0;if(c.targetEndpoint&&c.targetEndpoint.isFull())return d.log(f,"could not add connection; target endpoint is full"),void 0;if(!c.type&&c.sourceEndpoint&&(c.type=c.sourceEndpoint.connectionType),c.sourceEndpoint&&c.sourceEndpoint.connectorOverlays){c.overlays=c.overlays||[];for(var e=0,g=c.sourceEndpoint.connectorOverlays.length;g>e;e++)c.overlays.push(c.sourceEndpoint.connectorOverlays[e])}!c["pointer-events"]&&c.sourceEndpoint&&c.sourceEndpoint.connectorPointerEvents&&(c["pointer-events"]=c.sourceEndpoint.connectorPointerEvents);var h=function(a,b){var c=r.extend({},a);for(var d in b)b[d]&&(c[d]=b[d]);return c},i=function(a,b,d){return f.addEndpoint(a,h(b,{anchor:c.anchors?c.anchors[d]:c.anchor,endpoint:c.endpoints?c.endpoints[d]:c.endpoint,paintStyle:c.endpointStyles?c.endpointStyles[d]:c.endpointStyle,hoverPaintStyle:c.endpointHoverStyles?c.endpointHoverStyles[d]:c.endpointHoverStyle}))},j=function(a,b,d,e){if(c[a]&&!c[a].endpoint&&!c[a+"Endpoint"]&&!c.newConnection){var f=Y(c[a]),g=d[f];if(g=g?g[e]:null){if(!g.enabled)return!1;var h=null!=g.endpoint&&g.endpoint._jsPlumb?g.endpoint:i(c[a],g.def,b);if(h.isFull())return!1;c[a+"Endpoint"]=h,h._doNotDeleteOnDetach=!1,h._deleteOnDetach=!0,g.uniqueEndpoint&&(g.endpoint?h.finalEndpoint=g.endpoint:(g.endpoint=h,h._deleteOnDetach=!1,h._doNotDeleteOnDetach=!0))}} };return j("source",0,this.sourceEndpointDefinitions,c.type||"default")!==!1&&j("target",1,this.targetEndpointDefinitions,c.type||"default")!==!1?(c.sourceEndpoint&&c.targetEndpoint&&(N(c.sourceEndpoint,c.targetEndpoint)||(c=null)),c):void 0}.bind(f),P=function(a){var b=f.Defaults.ConnectionType||f.getDefaultConnectionType();a._jsPlumb=f,a.newConnection=P,a.newEndpoint=R,a.endpointsByUUID=x,a.endpointsByElement=w,a.finaliseConnection=Q,a.id="con_"+I();var c=new b(a);return c.isDetachable()&&(c.endpoints[0].initDraggable("_jsPlumbSource"),c.endpoints[1].initDraggable("_jsPlumbTarget")),c},Q=f.finaliseConnection=function(a,b,c,d){if(b=b||{},a.suspendedEndpoint||v.push(a),a.pending=null,a.endpoints[0].isTemporarySource=!1,d!==!1&&f.anchorManager.newConnection(a),K(a.source),!b.doNotFireConnectionEvent&&b.fireEvent!==!1){var e={connection:a,source:a.source,target:a.target,sourceId:a.sourceId,targetId:a.targetId,sourceEndpoint:a.endpoints[0],targetEndpoint:a.endpoints[1]};f.fire("connection",e,c)}},R=function(a,b){var c=f.Defaults.EndpointType||r.Endpoint,d=r.extend({},a);d._jsPlumb=f,d.newConnection=P,d.newEndpoint=R,d.endpointsByUUID=x,d.endpointsByElement=w,d.fireDetachEvent=_,d.elementId=b||Y(d.source);var e=new c(d);return e.id="ep_"+I(),pb(d.elementId,d.source),r.headless||f.getDragManager().endpointAdded(d.source,b),e},S=function(a,b,c){var d=w[a];if(d&&d.length)for(var e=0,f=d.length;f>e;e++){for(var g=0,h=d[e].connections.length;h>g;g++){var i=b(d[e].connections[g]);if(i)return}c&&c(d[e])}},T=function(a,b){return r.each(a,function(a){f.isDragSupported(a)&&(B[f.getAttribute(a,"id")]=b,f.setElementDraggable(a,b))})},U=function(a,b,c){b="block"===b;var d=null;c&&(d=b?function(a){a.setVisible(!0,!0,!0)}:function(a){a.setVisible(!1,!0,!0)});var e=n(a);S(e.id,function(a){if(b&&c){var d=a.sourceId===e.id?1:0;a.endpoints[d].isVisible()&&a.setVisible(!0)}else a.setVisible(b)},d)},V=function(a){return r.each(a,function(a){var b=f.getAttribute(a,"id"),c=null==B[b]?!1:B[b];return c=!c,B[b]=c,f.setDraggable(a,c),c}.bind(this))},W=function(a,b){var c=null;b&&(c=function(a){var b=a.isVisible();a.setVisible(!b)}),S(a,function(a){var b=a.isVisible();a.setVisible(!b)},c)},X=function(a){var b=z[a];return b?{o:b,s:D[a]}:qb({elId:a})},Y=function(a,b,c){if(jsPlumbUtil.isString(a))return a;if(null==a)return null;var d=f.getAttribute(a,"id");return d&&"undefined"!==d||(2==arguments.length&&void 0!==arguments[1]?d=b:(1==arguments.length||3==arguments.length&&!arguments[2])&&(d="jsPlumb_"+h+"_"+I()),c||f.setAttribute(a,"id",d)),d};this.setConnectionBeingDragged=function(a){C=a},this.isConnectionBeingDragged=function(){return C},this.getManagedElements=function(){return y},this.getRenderMode=function(){return"svg"},this.connectorClass="jsplumb-connector",this.connectorOutlineClass="jsplumb-connector-outline",this.connectedClass="jsplumb-connected",this.hoverClass="jsplumb-hover",this.endpointClass="jsplumb-endpoint",this.endpointConnectedClass="jsplumb-endpoint-connected",this.endpointFullClass="jsplumb-endpoint-full",this.endpointDropAllowedClass="jsplumb-endpoint-drop-allowed",this.endpointDropForbiddenClass="jsplumb-endpoint-drop-forbidden",this.overlayClass="jsplumb-overlay",this.draggingClass="jsplumb-dragging",this.elementDraggingClass="jsplumb-element-dragging",this.sourceElementDraggingClass="jsplumb-source-element-dragging",this.targetElementDraggingClass="jsplumb-target-element-dragging",this.endpointAnchorClassPrefix="jsplumb-endpoint-anchor",this.hoverSourceClass="jsplumb-source-hover",this.hoverTargetClass="jsplumb-target-hover",this.dragSelectClass="jsplumb-drag-select",this.Anchors={},this.Connectors={svg:{}},this.Endpoints={svg:{}},this.Overlays={svg:{}},this.ConnectorRenderers={},this.SVG="svg",this.addEndpoint=function(a,b,c){c=c||{};var e=r.extend({},c);r.extend(e,b),e.endpoint=e.endpoint||f.Defaults.Endpoint,e.paintStyle=e.paintStyle||f.Defaults.EndpointStyle;for(var g=[],h=d.isArray(a)||null!=a.length&&!d.isString(a)?a:[a],i=0,j=h.length;j>i;i++){e.source=f.getElement(h[i]),nb(e.source);var k=Y(e.source),l=R(e,k),m=pb(k,e.source).info.o;d.addToList(w,k,l),E||l.paint({anchorLoc:l.anchor.compute({xy:[m.left,m.top],wh:D[k],element:l,timestamp:F}),timestamp:F}),g.push(l),l._doNotDeleteOnDetach=!0}return 1==g.length?g[0]:g},this.addEndpoints=function(a,b,c){for(var e=[],g=0,h=b.length;h>g;g++){var i=f.addEndpoint(a,b[g],c);d.isArray(i)?Array.prototype.push.apply(e,i):e.push(i)}return e},this.animate=function(a,b,c){if(!this.animationSupported)return!1;c=c||{};var e=f.getElement(a),g=Y(e),h=r.animEvents.step,i=r.animEvents.complete;c[h]=d.wrap(c[h],function(){f.revalidate(g)}),c[i]=d.wrap(c[i],function(){f.revalidate(g)}),f.doAnimate(e,b,c)},this.checkCondition=function(a){var b=f.getListener(a),c=!0;if(b&&b.length>0){var e=Array.prototype.slice.call(arguments,1);try{for(var g=0,h=b.length;h>g;g++)c=c&&b[g].apply(b[g],e)}catch(i){d.log(f,"cannot check condition ["+a+"]"+i)}}return c},this.connect=function(a,b){var c,d=O(a,b);if(d){if(null==d.source&&null==d.sourceEndpoint)return jsPlumbUtil.log("Cannot establish connection - source does not exist"),void 0;if(null==d.target&&null==d.targetEndpoint)return jsPlumbUtil.log("Cannot establish connection - target does not exist"),void 0;nb(d.source),c=P(d),Q(c,d)}return c};var Z=[{el:"source",elId:"sourceId",epDefs:"sourceEndpointDefinitions"},{el:"target",elId:"targetId",epDefs:"targetEndpointDefinitions"}],$=function(a,b,c,d){var e,f,g,h=Z[c],i=a[h.elId],j=(a[h.el],a.endpoints[c]),k={index:c,originalSourceId:0===c?i:a.sourceId,newSourceId:a.sourceId,originalTargetId:1==c?i:a.targetId,newTargetId:a.targetId,connection:a};if(b.constructor==r.Endpoint)e=b,e.addConnection(a);else if(f=Y(b),g=this[h.epDefs][f],f===a[h.elId])e=null;else if(g)for(var l in g){if(!g[l].enabled)return;e=null!=g[l].endpoint&&g[l].endpoint._jsPlumb?g[l].endpoint:this.addEndpoint(b,g[l].def),g[l].uniqueEndpoint&&(g[l].endpoint=e),e._doNotDeleteOnDetach=!1,e._deleteOnDetach=!0,e.addConnection(a)}else e=a.makeEndpoint(0===c,b,f),e._doNotDeleteOnDetach=!1,e._deleteOnDetach=!0;return null!=e&&(j.detachFromConnection(a),a.endpoints[c]=e,a[h.el]=e.element,a[h.elId]=e.elementId,k[0===c?"newSourceId":"newTargetId"]=e.elementId,ab(k),d||a.repaint()),k}.bind(this);this.setSource=function(a,b,c){var d=$(a,b,0,c);this.anchorManager.sourceChanged(d.originalSourceId,d.newSourceId,a)},this.setTarget=function(a,b,c){var d=$(a,b,1,c);this.anchorManager.updateOtherEndpoint(d.originalSourceId,d.originalTargetId,d.newTargetId,a)},this.deleteEndpoint=function(a,b){var c="string"==typeof a?x[a]:a;return c&&f.deleteObject({endpoint:c,dontUpdateHover:b}),f},this.deleteEveryEndpoint=function(){var a=f.setSuspendDrawing(!0);for(var b in w){var c=w[b];if(c&&c.length)for(var d=0,e=c.length;e>d;d++)f.deleteEndpoint(c[d],!0)}return w={},y={},x={},z={},A={},f.anchorManager.reset(),f.getDragManager().reset(),a||f.setSuspendDrawing(!1),f};var _=function(a,b,c){var d=f.Defaults.ConnectionType||f.getDefaultConnectionType(),e=a.constructor==d,g=e?{connection:a,source:a.source,target:a.target,sourceId:a.sourceId,targetId:a.targetId,sourceEndpoint:a.endpoints[0],targetEndpoint:a.endpoints[1]}:a;b&&f.fire("connectionDetached",g,c),f.anchorManager.connectionDetached(g)},ab=f.fireMoveEvent=function(a,b){f.fire("connectionMoved",a,b)};this.unregisterEndpoint=function(a){a._jsPlumb.uuid&&(x[a._jsPlumb.uuid]=null),f.anchorManager.deleteEndpoint(a);for(var b in w){var c=w[b];if(c){for(var d=[],e=0,g=c.length;g>e;e++)c[e]!=a&&d.push(c[e]);w[b]=d}w[b].length<1&&delete w[b]}},this.detach=function(){if(0!==arguments.length){var a=f.Defaults.ConnectionType||f.getDefaultConnectionType(),b=arguments[0].constructor==a,c=2==arguments.length?b?arguments[1]||{}:arguments[0]:arguments[0],d=c.fireEvent!==!1,e=c.forceDetach,g=b?arguments[0]:c.connection;if(g)(e||jsPlumbUtil.functionChain(!0,!1,[[g.endpoints[0],"isDetachAllowed",[g]],[g.endpoints[1],"isDetachAllowed",[g]],[g,"isDetachAllowed",[g]],[f,"checkCondition",["beforeDetach",g]]]))&&g.endpoints[0].detach(g,!1,!0,d);else{var h=r.extend({},c);if(h.uuids)L(h.uuids[0]).detachFrom(L(h.uuids[1]),d);else if(h.sourceEndpoint&&h.targetEndpoint)h.sourceEndpoint.detachFrom(h.targetEndpoint);else{var i=Y(f.getElement(h.source)),j=Y(f.getElement(h.target));S(i,function(a){(a.sourceId==i&&a.targetId==j||a.targetId==i&&a.sourceId==j)&&f.checkCondition("beforeDetach",a)&&a.endpoints[0].detach(a,!1,!0,d)})}} }},this.detachAllConnections=function(a,b){b=b||{},a=f.getElement(a);var c=Y(a),d=w[c];if(d&&d.length)for(var e=0,g=d.length;g>e;e++)d[e].detachAll(b.fireEvent!==!1,b.forceDetach);return f},this.detachEveryConnection=function(a){return a=a||{},f.batch(function(){for(var b in w){var c=w[b];if(c&&c.length)for(var d=0,e=c.length;e>d;d++)c[d].detachAll(a.fireEvent!==!1,a.forceDetach)}v.length=0}),f},this.deleteObject=function(a){var b={endpoints:{},connections:{},endpointCount:0,connectionCount:0},c=(a.fireEvent!==!1,a.deleteAttachedObjects!==!1),d=function(d){if(null!=d&&null==b.connections[d.id]&&(a.dontUpdateHover||null==d._jsPlumb||d.setHover(!1),b.connections[d.id]=d,b.connectionCount++,c))for(var f=0;f<d.endpoints.length;f++)d.endpoints[f]._deleteOnDetach&&e(d.endpoints[f])},e=function(e){if(null!=e&&null==b.endpoints[e.id]&&(a.dontUpdateHover||null==e._jsPlumb||e.setHover(!1),b.endpoints[e.id]=e,b.endpointCount++,c))for(var f=0;f<e.connections.length;f++){var g=e.connections[f];d(g)}};a.connection?d(a.connection):e(a.endpoint);for(var g in b.connections){var h=b.connections[g];h._jsPlumb&&(jsPlumbUtil.removeWithFunction(v,function(a){return h.id==a.id}),_(h,a.fireEvent===!1?!1:!h.pending,a.originalEvent),h.endpoints[0].detachFromConnection(h),h.endpoints[1].detachFromConnection(h),h.cleanup(!0),h.destroy(!0))}for(var i in b.endpoints){var j=b.endpoints[i];j._jsPlumb&&(f.unregisterEndpoint(j),j.cleanup(!0),j.destroy(!0))}return b},this.draggable=function(a,b){var c;return k(function(a){c=n(a),c.el&&M(c.el,!0,b,c.id)},a),f},this.droppable=function(a,b){var c;return b=b||{},b.allowLoopback=!1,k(function(a){c=n(a),c.el&&f.initDroppable(c.el,b)},a),f};var bb=function(a,b,c,d){for(var e=0,f=a.length;f>e;e++)a[e][b].apply(a[e],c);return d(a)},cb=function(a,b,c){for(var d=[],e=0,f=a.length;f>e;e++)d.push([a[e][b].apply(a[e],c),a[e]]);return d},db=function(a,b,c){return function(){return bb(a,b,arguments,c)}},eb=function(a,b){return function(){return cb(a,b,arguments)}},fb=function(a,b){var c=[];if(a)if("string"==typeof a){if("*"===a)return a;c.push(a)}else if(b)c=a;else if(a.length)for(var d=0,e=a.length;e>d;d++)c.push(n(a[d]).id);else c.push(n(a).id);return c},gb=function(a,b,c){return"*"===a?!0:a.length>0?-1!=a.indexOf(b):!c};this.getConnections=function(a,b){a?a.constructor==String&&(a={scope:a}):a={};for(var c=a.scope||f.getDefaultScope(),d=fb(c,!0),e=fb(a.source),g=fb(a.target),h=!b&&d.length>1?{}:[],i=function(a,c){if(!b&&d.length>1){var e=h[a];null==e&&(e=h[a]=[]),e.push(c)}else h.push(c)},j=0,k=v.length;k>j;j++){var l=v[j];gb(d,l.scope)&&gb(e,l.sourceId)&&gb(g,l.targetId)&&i(l.scope,l)}return h};var hb=function(a,b){return function(c){for(var d=0,e=a.length;e>d;d++)c(a[d]);return b(a)}},ib=function(a){return function(b){return a[b]}},jb=function(a,b){var c,d,e={length:a.length,each:hb(a,b),get:ib(a)},f=["setHover","removeAllOverlays","setLabel","addClass","addOverlay","removeOverlay","removeOverlays","showOverlay","hideOverlay","showOverlays","hideOverlays","setPaintStyle","setHoverPaintStyle","setSuspendEvents","setParameter","setParameters","setVisible","repaint","addType","toggleType","removeType","removeClass","setType","bind","unbind"],g=["getLabel","getOverlay","isHover","getParameter","getParameters","getPaintStyle","getHoverPaintStyle","isVisible","hasType","getType","isSuspendEvents"];for(c=0,d=f.length;d>c;c++)e[f[c]]=db(a,f[c],b);for(c=0,d=g.length;d>c;c++)e[g[c]]=eb(a,g[c]);return e},kb=function(a){var b=jb(a,kb);return r.extend(b,{setDetachable:db(a,"setDetachable",kb),setReattach:db(a,"setReattach",kb),setConnector:db(a,"setConnector",kb),detach:function(){for(var b=0,c=a.length;c>b;b++)f.detach(a[b])},isDetachable:eb(a,"isDetachable"),isReattach:eb(a,"isReattach")})},lb=function(a){var b=jb(a,lb);return r.extend(b,{setEnabled:db(a,"setEnabled",lb),setAnchor:db(a,"setAnchor",lb),isEnabled:eb(a,"isEnabled"),detachAll:function(){for(var b=0,c=a.length;c>b;b++)a[b].detachAll()},remove:function(){for(var b=0,c=a.length;c>b;b++)f.deleteObject({endpoint:a[b]})}})};this.select=function(a){return a=a||{},a.scope=a.scope||"*",kb(a.connections||f.getConnections(a,!0))},this.selectEndpoints=function(a){a=a||{},a.scope=a.scope||"*";var b=!a.element&&!a.source&&!a.target,c=b?"*":fb(a.element),d=b?"*":fb(a.source),e=b?"*":fb(a.target),f=fb(a.scope,!0),g=[];for(var h in w){var i=gb(c,h,!0),j=gb(d,h,!0),k="*"!=d,l=gb(e,h,!0),m="*"!=e;if(i||j||l)a:for(var n=0,o=w[h].length;o>n;n++){var p=w[h][n];if(gb(f,p.scope,!0)){var q=k&&d.length>0&&!p.isSource,r=m&&e.length>0&&!p.isTarget;if(q||r)continue a;g.push(p)}} }return lb(g)},this.getAllConnections=function(){return v},this.getDefaultScope=function(){return G},this.getEndpoint=L,this.getEndpoints=function(a){return w[n(a).id]},this.getDefaultEndpointType=function(){return r.Endpoint},this.getDefaultConnectionType=function(){return r.Connection},this.getId=Y,this.appendElement=J;var mb=!1;this.isHoverSuspended=function(){return mb},this.setHoverSuspended=function(a){mb=a},this.hide=function(a,b){return U(a,"none",b),f},this.idstamp=I,this.connectorsInitialized=!1,this.registerConnectorType=function(a,b){c.push([a,b])};var nb=function(a){if(!q&&a){var b=f.getElement(a);b.offsetParent&&f.setContainer(b.offsetParent)}},ob=function(){f.Defaults.Container&&f.setContainer(f.Defaults.Container)},pb=f.manage=function(a,b,c){return y[a]||(y[a]={el:b,endpoints:[],connections:[]},y[a].info=qb({elId:a,timestamp:F}),c||f.fire("manageElement",{id:a,info:y[a].info,el:b})),y[a]},qb=this.updateOffset=function(a){var b,c=a.timestamp,d=a.recalc,e=a.offset,g=a.elId;return E&&!c&&(c=F),!d&&c&&c===A[g]?{o:a.offset||z[g],s:D[g]}:(d||!e&&null==z[g]?(b=y[g]?y[g].el:null,null!=b&&(D[g]=f.getSize(b),z[g]=f.getOffset(b),A[g]=c)):(z[g]=e||z[g],null==D[g]&&(b=y[g].el,null!=b&&(D[g]=f.getSize(b))),A[g]=c),z[g]&&!z[g].right&&(z[g].right=z[g].left+D[g][0],z[g].bottom=z[g].top+D[g][1],z[g].width=D[g][0],z[g].height=D[g][1],z[g].centerx=z[g].left+z[g].width/2,z[g].centery=z[g].top+z[g].height/2),{o:z[g],s:D[g]})};this.init=function(){a=r.getRenderModes();var b=function(a,b,c){r.Connectors[a][b]=function(){c.apply(this,arguments),r.ConnectorRenderers[a].apply(this,arguments)},jsPlumbUtil.extend(r.Connectors[a][b],[c,r.ConnectorRenderers[a]])};if(!r.connectorsInitialized){for(var d=0;d<c.length;d++)for(var e=0;e<a.length;e++)b(a[e],c[d][1],c[d][0]);r.connectorsInitialized=!0}u||(ob(),f.anchorManager=new r.AnchorManager({jsPlumbInstance:f}),u=!0,f.fire("ready",f))}.bind(this),this.log=t,this.jsPlumbUIComponent=m,this.makeAnchor=function(){var a,b=function(a,b){if(r.Anchors[a])return new r.Anchors[a](b);if(!f.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown anchor type '"+a+"'"}};if(0===arguments.length)return null;var c=arguments[0],e=arguments[1],g=(arguments[2],null);if(c.compute&&c.getOrientation)return c;if("string"==typeof c)g=b(arguments[0],{elementId:e,jsPlumbInstance:f});else if(d.isArray(c))if(d.isArray(c[0])||d.isString(c[0]))2==c.length&&d.isObject(c[1])?d.isString(c[0])?(a=r.extend({elementId:e,jsPlumbInstance:f},c[1]),g=b(c[0],a)):(a=r.extend({elementId:e,jsPlumbInstance:f,anchors:c[0]},c[1]),g=new r.DynamicAnchor(a)):g=new r.DynamicAnchor({anchors:c,selector:null,elementId:e,jsPlumbInstance:f});else{var h={x:c[0],y:c[1],orientation:c.length>=4?[c[2],c[3]]:[0,0],offsets:c.length>=6?[c[4],c[5]]:[0,0],elementId:e,jsPlumbInstance:f,cssClass:7==c.length?c[6]:null};g=new r.Anchor(h),g.clone=function(){return new r.Anchor(h)}}return g.id||(g.id="anchor_"+I()),g},this.makeAnchors=function(a,b,c){for(var e=[],g=0,h=a.length;h>g;g++)"string"==typeof a[g]?e.push(r.Anchors[a[g]]({elementId:b,jsPlumbInstance:c})):d.isArray(a[g])&&e.push(f.makeAnchor(a[g],b,c));return e},this.makeDynamicAnchor=function(a,b){return new r.DynamicAnchor({anchors:a,selector:b,elementId:null,jsPlumbInstance:f})},this.targetEndpointDefinitions={};var rb=function(){};this.sourceEndpointDefinitions={};var sb=function(a,b,c,d,e){for(var f=a.target||a.srcElement,g=!1,h=d.getSelector(b,c),i=0;i<h.length;i++)if(h[i]==f){g=!0;break}return e?!g:g},tb=function(a,b,c,e,g){var h=new m(b),i=b._jsPlumb.EndpointDropHandler({jsPlumb:f,enabled:function(){return a.def.enabled},isFull:function(){var b=f.select({target:a.id}).length;return a.def.maxConnections>0&&b>=a.def.maxConnections},element:a.el,elementId:a.id,isSource:e,isTarget:g,addClass:function(b){f.addClass(a.el,b)},removeClass:function(b){f.removeClass(a.el,b)},onDrop:function(a){var b=a.endpoints[0];b.anchor.locked=!1},isDropAllowed:function(){return h.isDropAllowed.apply(h,arguments)},isRedrop:function(b){return null!=b.suspendedElement&&null!=b.suspendedEndpoint&&b.suspendedEndpoint.element===a.el},getEndpoint:function(c){var d=a.def.endpoint;if(null==d||null==d._jsPlumb){var e=f.deriveEndpointAndAnchorSpec(c.getType().join(" "),!0),g=e.endpoints?r.extend(b,{endpoint:a.def.def.endpoint||e.endpoints[1]}):b;e.anchors&&(g=r.extend(g,{anchor:a.def.def.anchor||e.anchors[1]})),d=f.addEndpoint(a.el,g),d._mtNew=!0}if(b.uniqueEndpoint&&(a.def.endpoint=d),d._doNotDeleteOnDetach=!1,d._deleteOnDetach=!0,c.isDetachable()&&d.initDraggable(),null!=d.anchor.positionFinder){var h=f.getUIPosition(arguments,f.getZoom()),i=f.getOffset(a.el),j=f.getSize(a.el),k=d.anchor.positionFinder(h,i,j,d.anchor.constructorParams);
d.anchor.x=k[0],d.anchor.y=k[1]}return d},maybeCleanup:function(a){a._mtNew&&0===a.connections.length?f.deleteObject({endpoint:a}):delete a._mtNew}}),j=r.dragEvents.drop;return c.scope=c.scope||b.scope||f.Defaults.Scope,c[j]=d.wrap(c[j],i,!0),g&&(c[r.dragEvents.over]=function(){return!0}),b.allowLoopback===!1&&(c.canDrop=function(b){var c=b.getDragElement()._jsPlumbRelatedElement;return c!=a.el}),f.initDroppable(a.el,c,"internal"),i};this.makeTarget=function(a,b,c){var d=r.extend({_jsPlumb:this},c);r.extend(d,b),rb(d,1,this);for(var e=(!(d.deleteEndpointsOnDetach===!1),d.maxConnections||-1),f=function(a){var b=n(a),c=b.id,f=r.extend({},d.dropOptions||{}),g="default";this.targetEndpointDefinitions[c]=this.targetEndpointDefinitions[c]||{},nb(c);var h={def:r.extend({},d),uniqueEndpoint:d.uniqueEndpoint,maxConnections:e,enabled:!0};b.def=h,this.targetEndpointDefinitions[c][g]=h,tb(b,d,f,d.isSource===!0,!0)}.bind(this),g=a.length&&a.constructor!=String?a:[a],h=0,i=g.length;i>h;h++)f(g[h]);return this},this.unmakeTarget=function(a,b){var c=n(a);return r.destroyDroppable(c.el),b||delete this.targetEndpointDefinitions[c.id],this},this.makeSource=function(a,b,c){var e=r.extend({_jsPlumb:this},c);r.extend(e,b);var g=e.connectionType||"default",h=f.deriveEndpointAndAnchorSpec(g);e.endpoint=e.endpoint||h.endpoints[0],e.anchor=e.anchor||h.anchors[0],rb(e,0,this);for(var i=e.maxConnections||-1,j=e.onMaxConnections,k=function(a){var b=a.id,c=this.getElement(a.el);this.sourceEndpointDefinitions[b]=this.sourceEndpointDefinitions[b]||{},nb(b);var h={def:r.extend({},e),uniqueEndpoint:e.uniqueEndpoint,maxConnections:i,enabled:!0};this.sourceEndpointDefinitions[b][g]=h,a.def=h;var k=r.dragEvents.stop,m=r.dragEvents.drag,n=r.extend({},e.dragOptions||{}),o=n.drag,p=n.stop,q=null,s=!1;n.scope=n.scope||e.scope,n[m]=d.wrap(n[m],function(){o&&o.apply(this,arguments),s=!1}),n[k]=d.wrap(n[k],function(){if(p&&p.apply(this,arguments),this.currentlyDragging=!1,null!=q._jsPlumb){var a=e.anchor||this.Defaults.Anchor,c=q.anchor,d=q.connections[0],g=this.makeAnchor(a,b,this),h=q.element;if(null!=g.positionFinder){var i=f.getOffset(h),j=this.getSize(h),k={left:i.left+c.x*j[0],top:i.top+c.y*j[1]},l=g.positionFinder(k,i,j,g.constructorParams);g.x=l[0],g.y=l[1]}q.setAnchor(g,!0),q.repaint(),this.repaint(q.elementId),null!=d&&this.repaint(d.targetId)}}.bind(this));var t=function(d){if(3!==d.which&&2!==d.button){var h=this.sourceEndpointDefinitions[b][g];if(h.enabled){if(b=this.getId(this.getElement(a.el)),e.filter){var k=jsPlumbUtil.isString(e.filter)?sb(d,a.el,e.filter,this,e.filterExclude):e.filter(d,a.el);if(k===!1)return}var m=this.select({source:b}).length;if(h.maxConnections>=0&&m>=h.maxConnections)return j&&j({element:a.el,maxConnections:i},d),!1;var o=r.getPositionOnElement(d,c,l),p={};r.extend(p,e),p.isTemporarySource=!0,p.anchor=[o[0],o[1],0,0],p.dragOptions=n,h.def.scope&&(p.scope=h.def.scope),q=this.addEndpoint(b,p),s=!0,q._doNotDeleteOnDetach=!1,q._deleteOnDetach=!0,h.uniqueEndpoint&&(h.endpoint?q.finalEndpoint=h.endpoint:(h.endpoint=q,q._deleteOnDetach=!1,q._doNotDeleteOnDetach=!0));var t=function(){f.off(q.canvas,"mouseup",t),f.off(a.el,"mouseup",t),s&&(s=!1,f.deleteEndpoint(q))};f.on(q.canvas,"mouseup",t),f.on(a.el,"mouseup",t);var u={};if(h.def.extract)for(var v in h.def.extract){var w=d.srcElement.getAttribute(v);w&&(u[h.def.extract[v]]=w)}f.trigger(q.canvas,"mousedown",d,u),jsPlumbUtil.consume(d)}} }.bind(this);this.on(a.el,"mousedown",t),h.trigger=t,e.filter&&(jsPlumbUtil.isString(e.filter)||jsPlumbUtil.isFunction(e.filter))&&f.setDragFilter(a.el,e.filter);var u=r.extend({},e.dropOptions||{});tb(a,e,u,!0,e.isTarget===!0)}.bind(this),m=a.length&&a.constructor!=String?a:[a],o=0,p=m.length;p>o;o++)k(n(m[o]));return this},this.unmakeSource=function(a,b,c){var d=n(a),e=this.sourceEndpointDefinitions[d.id];if(e)for(var g in e)if(null==b||b===g){var h=e[g].trigger;h&&f.off(d.el,"mousedown",h),c||delete this.sourceEndpointDefinitions[d.id][g]}return this},this.unmakeEverySource=function(){for(var a in this.sourceEndpointDefinitions)f.unmakeSource(a,null,!0);return this.sourceEndpointDefinitions={},this};var ub=function(a,b,c){b=jsPlumbUtil.isArray(b)?b:[b];var d=Y(a);c=c||"default";for(var e=0;e<b.length;e++){var f=this[b[e]][d];if(f&&f[c])return f[c].def.scope||this.Defaults.Scope}}.bind(this),vb=function(a,b,c,d){c=jsPlumbUtil.isArray(c)?c:[c];var e=Y(a);d=d||"default";for(var f=0;f<c.length;f++){var g=this[c[f]][e];g&&g[d]&&(g[d].def.scope=b)}}.bind(this);this.getScope=function(a){return ub(a,["sourceEndpointDefinitions","targetEndpointDefinitions"])},this.getSourceScope=function(a){return ub(a,"sourceEndpointDefinitions")},this.getTargetScope=function(a){return ub(a,"targetEndpointDefinitions")},this.setScope=function(a,b,c){this.setSourceScope(a,b,c),this.setTargetScope(a,b,c)},this.setSourceScope=function(a,b,c){vb(a,b,"sourceEndpointDefinitions",c),this.setDragScope(a,b)},this.setTargetScope=function(a,b,c){vb(a,b,"targetEndpointDefinitions",c),this.setDropScope(a,b)},this.unmakeEveryTarget=function(){for(var a in this.targetEndpointDefinitions)f.unmakeTarget(a,!0);return this.targetEndpointDefinitions={},this};var wb=function(a,b,c,e,f){var g="source"==a?this.sourceEndpointDefinitions:this.targetEndpointDefinitions;if(f=f||"default",d.isString(b)&&g[b]&&g[b][f])g[b][f].enabled=e?!g[b][f].enabled:c;else if(b.length)for(var h=0,i=b.length;i>h;h++){var j=n(b[h]);g[j.id]&&g[j.id][f]&&(g[j.id][f].enabled=e?!g[j.id][f].enabled:c)}else{var k=n(b).id;g[k]&&g[k][f]&&(g[k][f].enabled=e?!g[k][f].enabled:c)}return this}.bind(this),xb=function(a,b){return d.isString(a)||!a.length?b.apply(this,[a]):a.length?b.apply(this,[a[0]]):void 0}.bind(this);this.toggleSourceEnabled=function(a,b){return wb("source",a,null,!0,b),this.isSourceEnabled(a,b)},this.setSourceEnabled=function(a,b,c){return wb("source",a,b,null,c)},this.isSource=function(a,b){return b=b||"default",xb(a,function(a){var c=this.sourceEndpointDefinitions[n(a).id];return null!=c&&null!=c[b]}.bind(this))},this.isSourceEnabled=function(a,b){return b=b||"default",xb(a,function(a){var c=this.sourceEndpointDefinitions[n(a).id];return c&&c[b]&&c[b].enabled===!0}.bind(this))},this.toggleTargetEnabled=function(a,b){return wb("target",a,null,!0,b),this.isTargetEnabled(a,b)},this.isTarget=function(a,b){return b=b||"default",xb(a,function(a){var c=this.targetEndpointDefinitions[n(a).id];return null!=c&&null!=c[b]}.bind(this))},this.isTargetEnabled=function(a,b){return b=b||"default",xb(a,function(a){var c=this.targetEndpointDefinitions[n(a).id];return c&&c[b]&&c[b].enabled===!0}.bind(this))},this.setTargetEnabled=function(a,b,c){return wb("target",a,b,null,c)},this.ready=function(a){f.bind("ready",a)};var yb=function(a,b){if("object"==typeof a&&a.length)for(var c=0,d=a.length;d>c;c++)b(a[c]);else b(a);return f};this.repaint=function(a,b,c){return yb(a,function(a){K(a,b,c)})},this.revalidate=function(a,b,c){return yb(a,function(a){var d=c?a:f.getId(a);f.updateOffset({elId:d,recalc:!0,timestamp:b}),f.repaint(a)})},this.repaintEverything=function(){var a,b=e();for(a in w)f.updateOffset({elId:a,recalc:!0,timestamp:b});for(a in w)K(a,null,b);return this},this.removeAllEndpoints=function(a,b,c){c=c||[];var d=function(a){var e,g,h=n(a),i=w[h.id];if(i)for(c.push(h),e=0,g=i.length;g>e;e++)f.deleteEndpoint(i[e],!1);if(delete w[h.id],b&&h.el&&3!=h.el.nodeType&&8!=h.el.nodeType)for(e=0,g=h.el.childNodes.length;g>e;e++)d(h.el.childNodes[e])};return d(a),this};var zb=function(a,b){f.removeAllEndpoints(a.id,!0,b);for(var c=function(a){f.getDragManager().elementRemoved(a.id),f.anchorManager.clearFor(a.id),f.anchorManager.removeFloatingConnection(a.id),delete f.floatingConnections[a.id],delete y[a.id],delete z[a.id],a.el&&(f.removeElement(a.el),a.el._jsPlumb=null)},d=1;d<b.length;d++)c(b[d]);c(a)};this.remove=function(a,b){var c=n(a),d=[];return c.text?c.el.parentNode.removeChild(c.el):c.id&&f.batch(function(){zb(c,d)},b===!1),f},this.empty=function(a,b){var c=[],d=function(a,b){var e=n(a);if(e.text)e.el.parentNode.removeChild(e.el);else if(e.el){for(;e.el.childNodes.length>0;)d(e.el.childNodes[0]);b||zb(e,c)}};return f.batch(function(){d(a,!0)},b===!1),f},this.reset=function(){f.silently(function(){f.deleteEveryEndpoint(),f.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},v.length=0,this.doReset&&this.doReset()}.bind(this))};var Ab=function(a){a.canvas&&a.canvas.parentNode&&a.canvas.parentNode.removeChild(a.canvas),a.cleanup(),a.destroy()};this.clear=function(){f.select().each(Ab),f.selectEndpoints().each(Ab),w={},x={}},this.setDefaultScope=function(a){return G=a,f},this.setDraggable=T,this.deriveEndpointAndAnchorSpec=function(a,b){for(var c=((b?"":"default ")+a).split(/[\s]/),d=null,e=null,g=null,h=null,i=0;i<c.length;i++){var j=f.getType(c[i],"connection");j&&(j.endpoints&&(d=j.endpoints),j.endpoint&&(e=j.endpoint),j.anchors&&(h=j.anchors),j.anchor&&(g=j.anchor))}return{endpoints:d?d:[e,e],anchors:h?h:[g,g]}},this.setId=function(a,b,c){var d;jsPlumbUtil.isString(a)?d=a:(a=this.getElement(a),d=this.getId(a));var e=this.getConnections({source:d,scope:"*"},!0),f=this.getConnections({target:d,scope:"*"},!0);b=""+b,c?a=this.getElement(b):(a=this.getElement(d),this.setAttribute(a,"id",b)),w[b]=w[d]||[];for(var g=0,h=w[b].length;h>g;g++)w[b][g].setElementId(b),w[b][g].setReferenceElement(a);delete w[d],this.sourceEndpointDefinitions[b]=this.sourceEndpointDefinitions[d],delete this.sourceEndpointDefinitions[d],this.targetEndpointDefinitions[b]=this.targetEndpointDefinitions[d],delete this.targetEndpointDefinitions[d],this.anchorManager.changeId(d,b),this.getDragManager().changeId(d,b),y[b]=y[d],delete y[d];var i=function(c,d,e){for(var f=0,g=c.length;g>f;f++)c[f].endpoints[d].setElementId(b),c[f].endpoints[d].setReferenceElement(a),c[f][e+"Id"]=b,c[f][e]=a};i(e,0,"source"),i(f,1,"target"),this.repaint(b)},this.setDebugLog=function(a){t=a},this.setSuspendDrawing=function(a,b){var c=E;return E=a,F=a?(new Date).getTime():null,b&&this.repaintEverything(),c},this.isSuspendDrawing=function(){return E},this.getSuspendedAt=function(){return F},this.batch=function(a,b){var c=this.isSuspendDrawing();c||this.setSuspendDrawing(!0);try{a()}catch(e){d.log("Function run while suspended failed",e)}c||this.setSuspendDrawing(!1,!b)},this.doWhileSuspended=this.batch,this.getCachedData=X,this.timestamp=e,this.show=function(a,b){return U(a,"block",b),f},this.toggleVisible=W,this.toggleDraggable=V,this.addListener=this.bind};jsPlumbUtil.extend(q,jsPlumbUtil.EventGenerator,{setAttribute:function(a,b,c){this.setAttribute(a,b,c)},getAttribute:function(a,b){return this.getAttribute(r.getElement(a),b)},convertToFullOverlaySpec:function(a){return jsPlumbUtil.isString(a)&&(a=[a,{}]),a[1].id=a[1].id||jsPlumbUtil.uuid(),a},registerConnectionType:function(a,b){if(this._connectionTypes[a]=r.extend({},b),b.overlays){for(var c={},d=0;d<b.overlays.length;d++){var e=this.convertToFullOverlaySpec(b.overlays[d]);c[e[1].id]=e}this._connectionTypes[a].overlays=c}},registerConnectionTypes:function(a){for(var b in a)this.registerConnectionType(b,a[b])},registerEndpointType:function(a,b){if(this._endpointTypes[a]=r.extend({},b),b.overlays){for(var c={},d=0;d<b.overlays.length;d++){var e=this.convertToFullOverlaySpec(b.overlays[d]);c[e[1].id]=e}this._endpointTypes[a].overlays=c}},registerEndpointTypes:function(a){for(var b in a)this.registerEndpointType(b,a[b])},getType:function(a,b){return"connection"===b?this._connectionTypes[a]:this._endpointTypes[a]},setIdChanged:function(a,b){this.setId(a,b,!0)},setParent:function(a,b){var c=this.getElement(a),d=this.getId(c),e=this.getElement(b),f=this.getId(e);c.parentNode.removeChild(c),e.appendChild(c),this.getDragManager().setParent(c,d,e,f)},extend:function(a,b,c){var d;if(c)for(d=0;d<c.length;d++)a[c[d]]=b[c[d]];else for(d in b)a[d]=b[d];return a},floatingConnections:{},getFloatingAnchorIndex:function(a){return a.endpoints[0].isFloating()?0:a.endpoints[1].isFloating()?1:-1}});var r=new q;"undefined"!=typeof window&&(window.jsPlumb=r),r.getInstance=function(a){var b=new q(a);return b.init(),b},r.each=function(a,b){if(null!=a)if("string"==typeof a)b(r.getElement(a));else if(null!=a.length)for(var c=0;c<a.length;c++)b(r.getElement(a[c]));else b(a)},"function"==typeof define&&(define("jsplumb",[],function(){return r}),define("jsplumbinstance",[],function(){return r.getInstance()})),"undefined"!=typeof exports&&(exports.jsPlumb=r)}.call(this),function(){var a=this;a.jsPlumbUtil;var b=(!!window.SVGAngle||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),function(a,b){if(null==a)return[0,0];var c=g(a),d=f(c,0);return[d[b+"X"],d[b+"Y"]]}),c=function(a){return null==a?[0,0]:b(a,"page")},d=function(a){return b(a,"screen")},e=function(a){return b(a,"client")},f=function(a,b){return a.item?a.item(b):a[b]},g=function(a){return a.touches&&a.touches.length>0?a.touches:a.changedTouches&&a.changedTouches.length>0?a.changedTouches:a.targetTouches&&a.targetTouches.length>0?a.targetTouches:[a]},h=function(a){var b={},c=[],d={},e={},f={};this.register=function(g){var h=a.getId(g),i=a.getOffset(g);b[h]||(b[h]=g,c.push(g),d[h]={});var j=function(b){if(b)for(var c=0;c<b.childNodes.length;c++)if(3!=b.childNodes[c].nodeType&&8!=b.childNodes[c].nodeType){var g=jsPlumb.getElement(b.childNodes[c]),k=a.getId(b.childNodes[c],null,!0);if(k&&e[k]&&e[k]>0){var l=a.getOffset(g);d[h][k]={id:k,offset:{left:l.left-i.left,top:l.top-i.top}},f[k]=h}j(b.childNodes[c])}};j(g)},this.updateOffsets=function(b){if(null!=b){var c=jsPlumb.getElement(b),e=a.getId(c),g=d[e],h=a.getOffset(c);if(g)for(var i in g)if(g.hasOwnProperty(i)){var j=jsPlumb.getElement(i),k=a.getOffset(j);d[e][i]={id:i,offset:{left:k.left-h.left,top:k.top-h.top}},f[i]=e}} },this.endpointAdded=function(c,g){g=g||a.getId(c);var h=document.body,i=c.parentNode;for(e[g]=e[g]?e[g]+1:1;null!=i&&i!=h;){var j=a.getId(i,null,!0);if(j&&b[j]){var k=a.getOffset(i);if(null==d[j][g]){var l=a.getOffset(c);d[j][g]={id:g,offset:{left:l.left-k.left,top:l.top-k.top}},f[g]=j}break}i=i.parentNode}},this.endpointDeleted=function(a){if(e[a.elementId]&&(e[a.elementId]--,e[a.elementId]<=0))for(var b in d)d.hasOwnProperty(b)&&d[b]&&(delete d[b][a.elementId],delete f[a.elementId])},this.changeId=function(a,b){d[b]=d[a],d[a]={},f[b]=f[a],f[a]=null},this.getElementsForDraggable=function(a){return d[a]},this.elementRemoved=function(a){var b=f[a];b&&(delete d[b][a],delete f[a])},this.reset=function(){b={},c=[],d={},e={}},this.dragEnded=function(b){var c=a.getId(b),d=f[c];d&&this.updateOffsets(d)},this.setParent=function(b,c,e,g){var h=f[c];if(h){d[g]||(d[g]={}),d[g][c]=d[h][c],delete d[h][c];var i=a.getOffset(e),j=a.getOffset(b);d[g][c].offset={left:j.left-i.left,top:j.top-i.top},f[c]=g}},this.getDragAncestor=function(b){var c=jsPlumb.getElement(b),d=a.getId(c),e=f[d];return e?jsPlumb.getElement(e):null}},i=function(a){return null==a?null:a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},j=function(a,b){b=i(b),"undefined"!=typeof a.className.baseVal?a.className.baseVal=b:a.className=b},k=function(a){return"undefined"==typeof a.className.baseVal?a.className:a.className.baseVal},l=function(a,b,c){b=null==b?[]:jsPlumbUtil.isArray(b)?b:b.split(/\s+/),c=null==c?[]:jsPlumbUtil.isArray(c)?c:c.split(/\s+/);var d=k(a),e=d.split(/\s+/),f=function(a,b){for(var c=0;c<b.length;c++)if(a)-1==e.indexOf(b[c])&&e.push(b[c]);else{var d=e.indexOf(b[c]);-1!=d&&e.splice(d,1)}};f(!0,b),f(!1,c),j(a,e.join(" "))};jsPlumb.extend(jsPlumbInstance.prototype,{headless:!1,pageLocation:c,screenLocation:d,clientLocation:e,getDragManager:function(){return null==this.dragManager&&(this.dragManager=new h(this)),this.dragManager},recalculateOffsets:function(a){this.getDragManager().updateOffsets(a)},createElement:function(a,b,c,d){return this.createElementNS(null,a,b,c,d)},createElementNS:function(a,b,c,d,e){var f,g=null==a?document.createElement(b):document.createElementNS(a,b);c=c||{};for(f in c)g.style[f]=c[f];d&&(g.className=d),e=e||{};for(f in e)g.setAttribute(f,""+e[f]);return g},getAttribute:function(a,b){return null!=a.getAttribute?a.getAttribute(b):null},setAttribute:function(a,b,c){null!=a.setAttribute&&a.setAttribute(b,c)},setAttributes:function(a,b){for(var c in b)b.hasOwnProperty(c)&&a.setAttribute(c,b[c])},appendToRoot:function(a){document.body.appendChild(a)},getRenderModes:function(){return["svg"]},getClass:k,addClass:function(a,b){jsPlumb.each(a,function(a){l(a,b)})},hasClass:function(a,b){return a=jsPlumb.getElement(a),a.classList?a.classList.contains(b):-1!=k(a).indexOf(b)},removeClass:function(a,b){jsPlumb.each(a,function(a){l(a,null,b)})},updateClasses:function(a,b,c){jsPlumb.each(a,function(a){l(a,b,c)})},setClass:function(a,b){jsPlumb.each(a,function(a){j(a,b)})},setPosition:function(a,b){a.style.left=b.left+"px",a.style.top=b.top+"px"},getPosition:function(a){var b=function(b){var c=a.style[b];return c?c.substring(0,c.length-2):0};return{left:b("left"),top:b("top")}},getStyle:function(a,b){return"undefined"!=typeof window.getComputedStyle?getComputedStyle(a,null).getPropertyValue(b):a.currentStyle[b]},getSelector:function(a,b){var c=null;return c=1==arguments.length?null!=a.nodeType?a:document.querySelectorAll(a):a.querySelectorAll(b)},getOffset:function(a,b,c){a=jsPlumb.getElement(a),c=c||this.getContainer();for(var d={left:a.offsetLeft,top:a.offsetTop},e=b||null!=c&&a!=c&&a.offsetParent!=c?a.offsetParent:null,f=function(a){null!=a&&a!==document.body&&(a.scrollTop>0||a.scrollLeft>0)&&(d.left-=a.scrollLeft,d.top-=a.scrollTop)}.bind(this);null!=e;)d.left+=e.offsetLeft,d.top+=e.offsetTop,f(e),e=b?e.offsetParent:e.offsetParent==c?null:e.offsetParent;if(null!=c&&!b&&(c.scrollTop>0||c.scrollLeft>0)){var g=null!=a.offsetParent?this.getStyle(a.offsetParent,"position"):"static",h=this.getStyle(a,"position");"absolute"!==h&&"fixed"!==h&&"absolute"!==g&&"fixed"!=g&&(d.left-=c.scrollLeft,d.top-=c.scrollTop)}return d},getPositionOnElement:function(a,b,c){var d="undefined"!=typeof b.getBoundingClientRect?b.getBoundingClientRect():{left:0,top:0,width:0,height:0},e=document.body,f=document.documentElement,g=window.pageYOffset||f.scrollTop||e.scrollTop,h=window.pageXOffset||f.scrollLeft||e.scrollLeft,i=f.clientTop||e.clientTop||0,j=f.clientLeft||e.clientLeft||0,k=0,l=0,m=d.top+g-i+k*c,n=d.left+h-j+l*c,o=jsPlumb.pageLocation(a),p=d.width||b.offsetWidth*c,q=d.height||b.offsetHeight*c,r=(o[0]-n)/p,s=(o[1]-m)/q;return[r,s]},getAbsolutePosition:function(a){var b=function(b){var c=a.style[b];return c?parseFloat(c.substring(0,c.length-2)):void 0};return[b("left"),b("top")]},setAbsolutePosition:function(a,b,c,d){c?this.animate(a,{left:"+="+(b[0]-c[0]),top:"+="+(b[1]-c[1])},d):(a.style.left=b[0]+"px",a.style.top=b[1]+"px")},getSize:function(a){return[a.offsetWidth,a.offsetHeight]},getWidth:function(a){return a.offsetWidth},getHeight:function(a){return a.offsetHeight}})}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d="__label",e=function(a,c){var e={cssClass:c.cssClass,labelStyle:a.labelStyle,id:d,component:a,_jsPlumb:a._jsPlumb.instance},f=jsPlumb.extend(e,c);return new(b.Overlays[a._jsPlumb.instance.getRenderMode()].Label)(f)},f=function(a,d){var e=null;if(c.isArray(d)){var f=d[0],g=b.extend({component:a,_jsPlumb:a._jsPlumb.instance},d[1]);3==d.length&&b.extend(g,d[2]),e=new(b.Overlays[a._jsPlumb.instance.getRenderMode()][f])(g)}else e=d.constructor==String?new(b.Overlays[a._jsPlumb.instance.getRenderMode()][d])({component:a,_jsPlumb:a._jsPlumb.instance}):d;return e.id=e.id||c.uuid(),a.cacheTypeItem("overlay",e,e.id),a._jsPlumb.overlays[e.id]=e,e};b.OverlayCapableJsPlumbUIComponent=function(a){jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.overlays={},this._jsPlumb.overlayPositions={},a.label&&(this.getDefaultType().overlays[d]=["Label",{label:a.label,location:a.labelLocation||this.defaultLabelLocation||.5,labelStyle:a.labelStyle||this._jsPlumb.instance.Defaults.LabelStyle,id:d}]),this.setListenerComponent=function(a){if(this._jsPlumb)for(var b in this._jsPlumb.overlays)this._jsPlumb.overlays[b].setListenerComponent(a)}},b.OverlayCapableJsPlumbUIComponent.applyType=function(a,b){if(b.overlays){var c,d={};for(c in b.overlays){var e=a._jsPlumb.overlays[b.overlays[c][1].id];if(e)e.updateFrom(b.overlays[c][1]),d[b.overlays[c][1].id]=!0;else{var f=a.getCachedTypeItem("overlay",b.overlays[c][1].id);null!=f?(f.reattach(a._jsPlumb.instance),f.updateFrom(b.overlays[c][1]),a._jsPlumb.overlays[f.id]=f):f=a.addOverlay(b.overlays[c],!0),d[f.id]=!0}}for(c in a._jsPlumb.overlays)null==d[a._jsPlumb.overlays[c].id]&&a.removeOverlay(a._jsPlumb.overlays[c].id)}},c.extend(b.OverlayCapableJsPlumbUIComponent,jsPlumbUIComponent,{setHover:function(a){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged())for(var b in this._jsPlumb.overlays)this._jsPlumb.overlays[b][a?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)},addOverlay:function(a,b){var c=f(this,a);return b||this.repaint(),c},getOverlay:function(a){return this._jsPlumb.overlays[a]},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(a){var b=this.getOverlay(a);b&&b.hide()},hideOverlays:function(){for(var a in this._jsPlumb.overlays)this._jsPlumb.overlays[a].hide()},showOverlay:function(a){var b=this.getOverlay(a);b&&b.show()},showOverlays:function(){for(var a in this._jsPlumb.overlays)this._jsPlumb.overlays[a].show()},removeAllOverlays:function(a){for(var b in this._jsPlumb.overlays)this._jsPlumb.overlays[b].cleanup&&this._jsPlumb.overlays[b].cleanup();this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null,a||this.repaint()},removeOverlay:function(a){var b=this._jsPlumb.overlays[a];b&&(b.cleanup&&b.cleanup(),delete this._jsPlumb.overlays[a],this._jsPlumb.overlayPositions&&delete this._jsPlumb.overlayPositions[a])},removeOverlays:function(){for(var a=0,b=arguments.length;b>a;a++)this.removeOverlay(arguments[a])},moveParent:function(a){if(this.bgCanvas&&(this.bgCanvas.parentNode.removeChild(this.bgCanvas),a.appendChild(this.bgCanvas)),this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas),a.appendChild(this.canvas);for(var b in this._jsPlumb.overlays)if(this._jsPlumb.overlays[b].isAppendedAtTopLevel){var c=this._jsPlumb.overlays[b].getElement();c.parentNode.removeChild(c),a.appendChild(c)}} },getLabel:function(){var a=this.getOverlay(d);return null!=a?a.getLabel():null},getLabelOverlay:function(){return this.getOverlay(d)},setLabel:function(a){var b=this.getOverlay(d);if(b)a.constructor==String||a.constructor==Function?b.setLabel(a):(a.label&&b.setLabel(a.label),a.location&&b.setLocation(a.location));else{var c=a.constructor==String||a.constructor==Function?{label:a}:a;b=e(this,c),this._jsPlumb.overlays[d]=b}this._jsPlumb.instance.isSuspendDrawing()||this.repaint()},cleanup:function(a){for(var b in this._jsPlumb.overlays)this._jsPlumb.overlays[b].cleanup(a),this._jsPlumb.overlays[b].destroy(a);a&&(this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null)},setVisible:function(a){this[a?"showOverlays":"hideOverlays"]()},setAbsoluteOverlayPosition:function(a,b){this._jsPlumb.overlayPositions[a.id]=b},getAbsoluteOverlayPosition:function(a){return this._jsPlumb.overlayPositions?this._jsPlumb.overlayPositions[a.id]:null}})}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=function(a,b,c){var d=!1;return{drag:function(){if(d)return d=!1,!0;if(b.element){var e=c.getUIPosition(arguments,c.getZoom());jsPlumb.setPosition(b.element,e),c.repaint(b.element,e),a.paint({anchorPoint:a.anchor.getCurrentLocation({element:a.element})})}},stopDrag:function(){d=!0}} },e=function(a,b,c,d){var e=jsPlumb.createElement("div",{position:"absolute"});b.appendElement(e);var f=b.getId(e);jsPlumb.setPosition(e,c),e.style.width=d[0]+"px",e.style.height=d[1]+"px",b.manage(f,e,!0),a.id=f,a.element=e},f=function(a,c,d,e,f,g,h,i){var j=new b.FloatingAnchor({reference:c,referenceCanvas:e,jsPlumbInstance:g});return h({paintStyle:a,endpoint:d,anchor:j,source:f,scope:i})},g=["connectorStyle","connectorHoverStyle","connectorOverlays","connector","connectionType","connectorClass","connectorHoverClass"],h=function(a,b){var c=0;if(null!=b)for(var d=0;d<a.connections.length;d++)if(a.connections[d].sourceId==b||a.connections[d].targetId==b){c=d;break}return a.connections[c]};b.Endpoint=function(a){var i=a._jsPlumb,j=a.newConnection,k=a.newEndpoint;this.idPrefix="_jsplumb_e_",this.defaultLabelLocation=[.5,.5],this.defaultOverlayKeys=["Overlays","EndpointOverlays"],b.OverlayCapableJsPlumbUIComponent.apply(this,arguments),this.appendToDefaultType({connectionType:a.connectionType,maxConnections:null==a.maxConnections?this._jsPlumb.instance.Defaults.MaxConnections:a.maxConnections,paintStyle:a.endpointStyle||a.paintStyle||a.style||this._jsPlumb.instance.Defaults.EndpointStyle||b.Defaults.EndpointStyle,hoverPaintStyle:a.endpointHoverStyle||a.hoverPaintStyle||this._jsPlumb.instance.Defaults.EndpointHoverStyle||b.Defaults.EndpointHoverStyle,connectorStyle:a.connectorStyle,connectorHoverStyle:a.connectorHoverStyle,connectorClass:a.connectorClass,connectorHoverClass:a.connectorHoverClass,connectorOverlays:a.connectorOverlays,connector:a.connector,connectorTooltip:a.connectorTooltip}),this._jsPlumb.enabled=!(a.enabled===!1),this._jsPlumb.visible=!0,this.element=b.getElement(a.source),this._jsPlumb.uuid=a.uuid,this._jsPlumb.floatingEndpoint=null;var l=null;this._jsPlumb.uuid&&(a.endpointsByUUID[this._jsPlumb.uuid]=this),this.elementId=a.elementId,this.dragProxy=a.dragProxy,this._jsPlumb.connectionCost=a.connectionCost,this._jsPlumb.connectionsDirected=a.connectionsDirected,this._jsPlumb.currentAnchorClass="",this._jsPlumb.events={};var m=function(){var a=i.endpointAnchorClassPrefix+"-"+this._jsPlumb.currentAnchorClass;this._jsPlumb.currentAnchorClass=this.anchor.getCssClass();var b=i.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");this.removeClass(a),this.addClass(b),jsPlumb.updateClasses(this.element,b,a)}.bind(this);this.prepareAnchor=function(a){var b=this._jsPlumb.instance.makeAnchor(a,this.elementId,i);return b.bind("anchorChanged",function(a){this.fire("anchorChanged",{endpoint:this,anchor:a}),m()}.bind(this)),b},this.setPreparedAnchor=function(a,b){return this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId),this.anchor=a,m(),b||this._jsPlumb.instance.repaint(this.elementId),this},this.setAnchor=function(a,b){var c=this.prepareAnchor(a);return this.setPreparedAnchor(c,b),this};var n=function(a){if(this.connections.length>0)for(var b=0;b<this.connections.length;b++)this.connections[b].setHover(a,!1);else this.setHover(a)}.bind(this);this.bind("mouseover",function(){n(!0)}),this.bind("mouseout",function(){n(!1)}),a._transient||this._jsPlumb.instance.anchorManager.add(this,this.elementId),this.prepareEndpoint=function(d,e){var f,g=function(a,c){var d=i.getRenderMode();if(b.Endpoints[d][a])return new b.Endpoints[d][a](c);if(!i.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown endpoint type '"+a+"'"}},h={_jsPlumb:this._jsPlumb.instance,cssClass:a.cssClass,container:a.container,tooltip:a.tooltip,connectorTooltip:a.connectorTooltip,endpoint:this};return c.isString(d)?f=g(d,h):c.isArray(d)?(h=c.merge(d[1],h),f=g(d[0],h)):f=d.clone(),f.clone=function(){return c.isString(d)?g(d,h):c.isArray(d)?(h=c.merge(d[1],h),g(d[0],h)):void 0}.bind(this),f.typeId=e,f},this.setEndpoint=function(a){var b=this.prepareEndpoint(a);this.setPreparedEndpoint(b,!0)},this.setPreparedEndpoint=function(a){null!=this.endpoint&&(this.endpoint.cleanup(),this.endpoint.destroy()),this.endpoint=a,this.type=this.endpoint.type,this.canvas=this.endpoint.canvas},b.extend(this,a,g),this.isSource=a.isSource||!1,this.isTemporarySource=a.isTemporarySource||!1,this.isTarget=a.isTarget||!1,this.connections=a.connections||[],this.connectorPointerEvents=a["connector-pointer-events"],this.scope=a.scope||i.getDefaultScope(),this.timestamp=null,this.reattachConnections=a.reattach||i.Defaults.ReattachConnections,this.connectionsDetachable=i.Defaults.ConnectionsDetachable,(a.connectionsDetachable===!1||a.detachable===!1)&&(this.connectionsDetachable=!1),this.dragAllowedWhenFull=a.dragAllowedWhenFull!==!1,a.onMaxConnections&&this.bind("maxConnections",a.onMaxConnections),this.addConnection=function(a){this.connections.push(a),this[(this.connections.length>0?"add":"remove")+"Class"](i.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](i.endpointFullClass)},this.detachFromConnection=function(a,b,c){b=null==b?this.connections.indexOf(a):b,b>=0&&(this.connections.splice(b,1),this[(this.connections.length>0?"add":"remove")+"Class"](i.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](i.endpointFullClass)),!c&&this._deleteOnDetach&&0===this.connections.length&&i.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:!1})},this.detach=function(a,b,c,d,e,f,g){var h=null==g?this.connections.indexOf(a):g,j=!1;return d=d!==!1,h>=0&&(c||a._forceDetach||a.isDetachable()&&a.isDetachAllowed(a)&&this.isDetachAllowed(a)&&i.checkCondition("beforeDetach",a,f))&&(i.deleteObject({connection:a,fireEvent:!b&&d,originalEvent:e,deleteAttachedObjects:!1}),j=!0),j},this.detachAll=function(a,b){for(var c=[];this.connections.length>0;){var d=this.detach(this.connections[0],!1,b===!0,a!==!1,null,this,0);d||(c.push(this.connections[0]),this.connections.splice(0,1))}return this.connections=c,this},this.detachFrom=function(a,b,c){for(var d=[],e=0;e<this.connections.length;e++)(this.connections[e].endpoints[1]==a||this.connections[e].endpoints[0]==a)&&d.push(this.connections[e]);for(var f=0;f<d.length;f++)this.detach(d[f],!1,!0,b,c);return this},this.getElement=function(){return this.element},this.setElement=function(b){var d=this._jsPlumb.instance.getId(b),e=this.elementId;return c.removeWithFunction(a.endpointsByElement[this.elementId],function(a){return a.id==this.id}.bind(this)),this.element=jsPlumb.getElement(b),this.elementId=i.getId(this.element),i.anchorManager.rehomeEndpoint(this,e,this.element),i.dragManager.endpointAdded(this.element),c.addToList(a.endpointsByElement,d,this),this},this.makeInPlaceCopy=function(){var b=this.anchor.getCurrentLocation({element:this}),c=this.anchor.getOrientation(this),d=this.anchor.getCssClass(),e={bind:function(){},compute:function(){return[b[0],b[1]]},getCurrentLocation:function(){return[b[0],b[1]]},getOrientation:function(){return c},getCssClass:function(){return d}};return k({dropOptions:a.dropOptions,anchor:e,source:this.element,paintStyle:this.getPaintStyle(),endpoint:a.hideOnDrag?"Blank":this.endpoint,_transient:!0,scope:this.scope,reference:this})},this.connectorSelector=function(){var a=this.connections[0];return a?a:this.connections.length<this._jsPlumb.maxConnections||-1==this._jsPlumb.maxConnections?null:a},this.setStyle=this.setPaintStyle,this.paint=function(a){a=a||{};var b=a.timestamp,c=!(a.recalc===!1);if(!b||this.timestamp!==b){var d=i.updateOffset({elId:this.elementId,timestamp:b}),e=a.offset?a.offset.o:d.o;if(null!=e){var f=a.anchorPoint,g=a.connectorPaintStyle;if(null==f){var j=a.dimensions||d.s,k={xy:[e.left,e.top],wh:j,element:this,timestamp:b};if(c&&this.anchor.isDynamic&&this.connections.length>0){var l=h(this,a.elementWithPrecedence),m=l.endpoints[0]==this?1:0,n=0===m?l.sourceId:l.targetId,o=i.getCachedData(n),p=o.o,q=o.s;k.txy=[p.left,p.top],k.twh=q,k.tElement=l.endpoints[m]}f=this.anchor.compute(k)}this.endpoint.compute(f,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,g||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=b;for(var r in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(r)){var s=this._jsPlumb.overlays[r];s.isVisible()&&(this._jsPlumb.overlayPlacements[r]=s.draw(this.endpoint,this._jsPlumb.paintStyleInUse),s.paint(this._jsPlumb.overlayPlacements[r]))}} }},this.getTypeDescriptor=function(){return"endpoint"
},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var o=!1;this.initDraggable=function(){if(!o&&b.isDragSupported(this.element)){var g,h={id:null,element:null},m=null,n=!1,p=null,q=d(this,h,i),r=a.dragOptions||{},s={},t=b.dragEvents.start,u=b.dragEvents.stop,v=b.dragEvents.drag,w=b.dragEvents.beforeStart,x=function(a){g=a.e.payload||{}},y=function(){m=this.connectorSelector();var b=!0;this.isEnabled()||(b=!1),null!=m||this.isSource||this.isTemporarySource||(b=!1),!this.isSource||!this.isFull()||null!=m&&this.dragAllowedWhenFull||(b=!1),null==m||m.isDetachable(this)||(b=!1);var d=i.checkCondition(null==m?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:m});if(d===!1?b=!1:"object"==typeof d?jsPlumb.extend(d,g||{}):d=g||{},b===!1)return i.stopDrag&&i.stopDrag(this.canvas),q.stopDrag(),!1;for(var l=0;l<this.connections.length;l++)this.connections[l].setHover(!1);this.addClass("endpointDrag"),i.setConnectionBeingDragged(!0),m&&!this.isFull()&&this.isSource&&(m=null),i.updateOffset({elId:this.elementId});var o=this._jsPlumb.instance.getOffset(this.canvas),r=this.canvas,s=this._jsPlumb.instance.getSize(this.canvas);e(h,i,o,s),i.setAttributes(this.canvas,{dragId:h.id,elId:this.elementId});var t=this.dragProxy||this.endpoint;if(null==this.dragProxy&&null!=this.connectionType){var u=this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);u.endpoints[1]&&(t=u.endpoints[1])}var v=this._jsPlumb.instance.makeAnchor("Center");v.isFloating=!0,this._jsPlumb.floatingEndpoint=f(this.getPaintStyle(),v,t,this.canvas,h.element,i,k,this.scope);var w=this._jsPlumb.floatingEndpoint.anchor;if(null==m)this.setHover(!1,!1),m=j({sourceEndpoint:this,targetEndpoint:this._jsPlumb.floatingEndpoint,source:this.element,target:h.element,anchors:[this.anchor,this._jsPlumb.floatingEndpoint.anchor],paintStyle:a.connectorStyle,hoverPaintStyle:a.connectorHoverStyle,connector:a.connector,overlays:a.connectorOverlays,type:this.connectionType,cssClass:this.connectorClass,hoverClass:this.connectorHoverClass,data:d}),m.pending=!0,m.addClass(i.draggingClass),this._jsPlumb.floatingEndpoint.addClass(i.draggingClass),this._jsPlumb.floatingEndpoint.anchor=w,i.fire("connectionDrag",m),i.anchorManager.newConnection(m);else{n=!0,m.setHover(!1);var x=m.endpoints[0].id==this.id?0:1;this.detachFromConnection(m,null,!0);var y=i.getDragScope(r);i.setAttribute(this.canvas,"originalScope",y),i.fire("connectionDrag",m),0===x?(p=[m.source,m.sourceId,r,y],m.source=h.element,m.sourceId=h.id,i.anchorManager.sourceChanged(m.endpoints[x].elementId,m.sourceId,m)):(p=[m.target,m.targetId,r,y],m.target=h.element,m.targetId=h.id,i.anchorManager.updateOtherEndpoint(m.sourceId,m.endpoints[x].elementId,m.targetId,m)),m.suspendedEndpoint=m.endpoints[x],m.suspendedElement=m.endpoints[x].getElement(),m.suspendedElementId=m.endpoints[x].elementId,m.suspendedElementType=0===x?"source":"target",m.suspendedEndpoint.setHover(!1),this._jsPlumb.floatingEndpoint.referenceEndpoint=m.suspendedEndpoint,m.endpoints[x]=this._jsPlumb.floatingEndpoint,m.addClass(i.draggingClass),this._jsPlumb.floatingEndpoint.addClass(i.draggingClass)}i.floatingConnections[h.id]=m,c.addToList(a.endpointsByElement,h.id,this._jsPlumb.floatingEndpoint),i.currentlyDragging=!0}.bind(this),z=function(){if(i.setConnectionBeingDragged(!1),m&&null!=m.endpoints){var a=i.getDropEvent(arguments),b=i.getFloatingAnchorIndex(m);if(m.endpoints[0===b?1:0].anchor.locked=!1,m.removeClass(i.draggingClass),this._jsPlumb&&(m.deleteConnectionNow||m.endpoints[b]==this._jsPlumb.floatingEndpoint)&&n&&m.suspendedEndpoint){0===b?(m.floatingElement=m.source,m.floatingId=m.sourceId,m.floatingEndpoint=m.endpoints[0],m.floatingIndex=0,m.source=p[0],m.sourceId=p[1]):(m.floatingElement=m.target,m.floatingId=m.targetId,m.floatingEndpoint=m.endpoints[1],m.floatingIndex=1,m.target=p[0],m.targetId=p[1]);var c=this._jsPlumb.floatingEndpoint;i.setDragScope(p[2],p[3]),m.endpoints[b]=m.suspendedEndpoint,m.isReattach()||m._forceReattach||m._forceDetach||!m.endpoints[0===b?1:0].detach(m,!1,!1,!0,a,!0)?(m.setHover(!1),m._forceDetach=null,m._forceReattach=null,this._jsPlumb.floatingEndpoint.detachFromConnection(m),m.suspendedEndpoint.addConnection(m),1==b?i.anchorManager.updateOtherEndpoint(m.sourceId,m.floatingId,m.targetId,m):i.anchorManager.sourceChanged(m.floatingId,m.sourceId,m),i.repaint(p[1])):i.deleteObject({endpoint:c})}this.deleteAfterDragStop?i.deleteObject({endpoint:this}):this._jsPlumb&&this.paint({recalc:!1}),i.fire("connectionDragStop",m,a),i.currentlyDragging=!1,m=null}h&&h.element&&i.remove(h.element,!1,!1),l&&i.deleteObject({endpoint:l}),this._jsPlumb&&(this.canvas.style.visibility="visible",this.anchor.locked=!1,this._jsPlumb.floatingEndpoint=null)}.bind(this);r=b.extend(s,r),r.scope=this.scope||r.scope,r[w]=c.wrap(r[w],x,!1),r[t]=c.wrap(r[t],y,!1),r[v]=c.wrap(r[v],q.drag),r[u]=c.wrap(r[u],z),r.multipleDrop=!1,r.canDrag=function(){return this.isSource||this.isTemporarySource||this.connections.length>0}.bind(this),i.initDraggable(this.canvas,r,"internal"),this.canvas._jsPlumbRelatedElement=this.element,o=!0}};var p=a.endpoint||this._jsPlumb.instance.Defaults.Endpoint||b.Defaults.Endpoint;this.setEndpoint(p,!0);var q=a.anchor?a.anchor:a.anchors?a.anchors:i.Defaults.Anchor||"Top";this.setAnchor(q,!0);var r=["default",a.type||""].join(" ");this.addType(r,a.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var s=function(d,e,f,g){if(b.isDropSupported(this.element)){var h=a.dropOptions||i.Defaults.DropOptions||b.Defaults.DropOptions;h=b.extend({},h),h.scope=h.scope||this.scope;var j=b.dragEvents.drop,k=b.dragEvents.over,l=b.dragEvents.out,m=this,n=i.EndpointDropHandler({getEndpoint:function(){return m},jsPlumb:i,enabled:function(){return null!=f?f.isEnabled():!0},isFull:function(){return f.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(a){m.addClass(a)},removeClass:function(a){m.removeClass(a)},isDropAllowed:function(){return m.isDropAllowed.apply(m,arguments)},reference:g,isRedrop:function(a,b){return a.suspendedEndpoint&&b.reference&&a.suspendedEndpoint.id===b.reference.id}});h[j]=c.wrap(h[j],n,!0),h[k]=c.wrap(h[k],function(){var a=b.getDragObject(arguments),c=i.getAttribute(b.getElement(a),"dragId"),d=i.floatingConnections[c];if(null!=d){var e=i.getFloatingAnchorIndex(d),f=this.isTarget&&0!==e||d.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==d.suspendedEndpoint.id;if(f){var g=i.checkCondition("checkDropAllowed",{sourceEndpoint:d.endpoints[e],targetEndpoint:this,connection:d});this[(g?"add":"remove")+"Class"](i.endpointDropAllowedClass),this[(g?"remove":"add")+"Class"](i.endpointDropForbiddenClass),d.endpoints[e].anchor.over(this.anchor,this)}} }.bind(this)),h[l]=c.wrap(h[l],function(){var a=b.getDragObject(arguments),c=null==a?null:i.getAttribute(b.getElement(a),"dragId"),d=c?i.floatingConnections[c]:null;if(null!=d){var e=i.getFloatingAnchorIndex(d),f=this.isTarget&&0!==e||d.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id==d.suspendedEndpoint.id;f&&(this.removeClass(i.endpointDropAllowedClass),this.removeClass(i.endpointDropForbiddenClass),d.endpoints[e].anchor.out())}}.bind(this)),i.initDroppable(d,h,"internal",e)}}.bind(this);return this.anchor.isFloating||s(this.canvas,!(a._transient||this.anchor.isFloating),this,a.reference),this},c.extend(b.Endpoint,b.OverlayCapableJsPlumbUIComponent,{setVisible:function(a,b,c){if(this._jsPlumb.visible=a,this.canvas&&(this.canvas.style.display=a?"block":"none"),this[a?"showOverlays":"hideOverlays"](),!b)for(var d=0;d<this.connections.length;d++)if(this.connections[d].setVisible(a),!c){var e=this===this.connections[d].endpoints[0]?1:0;1==this.connections[d].endpoints[e].connections.length&&this.connections[d].endpoints[e].setVisible(a,!0,!0)}},getAttachedElements:function(){return this.connections},applyType:function(a,c){this.setPaintStyle(a.endpointStyle||a.paintStyle,c),this.setHoverPaintStyle(a.endpointHoverStyle||a.hoverPaintStyle,c),null!=a.maxConnections&&(this._jsPlumb.maxConnections=a.maxConnections),a.scope&&(this.scope=a.scope),b.extend(this,a,g),null!=a.cssClass&&this.canvas&&this._jsPlumb.instance.addClass(this.canvas,a.cssClass),b.OverlayCapableJsPlumbUIComponent.applyType(this,a)},isEnabled:function(){return this._jsPlumb.enabled},setEnabled:function(a){this._jsPlumb.enabled=a},cleanup:function(){var a=this._jsPlumb.instance.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");jsPlumb.removeClass(this.element,a),this.anchor=null,this.endpoint.cleanup(!0),this.endpoint.destroy(),this.endpoint=null,this._jsPlumb.instance.destroyDraggable(this.canvas,"internal"),this._jsPlumb.instance.destroyDroppable(this.canvas,"internal")},setHover:function(a){this.endpoint&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()&&this.endpoint.setHover(a)},isFull:function(){return 0===this._jsPlumb.maxConnections?!0:!(this.isFloating()||this._jsPlumb.maxConnections<0||this.connections.length<this._jsPlumb.maxConnections)},isFloating:function(){return null!=this.anchor&&this.anchor.isFloating},isConnectedTo:function(a){var b=!1;if(a)for(var c=0;c<this.connections.length;c++)if(this.connections[c].endpoints[1]==a||this.connections[c].endpoints[0]==a){b=!0;break}return b},getConnectionCost:function(){return this._jsPlumb.connectionCost},setConnectionCost:function(a){this._jsPlumb.connectionCost=a},areConnectionsDirected:function(){return this._jsPlumb.connectionsDirected},setConnectionsDirected:function(a){this._jsPlumb.connectionsDirected=a},setElementId:function(a){this.elementId=a,this.anchor.elementId=a},setReferenceElement:function(a){this.element=b.getElement(a)},setDragAllowedWhenFull:function(a){this.dragAllowedWhenFull=a},equals:function(a){return this.anchor.equals(a.anchor)},getUuid:function(){return this._jsPlumb.uuid},computeAnchor:function(a){return this.anchor.compute(a)}}),a.jsPlumbInstance.prototype.EndpointDropHandler=function(a){return function(b){var c=a.jsPlumb;a.removeClass(c.endpointDropAllowedClass),a.removeClass(c.endpointDropForbiddenClass);var d=c.getDropEvent(arguments),e=c.getDragObject(arguments),f=c.getAttribute(e,"dragId"),g=(c.getAttribute(e,"elId"),c.getAttribute(e,"originalScope")),h=c.floatingConnections[f];if(null!=h){var i=null!=h.suspendedEndpoint;if(!i||null!=h.suspendedEndpoint._jsPlumb){var j=a.getEndpoint(h);if(null!=j){if(a.isRedrop(h,a))return h._forceReattach=!0,h.setHover(!1),a.maybeCleanup&&a.maybeCleanup(j),void 0;var k=c.getFloatingAnchorIndex(h);if(0===k&&!a.isSource||1===k&&!a.isTarget)return a.maybeCleanup&&a.maybeCleanup(j),void 0;a.onDrop&&a.onDrop(h),g&&c.setDragScope(e,g);var l=a.isFull(b);if(l&&j.fire("maxConnections",{endpoint:this,connection:h,maxConnections:j._jsPlumb.maxConnections},d),!l&&a.enabled()){var m=!0;0===k?(h.floatingElement=h.source,h.floatingId=h.sourceId,h.floatingEndpoint=h.endpoints[0],h.floatingIndex=0,h.source=a.element,h.sourceId=a.elementId):(h.floatingElement=h.target,h.floatingId=h.targetId,h.floatingEndpoint=h.endpoints[1],h.floatingIndex=1,h.target=a.element,h.targetId=a.elementId),i&&h.suspendedEndpoint.id!=j.id&&(h.isDetachAllowed(h)&&h.endpoints[k].isDetachAllowed(h)&&h.suspendedEndpoint.isDetachAllowed(h)&&c.checkCondition("beforeDetach",h)||(m=!1));var n=function(a){h.endpoints[k].detachFromConnection(h),h.suspendedEndpoint&&h.suspendedEndpoint.detachFromConnection(h),h.endpoints[k]=j,j.addConnection(h);var b=j.getParameters();for(var e in b)h.setParameter(e,b[e]);if(i){var f=h.suspendedEndpoint.elementId;c.fireMoveEvent({index:k,originalSourceId:0===k?f:h.sourceId,newSourceId:0===k?j.elementId:h.sourceId,originalTargetId:1==k?f:h.targetId,newTargetId:1==k?j.elementId:h.targetId,originalSourceEndpoint:0===k?h.suspendedEndpoint:h.endpoints[0],newSourceEndpoint:0===k?j:h.endpoints[0],originalTargetEndpoint:1==k?h.suspendedEndpoint:h.endpoints[1],newTargetEndpoint:1==k?j:h.endpoints[1],connection:h},d)}else b.draggable&&c.initDraggable(this.element,dragOptions,"internal",c);if(1==k?c.anchorManager.updateOtherEndpoint(h.sourceId,h.floatingId,h.targetId,h):c.anchorManager.sourceChanged(h.floatingId,h.sourceId,h),h.endpoints[0].finalEndpoint){var g=h.endpoints[0];g.detachFromConnection(h),h.endpoints[0]=h.endpoints[0].finalEndpoint,h.endpoints[0].addConnection(h)}jsPlumbUtil.isObject(a)&&h.mergeData(a),c.finaliseConnection(h,null,d,!1),h.setHover(!1)}.bind(this),o=function(){h.suspendedEndpoint&&(h.endpoints[k]=h.suspendedEndpoint,h.setHover(!1),h._forceDetach=!0,0===k?(h.source=h.suspendedEndpoint.element,h.sourceId=h.suspendedEndpoint.elementId):(h.target=h.suspendedEndpoint.element,h.targetId=h.suspendedEndpoint.elementId),h.suspendedEndpoint.addConnection(h),1==k?c.anchorManager.updateOtherEndpoint(h.sourceId,h.floatingId,h.targetId,h):c.anchorManager.sourceChanged(h.floatingId,h.sourceId,h),c.repaint(h.sourceId),h._forceDetach=!1)};if(m=m&&a.isDropAllowed(h.sourceId,h.targetId,h.scope,h,j))return n(m),!0;o()}a.maybeCleanup&&a.maybeCleanup(j),c.currentlyDragging=!1}} }} }}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=function(a,c,d,e,f){if(!a.Defaults.DoNotThrowErrors&&null==jsPlumb.Connectors[c][d])throw{msg:"jsPlumb: unknown connector type '"+d+"'"};return new b.Connectors[c][d](e,f)},e=function(a,b,c){return a?c.makeAnchor(a,b,c):null},f=function(a,b,d,e){null!=b&&(b._jsPlumbConnections=b._jsPlumbConnections||{},e?delete b._jsPlumbConnections[a.id]:b._jsPlumbConnections[a.id]=!0,c.isEmpty(b._jsPlumbConnections)?d.removeClass(b,d.connectedClass):d.addClass(b,d.connectedClass))};b.Connection=function(a){var d=a.newEndpoint;this.id=a.id,this.connector=null,this.idPrefix="_jsplumb_c_",this.defaultLabelLocation=.5,this.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.previousConnection=a.previousConnection,this.source=b.getElement(a.source),this.target=b.getElement(a.target),a.sourceEndpoint&&(this.source=a.sourceEndpoint.getElement()),a.targetEndpoint&&(this.target=a.targetEndpoint.getElement()),b.OverlayCapableJsPlumbUIComponent.apply(this,arguments),this.sourceId=this._jsPlumb.instance.getId(this.source),this.targetId=this._jsPlumb.instance.getId(this.target),this.scope=a.scope,this.endpoints=[],this.endpointStyles=[];var e=this._jsPlumb.instance;e.manage(this.sourceId,this.source),e.manage(this.targetId,this.target),this._jsPlumb.visible=!0,this._jsPlumb.editable=a.editable===!0,this._jsPlumb.params={cssClass:a.cssClass,container:a.container,"pointer-events":a["pointer-events"],editorParams:a.editorParams,overlays:a.overlays},this._jsPlumb.lastPaintedAt=null,this.bind("mouseover",function(){this.setHover(!0)}.bind(this)),this.bind("mouseout",function(){this.setHover(!1)}.bind(this)),this.makeEndpoint=function(b,c,f,g){return f=f||this._jsPlumb.instance.getId(c),this.prepareEndpoint(e,d,this,g,b?0:1,a,c,f)},a.type&&(a.endpoints=this._jsPlumb.instance.deriveEndpointAndAnchorSpec(a.type).endpoints);var f=this.makeEndpoint(!0,this.source,this.sourceId,a.sourceEndpoint),g=this.makeEndpoint(!1,this.target,this.targetId,a.targetEndpoint);f&&c.addToList(a.endpointsByElement,this.sourceId,f),g&&c.addToList(a.endpointsByElement,this.targetId,g),this.scope||(this.scope=this.endpoints[0].scope),null!=a.deleteEndpointsOnDetach?(this.endpoints[0]._deleteOnDetach=a.deleteEndpointsOnDetach,this.endpoints[1]._deleteOnDetach=a.deleteEndpointsOnDetach):(this.endpoints[0]._doNotDeleteOnDetach||(this.endpoints[0]._deleteOnDetach=!0),this.endpoints[1]._doNotDeleteOnDetach||(this.endpoints[1]._deleteOnDetach=!0));var h=e.Defaults.ConnectionsDetachable;a.detachable===!1&&(h=!1),this.endpoints[0].connectionsDetachable===!1&&(h=!1),this.endpoints[1].connectionsDetachable===!1&&(h=!1);var i=a.reattach||this.endpoints[0].reattachConnections||this.endpoints[1].reattachConnections||e.Defaults.ReattachConnections;this.appendToDefaultType({detachable:h,rettach:i,paintStyle:this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||a.paintStyle||e.Defaults.PaintStyle||jsPlumb.Defaults.PaintStyle,hoverPaintStyle:this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||a.hoverPaintStyle||e.Defaults.HoverPaintStyle||jsPlumb.Defaults.HoverPaintStyle});var j=e.getSuspendedAt();if(!e.isSuspendDrawing()){var k=e.getCachedData(this.sourceId),l=k.o,m=k.s,n=e.getCachedData(this.targetId),o=n.o,p=n.s,q=j||e.timestamp(),r=this.endpoints[0].anchor.compute({xy:[l.left,l.top],wh:m,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[o.left,o.top],twh:p,tElement:this.endpoints[1],timestamp:q});this.endpoints[0].paint({anchorLoc:r,timestamp:q}),r=this.endpoints[1].anchor.compute({xy:[o.left,o.top],wh:p,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[l.left,l.top],twh:m,tElement:this.endpoints[0],timestamp:q}),this.endpoints[1].paint({anchorLoc:r,timestamp:q})}this.getTypeDescriptor=function(){return"connection"},this.getAttachedElements=function(){return this.endpoints},this.isDetachable=function(){return this._jsPlumb.detachable===!0},this.setDetachable=function(a){this._jsPlumb.detachable=a===!0},this.isReattach=function(){return this._jsPlumb.reattach===!0||this.endpoints[0].reattachConnections===!0||this.endpoints[1].reattachConnections===!0},this.setReattach=function(a){this._jsPlumb.reattach=a===!0},this._jsPlumb.cost=a.cost||this.endpoints[0].getConnectionCost(),this._jsPlumb.directed=a.directed,null==a.directed&&(this._jsPlumb.directed=this.endpoints[0].areConnectionsDirected());var s=jsPlumb.extend({},this.endpoints[1].getParameters());b.extend(s,this.endpoints[0].getParameters()),b.extend(s,this.getParameters()),this.setParameters(s),this.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||a.connector||e.Defaults.Connector||b.Defaults.Connector,!0);var t=null!=a.data&&jsPlumbUtil.isObject(a.data)?a.data:{};this.getData=function(){return t},this.setData=function(a){t=a||{}},this.mergeData=function(a){t=jsPlumb.extend(t,a)};var u=["default",this.endpoints[0].connectionType,this.endpoints[1].connectionType,a.type].join(" ");/[^\s]/.test(u)&&this.addType(u,a.data,!0),this.updateConnectedClass()},c.extend(b.Connection,b.OverlayCapableJsPlumbUIComponent,{applyType:function(a,c,d){null!=a.detachable&&this.setDetachable(a.detachable),null!=a.reattach&&this.setReattach(a.reattach),a.scope&&(this.scope=a.scope),null!=a.cssClass&&this.canvas&&this._jsPlumb.instance.addClass(this.canvas,a.cssClass);var e=null;a.anchor?(e=this.getCachedTypeItem("anchors",d.anchor),null==e&&(e=[this._jsPlumb.instance.makeAnchor(a.anchor),this._jsPlumb.instance.makeAnchor(a.anchor)],this.cacheTypeItem("anchors",e,d.anchor))):a.anchors&&(e=this.getCachedTypeItem("anchors",d.anchors),null==e&&(e=[this._jsPlumb.instance.makeAnchor(a.anchors[0]),this._jsPlumb.instance.makeAnchor(a.anchors[1])],this.cacheTypeItem("anchors",e,d.anchors))),null!=e&&(this.endpoints[0].anchor=e[0],this.endpoints[1].anchor=e[1],this.endpoints[1].anchor.isDynamic&&this._jsPlumb.instance.repaint(this.endpoints[1].elementId)),b.OverlayCapableJsPlumbUIComponent.applyType(this,a)},addClass:function(a,b){b&&(this.endpoints[0].addClass(a),this.endpoints[1].addClass(a),this.suspendedEndpoint&&this.suspendedEndpoint.addClass(a)),this.connector&&this.connector.addClass(a)},removeClass:function(a,b){b&&(this.endpoints[0].removeClass(a),this.endpoints[1].removeClass(a),this.suspendedEndpoint&&this.suspendedEndpoint.removeClass(a)),this.connector&&this.connector.removeClass(a)},isVisible:function(){return this._jsPlumb.visible},setVisible:function(a){this._jsPlumb.visible=a,this.connector&&this.connector.setVisible(a),this.repaint()},cleanup:function(){this.updateConnectedClass(!0),this.endpoints=null,this.source=null,this.target=null,null!=this.connector&&(this.connector.cleanup(!0),this.connector.destroy(!0)),this.connector=null},updateConnectedClass:function(a){f(this,this.source,this._jsPlumb.instance,a),f(this,this.target,this._jsPlumb.instance,a)},setHover:function(b){this.connector&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()&&(this.connector.setHover(b),a.jsPlumb[b?"addClass":"removeClass"](this.source,this._jsPlumb.instance.hoverSourceClass),a.jsPlumb[b?"addClass":"removeClass"](this.target,this._jsPlumb.instance.hoverTargetClass))},getUuids:function(){return[this.endpoints[0].getUuid(),this.endpoints[1].getUuid()]},getCost:function(){return this._jsPlumb.cost},setCost:function(a){this._jsPlumb.cost=a},isDirected:function(){return this._jsPlumb.directed===!0},getConnector:function(){return this.connector},prepareConnector:function(a,b){var e,f={_jsPlumb:this._jsPlumb.instance,cssClass:this._jsPlumb.params.cssClass,container:this._jsPlumb.params.container,"pointer-events":this._jsPlumb.params["pointer-events"]},g=this._jsPlumb.instance.getRenderMode();return c.isString(a)?e=d(this._jsPlumb.instance,g,a,f,this):c.isArray(a)&&(e=1==a.length?d(this._jsPlumb.instance,g,a[0],f,this):d(this._jsPlumb.instance,g,a[0],c.merge(a[1],f),this)),null!=b&&(e.typeId=b),e},setPreparedConnector:function(a,b,c,d){var e,f="";if(null!=this.connector&&(e=this.connector,f=e.getClass(),this.connector.cleanup(),this.connector.destroy()),this.connector=a,d&&this.cacheTypeItem("connector",a,d),this.canvas=this.connector.canvas,this.bgCanvas=this.connector.bgCanvas,this.addClass(f),this.canvas&&(this.canvas._jsPlumb=this),this.bgCanvas&&(this.bgCanvas._jsPlumb=this),null!=e)for(var g=this.getOverlays(),h=0;h<g.length;h++)g[h].transfer&&g[h].transfer(this.connector);c||this.setListenerComponent(this.connector),b||this.repaint()},setConnector:function(a,b,c,d){var e=this.prepareConnector(a,d);this.setPreparedConnector(e,b,c,d)},paint:function(a){if(!this._jsPlumb.instance.isSuspendDrawing()&&this._jsPlumb.visible){a=a||{};var b=a.timestamp,c=!1,d=c?this.sourceId:this.targetId,e=c?this.targetId:this.sourceId,f=c?0:1,g=c?1:0;if(null==b||b!=this._jsPlumb.lastPaintedAt){var h=this._jsPlumb.instance.updateOffset({elId:e}).o,i=this._jsPlumb.instance.updateOffset({elId:d}).o,j=this.endpoints[g],k=this.endpoints[f],l=j.anchor.getCurrentLocation({xy:[h.left,h.top],wh:[h.width,h.height],element:j,timestamp:b}),m=k.anchor.getCurrentLocation({xy:[i.left,i.top],wh:[i.width,i.height],element:k,timestamp:b});this.connector.resetBounds(),this.connector.compute({sourcePos:l,targetPos:m,sourceEndpoint:this.endpoints[g],targetEndpoint:this.endpoints[f],lineWidth:this._jsPlumb.paintStyleInUse.lineWidth,sourceInfo:h,targetInfo:i});var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(var o in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(o)){var p=this._jsPlumb.overlays[o];p.isVisible()&&(this._jsPlumb.overlayPlacements[o]=p.draw(this.connector,this._jsPlumb.paintStyleInUse,this.getAbsoluteOverlayPosition(p)),n.minX=Math.min(n.minX,this._jsPlumb.overlayPlacements[o].minX),n.maxX=Math.max(n.maxX,this._jsPlumb.overlayPlacements[o].maxX),n.minY=Math.min(n.minY,this._jsPlumb.overlayPlacements[o].minY),n.maxY=Math.max(n.maxY,this._jsPlumb.overlayPlacements[o].maxY))}var q=parseFloat(this._jsPlumb.paintStyleInUse.lineWidth||1)/2,r=parseFloat(this._jsPlumb.paintStyleInUse.lineWidth||0),s={xmin:Math.min(this.connector.bounds.minX-(q+r),n.minX),ymin:Math.min(this.connector.bounds.minY-(q+r),n.minY),xmax:Math.max(this.connector.bounds.maxX+(q+r),n.maxX),ymax:Math.max(this.connector.bounds.maxY+(q+r),n.maxY)};this.connector.paint(this._jsPlumb.paintStyleInUse,null,s);for(var t in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(t)){var u=this._jsPlumb.overlays[t];u.isVisible()&&u.paint(this._jsPlumb.overlayPlacements[t],s)}}this._jsPlumb.lastPaintedAt=b}},repaint:function(a){a=a||{},this.paint({elId:this.sourceId,recalc:!(a.recalc===!1),timestamp:a.timestamp})},prepareEndpoint:function(a,c,d,f,g,h,i,j){var k;if(f)d.endpoints[g]=f,f.addConnection(d);else{h.endpoints||(h.endpoints=[null,null]);var l=h.endpoints[g]||h.endpoint||a.Defaults.Endpoints[g]||jsPlumb.Defaults.Endpoints[g]||a.Defaults.Endpoint||jsPlumb.Defaults.Endpoint;h.endpointStyles||(h.endpointStyles=[null,null]),h.endpointHoverStyles||(h.endpointHoverStyles=[null,null]);var m=h.endpointStyles[g]||h.endpointStyle||a.Defaults.EndpointStyles[g]||jsPlumb.Defaults.EndpointStyles[g]||a.Defaults.EndpointStyle||jsPlumb.Defaults.EndpointStyle;null==m.fillStyle&&null!=h.paintStyle&&(m.fillStyle=h.paintStyle.strokeStyle),null==m.outlineColor&&null!=h.paintStyle&&(m.outlineColor=h.paintStyle.outlineColor),null==m.outlineWidth&&null!=h.paintStyle&&(m.outlineWidth=h.paintStyle.outlineWidth);var n=h.endpointHoverStyles[g]||h.endpointHoverStyle||a.Defaults.EndpointHoverStyles[g]||jsPlumb.Defaults.EndpointHoverStyles[g]||a.Defaults.EndpointHoverStyle||jsPlumb.Defaults.EndpointHoverStyle;null!=h.hoverPaintStyle&&(null==n&&(n={}),null==n.fillStyle&&(n.fillStyle=h.hoverPaintStyle.strokeStyle));var o=h.anchors?h.anchors[g]:h.anchor?h.anchor:e(a.Defaults.Anchors[g],j,a)||e(b.Defaults.Anchors[g],j,a)||e(a.Defaults.Anchor,j,a)||e(b.Defaults.Anchor,j,a),p=h.uuids?h.uuids[g]:null;k=c({paintStyle:m,hoverPaintStyle:n,endpoint:l,connections:[d],uuid:p,anchor:o,source:i,scope:h.scope,reattach:h.reattach||a.Defaults.ReattachConnections,detachable:h.detachable||a.Defaults.ConnectionsDetachable}),d.endpoints[g]=k,h.drawEndpoints===!1&&k.setVisible(!1,!0,!0)}return k}})}.call(this),function(){"use strict";var a=this,b=a.jsPlumbUtil,c=a.jsPlumb;c.AnchorManager=function(a){var d={},e={},f={},g={},h={HORIZONTAL:"horizontal",VERTICAL:"vertical",DIAGONAL:"diagonal",IDENTITY:"identity"},i=["left","top","right","bottom"],j={},k=this,l={},m=a.jsPlumbInstance,n={},o=function(a,b,c,d,e,f){if(a===b)return{orientation:h.IDENTITY,a:["top","top"]};var g=Math.atan2(d.centery-c.centery,d.centerx-c.centerx),j=Math.atan2(c.centery-d.centery,c.centerx-d.centerx),k=[],l={};!function(a,b){for(var c=0;c<a.length;c++)l[a[c]]={left:[b[c].left,b[c].centery],right:[b[c].right,b[c].centery],top:[b[c].centerx,b[c].top],bottom:[b[c].centerx,b[c].bottom]}}(["source","target"],[c,d]);for(var m=0;m<i.length;m++)for(var n=0;n<i.length;n++)m!=n&&k.push({source:i[m],target:i[n],dist:Biltong.lineLength(l.source[i[m]],l.target[i[n]])});k.sort(function(a,b){return a.dist<b.dist?-1:a.dist>b.dist?1:0});for(var o=k[0].source,p=k[0].target,q=0;q<k.length&&(o=!e.isContinuous||e.isEdgeSupported(k[q].source)?k[q].source:null,p=!f.isContinuous||f.isEdgeSupported(k[q].target)?k[q].target:null,null==o||null==p);q++);return{a:[o,p],theta:g,theta2:j}},p=function(a,b,c,d,e,f,g){for(var h=[],i=b[e?0:1]/(d.length+1),j=0;j<d.length;j++){var k=(j+1)*i,l=f*b[e?1:0];g&&(k=b[e?0:1]-k);var m=e?k:l,n=c[0]+m,o=m/b[0],p=e?l:k,q=c[1]+p,r=p/b[1];h.push([n,q,o,r,d[j][1],d[j][2]])}return h},q=function(a){return function(b,c){var d=!0;return d=a?b[0][0]<c[0][0]:b[0][0]>c[0][0],d===!1?-1:1}},r=function(a,b){var c=a[0][0]<0?-Math.PI-a[0][0]:Math.PI-a[0][0],d=b[0][0]<0?-Math.PI-b[0][0]:Math.PI-b[0][0];return c>d?1:a[0][1]>b[0][1]?1:-1},s={top:function(a,b){return a[0]>b[0]?1:-1},right:q(!0),bottom:q(!0),left:r},t=function(a,b){return a.sort(b)},u=function(a,b){var c=m.getCachedData(a),d=c.s,f=c.o,h=function(b,c,d,f,h,i,j){if(f.length>0)for(var k=t(f,s[b]),l="right"===b||"top"===b,m=p(b,c,d,k,h,i,l),n=function(a,b){e[a.id]=[b[0],b[1],b[2],b[3]],g[a.id]=j},o=0;o<m.length;o++){var q=m[o][4],r=q.endpoints[0].elementId===a,u=q.endpoints[1].elementId===a;r?n(q.endpoints[0],m[o]):u&&n(q.endpoints[1],m[o])}};h("bottom",d,[f.left,f.top],b.bottom,!0,1,[0,1]),h("top",d,[f.left,f.top],b.top,!0,0,[0,-1]),h("left",d,[f.left,f.top],b.left,!1,0,[-1,0]),h("right",d,[f.left,f.top],b.right,!1,1,[1,0])};this.reset=function(){d={},j={},l={}},this.addFloatingConnection=function(a,b){n[a]=b},this.removeFloatingConnection=function(a){delete n[a]},this.newConnection=function(a){var d=a.sourceId,e=a.targetId,f=a.endpoints,g=!0,h=function(h,i,k,l,m){d==e&&k.isContinuous&&(a._jsPlumb.instance.removeElement(f[1].canvas),g=!1),b.addToList(j,l,[m,i,k.constructor==c.DynamicAnchor])};h(0,f[0],f[0].anchor,e,a),g&&h(1,f[1],f[1].anchor,d,a)};var v=function(a){!function(a,c){if(a){var d=function(a){return a[4]==c};b.removeWithFunction(a.top,d),b.removeWithFunction(a.left,d),b.removeWithFunction(a.bottom,d),b.removeWithFunction(a.right,d)}}(l[a.elementId],a.id)};this.connectionDetached=function(a,c){var d=a.connection||a,e=a.sourceId,f=a.targetId,g=d.endpoints,h=function(a,c,d,e,f){b.removeWithFunction(j[e],function(a){return a[0].id==f.id})};h(1,g[1],g[1].anchor,e,d),h(0,g[0],g[0].anchor,f,d),d.floatingId&&(h(d.floatingIndex,d.floatingEndpoint,d.floatingEndpoint.anchor,d.floatingId,d),v(d.floatingEndpoint)),v(d.endpoints[0]),v(d.endpoints[1]),c||(k.redraw(d.sourceId),d.targetId!==d.sourceId&&k.redraw(d.targetId))},this.add=function(a,c){b.addToList(d,c,a)},this.changeId=function(a,b){j[b]=j[a],d[b]=d[a],delete j[a],delete d[a]},this.getConnectionsFor=function(a){return j[a]||[]},this.getEndpointsFor=function(a){return d[a]||[]},this.deleteEndpoint=function(a){b.removeWithFunction(d[a.elementId],function(b){return b.id==a.id}),v(a)},this.clearFor=function(a){delete d[a],d[a]=[]};var w=function(c,d,e,f,g,h,i,j,k,l,m,n){var o,p,q=-1,r=-1,s=f.endpoints[i],t=s.id,u=[1,0][i],v=[[d,e],f,g,h,t],w=c[k],x=s._continuousAnchorEdge?c[s._continuousAnchorEdge]:null;if(x){var y=b.findWithFunction(x,function(a){return a[4]==t});if(-1!=y)for(x.splice(y,1),o=0;o<x.length;o++)p=x[o][1],b.addWithFunction(m,p,function(a){return a.id==p.id}),b.addWithFunction(n,x[o][1].endpoints[i],function(a){return a.id==p.endpoints[i].id}),b.addWithFunction(n,x[o][1].endpoints[u],function(a){return a.id==p.endpoints[u].id})}for(o=0;o<w.length;o++)p=w[o][1],1==a.idx&&w[o][3]===h&&-1==r&&(r=o),b.addWithFunction(m,p,function(a){return a.id==p.id}),b.addWithFunction(n,w[o][1].endpoints[i],function(a){return a.id==p.endpoints[i].id}),b.addWithFunction(n,w[o][1].endpoints[u],function(a){return a.id==p.endpoints[u].id});if(-1!=q)w[q]=v;else{var z=j?-1!=r?r:0:w.length;w.splice(z,0,v)}s._continuousAnchorEdge=k};this.updateOtherEndpoint=function(a,d,e,f){var g=b.findWithFunction(j[a],function(a){return a[0].id===f.id}),h=b.findWithFunction(j[d],function(a){return a[0].id===f.id});-1!=g&&(j[a][g][0]=f,j[a][g][1]=f.endpoints[1],j[a][g][2]=f.endpoints[1].anchor.constructor==c.DynamicAnchor),h>-1&&(j[d].splice(h,1),b.addToList(j,e,[f,f.endpoints[0],f.endpoints[0].anchor.constructor==c.DynamicAnchor])),f.updateConnectedClass()},this.sourceChanged=function(a,d,e){if(a!==d){b.removeWithFunction(j[a],function(a){return a[0].id===e.id});var f=b.findWithFunction(j[e.targetId],function(a){return a[0].id===e.id});f>-1&&(j[e.targetId][f][0]=e,j[e.targetId][f][1]=e.endpoints[0],j[e.targetId][f][2]=e.endpoints[0].anchor.constructor==c.DynamicAnchor),b.addToList(j,d,[e,e.endpoints[1],e.endpoints[1].anchor.constructor==c.DynamicAnchor]),e.endpoints[1].anchor.isContinuous&&(e.source===e.target?e._jsPlumb.instance.removeElement(e.endpoints[1].canvas):null==e.endpoints[1].canvas.parentNode&&e._jsPlumb.instance.appendElement(e.endpoints[1].canvas)),e.updateConnectedClass()}},this.rehomeEndpoint=function(a,b,c){var e=d[b]||[],f=m.getId(c);if(f!==b){var g=e.indexOf(a);if(g>-1){var h=e.splice(g,1)[0];k.add(h,f)}}for(var i=0;i<a.connections.length;i++)a.connections[i].sourceId==b?(a.connections[i].sourceId=a.elementId,a.connections[i].source=a.element,k.sourceChanged(b,a.elementId,a.connections[i])):a.connections[i].targetId==b&&(a.connections[i].targetId=a.elementId,a.connections[i].target=a.element,k.updateOtherEndpoint(a.connections[i].sourceId,b,a.elementId,a.connections[i]))},this.redraw=function(a,e,f,g,h,i){if(!m.isSuspendDrawing()){var k=d[a]||[],p=j[a]||[],q=[],r=[],s=[];f=f||m.timestamp(),g=g||{left:0,top:0},e&&(e={left:e.left+g.left,top:e.top+g.top});for(var t=m.updateOffset({elId:a,offset:e,recalc:!1,timestamp:f}),v={},x=0;x<p.length;x++){var y=p[x][0],z=y.sourceId,A=y.targetId,B=y.endpoints[0].anchor.isContinuous,C=y.endpoints[1].anchor.isContinuous;
if(B||C){var D=z+"_"+A,E=v[D],F=y.sourceId==a?1:0;B&&!l[z]&&(l[z]={top:[],right:[],bottom:[],left:[]}),C&&!l[A]&&(l[A]={top:[],right:[],bottom:[],left:[]}),a!=A&&m.updateOffset({elId:A,timestamp:f}),a!=z&&m.updateOffset({elId:z,timestamp:f});var G=m.getCachedData(A),H=m.getCachedData(z);A==z&&(B||C)?w(l[z],-Math.PI/2,0,y,!1,A,0,!1,"top",z,q,r):(E||(E=o(z,A,H.o,G.o,y.endpoints[0].anchor,y.endpoints[1].anchor),v[D]=E),B&&w(l[z],E.theta,0,y,!1,A,0,!1,E.a[0],z,q,r),C&&w(l[A],E.theta2,-1,y,!0,z,1,!0,E.a[1],A,q,r)),B&&b.addWithFunction(s,z,function(a){return a===z}),C&&b.addWithFunction(s,A,function(a){return a===A}),b.addWithFunction(q,y,function(a){return a.id==y.id}),(B&&0===F||C&&1===F)&&b.addWithFunction(r,y.endpoints[F],function(a){return a.id==y.endpoints[F].id})}}for(x=0;x<k.length;x++)0===k[x].connections.length&&k[x].anchor.isContinuous&&(l[a]||(l[a]={top:[],right:[],bottom:[],left:[]}),w(l[a],-Math.PI/2,0,{endpoints:[k[x],k[x]],paint:function(){}},!1,a,0,!1,k[x].anchor.getDefaultFace(),a,q,r),b.addWithFunction(s,a,function(b){return b===a}));for(x=0;x<s.length;x++)u(s[x],l[s[x]]);for(x=0;x<k.length;x++)k[x].paint({timestamp:f,offset:t,dimensions:t.s,recalc:i!==!0});for(x=0;x<r.length;x++){var I=m.getCachedData(r[x].elementId);r[x].paint({timestamp:f,offset:I,dimensions:I.s})}for(x=0;x<p.length;x++){var J=p[x][1];if(J.anchor.constructor==c.DynamicAnchor){J.paint({elementWithPrecedence:a,timestamp:f}),b.addWithFunction(q,p[x][0],function(a){return a.id==p[x][0].id});for(var K=0;K<J.connections.length;K++)J.connections[K]!==p[x][0]&&b.addWithFunction(q,J.connections[K],function(a){return a.id==J.connections[K].id})}else J.anchor.constructor==c.Anchor&&b.addWithFunction(q,p[x][0],function(a){return a.id==p[x][0].id})}var L=n[a];for(L&&L.paint({timestamp:f,recalc:!1,elId:a}),x=0;x<q.length;x++)q[x].paint({elId:a,timestamp:f,recalc:!1,clearEdits:h})}};var x=function(a){b.EventGenerator.apply(this),this.type="Continuous",this.isDynamic=!0,this.isContinuous=!0;for(var c=a.faces||["top","right","bottom","left"],d=!(a.clockwise===!1),h={},i={top:"bottom",right:"left",left:"right",bottom:"top"},j={top:"right",right:"bottom",left:"top",bottom:"left"},k={top:"left",right:"top",left:"bottom",bottom:"right"},l=d?j:k,m=d?k:j,n=a.cssClass||"",o=0;o<c.length;o++)h[c[o]]=!0;this.getDefaultFace=function(){return 0===c.length?"top":c[0]},this.verifyEdge=function(a){return h[a]?a:h[i[a]]?i[a]:h[l[a]]?l[a]:h[m[a]]?m[a]:a},this.isEdgeSupported=function(a){return h[a]===!0},this.compute=function(a){return f[a.element.id]||e[a.element.id]||[0,0]},this.getCurrentLocation=function(a){return f[a.element.id]||e[a.element.id]||[0,0]},this.getOrientation=function(a){return g[a.id]||[0,0]},this.clearUserDefinedLocation=function(){delete f[a.elementId]},this.setUserDefinedLocation=function(b){f[a.elementId]=b},this.getCssClass=function(){return n}};m.continuousAnchorFactory={get:function(a){return new x(a)},clear:function(a){delete f[a],delete e[a]}} },c.Anchor=function(a){this.x=a.x||0,this.y=a.y||0,this.elementId=a.elementId,this.cssClass=a.cssClass||"",this.userDefinedLocation=null,this.orientation=a.orientation||[0,0],this.lastReturnValue=null,this.offsets=a.offsets||[0,0],this.timestamp=null,b.EventGenerator.apply(this),this.compute=function(a){var b=a.xy,c=a.wh,d=a.timestamp;return a.clearUserDefinedLocation&&(this.userDefinedLocation=null),d&&d===self.timestamp?this.lastReturnValue:(this.lastReturnValue=null!=this.userDefinedLocation?this.userDefinedLocation:[b[0]+this.x*c[0]+this.offsets[0],b[1]+this.y*c[1]+this.offsets[1]],this.timestamp=d,this.lastReturnValue)},this.getCurrentLocation=function(a){return a=a||{},null==this.lastReturnValue||null!=a.timestamp&&this.timestamp!=a.timestamp?this.compute(a):this.lastReturnValue}},b.extend(c.Anchor,b.EventGenerator,{equals:function(a){if(!a)return!1;var b=a.getOrientation(),c=this.getOrientation();return this.x==a.x&&this.y==a.y&&this.offsets[0]==a.offsets[0]&&this.offsets[1]==a.offsets[1]&&c[0]==b[0]&&c[1]==b[1]},getUserDefinedLocation:function(){return this.userDefinedLocation},setUserDefinedLocation:function(a){this.userDefinedLocation=a},clearUserDefinedLocation:function(){this.userDefinedLocation=null},getOrientation:function(){return this.orientation},getCssClass:function(){return this.cssClass}}),c.FloatingAnchor=function(a){c.Anchor.apply(this,arguments);var b=a.reference,d=a.referenceCanvas,e=c.getSize(d),f=0,g=0,h=null,i=null;this.orientation=null,this.x=0,this.y=0,this.isFloating=!0,this.compute=function(a){var b=a.xy,c=[b[0]+e[0]/2,b[1]+e[1]/2];return i=c,c},this.getOrientation=function(a){if(h)return h;var c=b.getOrientation(a);return[-1*Math.abs(c[0])*f,-1*Math.abs(c[1])*g]},this.over=function(a,b){h=a.getOrientation(b)},this.out=function(){h=null},this.getCurrentLocation=function(a){return null==i?this.compute(a):i}},b.extend(c.FloatingAnchor,c.Anchor);var d=function(a,b,d){return a.constructor==c.Anchor?a:b.makeAnchor(a,d,b)};c.DynamicAnchor=function(a){c.Anchor.apply(this,arguments),this.isDynamic=!0,this.anchors=[],this.elementId=a.elementId,this.jsPlumbInstance=a.jsPlumbInstance;for(var b=0;b<a.anchors.length;b++)this.anchors[b]=d(a.anchors[b],this.jsPlumbInstance,this.elementId);this.getAnchors=function(){return this.anchors},this.locked=!1;var e=this.anchors.length>0?this.anchors[0]:null,f=e,g=this,h=function(a,b,c,d,e){var f=d[0]+a.x*e[0],g=d[1]+a.y*e[1],h=d[0]+e[0]/2,i=d[1]+e[1]/2;return Math.sqrt(Math.pow(b-f,2)+Math.pow(c-g,2))+Math.sqrt(Math.pow(h-f,2)+Math.pow(i-g,2))},i=a.selector||function(a,b,c,d,e){for(var f=c[0]+d[0]/2,g=c[1]+d[1]/2,i=-1,j=1/0,k=0;k<e.length;k++){var l=h(e[k],f,g,a,b);j>l&&(i=k+0,j=l)}return e[i]};this.compute=function(a){var b=a.xy,c=a.wh,d=a.txy,h=a.twh;this.timestamp=a.timestamp;var j=g.getUserDefinedLocation();return null!=j?j:this.locked||null==d||null==h?e.compute(a):(a.timestamp=null,e=i(b,c,d,h,this.anchors),this.x=e.x,this.y=e.y,e!=f&&this.fire("anchorChanged",e),f=e,e.compute(a))},this.getCurrentLocation=function(a){return this.getUserDefinedLocation()||(null!=e?e.getCurrentLocation(a):null)},this.getOrientation=function(a){return null!=e?e.getOrientation(a):[0,0]},this.over=function(a,b){null!=e&&e.over(a,b)},this.out=function(){null!=e&&e.out()},this.getCssClass=function(){return e&&e.getCssClass()||""}},b.extend(c.DynamicAnchor,c.Anchor);var e=function(a,b,d,e,f,g){c.Anchors[f]=function(c){var h=c.jsPlumbInstance.makeAnchor([a,b,d,e,0,0],c.elementId,c.jsPlumbInstance);return h.type=f,g&&g(h,c),h}};e(.5,0,0,-1,"TopCenter"),e(.5,1,0,1,"BottomCenter"),e(0,.5,-1,0,"LeftMiddle"),e(1,.5,1,0,"RightMiddle"),e(.5,0,0,-1,"Top"),e(.5,1,0,1,"Bottom"),e(0,.5,-1,0,"Left"),e(1,.5,1,0,"Right"),e(.5,.5,0,0,"Center"),e(1,0,0,-1,"TopRight"),e(1,1,0,1,"BottomRight"),e(0,0,0,-1,"TopLeft"),e(0,1,0,1,"BottomLeft"),c.Defaults.DynamicAnchors=function(a){return a.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],a.elementId,a.jsPlumbInstance)},c.Anchors.AutoDefault=function(a){var b=a.jsPlumbInstance.makeDynamicAnchor(c.Defaults.DynamicAnchors(a));return b.type="AutoDefault",b};var f=function(a,b){c.Anchors[a]=function(c){var d=c.jsPlumbInstance.makeAnchor(["Continuous",{faces:b}],c.elementId,c.jsPlumbInstance);return d.type=a,d}};c.Anchors.Continuous=function(a){return a.jsPlumbInstance.continuousAnchorFactory.get(a)},f("ContinuousLeft",["left"]),f("ContinuousTop",["top"]),f("ContinuousBottom",["bottom"]),f("ContinuousRight",["right"]),e(0,0,0,0,"Assign",function(a,b){var c=b.position||"Fixed";a.positionFinder=c.constructor==String?b.jsPlumbInstance.AnchorPositionFinders[c]:c,a.constructorParams=b}),jsPlumbInstance.prototype.AnchorPositionFinders={Fixed:function(a,b,c){return[(a.left-b.left)/c[0],(a.top-b.top)/c[1]]},Grid:function(a,b,c,d){var e=a.left-b.left,f=a.top-b.top,g=c[0]/d.grid[0],h=c[1]/d.grid[1],i=Math.floor(e/g),j=Math.floor(f/h);return[(i*g+g/2)/c[0],(j*h+h/2)/c[1]]}},c.Anchors.Perimeter=function(a){a=a||{};var b=a.anchorCount||60,c=a.shape;if(!c)throw new Error("no shape supplied to Perimeter Anchor type");var d=function(){for(var a=.5,c=2*Math.PI/b,d=0,e=[],f=0;b>f;f++){var g=a+a*Math.sin(d),h=a+a*Math.cos(d);e.push([g,h,0,0]),d+=c}return e},e=function(a){for(var c=b/a.length,d=[],e=function(a,e,f,g,h){c=b*h;for(var i=(f-a)/c,j=(g-e)/c,k=0;c>k;k++)d.push([a+i*k,e+j*k,0,0])},f=0;f<a.length;f++)e.apply(null,a[f]);return d},f=function(a){for(var b=[],c=0;c<a.length;c++)b.push([a[c][0],a[c][1],a[c][2],a[c][3],1/a.length]);return e(b)},g=function(){return f([[0,0,1,0],[1,0,1,1],[1,1,0,1],[0,1,0,0]])},h={Circle:d,Ellipse:d,Diamond:function(){return f([[.5,0,1,.5],[1,.5,.5,1],[.5,1,0,.5],[0,.5,.5,0]])},Rectangle:g,Square:g,Triangle:function(){return f([[.5,0,1,1],[1,1,0,1],[0,1,.5,0]])},Path:function(a){for(var b=a.points,c=[],d=0,f=0;f<b.length-1;f++){var g=Math.sqrt(Math.pow(b[f][2]-b[f][0])+Math.pow(b[f][3]-b[f][1]));d+=g,c.push([b[f][0],b[f][1],b[f+1][0],b[f+1][1],g])}for(var h=0;h<c.length;h++)c[h][4]=c[h][4]/d;return e(c)}},i=function(a,b){for(var c=[],d=b/180*Math.PI,e=0;e<a.length;e++){var f=a[e][0]-.5,g=a[e][1]-.5;c.push([.5+(f*Math.cos(d)-g*Math.sin(d)),.5+(f*Math.sin(d)+g*Math.cos(d)),a[e][2],a[e][3]])}return c};if(!h[c])throw new Error("Shape ["+c+"] is unknown by Perimeter Anchor type");var j=h[c](a);a.rotation&&(j=i(j,a.rotation));var k=a.jsPlumbInstance.makeDynamicAnchor(j);return k.type="Perimeter",k}}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=a.Biltong;b.Segments={AbstractSegment:function(a){this.params=a,this.findClosestPointOnPath=function(){return{d:1/0,x:null,y:null,l:null}},this.getBounds=function(){return{minX:Math.min(a.x1,a.x2),minY:Math.min(a.y1,a.y2),maxX:Math.max(a.x1,a.x2),maxY:Math.max(a.y1,a.y2)}} },Straight:function(a){var c,e,f,g,h,i,j,k=(b.Segments.AbstractSegment.apply(this,arguments),function(){c=Math.sqrt(Math.pow(h-g,2)+Math.pow(j-i,2)),e=d.gradient({x:g,y:i},{x:h,y:j}),f=-1/e});this.type="Straight",this.getLength=function(){return c},this.getGradient=function(){return e},this.getCoordinates=function(){return{x1:g,y1:i,x2:h,y2:j}},this.setCoordinates=function(a){g=a.x1,i=a.y1,h=a.x2,j=a.y2,k()},this.setCoordinates({x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2}),this.getBounds=function(){return{minX:Math.min(g,h),minY:Math.min(i,j),maxX:Math.max(g,h),maxY:Math.max(i,j)}},this.pointOnPath=function(a,b){if(0!==a||b){if(1!=a||b){var e=b?a>0?a:c+a:a*c;return d.pointOnLine({x:g,y:i},{x:h,y:j},e)}return{x:h,y:j}}return{x:g,y:i}},this.gradientAtPoint=function(){return e},this.pointAlongPathFrom=function(a,b,c){var e=this.pointOnPath(a,c),f=0>=b?{x:g,y:i}:{x:h,y:j};return 0>=b&&Math.abs(b)>1&&(b*=-1),d.pointOnLine(e,f,b)};var l=function(a,b,c){return c>=Math.min(a,b)&&c<=Math.max(a,b)},m=function(a,b,c){return Math.abs(c-a)<Math.abs(c-b)?a:b};this.findClosestPointOnPath=function(a,b){var k={d:1/0,x:null,y:null,l:null,x1:g,x2:h,y1:i,y2:j};if(0===e)k.y=i,k.x=l(g,h,a)?a:m(g,h,a);else if(1/0==e||e==-1/0)k.x=g,k.y=l(i,j,b)?b:m(i,j,b);else{var n=i-e*g,o=b-f*a,p=(o-n)/(e-f),q=e*p+n;k.x=l(g,h,p)?p:m(g,h,p),k.y=l(i,j,q)?q:m(i,j,q)}var r=d.lineLength([k.x,k.y],[g,i]);return k.d=d.lineLength([a,b],[k.x,k.y]),k.l=r/c,k}},Arc:function(a){var c=(b.Segments.AbstractSegment.apply(this,arguments),function(b,c){return d.theta([a.cx,a.cy],[b,c])}),e=function(a,b){if(a.anticlockwise){var c=a.startAngle<a.endAngle?a.startAngle+f:a.startAngle,d=Math.abs(c-a.endAngle);return c-d*b}var e=a.endAngle<a.startAngle?a.endAngle+f:a.endAngle,g=Math.abs(e-a.startAngle);return a.startAngle+g*b},f=2*Math.PI;this.radius=a.r,this.anticlockwise=a.ac,this.type="Arc",a.startAngle&&a.endAngle?(this.startAngle=a.startAngle,this.endAngle=a.endAngle,this.x1=a.cx+this.radius*Math.cos(a.startAngle),this.y1=a.cy+this.radius*Math.sin(a.startAngle),this.x2=a.cx+this.radius*Math.cos(a.endAngle),this.y2=a.cy+this.radius*Math.sin(a.endAngle)):(this.startAngle=c(a.x1,a.y1),this.endAngle=c(a.x2,a.y2),this.x1=a.x1,this.y1=a.y1,this.x2=a.x2,this.y2=a.y2),this.endAngle<0&&(this.endAngle+=f),this.startAngle<0&&(this.startAngle+=f);var g=this.endAngle<this.startAngle?this.endAngle+f:this.endAngle;this.sweep=Math.abs(g-this.startAngle),this.anticlockwise&&(this.sweep=f-this.sweep);var h=2*Math.PI*this.radius,i=this.sweep/f,j=h*i;this.getLength=function(){return j},this.getBounds=function(){return{minX:a.cx-a.r,maxX:a.cx+a.r,minY:a.cy-a.r,maxY:a.cy+a.r}};var k=1e-10,l=function(a){var b=Math.floor(a),c=Math.ceil(a);return k>a-b?b:k>c-a?c:a};this.pointOnPath=function(b,c){if(0===b)return{x:this.x1,y:this.y1,theta:this.startAngle};if(1==b)return{x:this.x2,y:this.y2,theta:this.endAngle};c&&(b/=j);var d=e(this,b),f=a.cx+a.r*Math.cos(d),g=a.cy+a.r*Math.sin(d);return{x:l(f),y:l(g),theta:d}},this.gradientAtPoint=function(b,c){var e=this.pointOnPath(b,c),f=d.normal([a.cx,a.cy],[e.x,e.y]);return this.anticlockwise||1/0!=f&&f!=-1/0||(f*=-1),f},this.pointAlongPathFrom=function(b,c,d){var e=this.pointOnPath(b,d),f=2*(c/h)*Math.PI,g=this.anticlockwise?-1:1,i=e.theta+g*f,j=a.cx+this.radius*Math.cos(i),k=a.cy+this.radius*Math.sin(i);return{x:j,y:k}} },Bezier:function(c){this.curve=[{x:c.x1,y:c.y1},{x:c.cp1x,y:c.cp1y},{x:c.cp2x,y:c.cp2y},{x:c.x2,y:c.y2}],b.Segments.AbstractSegment.apply(this,arguments),this.bounds={minX:Math.min(c.x1,c.x2,c.cp1x,c.cp2x),minY:Math.min(c.y1,c.y2,c.cp1y,c.cp2y),maxX:Math.max(c.x1,c.x2,c.cp1x,c.cp2x),maxY:Math.max(c.y1,c.y2,c.cp1y,c.cp2y)},this.type="Bezier";var d=function(b,c,d){return d&&(c=a.jsBezier.locationAlongCurveFrom(b,c>0?0:1,c)),c};this.pointOnPath=function(b,c){return b=d(this.curve,b,c),a.jsBezier.pointOnCurve(this.curve,b)},this.gradientAtPoint=function(b,c){return b=d(this.curve,b,c),a.jsBezier.gradientAtPoint(this.curve,b)},this.pointAlongPathFrom=function(b,c,e){return b=d(this.curve,b,e),a.jsBezier.pointAlongCurveFrom(this.curve,b,c)},this.getLength=function(){return a.jsBezier.getLength(this.curve)},this.getBounds=function(){return this.bounds}} };var e=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},this.resetBounds()};b.Connectors.AbstractConnector=function(a){e.apply(this,arguments);var f=[],g=0,h=[],i=[],j=a.stub||0,k=c.isArray(j)?j[0]:j,l=c.isArray(j)?j[1]:j,m=a.gap||0,n=c.isArray(m)?m[0]:m,o=c.isArray(m)?m[1]:m,p=null,q=!1,r=null;this.getPath=function(){},this.setPath=function(){},this.findSegmentForPoint=function(a,b){for(var c={d:1/0,s:null,x:null,y:null,l:null},d=0;d<f.length;d++){var e=f[d].findClosestPointOnPath(a,b);e.d<c.d&&(c.d=e.d,c.l=e.l,c.x=e.x,c.y=e.y,c.s=f[d],c.x1=e.x1,c.x2=e.x2,c.y1=e.y1,c.y2=e.y2,c.index=d)}return c};var s=function(){for(var a=0,b=0;b<f.length;b++){var c=f[b].getLength();i[b]=c/g,h[b]=[a,a+=c/g]}},t=function(a,b){b&&(a=a>0?a/g:(g+a)/g);for(var c=h.length-1,d=1,e=0;e<h.length;e++)if(h[e][1]>=a){c=e,d=1==a?1:0===a?0:(a-h[e][0])/i[e];break}return{segment:f[c],proportion:d,index:c}},u=function(a,c,d){if(d.x1!=d.x2||d.y1!=d.y2){var e=new b.Segments[c](d);f.push(e),g+=e.getLength(),a.updateBounds(e)}},v=function(){g=f.length=h.length=i.length=0};this.setSegments=function(a){p=[],g=0;for(var b=0;b<a.length;b++)p.push(a[b]),g+=a[b].getLength()},this.getLength=function(){return g};var w=function(a){this.lineWidth=a.lineWidth;var b=d.quadrant(a.sourcePos,a.targetPos),c=a.targetPos[0]<a.sourcePos[0],e=a.targetPos[1]<a.sourcePos[1],f=a.lineWidth||1,g=a.sourceEndpoint.anchor.getOrientation(a.sourceEndpoint),h=a.targetEndpoint.anchor.getOrientation(a.targetEndpoint),i=c?a.targetPos[0]:a.sourcePos[0],j=e?a.targetPos[1]:a.sourcePos[1],m=Math.abs(a.targetPos[0]-a.sourcePos[0]),p=Math.abs(a.targetPos[1]-a.sourcePos[1]);if(0===g[0]&&0===g[1]||0===h[0]&&0===h[1]){var q=m>p?0:1,r=[1,0][q];g=[],h=[],g[q]=a.sourcePos[q]>a.targetPos[q]?-1:1,h[q]=a.sourcePos[q]>a.targetPos[q]?1:-1,g[r]=0,h[r]=0}var s=c?m+n*g[0]:n*g[0],t=e?p+n*g[1]:n*g[1],u=c?o*h[0]:m+o*h[0],v=e?o*h[1]:p+o*h[1],w=g[0]*h[0]+g[1]*h[1],x={sx:s,sy:t,tx:u,ty:v,lw:f,xSpan:Math.abs(u-s),ySpan:Math.abs(v-t),mx:(s+u)/2,my:(t+v)/2,so:g,to:h,x:i,y:j,w:m,h:p,segment:b,startStubX:s+g[0]*k,startStubY:t+g[1]*k,endStubX:u+h[0]*l,endStubY:v+h[1]*l,isXGreaterThanStubTimes2:Math.abs(s-u)>k+l,isYGreaterThanStubTimes2:Math.abs(t-v)>k+l,opposite:-1==w,perpendicular:0===w,orthogonal:1==w,sourceAxis:0===g[0]?"y":"x",points:[i,j,m,p,s,t,u,v]};return x.anchorOrientation=x.opposite?"opposite":x.orthogonal?"orthogonal":"perpendicular",x};return this.getSegments=function(){return f},this.updateBounds=function(a){var b=a.getBounds();this.bounds.minX=Math.min(this.bounds.minX,b.minX),this.bounds.maxX=Math.max(this.bounds.maxX,b.maxX),this.bounds.minY=Math.min(this.bounds.minY,b.minY),this.bounds.maxY=Math.max(this.bounds.maxY,b.maxY)},this.pointOnPath=function(a,b){var c=t(a,b);return c.segment&&c.segment.pointOnPath(c.proportion,!1)||[0,0]},this.gradientAtPoint=function(a,b){var c=t(a,b);return c.segment&&c.segment.gradientAtPoint(c.proportion,!1)||0},this.pointAlongPathFrom=function(a,b,c){var d=t(a,c);return d.segment&&d.segment.pointAlongPathFrom(d.proportion,b,!1)||[0,0]},this.compute=function(a){q||(r=w.call(this,a)),v(),this._compute(r,a),this.x=r.points[0],this.y=r.points[1],this.w=r.points[2],this.h=r.points[3],this.segment=r.segment,s()},{addSegment:u,prepareCompute:w,sourceStub:k,targetStub:l,maxStub:Math.max(k,l),sourceGap:n,targetGap:o,maxGap:Math.max(n,o)}},c.extend(b.Connectors.AbstractConnector,e);var f=b.Connectors.Straight=function(){this.type="Straight";var a=b.Connectors.AbstractConnector.apply(this,arguments);this._compute=function(b){a.addSegment(this,"Straight",{x1:b.sx,y1:b.sy,x2:b.startStubX,y2:b.startStubY}),a.addSegment(this,"Straight",{x1:b.startStubX,y1:b.startStubY,x2:b.endStubX,y2:b.endStubY}),a.addSegment(this,"Straight",{x1:b.endStubX,y1:b.endStubY,x2:b.tx,y2:b.ty})}};c.extend(b.Connectors.Straight,b.Connectors.AbstractConnector),b.registerConnectorType(f,"Straight"),b.Endpoints.AbstractEndpoint=function(a){e.apply(this,arguments);var b=this.compute=function(){var a=this._compute.apply(this,arguments);return this.x=a[0],this.y=a[1],this.w=a[2],this.h=a[3],this.bounds.minX=this.x,this.bounds.minY=this.y,this.bounds.maxX=this.x+this.w,this.bounds.maxY=this.y+this.h,a};return{compute:b,cssClass:a.cssClass}},c.extend(b.Endpoints.AbstractEndpoint,e),b.Endpoints.Dot=function(a){this.type="Dot",b.Endpoints.AbstractEndpoint.apply(this,arguments),a=a||{},this.radius=a.radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this._compute=function(a,b,c){this.radius=c.radius||this.radius;var d=a[0]-this.radius,e=a[1]-this.radius,f=2*this.radius,g=2*this.radius;if(c.strokeStyle){var h=c.lineWidth||1;d-=h,e-=h,f+=2*h,g+=2*h}return[d,e,f,g,this.radius]}},c.extend(b.Endpoints.Dot,b.Endpoints.AbstractEndpoint),b.Endpoints.Rectangle=function(a){this.type="Rectangle",b.Endpoints.AbstractEndpoint.apply(this,arguments),a=a||{},this.width=a.width||20,this.height=a.height||20,this._compute=function(a,b,c){var d=c.width||this.width,e=c.height||this.height,f=a[0]-d/2,g=a[1]-e/2;return[f,g,d,e]}},c.extend(b.Endpoints.Rectangle,b.Endpoints.AbstractEndpoint);var g=function(){b.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.displayElements=[]};c.extend(g,b.jsPlumbUIComponent,{getDisplayElements:function(){return this._jsPlumb.displayElements},appendDisplayElement:function(a){this._jsPlumb.displayElements.push(a)}}),b.Endpoints.Image=function(d){this.type="Image",g.apply(this,arguments),b.Endpoints.AbstractEndpoint.apply(this,arguments);var e=d.onload,f=d.src||d.url,h=d.cssClass?" "+d.cssClass:"";this._jsPlumb.img=new Image,this._jsPlumb.ready=!1,this._jsPlumb.initialized=!1,this._jsPlumb.deleted=!1,this._jsPlumb.widthToUse=d.width,this._jsPlumb.heightToUse=d.height,this._jsPlumb.endpoint=d.endpoint,this._jsPlumb.img.onload=function(){null!=this._jsPlumb&&(this._jsPlumb.ready=!0,this._jsPlumb.widthToUse=this._jsPlumb.widthToUse||this._jsPlumb.img.width,this._jsPlumb.heightToUse=this._jsPlumb.heightToUse||this._jsPlumb.img.height,e&&e(this))}.bind(this),this._jsPlumb.endpoint.setImage=function(a,b){var c=a.constructor==String?a:a.src;e=b,this._jsPlumb.img.src=c,null!=this.canvas&&this.canvas.setAttribute("src",this._jsPlumb.img.src)}.bind(this),this._jsPlumb.endpoint.setImage(f,e),this._compute=function(a){return this.anchorPoint=a,this._jsPlumb.ready?[a[0]-this._jsPlumb.widthToUse/2,a[1]-this._jsPlumb.heightToUse/2,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse]:[0,0,0,0]},this.canvas=jsPlumb.createElement("img",{position:"absolute",margin:0,padding:0,outline:0},this._jsPlumb.instance.endpointClass+h),this._jsPlumb.widthToUse&&this.canvas.setAttribute("width",this._jsPlumb.widthToUse),this._jsPlumb.heightToUse&&this.canvas.setAttribute("height",this._jsPlumb.heightToUse),this._jsPlumb.instance.appendElement(this.canvas),this.actuallyPaint=function(){if(!this._jsPlumb.deleted){this._jsPlumb.initialized||(this.canvas.setAttribute("src",this._jsPlumb.img.src),this.appendDisplayElement(this.canvas),this._jsPlumb.initialized=!0);var a=this.anchorPoint[0]-this._jsPlumb.widthToUse/2,b=this.anchorPoint[1]-this._jsPlumb.heightToUse/2;c.sizeElement(this.canvas,a,b,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse)}},this.paint=function(b,c){null!=this._jsPlumb&&(this._jsPlumb.ready?this.actuallyPaint(b,c):a.setTimeout(function(){this.paint(b,c)}.bind(this),200))}},c.extend(b.Endpoints.Image,[g,b.Endpoints.AbstractEndpoint],{cleanup:function(a){a&&(this._jsPlumb.deleted=!0,this.canvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null)}}),b.Endpoints.Blank=function(a){b.Endpoints.AbstractEndpoint.apply(this,arguments),this.type="Blank",g.apply(this,arguments),this._compute=function(a){return[a[0],a[1],10,0]};var d=a.cssClass?" "+a.cssClass:"";this.canvas=jsPlumb.createElement("div",{display:"block",width:"1px",height:"1px",background:"transparent",position:"absolute"},this._jsPlumb.instance.endpointClass+d),this._jsPlumb.instance.appendElement(this.canvas),this.paint=function(){c.sizeElement(this.canvas,this.x,this.y,this.w,this.h)}},c.extend(b.Endpoints.Blank,[b.Endpoints.AbstractEndpoint,g],{cleanup:function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}),b.Endpoints.Triangle=function(a){this.type="Triangle",b.Endpoints.AbstractEndpoint.apply(this,arguments),a=a||{},a.width=a.width||55,a.height=a.height||55,this.width=a.width,this.height=a.height,this._compute=function(a,b,c){var d=c.width||self.width,e=c.height||self.height,f=a[0]-d/2,g=a[1]-e/2;return[f,g,d,e]}};var h=b.Overlays.AbstractOverlay=function(a){this.visible=!0,this.isAppendedAtTopLevel=!0,this.component=a.component,this.loc=null==a.location?.5:a.location,this.endpointLoc=null==a.endpointLocation?[.5,.5]:a.endpointLocation};h.prototype={cleanup:function(a){a&&(this.component=null,this.canvas=null,this.endpointLoc=null)},reattach:function(){},setVisible:function(a){this.visible=a,this.component.repaint()},isVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},incrementLocation:function(a){this.loc+=a,this.component.repaint()},setLocation:function(a){this.loc=a,this.component.repaint()},getLocation:function(){return this.loc},updateFrom:function(){}},b.Overlays.Arrow=function(a){this.type="Arrow",h.apply(this,arguments),this.isAppendedAtTopLevel=!1,a=a||{},this.length=a.length||20,this.width=a.width||20,this.id=a.id;var b=(a.direction||1)<0?-1:1,e=a.paintStyle||{lineWidth:1},f=a.foldback||.623;this.computeMaxSize=function(){return 1.5*self.width},this.draw=function(a,g){var h,i,j,k,l;if(a.pointAlongPathFrom){if(c.isString(this.loc)||this.loc>1||this.loc<0){var m=parseInt(this.loc,10),n=this.loc<0?1:0;h=a.pointAlongPathFrom(n,m,!1),i=a.pointAlongPathFrom(n,m-b*this.length/2,!1),j=d.pointOnLine(h,i,this.length)}else if(1==this.loc){if(h=a.pointOnPath(this.loc),i=a.pointAlongPathFrom(this.loc,-this.length),j=d.pointOnLine(h,i,this.length),-1==b){var o=j;j=h,h=o}}else if(0===this.loc){if(j=a.pointOnPath(this.loc),i=a.pointAlongPathFrom(this.loc,this.length),h=d.pointOnLine(j,i,this.length),-1==b){var p=j;j=h,h=p}}else h=a.pointAlongPathFrom(this.loc,b*this.length/2),i=a.pointOnPath(this.loc),j=d.pointOnLine(h,i,this.length);k=d.perpendicularLineTo(h,j,this.width),l=d.pointOnLine(h,j,f*this.length);var q={hxy:h,tail:k,cxy:l},r=e.strokeStyle||g.strokeStyle,s=e.fillStyle||g.strokeStyle,t=e.lineWidth||g.lineWidth;return{component:a,d:q,lineWidth:t,strokeStyle:r,fillStyle:s,minX:Math.min(h.x,k[0].x,k[1].x),maxX:Math.max(h.x,k[0].x,k[1].x),minY:Math.min(h.y,k[0].y,k[1].y),maxY:Math.max(h.y,k[0].y,k[1].y)}}return{component:a,minX:0,maxX:0,minY:0,maxY:0}} },c.extend(b.Overlays.Arrow,h,{updateFrom:function(a){this.length=a.length||this.length,this.width=a.width||this.width,this.direction=null!=a.direction?a.direction:this.direction,this.foldback=a.foldback||this.foldback}}),b.Overlays.PlainArrow=function(a){a=a||{};var c=b.extend(a,{foldback:1});b.Overlays.Arrow.call(this,c),this.type="PlainArrow"},c.extend(b.Overlays.PlainArrow,b.Overlays.Arrow),b.Overlays.Diamond=function(a){a=a||{};var c=a.length||40,d=jsPlumb.extend(a,{length:c/2,foldback:2});b.Overlays.Arrow.call(this,d),this.type="Diamond"},c.extend(b.Overlays.Diamond,b.Overlays.Arrow);var i=function(a,b){return(null==a._jsPlumb.cachedDimensions||b)&&(a._jsPlumb.cachedDimensions=a.getDimensions()),a._jsPlumb.cachedDimensions},j=function(a){b.jsPlumbUIComponent.apply(this,arguments),h.apply(this,arguments);var d=this.fire;this.fire=function(){d.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=a.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=a.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=a.create,this._jsPlumb.initiallyInvisible=a.visible===!1,this.getElement=function(){if(null==this._jsPlumb.div){var b=this._jsPlumb.div=jsPlumb.getElement(this._jsPlumb.create(this._jsPlumb.component));b.style.position="absolute",b.className=this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:a.cssClass?a.cssClass:""),this._jsPlumb.instance.appendElement(b),this._jsPlumb.instance.getId(b),this.canvas=b;var c="translate(-50%, -50%)";b.style.webkitTransform=c,b.style.mozTransform=c,b.style.msTransform=c,b.style.oTransform=c,b.style.transform=c,b._jsPlumb=this,a.visible===!1&&(b.style.display="none")}return this._jsPlumb.div},this.draw=function(a,b,d){var e=i(this);if(null!=e&&2==e.length){var f={x:0,y:0};if(d)f={x:d[0],y:d[1]};else if(a.pointOnPath){var g=this.loc,h=!1;(c.isString(this.loc)||this.loc<0||this.loc>1)&&(g=parseInt(this.loc,10),h=!0),f=a.pointOnPath(g,h)}else{var j=this.loc.constructor==Array?this.loc:this.endpointLoc;f={x:j[0]*a.w,y:j[1]*a.h}}var k=f.x-e[0]/2,l=f.y-e[1]/2;return{component:a,d:{minx:k,miny:l,td:e,cxy:f},minX:k,maxX:k+e[0],minY:l,maxY:l+e[1]}}return{minX:0,maxX:0,minY:0,maxY:0}} };c.extend(j,[b.jsPlumbUIComponent,h],{getDimensions:function(){return[1,1]},setVisible:function(a){this._jsPlumb.div&&(this._jsPlumb.div.style.display=a?"block":"none",a&&this._jsPlumb.initiallyInvisible&&(i(this,!0),this.component.repaint(),this._jsPlumb.initiallyInvisible=!1))},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(a){a?null!=this._jsPlumb.div&&(this._jsPlumb.div._jsPlumb=null,this._jsPlumb.instance.removeElement(this._jsPlumb.div)):(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div),this.detached=!0)},reattach:function(a){null!=this._jsPlumb.div&&a.getContainer().appendChild(this._jsPlumb.div),this.detached=!1},computeMaxSize:function(){var a=i(this);return Math.max(a[0],a[1])},paint:function(a){this._jsPlumb.initialised||(this.getElement(),a.component.appendDisplayElement(this._jsPlumb.div),this._jsPlumb.initialised=!0,this.detached&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)),this._jsPlumb.div.style.left=a.component.x+a.d.minx+"px",this._jsPlumb.div.style.top=a.component.y+a.d.miny+"px"}}),b.Overlays.Custom=function(){this.type="Custom",j.apply(this,arguments)},c.extend(b.Overlays.Custom,j),b.Overlays.GuideLines=function(){var a=this;a.length=50,a.lineWidth=5,this.type="GuideLines",h.apply(this,arguments),b.jsPlumbUIComponent.apply(this,arguments),this.draw=function(b){var c=b.pointAlongPathFrom(a.loc,a.length/2),e=b.pointOnPath(a.loc),f=d.pointOnLine(c,e,a.length),g=d.perpendicularLineTo(c,f,40),h=d.perpendicularLineTo(f,c,20);return{connector:b,head:c,tail:f,headLine:h,tailLine:g,minX:Math.min(c.x,f.x,h[0].x,h[1].x),minY:Math.min(c.y,f.y,h[0].y,h[1].y),maxX:Math.max(c.x,f.x,h[0].x,h[1].x),maxY:Math.max(c.y,f.y,h[0].y,h[1].y)}} },b.Overlays.Label=function(a){this.labelStyle=a.labelStyle,this.cssClass=null!=this.labelStyle?this.labelStyle.cssClass:null;var c=b.extend({create:function(){return jsPlumb.createElement("div")}},a);if(b.Overlays.Custom.call(this,c),this.type="Label",this.label=a.label||"",this.labelText=null,this.labelStyle){var d=this.getElement();if(this.labelStyle.font=this.labelStyle.font||"12px sans-serif",d.style.font=this.labelStyle.font,d.style.color=this.labelStyle.color||"black",this.labelStyle.fillStyle&&(d.style.background=this.labelStyle.fillStyle),this.labelStyle.borderWidth>0){var e=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";d.style.border=this.labelStyle.borderWidth+"px solid "+e}this.labelStyle.padding&&(d.style.padding=this.labelStyle.padding)}},c.extend(b.Overlays.Label,b.Overlays.Custom,{cleanup:function(a){a&&(this.div=null,this.label=null,this.labelText=null,this.cssClass=null,this.labelStyle=null)},getLabel:function(){return this.label},setLabel:function(a){this.label=a,this.labelText=null,this.clearCachedDimensions(),this.update(),this.component.repaint()},getDimensions:function(){return this.update(),j.prototype.getDimensions.apply(this,arguments)},update:function(){if("function"==typeof this.label){var a=this.label(this);this.getElement().innerHTML=a.replace(/\r\n/g,"<br/>")}else null==this.labelText&&(this.labelText=this.label,this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"<br/>"))},updateFrom:function(a){a.label&&this.setLabel(a.label)}})}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=function(b){var c=b._mottle;return c||(c=b._mottle=new a.Mottle),c};b.extend(a.jsPlumbInstance.prototype,{getEventManager:function(){return c(this)},on:function(){return this.getEventManager().on.apply(this,arguments),this},off:function(){return this.getEventManager().off.apply(this,arguments),this}})}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=function(a){this.type="Flowchart",a=a||{},a.stub=null==a.stub?30:a.stub;var c,d,e=b.Connectors.AbstractConnector.apply(this,arguments),f=null==a.midpoint?.5:a.midpoint,g=a.alwaysRespectStubs===!0,h=null,i=null,j=null,k=null!=a.cornerRadius?a.cornerRadius:0,l=function(a){return 0>a?-1:0===a?0:1},m=function(a,b,c,d){if(i!=b||j!=c){var e=null==i?d.sx:i,f=null==j?d.sy:j,g=e==b?"v":"h",h=l(b-e),k=l(c-f);i=b,j=c,a.push([e,f,b,c,g,h,k])}},n=function(a){return Math.sqrt(Math.pow(a[0]-a[2],2)+Math.pow(a[1]-a[3],2))},o=function(a){var b=[];return b.push.apply(b,a),b},p=function(a,b,c){for(var d,f=null,g=0;g<b.length-1;g++){if(f=f||o(b[g]),d=o(b[g+1]),k>0&&f[4]!=d[4]){var h=Math.min(k,n(f),n(d));f[2]-=f[5]*h,f[3]-=f[6]*h,d[0]+=d[5]*h,d[1]+=d[6]*h;var i=f[6]==d[5]&&1==d[5]||f[6]==d[5]&&0===d[5]&&f[5]!=d[6]||f[6]==d[5]&&-1==d[5],j=d[1]>f[3]?1:-1,l=d[0]>f[2]?1:-1,m=j==l,p=m&&i||!m&&!i?d[0]:f[2],q=m&&i||!m&&!i?f[3]:d[1];e.addSegment(a,"Straight",{x1:f[0],y1:f[1],x2:f[2],y2:f[3]}),e.addSegment(a,"Arc",{r:h,x1:f[2],y1:f[3],x2:d[0],y2:d[1],cx:p,cy:q,ac:i})}else{var r=f[2]==f[0]?0:f[2]>f[0]?c.lw/2:-(c.lw/2),s=f[3]==f[1]?0:f[3]>f[1]?c.lw/2:-(c.lw/2);e.addSegment(a,"Straight",{x1:f[0]-r,y1:f[1]-s,x2:f[2]+r,y2:f[3]+s})}f=d}null!=d&&e.addSegment(a,"Straight",{x1:d[0],y1:d[1],x2:d[2],y2:d[3]})};this.setSegments=function(a){h=a},this.isEditable=function(){return!0
},this.getOriginalSegments=function(){return h||c},this._compute=function(a,b){if(b.clearEdits&&(h=null),null!=h)return p(this,h,a),void 0;c=[],i=null,j=null,d=null;var k=a.startStubX+(a.endStubX-a.startStubX)*f,l=a.startStubY+(a.endStubY-a.startStubY)*f,n={x:[0,1],y:[1,0]},o=function(){return[a.startStubX,a.startStubY,a.endStubX,a.endStubY]},q={perpendicular:o,orthogonal:o,opposite:function(b){var c=a,d="x"==b?0:1,e={x:function(){return 1==c.so[d]&&(c.startStubX>c.endStubX&&c.tx>c.startStubX||c.sx>c.endStubX&&c.tx>c.sx)||-1==c.so[d]&&(c.startStubX<c.endStubX&&c.tx<c.startStubX||c.sx<c.endStubX&&c.tx<c.sx)},y:function(){return 1==c.so[d]&&(c.startStubY>c.endStubY&&c.ty>c.startStubY||c.sy>c.endStubY&&c.ty>c.sy)||-1==c.so[d]&&(c.startStubY<c.endStubY&&c.ty<c.startStubY||c.sy<c.endStubY&&c.ty<c.sy)}};return!g&&e[b]()?{x:[(a.sx+a.tx)/2,a.startStubY,(a.sx+a.tx)/2,a.endStubY],y:[a.startStubX,(a.sy+a.ty)/2,a.endStubX,(a.sy+a.ty)/2]}[b]:[a.startStubX,a.startStubY,a.endStubX,a.endStubY]}},r={perpendicular:function(b){var c=a,d={x:[[[1,2,3,4],null,[2,1,4,3]],null,[[4,3,2,1],null,[3,4,1,2]]],y:[[[3,2,1,4],null,[2,3,4,1]],null,[[4,1,2,3],null,[1,4,3,2]]]},e={x:[[c.startStubX,c.endStubX],null,[c.endStubX,c.startStubX]],y:[[c.startStubY,c.endStubY],null,[c.endStubY,c.startStubY]]},f={x:[[k,c.startStubY],[k,c.endStubY]],y:[[c.startStubX,l],[c.endStubX,l]]},g={x:[[c.endStubX,c.startStubY]],y:[[c.startStubX,c.endStubY]]},h={x:[[c.startStubX,c.endStubY],[c.endStubX,c.endStubY]],y:[[c.endStubX,c.startStubY],[c.endStubX,c.endStubY]]},i={x:[[c.startStubX,l],[c.endStubX,l],[c.endStubX,c.endStubY]],y:[[k,c.startStubY],[k,c.endStubY],[c.endStubX,c.endStubY]]},j={x:[c.startStubY,c.endStubY],y:[c.startStubX,c.endStubX]},m=n[b][0],o=n[b][1],p=c.so[m]+1,q=c.to[o]+1,r=-1==c.to[o]&&j[b][1]<j[b][0]||1==c.to[o]&&j[b][1]>j[b][0],s=e[b][p][0],t=e[b][p][1],u=d[b][p][q];return c.segment==u[3]||c.segment==u[2]&&r?f[b]:c.segment==u[2]&&s>t?g[b]:c.segment==u[2]&&t>=s||c.segment==u[1]&&!r?i[b]:c.segment==u[0]||c.segment==u[1]&&r?h[b]:void 0},orthogonal:function(b,c,d,e,f){var g=a,h={x:-1==g.so[0]?Math.min(c,e):Math.max(c,e),y:-1==g.so[1]?Math.min(c,e):Math.max(c,e)}[b];return{x:[[h,d],[h,f],[e,f]],y:[[d,h],[f,h],[f,e]]}[b]},opposite:function(c,d,f,g){var h=a,i={x:"y",y:"x"}[c],j={x:"height",y:"width"}[c],m=h["is"+c.toUpperCase()+"GreaterThanStubTimes2"];if(b.sourceEndpoint.elementId==b.targetEndpoint.elementId){var n=f+(1-b.sourceEndpoint.anchor[i])*b.sourceInfo[j]+e.maxStub;return{x:[[d,n],[g,n]],y:[[n,d],[n,g]]}[c]}return!m||1==h.so[t]&&d>g||-1==h.so[t]&&g>d?{x:[[d,l],[g,l]],y:[[k,d],[k,g]]}[c]:1==h.so[t]&&g>d||-1==h.so[t]&&d>g?{x:[[k,h.sy],[k,h.ty]],y:[[h.sx,l],[h.tx,l]]}[c]:void 0}},s=q[a.anchorOrientation](a.sourceAxis),t="x"==a.sourceAxis?0:1,u="x"==a.sourceAxis?1:0,v=s[t],w=s[u],x=s[t+2],y=s[u+2];m(c,s[0],s[1],a);var z=r[a.anchorOrientation](a.sourceAxis,v,w,x,y);if(z)for(var A=0;A<z.length;A++)m(c,z[A][0],z[A][1],a);m(c,s[2],s[3],a),m(c,a.tx,a.ty,a),p(this,c,a)},this.getPath=function(){for(var a=null,b=null,d=[],e=h||c,f=0;f<e.length;f++){var g=e[f],i=g[4],j="v"==i?3:2;null!=a&&b===i?a[j]=g[j]:(g[0]!=g[2]||g[1]!=g[3])&&(d.push({start:[g[0],g[1]],end:[g[2],g[3]]}),a=g,b=g[4])}return d},this.setPath=function(a){h=[];for(var b=0;b<a.length;b++){var c=a[b].start[0],d=a[b].start[1],e=a[b].end[0],f=a[b].end[1],g=c==e?"v":"h",i=l(e-c),j=l(f-d);h.push([c,d,e,f,g,i,j])}} };c.extend(d,b.Connectors.AbstractConnector),b.registerConnectorType(d,"Flowchart")}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=function(a,b,c,d){return c>=a&&b>=d?1:c>=a&&d>=b?2:a>=c&&d>=b?3:4},e=function(a,b,c,d,e,f,g,h,i){return i>=h?[a,b]:1===c?d[3]<=0&&e[3]>=1?[a+(d[2]<.5?-1*f:f),b]:d[2]>=1&&e[2]<=0?[a,b+(d[3]<.5?-1*g:g)]:[a+-1*f,b+-1*g]:2===c?d[3]>=1&&e[3]<=0?[a+(d[2]<.5?-1*f:f),b]:d[2]>=1&&e[2]<=0?[a,b+(d[3]<.5?-1*g:g)]:[a+f,b+-1*g]:3===c?d[3]>=1&&e[3]<=0?[a+(d[2]<.5?-1*f:f),b]:d[2]<=0&&e[2]>=1?[a,b+(d[3]<.5?-1*g:g)]:[a+-1*f,b+-1*g]:4===c?d[3]<=0&&e[3]>=1?[a+(d[2]<.5?-1*f:f),b]:d[2]<=0&&e[2]>=1?[a,b+(d[3]<.5?-1*g:g)]:[a+f,b+-1*g]:void 0},f=function(a){a=a||{},this.type="StateMachine";var c=b.Connectors.AbstractConnector.apply(this,arguments),f=a.curviness||10,g=a.margin||5,h=a.proximityLimit||80,i=a.orientation&&"clockwise"===a.orientation,j=a.loopbackRadius||25,k=a.showLoopback!==!1;this._compute=function(a,b){var l=Math.abs(b.sourcePos[0]-b.targetPos[0]),m=Math.abs(b.sourcePos[1]-b.targetPos[1]);if(k&&b.sourceEndpoint.elementId===b.targetEndpoint.elementId){var n=b.sourcePos[0],o=b.sourcePos[1]-g,p=n,q=o-j,r=2*j,s=2*j,t=p-j,u=q-j;a.points[0]=t,a.points[1]=u,a.points[2]=r,a.points[3]=s,c.addSegment(this,"Arc",{loopback:!0,x1:n-t+4,y1:o-u,startAngle:0,endAngle:2*Math.PI,r:j,ac:!i,x2:n-t-4,y2:o-u,cx:p-t,cy:q-u})}else{var v=b.sourcePos[0]<b.targetPos[0]?0:l,w=b.sourcePos[1]<b.targetPos[1]?0:m,x=b.sourcePos[0]<b.targetPos[0]?l:0,y=b.sourcePos[1]<b.targetPos[1]?m:0;0===b.sourcePos[2]&&(v-=g),1===b.sourcePos[2]&&(v+=g),0===b.sourcePos[3]&&(w-=g),1===b.sourcePos[3]&&(w+=g),0===b.targetPos[2]&&(x-=g),1===b.targetPos[2]&&(x+=g),0===b.targetPos[3]&&(y-=g),1===b.targetPos[3]&&(y+=g);var z=(v+x)/2,A=(w+y)/2,B=d(v,w,x,y),C=Math.sqrt(Math.pow(x-v,2)+Math.pow(y-w,2)),D=e(z,A,B,b.sourcePos,b.targetPos,f,f,C,h);c.addSegment(this,"Bezier",{x1:x,y1:y,x2:v,y2:w,cp1x:D[0],cp1y:D[1],cp2x:D[0],cp2y:D[1]})}} };c.extend(f,b.Connectors.AbstractConnector),b.registerConnectorType(f,"StateMachine")}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=function(a){a=a||{};var c=b.Connectors.AbstractConnector.apply(this,arguments),d=a.curviness||150,e=10;this.type="Bezier",this.getCurviness=function(){return d},this._findControlPoint=function(a,b,c,f,g,h,i){var j=h[0]!=i[0]||h[1]==i[1],k=[];return j?(0===i[0]?k.push(c[0]<b[0]?a[0]+e:a[0]-e):k.push(a[0]+d*i[0]),0===i[1]?k.push(c[1]<b[1]?a[1]+e:a[1]-e):k.push(a[1]+d*h[1])):(0===h[0]?k.push(b[0]<c[0]?a[0]+e:a[0]-e):k.push(a[0]-d*h[0]),0===h[1]?k.push(b[1]<c[1]?a[1]+e:a[1]-e):k.push(a[1]+d*i[1])),k},this._compute=function(a,b){var d=b.sourcePos,e=b.targetPos,f=Math.abs(d[0]-e[0]),g=Math.abs(d[1]-e[1]),h=d[0]<e[0]?f:0,i=d[1]<e[1]?g:0,j=d[0]<e[0]?0:f,k=d[1]<e[1]?0:g,l=this._findControlPoint([h,i],d,e,b.sourceEndpoint,b.targetEndpoint,a.so,a.to),m=this._findControlPoint([j,k],e,d,b.targetEndpoint,b.sourceEndpoint,a.to,a.so);c.addSegment(this,"Bezier",{x1:h,y1:i,x2:j,y2:k,cp1x:l[0],cp1y:l[1],cp2x:m[0],cp2y:m[1]})}};c.extend(d,b.Connectors.AbstractConnector),b.registerConnectorType(d,"Bezier")}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d={"stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},e="stroke-dasharray",f="dashstyle",g="linearGradient",h="radialGradient",i="defs",j="fill",k="stop",l="stroke",m="stroke-width",n="style",o="none",p="jsplumb_gradient_",q="lineWidth",r={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml"},s=function(a,b){for(var c in b)a.setAttribute(c,""+b[c])},t=function(a,b){return b=b||{},b.version="1.1",b.xmlns=r.xhtml,jsPlumb.createElementNS(r.svg,a,null,null,b)},u=function(a){return"position:absolute;left:"+a[0]+"px;top:"+a[1]+"px"},v=function(a){for(var b=a.querySelectorAll(" defs,linearGradient,radialGradient"),c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c])},w=function(a,b,c,d,e){var f=p+e._jsPlumb.instance.idstamp();v(a);var m;m=c.gradient.offset?t(h,{id:f}):t(g,{id:f,gradientUnits:"userSpaceOnUse"});var n=t(i);a.appendChild(n),n.appendChild(m);for(var o=0;o<c.gradient.stops.length;o++){var q=1==e.segment||2==e.segment?o:c.gradient.stops.length-1-o,r=c.gradient.stops[q][1],s=t(k,{offset:Math.floor(100*c.gradient.stops[o][0])+"%","stop-color":r});m.appendChild(s)}var u=c.strokeStyle?l:j;b.setAttribute(u,"url(#"+f+")")},x=function(a,b,c,g,h){if(b.setAttribute(j,c.fillStyle?c.fillStyle:o),b.setAttribute(l,c.strokeStyle?c.strokeStyle:o),c.gradient?w(a,b,c,g,h):(v(a),b.setAttribute(n,"")),c.lineWidth&&b.setAttribute(m,c.lineWidth),c[f]&&c[q]&&!c[e]){var i=-1==c[f].indexOf(",")?" ":",",k=c[f].split(i),p="";k.forEach(function(a){p+=Math.floor(a*c.lineWidth)+i}),b.setAttribute(e,p)}else c[e]&&b.setAttribute(e,c[e]);for(var r in d)c[r]&&b.setAttribute(d[r],c[r])},y=function(a,b,c){a.childNodes.length>c?a.insertBefore(b,a.childNodes[c]):a.appendChild(b)};c.svg={node:t,attr:s,pos:u};var z=function(a){var d=a.pointerEventsSpec||"all",e={};b.jsPlumbUIComponent.apply(this,a.originalArgs),this.canvas=null,this.path=null,this.svg=null,this.bgCanvas=null;var f=a.cssClass+" "+(a.originalArgs[0].cssClass||""),g={style:"",width:0,height:0,"pointer-events":d,position:"absolute"};this.svg=t("svg",g),a.useDivWrapper?(this.canvas=jsPlumb.createElement("div",{position:"absolute"}),c.sizeElement(this.canvas,0,0,1,1),this.canvas.className=f):(s(this.svg,{"class":f}),this.canvas=this.svg),a._jsPlumb.appendElement(this.canvas,a.originalArgs[0].parent),a.useDivWrapper&&this.canvas.appendChild(this.svg);var h=[this.canvas];return this.getDisplayElements=function(){return h},this.appendDisplayElement=function(a){h.push(a)},this.paint=function(b,d,f){if(null!=b){var g,h=[this.x,this.y],i=[this.w,this.h];null!=f&&(f.xmin<0&&(h[0]+=f.xmin),f.ymin<0&&(h[1]+=f.ymin),i[0]=f.xmax+(f.xmin<0?-f.xmin:0),i[1]=f.ymax+(f.ymin<0?-f.ymin:0)),a.useDivWrapper?(c.sizeElement(this.canvas,h[0],h[1],i[0],i[1]),h[0]=0,h[1]=0,g=u([0,0])):g=u([h[0],h[1]]),e.paint.apply(this,arguments),s(this.svg,{style:g,width:i[0]||0,height:i[1]||0})}},{renderer:e}};c.extend(z,b.jsPlumbUIComponent,{cleanup:function(a){a||null==this.typeId?(this.canvas&&(this.canvas._jsPlumb=null),this.svg&&(this.svg._jsPlumb=null),this.bgCanvas&&(this.bgCanvas._jsPlumb=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.svg=null,this.canvas=null,this.path=null,this.group=null):(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.bgCanvas.parentNode.removeChild(this.bgCanvas))},reattach:function(a){var b=a.getContainer();this.canvas&&null==this.canvas.parentNode&&b.appendChild(this.canvas),this.bgCanvas&&null==this.bgCanvas.parentNode&&b.appendChild(this.bgCanvas)},setVisible:function(a){this.canvas&&(this.canvas.style.display=a?"block":"none")}}),b.ConnectorRenderers.svg=function(a){var c=this,d=z.apply(this,[{cssClass:a._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:a._jsPlumb}]);d.renderer.paint=function(d,e,f){var g=c.getSegments(),h="",i=[0,0];if(f.xmin<0&&(i[0]=-f.xmin),f.ymin<0&&(i[1]=-f.ymin),g.length>0){for(var j=0;j<g.length;j++)h+=b.Segments.svg.SegmentRenderer.getPath(g[j]),h+=" ";var k={d:h,transform:"translate("+i[0]+","+i[1]+")","pointer-events":a["pointer-events"]||"visibleStroke"},l=null,m=[c.x,c.y,c.w,c.h];if(d.outlineColor){var n=d.outlineWidth||1,o=d.lineWidth+2*n;l=b.extend({},d),delete l.gradient,l.strokeStyle=d.outlineColor,l.lineWidth=o,null==c.bgPath?(c.bgPath=t("path",k),b.addClass(c.bgPath,b.connectorOutlineClass),y(c.svg,c.bgPath,0)):s(c.bgPath,k),x(c.svg,c.bgPath,l,m,c)}null==c.path?(c.path=t("path",k),y(c.svg,c.path,d.outlineColor?1:0)):s(c.path,k),x(c.svg,c.path,d,m,c)}} },c.extend(b.ConnectorRenderers.svg,z),b.Segments.svg={SegmentRenderer:{getPath:function(a){return{Straight:function(){var b=a.getCoordinates();return"M "+b.x1+" "+b.y1+" L "+b.x2+" "+b.y2},Bezier:function(){var b=a.params;return"M "+b.x1+" "+b.y1+" C "+b.cp1x+" "+b.cp1y+" "+b.cp2x+" "+b.cp2y+" "+b.x2+" "+b.y2},Arc:function(){var b=a.params,c=a.sweep>Math.PI?1:0,d=a.anticlockwise?0:1;return"M"+a.x1+" "+a.y1+" A "+a.radius+" "+b.r+" 0 "+c+","+d+" "+a.x2+" "+a.y2}}[a.type]()}} };var A=b.SvgEndpoint=function(a){var c=z.apply(this,[{cssClass:a._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:a._jsPlumb}]);c.renderer.paint=function(a){var c=b.extend({},a);c.outlineColor&&(c.strokeWidth=c.outlineWidth,c.strokeStyle=c.outlineColor),null==this.node?(this.node=this.makeNode(c),this.svg.appendChild(this.node)):null!=this.updateNode&&this.updateNode(this.node),x(this.svg,this.node,c,[this.x,this.y,this.w,this.h],this),u(this.node,[this.x,this.y])}.bind(this)};c.extend(A,z),b.Endpoints.svg.Dot=function(){b.Endpoints.Dot.apply(this,arguments),A.apply(this,arguments),this.makeNode=function(){return t("circle",{cx:this.w/2,cy:this.h/2,r:this.radius})},this.updateNode=function(a){s(a,{cx:this.w/2,cy:this.h/2,r:this.radius})}},c.extend(b.Endpoints.svg.Dot,[b.Endpoints.Dot,A]),b.Endpoints.svg.Rectangle=function(){b.Endpoints.Rectangle.apply(this,arguments),A.apply(this,arguments),this.makeNode=function(){return t("rect",{width:this.w,height:this.h})},this.updateNode=function(a){s(a,{width:this.w,height:this.h})}},c.extend(b.Endpoints.svg.Rectangle,[b.Endpoints.Rectangle,A]),b.Endpoints.svg.Image=b.Endpoints.Image,b.Endpoints.svg.Blank=b.Endpoints.Blank,b.Overlays.svg.Label=b.Overlays.Label,b.Overlays.svg.Custom=b.Overlays.Custom;var B=function(a,c){a.apply(this,c),b.jsPlumbUIComponent.apply(this,c),this.isAppendedAtTopLevel=!1,this.path=null,this.paint=function(a,b){if(a.component.svg&&b){null==this.path&&(this.path=t("path",{"pointer-events":"all"}),a.component.svg.appendChild(this.path),this.canvas=a.component.svg);var e=c&&1==c.length?c[0].cssClass||"":"",f=[0,0];b.xmin<0&&(f[0]=-b.xmin),b.ymin<0&&(f[1]=-b.ymin),s(this.path,{d:d(a.d),"class":e,stroke:a.strokeStyle?a.strokeStyle:null,fill:a.fillStyle?a.fillStyle:null,transform:"translate("+f[0]+","+f[1]+")"})}};var d=function(a){return isNaN(a.cxy.x)||isNaN(a.cxy.y)?"":"M"+a.hxy.x+","+a.hxy.y+" L"+a.tail[0].x+","+a.tail[0].y+" L"+a.cxy.x+","+a.cxy.y+" L"+a.tail[1].x+","+a.tail[1].y+" L"+a.hxy.x+","+a.hxy.y};this.transfer=function(a){a.canvas&&this.path&&this.path.parentNode&&(this.path.parentNode.removeChild(this.path),a.canvas.appendChild(this.path))}};c.extend(B,[b.jsPlumbUIComponent,b.Overlays.AbstractOverlay],{cleanup:function(a){null!=this.path&&(a?this._jsPlumb.instance.removeElement(this.path):this.path.parentNode&&this.path.parentNode.removeChild(this.path))},reattach:function(){this.path&&this.canvas&&null==this.path.parentNode&&this.canvas.appendChild(this.path)},setVisible:function(a){null!=this.path&&(this.path.style.display=a?"block":"none")}}),b.Overlays.svg.Arrow=function(){B.apply(this,[b.Overlays.Arrow,arguments])},c.extend(b.Overlays.svg.Arrow,[b.Overlays.Arrow,B]),b.Overlays.svg.PlainArrow=function(){B.apply(this,[b.Overlays.PlainArrow,arguments])},c.extend(b.Overlays.svg.PlainArrow,[b.Overlays.PlainArrow,B]),b.Overlays.svg.Diamond=function(){B.apply(this,[b.Overlays.Diamond,arguments])},c.extend(b.Overlays.svg.Diamond,[b.Overlays.Diamond,B]),b.Overlays.svg.GuideLines=function(){var a,c,d=null,e=this;b.Overlays.GuideLines.apply(this,arguments),this.paint=function(b,g){null==d&&(d=t("path"),b.connector.svg.appendChild(d),e.attachListeners(d,b.connector),e.attachListeners(d,e),a=t("path"),b.connector.svg.appendChild(a),e.attachListeners(a,b.connector),e.attachListeners(a,e),c=t("path"),b.connector.svg.appendChild(c),e.attachListeners(c,b.connector),e.attachListeners(c,e));var h=[0,0];g.xmin<0&&(h[0]=-g.xmin),g.ymin<0&&(h[1]=-g.ymin),s(d,{d:f(b.head,b.tail),stroke:"red",fill:null,transform:"translate("+h[0]+","+h[1]+")"}),s(a,{d:f(b.tailLine[0],b.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+h[0]+","+h[1]+")"}),s(c,{d:f(b.headLine[0],b.headLine[1]),stroke:"green",fill:null,transform:"translate("+h[0]+","+h[1]+")"})};var f=function(a,b){return"M "+a.x+","+a.y+" L"+b.x+","+b.y}},c.extend(b.Overlays.svg.GuideLines,b.Overlays.GuideLines)}.call(this),function(){"use strict";var a=this,b=a.jsPlumb,c=a.jsPlumbUtil,d=a.Katavorio,e=a.Biltong,f=function(a,b){b=b||"main";var c="_katavorio_"+b,f=a[c],g=a.getEventManager();return f||(f=new d({bind:g.on,unbind:g.off,getSize:jsPlumb.getSize,getPosition:function(b){var c=a.getOffset(b,!1,b._katavorioDrag?b.offsetParent:null);return[c.left,c.top]},setPosition:function(a,b){a.style.left=b[0]+"px",a.style.top=b[1]+"px"},addClass:jsPlumb.addClass,removeClass:jsPlumb.removeClass,intersects:e.intersects,indexOf:function(a,b){return a.indexOf(b)},css:{noSelect:a.dragSelectClass,droppable:"jsplumb-droppable",draggable:"jsplumb-draggable",drag:"jsplumb-drag",selected:"jsplumb-drag-selected",active:"jsplumb-drag-active",hover:"jsplumb-drag-hover"}}),a[c]=f,a.bind("zoom",f.setZoom)),f},g=function(a,b){var d=function(d){if(null!=b[d]){if(c.isString(b[d])){var e=b[d].match(/-=/)?-1:1,f=b[d].substring(2);return a[d]+e*f}return b[d]}return a[d]};return[d("left"),d("top")]};b.extend(a.jsPlumbInstance.prototype,{animationSupported:!0,getElement:function(a){return null==a?null:(a="string"==typeof a?a:null!=a.length&&null==a.enctype?a[0]:a,"string"==typeof a?document.getElementById(a):a)},removeElement:function(a){f(this).elementRemoved(a),this.getEventManager().remove(a)},doAnimate:function(a,b,c){c=c||{};var d=this.getOffset(a),e=g(d,b),f=e[0]-d.left,h=e[1]-d.top,i=c.duration||250,j=15,k=i/j,l=j/i*f,m=j/i*h,n=0,o=setInterval(function(){jsPlumb.setPosition(a,{left:d.left+l*(n+1),top:d.top+m*(n+1)}),null!=c.step&&c.step(n,Math.ceil(k)),n++,n>=k&&(window.clearInterval(o),null!=c.complete&&c.complete())},j)},destroyDraggable:function(a,b){f(this,b).destroyDraggable(a)},destroyDroppable:function(a,b){f(this,b).destroyDroppable(a)},initDraggable:function(a,b,c){f(this,c).draggable(a,b)},initDroppable:function(a,b,c){f(this,c).droppable(a,b)},isAlreadyDraggable:function(a){return null!=a._katavorioDrag},isDragSupported:function(){return!0},isDropSupported:function(){return!0},isElementDraggable:function(a){return a=jsPlumb.getElement(a),a._katavorioDrag&&a._katavorioDrag.isEnabled()},getDragObject:function(a){return a[0].drag.getDragElement()},getDragScope:function(a){return a._katavorioDrag&&a._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(a){return a[0].e},getUIPosition:function(a){var b=a[0].el,c={left:a[0].pos[0],top:a[0].pos[1]};if(b._katavorioDrag&&b.offsetParent!==this.getContainer()){var d=this.getOffset(b.offsetParent);c.left+=d.left,c.top+=d.top}return c},setDragFilter:function(a,b,c){a._katavorioDrag&&a._katavorioDrag.setFilter(b,c)},setElementDraggable:function(a,b){a=jsPlumb.getElement(a),a._katavorioDrag&&a._katavorioDrag.setEnabled(b)},setDragScope:function(a,b){a._katavorioDrag&&a._katavorioDrag.k.setDragScope(a,b)},setDropScope:function(a,b){a._katavorioDrop&&a._katavorioDrop.length>0&&a._katavorioDrop[0].k.setDropScope(a,b)},addToPosse:function(a){var b=Array.prototype.slice.call(arguments,1),c=f(this);jsPlumb.each(a,function(a){a=[jsPlumb.getElement(a)],a.push.apply(a,b),c.addToPosse.apply(c,a)})},removeFromPosse:function(a){var b=Array.prototype.slice.call(arguments,1),c=f(this);jsPlumb.each(a,function(a){a=[jsPlumb.getElement(a)],a.push.apply(a,b),c.removeFromPosse.apply(c,a)})},removeFromAllPosses:function(a){var b=f(this);jsPlumb.each(a,function(a){b.removeFromAllPosses(jsPlumb.getElement(a))})},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete",beforeStart:"beforeStart"},animEvents:{step:"step",complete:"complete"},stopDrag:function(a){a._katavorioDrag&&a._katavorioDrag.abort()},addToDragSelection:function(a){f(this).select(a)},removeFromDragSelection:function(a){f(this).deselect(a)},clearDragSelection:function(){f(this).deselectAll()},trigger:function(a,b,c,d){this.getEventManager().trigger(a,b,c,d)},doReset:function(){for(var a in this)0===a.indexOf("_katavorio_")&&this[a].reset()}});var h=function(a){var b=function(){/complete|loaded|interactive/.test(document.readyState)&&"undefined"!=typeof document.body&&null!=document.body?a():setTimeout(b,9)};b()};h(b.init)}.call(this);
</script><!-- }}} -->
<!-- Page scripts {{{ --><script quine="true">
"use strict";
var numCopiesOfEachWorksheet = 3;
/// Whether any data has been entered. Set when you type into any text box, and
/// determines whether to prompt on tab close/reload
var dataEntered = false;
function makeInstructionAndWorksheetRenderings()
{
var sections = $(".section");
for(var ii=0; ii<sections.length; ii++)
{
var original = $(sections[ii]);
var instructionsRender = original.clone();
var worksheetRender = original.clone();
original.addClass("mixedRender");
instructionsRender.addClass("instructionsRender noQuine");
worksheetRender.addClass("worksheetRender noQuine");
instructionsRender.insertAfter(original);
$(".onlyInstructions, .onlyWorksheet, .onlyPrint", original).remove();
$(".notInstructions, .onlyWorksheet, .onlyMixed, .instructionsRender, .noPrint", instructionsRender).remove();
$(".instructions, .onlyInstructions, .onlyMixed, .noPrint", worksheetRender).remove();
var laidOutWorksheet = doWorksheetLayout(worksheetRender);
laidOutWorksheet.insertAfter(instructionsRender);
}
}
/// Find elements with the "step" class, and give them timers and textareas.
function addTimersAndTextareas()
{
var steps = $(".step");
for(var ii=0; ii<steps.length; ii++)
(function() {
{
var step = steps[ii];
var durationStr = $(step).attr("duration");
var timer = null;
if(durationStr) {
var durationSecs = parseTimerDuration(durationStr);
timer = new Timer(durationSecs, function() {
playGongSound();
});
timer.element.appendTo(step);
var printTimerInstructions = $(
'<span class="timerInstructions noQuine">'
+renderDuration(durationSecs)
+'</span>');
// If the step contains an H3, put the print version of the timer
// inside it. Otherwise, backtrack until we find an H3, and put it
// there.
var instructionsTarget = null;
if($("h3", step).length>0) {
instructionsTarget = $("h3", step);
} else {
// HACK
var candidates = $("h3, .step");
for(var jj=1; jj<candidates.length; jj++) {
if(candidates[jj] == step) {
instructionsTarget = candidates[jj-1];
break;
}
}
}
printTimerInstructions.appendTo(instructionsTarget);
}
var textarea;
if($("textarea", step).length > 0)
textarea = $("textarea", step);
else
textarea = $("<textarea></textarea>");
if(timer) {
$(textarea).on("focus", function() {
timer.unpause();
});
}
$(textarea).on("keydown", function() {
dataEntered = true;
});
textarea.appendTo(step);
autoExpandTextarea(textarea);
}})();
}
function addSaveButtons()
{
var sections = $(".section.mixedRender");
for(var ii=0; ii<sections.length; ii++)
(function()
{
var section = sections[ii];
var buttons = $('<div class="buttonContainer noQuine">'
+'<button class="saveButton">Save</button>'
+'<button class="feedbackButton">Send Feedback</button>'
+'</div>');
$(".saveButton", buttons).click(function() {
saveWorksheet(section);
});
$(".feedbackButton", buttons).click(function() {
sendFeedbackOn(section);
});
buttons.appendTo(section);
})();
}
function openFeedbackEmail()
{
}
/// For each .worksheetRender element, make it so that it is the first of
/// numCopies identical elements (all but the first of which with the
/// "worksheetCopy" class).
function duplicateWorksheets(numCopies)
{
var worksheets = $(".worksheetRender");
// Remove any duplicates that were already added
$(".worksheetCopy").remove();
for(var ii=0; ii<worksheets.length; ii++)
{
var worksheet = $(worksheets[ii]);
for(var jj=0; jj<numCopies-1; jj++)
{
var copy = worksheet.clone();
copy.addClass("worksheetCopy");
copy.insertAfter(worksheet);
}
}
}
/// Adjust the sizes of the whitespace between questions on a worksheet, to
/// nicely fill pages in print layout.
function doWorksheetLayout(worksheet)
{
// Unwrap numberedPage divs (which apply to the instructions render, but not
// to the worksheet render).
var numberedPages = $(".numberedPage", worksheet);
for(var ii=0; ii<numberedPages.length; ii++)
{
var numberedPage = $(numberedPages[ii]);
numberedPage.replaceWith(numberedPage.contents());
}
var pages = $('<div></div>');
pages.addClass(worksheet.attr("class"));
var currentPage = $('<div class="worksheetPage noQuine"></div>');
var worksheetChildElements = worksheet.children();
for(var ii=0; ii<worksheetChildElements.length; ii++)
{
var element = $(worksheetChildElements[ii]);
if(element.hasClass("worksheetPageBreak")) {
var page = doWorksheetLayoutForPage(currentPage);
page.appendTo(pages);
currentPage = $('<div class="worksheetPage noQuine"></div>');
} else {
element.clone().appendTo(currentPage);
}
}
if(currentPage.children().length > 0) {
var page = doWorksheetLayoutForPage(currentPage);
page.appendTo(pages);
}
return pages;
}
/// Set sizes for one worksheet page. Elements with the "weight" attribute are
/// automatically sized; elements without it are not.
function doWorksheetLayoutForPage(page)
{
var elements = page.children();
var totalWeight = 0;
var totalFixedHeight = 0;
// Compute the total height of fixed-size elements and total weight
for(var ii=0; ii<elements.length; ii++)
{
var element = $(elements[ii]);
var weight = element.attr("weight");
if(weight && weight>0) { // Has weight?
totalWeight += parseFloat(weight);
} else { // Otherwise fixed-size
var heightInInches = estimateElementPrintHeightInches(element);
totalFixedHeight += heightInInches;
}
}
// Amount of space to auto-allocate from. This is letter size minus 1 inch
// top and bottom margins minus half an inch fudge. The fudge is caused by
// failing to account for inter-element margins properly.
var pageHeightInches = 7.8;
var spaceToAllocate = pageHeightInches - totalFixedHeight;
var scaleFactor = spaceToAllocate / totalWeight;
for(var ii=0; ii<elements.length; ii++)
{
var element = $(elements[ii]);
var weight = element.attr("weight");
if(weight && weight>0) {
var heightInInches = parseFloat(weight) * scaleFactor;
element.css({
height: heightInInches+"in"
});
}
}
return page.clone();
}
function estimateElementPrintHeightInches(element)
{
var sizeTestContainer = $('<div style="position: absolute; left: -10000; width:7.5in"></div>');
sizeTestContainer.appendTo('body');
var copy = element.clone();
copy.appendTo(sizeTestContainer);
var heightInPx = copy.height();
var dpiMeasurer = $('<div style="height:1in"></div>');
dpiMeasurer.appendTo(sizeTestContainer);
var dpi = dpiMeasurer.height();
var heightInInches = heightInPx/dpi;
sizeTestContainer.remove();
return heightInInches;
}
/// Returns an anchor that would be used to link to the given element: either
/// the element's ID, or the ID of the closest element in the parent-chain,
/// prepended with a '#'. If there's no suitable ID, returns null instead.
function getAnchorNameFor(element)
{
while(element)
{
var id = $(element).attr('id');
if(id && id.length>0)
return '#'+id;
element = element.parentElement;
}
return null;
}
/// Add page-numbering elements and fill in page-numbering cross references for
/// print.
///
/// Unfortunately, browsers don't really do page numbering. The way they would
/// do it if they did is standardized in CSS3 ("page-margin boxes"), but none
/// of the major browsers actually implement it. And even if that was
/// implemented, it still wouldn't help us make things like a table of contents
/// with correct page numbers in it.
///
/// So instead, this is a bit of a hack: there are elements with class
/// .numberedPage, each such element fills a page which gets auto-numbered, and
/// pages without corresponding .numberedPage elements have no page numbers on
/// them and don't increment the page number. In the case of worksheets, this
/// is intended - those shouldn't be in the numbered sequence, since you're
/// expected to add and remove copies. Everywhere else, this means you have to
/// manually paginate by splitting long texts into page-sized chunks.
///
/// Cross-references are created by creating an element which looks like this:
/// <a href="#Section" class="pageNumberRef">Section Description</a>
/// This function will find the element with the corresponding ID, and insert
/// the page number of the first numbered page within that element. (On screen,
/// it will be a normal working anchor link.)
function addPageNumbers()
{
var numberedPages = $(".numberedPage");
var pageNumbers = {};
var currentPageNumber = 1;
for(var ii=0; ii<numberedPages.length; ii++)
{
var pageElement = numberedPages[ii];
if(!elementIsPrinted(pageElement))
continue;
var pageNumber = currentPageNumber++;
var pageNumberElement = $('<div class="pageNumberContainer"><div class="pageNumber">'+pageNumber+'</div></div>');
pageNumberElement.prependTo(pageElement);
$(pageElement).attr("number", pageNumber);
var anchorName = getAnchorNameFor(pageElement);
if(anchorName && !(anchorName in pageNumbers))
pageNumbers[anchorName] = pageNumber;
pageNumbers[pageElement] = pageNumber;
}
var pageNumberRefs = $(".pageNumberRef");
for(var ii=0; ii<pageNumberRefs.length; ii++)
{
var linkElement = $(pageNumberRefs[ii]);
var target = linkElement.attr('href');
if(!target.startsWith("#"))
continue;
var targetID = target.substring(1);
var targetElement = getPrintElementById(targetID);
var pageNumber = getPageNumberFor(targetElement);
if(!pageNumber) pageNumber="-";
$('<span class="pageNumberDisplay">'+pageNumber+'</span>').appendTo(linkElement);
}
}
/// Get an element with the given ID, excluding elements that don't appear in print
function getPrintElementById(id)
{
// HACK
return $('#'+id+':not(.mixedRender)')[0];
}
function elementIsPrinted(element)
{
var pos = element;
while(pos) {
var $pos = $(pos);
if($pos.hasClass("mixedRender")) return false;
if($pos.hasClass("noPrint")) return false;
if($pos.hasClass("placeholder")) return false;
pos = pos.parentElement;
}
return true;
}
/// Get the page number of the page the element appears on, as a string for
/// display. (Actually, a bit more subtle than that. If this *contains* a
/// numberedPage element, returns the first contained numberedPage element's
/// page number. Otherwise if it's contained in a numberedPage element, returns
/// that element's page number. Otherwise returns the string "?".
///
/// This will only work after addPageNumbers() has marked elements with their
/// page numbers.
function getPageNumberFor(element)
{
var numberedPagesInside = $(".numberedPage", element);
if(numberedPagesInside.length > 0)
return $(numberedPagesInside[0]).attr("number");
var pos = element;
while(pos)
{
if($(pos).hasClass("numberedPage"))
return $(pos).attr("number");
pos = pos.parentElement;
}
return "?";
}
/// Modify the page so that only the given element (subpage) is visible, by
/// adding the .inactiveSection class to every element that is a sibling of an
/// ancestor.
function navigateToSubpage(subpage)
{
var pos = $(subpage);
$(".inactiveSection").removeClass("inactiveSection");
for(var pos=$(subpage); pos && pos.attr('id') != "MainSequence"; pos=pos.parent())
{
var siblings = pos.siblings();
for(var ii=0; ii<siblings.length; ii++) {
var sibling = $(siblings[ii]);
sibling.addClass("inactiveSection");
}
}
return $(subpage);
}
/// Take a string (from the "duration") attribute and parse it, returning a
/// number of seconds. Currently, the string is taken to just be a float with
/// the number of minutes; this might be extended to allow strings with
/// explicit units in them.
function parseTimerDuration(str)
{
// TODO: Handle units, special cases, etc
var durationMins = parseFloat(str);
var durationSecs = durationMins*60;
return durationSecs;
}
function Timer(durationSecs, onFinish)
{
this.element = $('<div class="timerDisplay noQuine"></div>');
this.durationSecs = durationSecs;
this.isPaused = true;
this.timeLeft = durationSecs;
this.onFinish = onFinish;
this.updateText();
var _this = this;
this.element.click(function() {
if(_this.isFinished()) {
_this.reset();
} else if(_this.isPaused) {
_this.unpause();
} else {
_this.pause();
}
});
}
Timer.prototype.unpause = function()
{
if(!this.isPaused)
return;
if(!this.isFinished())
{
this.isPaused = false;
this.startTime = new Date();
this.tick();
}
}
Timer.prototype.pause = function()
{
if(this.isPaused)
return;
this.timeLeft = this.getRemainingSeconds();
this.isPaused = true;
}
Timer.prototype.getRemainingSeconds = function()
{
if(this.isPaused) {
return this.timeLeft;
} else {
var now = new Date();
var elapsedSecs = (now-this.startTime)/1000;
return this.timeLeft - elapsedSecs;
}
}
Timer.prototype.finish = function()
{
this.timeLeft = 0;
this.isPaused = true;
this.onFinish();
}
Timer.prototype.isFinished = function()
{
return this.getRemainingSeconds() <= 0;
}
Timer.prototype.reset = function()
{
this.timeLeft = this.durationSecs;
this.isPaused = true;
this.updateText();
}
Timer.prototype.tick = function()
{
var _this = this;
if(this.isPaused)
return;
if(this.isFinished()) {
this.finish();
} else {
var tickInterval = 50;
// HACK: Re-poll the clock every 50ms (because that's easier than
// dealing with integer-rounding type issues to get it to poll once
// per second)
setTimeout(function() {
_this.tick();
}, tickInterval);
}
this.updateText();
}
Timer.prototype.updateText = function()
{
var newText = this.labelFromSecondsRemaining(this.getRemainingSeconds());
this.element.text(newText);
}
Timer.prototype.labelFromSecondsRemaining = function(timeRemainingSecs)
{
var mins = Math.floor(timeRemainingSecs/60);
var secs = Math.floor(timeRemainingSecs - (mins*60));
var secsStr = (secs<10) ? "0"+secs : ""+secs;
return mins+':'+secsStr;
}
/// Play a sound, to indicate that a timer has finished.
function playGongSound()
{
var audioElement = $("#gongSound")[0];
audioElement.pause();
audioElement.currentTime = 0;
audioElement.play();
}
/// Get the version-number string by extracting text from the #versionNumber
/// element on the title page.
function getVersionString()
{
return $('#versionNumber').text();
}
function renderDuration(durationSecs)
{
var durationMins = durationSecs/60;
if(durationMins === 1.0)
return "(1 minute)";
else if(durationMins > 1.0)
return "("+durationMins+" minutes)";
else //(durationMins<1)
return "("+durationSecs+" seconds)";
}
/// Make a textarea that expands vertically as you type in it.
function autoExpandTextarea(textarea)
{
var heightLimit = 400;