Eliahu commited on
Commit
27e7d8e
·
1 Parent(s): d9ab175

Initial commit Model Atlas space

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ modalities_data.json filter=lfs diff=lfs merge=lfs -text
37
+ large_nlp_data.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,13 +1,12 @@
1
  ---
2
  title: Model Atlas
3
- emoji: 🐢
4
- colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 5.20.1
8
  app_file: app.py
9
  pinned: false
10
- short_description: Interactive repo visualization and analysis tool
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
  title: Model Atlas
3
+ emoji: 🗺️
4
+ colorFrom: indigo
5
  colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 5.20.1
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import requests
4
+ from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
5
+ from urllib.parse import parse_qs, urlparse
6
+
7
+
8
+ class RequestHandler(SimpleHTTPRequestHandler):
9
+ def do_GET(self):
10
+ if self.path == "/":
11
+ self.path = "index.html"
12
+
13
+ return SimpleHTTPRequestHandler.do_GET(self)
14
+
15
+ else:
16
+ return SimpleHTTPRequestHandler.do_GET(self)
17
+
18
+
19
+ server = ThreadingHTTPServer(("", 7860), RequestHandler)
20
+
21
+ server.serve_forever()
config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "network",
3
+ "version": "1.0",
4
+ "data": "modalities_data.json",
5
+ "logo": {
6
+ "file": "",
7
+ "link": "",
8
+ "text": "Test"
9
+ },
10
+ "text": {
11
+ "more": "More",
12
+ "intro": "A model atlas for a small region of Hugging Face. The model atlas was introduced in the paper \"Charting and Navigating Hugging Face's Model Atlas\". <br><br> For more details see <a href=\"https://horwitz.ai/model-atlas\" target=\"_blank\">horwitz.ai/model-atlas</a>. <br><br><br> Note: This visualizes a very small part of Hugging Face, more maps coming soon... <br><br><br> Note: this is an alpha version, many features are missing including edge arrows and node borders, they will be added in a future version.",
13
+ "title": "Model Atlas"
14
+ },
15
+ "legend": {
16
+ "edgeLabel": "edgeLabel",
17
+ "colorLabel": "colorLabel",
18
+ "nodeLabel": "nodeLabel"
19
+ },
20
+ "features": {
21
+ "search": true,
22
+ "groupSelectorAttribute": false,
23
+ "hoverBehavior": "dim"
24
+ },
25
+ "informationPanel": {
26
+ "groupByEdgeDirection": false,
27
+ "imageAttribute": false
28
+ },
29
+ "sigma": {
30
+ "drawingProperties": {
31
+ "defaultEdgeType": "curve",
32
+ "defaultHoverLabelBGColor": "#002147",
33
+ "defaultLabelBGColor": "#ddd",
34
+ "activeFontStyle": "bold",
35
+ "defaultLabelColor": "#000",
36
+ "labelThreshold": 10,
37
+ "defaultLabelHoverColor": "#fff",
38
+ "fontStyle": "bold",
39
+ "hoverFontStyle": "bold",
40
+ "defaultLabelSize": 14
41
+
42
+
43
+ },
44
+ "graphProperties": {
45
+ "maxEdgeSize": 2.5,
46
+ "minEdgeSize": 2,
47
+ "minNodeSize": 1,
48
+ "maxNodeSize": 7
49
+ },
50
+ "mouseProperties": {
51
+ "maxRatio": 20,
52
+ "minRatio": 0.75
53
+ }
54
+ }
55
+ }
css/style.css ADDED
@@ -0,0 +1,688 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * {
2
+ padding: 0px;
3
+ margin: 0px;
4
+ }
5
+
6
+ .cf:before, .cf:after {
7
+ content: "";
8
+ display: table;
9
+ }
10
+
11
+ .cf:after {
12
+ clear: both;
13
+ }
14
+
15
+ .cf {
16
+ zoom: 1;
17
+ }
18
+
19
+ html,body {
20
+ width: 100%;
21
+ height: 100%;
22
+ margin: 0px;
23
+ padding: 0px;
24
+ font-size: 12px;
25
+ font-family: sans-serif;
26
+ line-height:1.25em;
27
+ }
28
+
29
+ .sigma-parent {
30
+ position: relative;
31
+ height: 100%;
32
+ }
33
+
34
+ .sigma-expand {
35
+ position: absolute;
36
+ width: 100%;
37
+ height: 100%;
38
+ top: 0;
39
+ left: 0;
40
+ background-color: #eee;
41
+ background-position: center center;
42
+ background-repeat: no-repeat;
43
+ -webkit-touch-callout: none;
44
+ -webkit-user-select: none;
45
+ -khtml-user-select: none;
46
+ -moz-user-select: none;
47
+ -ms-user-select: none;
48
+ user-select: none;
49
+ }
50
+
51
+ canvas#sigma_bg_1 {
52
+ display: none;
53
+ }
54
+
55
+ #attributepane {
56
+ display: block;
57
+ display: none;
58
+ position:absolute;
59
+ height:auto;
60
+ bottom:0;
61
+ top:0;
62
+ right:0;
63
+ width: 240px;
64
+ background-color: #fff;
65
+ margin: 0;
66
+ word-wrap: break-word;
67
+ background-color:rgba(255,255,255,0.8);
68
+ border-left: 1px solid #ccc;
69
+ padding: 0px 18px 0px 18px;
70
+ z-index: 1;
71
+ }
72
+
73
+
74
+ #attributepane .text {
75
+ height:100%;
76
+ }
77
+
78
+ #attributepane .headertext {
79
+ color: #000;
80
+ margin-bottom: 5px;
81
+ height: 14px;
82
+ border-bottom: 1px solid #999;
83
+ padding: 0px 0 10px 0;
84
+ font-size:16px;
85
+ font-weight:bold;
86
+ }
87
+
88
+
89
+ #attributepane .returntext em {
90
+ background-image: url('../images/sprite.png');
91
+ background-repeat: no-repeat;
92
+ display: block;
93
+ width: 20px;
94
+ height: 20px;
95
+ background-position: -91px -13px;
96
+ float: left;
97
+ }
98
+
99
+ #attributepane .returntext span {
100
+ padding-left: 5px;
101
+ display: block;
102
+ }
103
+
104
+ #attributepane .close {
105
+ padding-left: 14px;
106
+ margin-top: 10px;
107
+ }
108
+
109
+ #attributepane .close .c {
110
+ border-top: 2px solid #999;
111
+ padding: 10px 0 14px 0;
112
+ }
113
+
114
+ #attributepane .close em {
115
+ background-image: url('../images/sprite.png');
116
+ background-repeat: no-repeat;
117
+ background-position: -11px -13px;
118
+ display: block;
119
+ width: 24px;
120
+ height: 16px;
121
+ float: left;
122
+ }
123
+
124
+ #attributepane .close span {
125
+ display: block;
126
+ width: 151px;
127
+ float: left;
128
+ }
129
+
130
+ #attributepane .nodeattributes {
131
+ display:block;
132
+ height:85%;
133
+ overflow-y: scroll;
134
+ overflow-x: hidden;
135
+ border-bottom:1px solid #999;
136
+ }
137
+
138
+ #attributepane .name {
139
+ font-size: 14px;
140
+ cursor: default;
141
+ padding-bottom: 10px;
142
+ padding-top: 18px;
143
+ font-weight:bold;
144
+ }
145
+
146
+ #attributepane .data {
147
+
148
+ }
149
+
150
+ #attributepane .data .plus {
151
+ background-repeat: no-repeat;
152
+ background-image: url('../images/sprite.png');
153
+ background-position: -171px -122px;
154
+ width: 22px;
155
+ height: 20px;
156
+ float: left;
157
+ display: block;
158
+ }
159
+
160
+ #attributepane .link {
161
+ padding: 0 0 0 4px;
162
+ }
163
+
164
+ #attributepane .link li {
165
+ padding-top: 2px;
166
+ cursor:pointer;
167
+ }
168
+
169
+ #attributepane .p {
170
+ padding-top: 10px;
171
+ font-weight: bold;
172
+ font-size:14px;
173
+ }
174
+
175
+ .left-close {
176
+ background-image: url('../images/fancybox_sprite.png');
177
+ margin-left:-37px;
178
+ z-index:99999;
179
+ cursor: pointer;
180
+ padding-left:31px;
181
+ line-height:36px;
182
+ background-repeat: no-repeat;
183
+ margin-bottom:25px;
184
+ font-weight: bold;
185
+ font-size:14px;
186
+
187
+ }
188
+
189
+ #developercontainer {
190
+ margin-left:25px;
191
+ margin-bottom:25px;
192
+ position:fixed;
193
+ bottom:0;
194
+ }
195
+
196
+ #jisc {
197
+ width: 71px;
198
+ height: 56px;
199
+ background-image: url('../images/jisc-logo-small.png');
200
+ background-repeat: no-repeat;
201
+ display:inline-block;
202
+ }
203
+
204
+ #jisc span {
205
+ display:none;
206
+ }
207
+
208
+ #oii {
209
+ width: 227px;
210
+ height: 56px;
211
+ background-image: url('../images/oii_text.png');
212
+ background-repeat: no-repeat;
213
+ display:inline-block;
214
+ margin-right:10px;
215
+
216
+ }
217
+
218
+ #oii span {
219
+ display:none;
220
+ }
221
+
222
+ #maintitle {
223
+ width: 100%;
224
+ height: 72px;
225
+ background-repeat: no-repeat;
226
+ margin-bottom:20px;
227
+ }
228
+
229
+ #maintitle h1 {
230
+ display: none;
231
+ }
232
+
233
+ #mainpanel {
234
+ margin-top: 50px;
235
+ margin-left: 25px;
236
+ background:#fff;
237
+ background-color:rgba(255,255,255,0.8);
238
+ border:1px solid #ccc;
239
+ z-index:20;
240
+ position:fixed;
241
+ top:0;
242
+ }
243
+
244
+ #mainpanel .b1 {
245
+ padding: 0px 0 0 0;
246
+ }
247
+
248
+ #mainpanel .col {
249
+ width: 240px;
250
+ padding: 18px 18px 18px 18px;
251
+ margin: 0;
252
+
253
+ }
254
+
255
+ #title {
256
+ font-weight: bold;
257
+ }
258
+
259
+ #titletext {
260
+ padding: 6px 0 10px 0;
261
+ }
262
+
263
+ #info {
264
+ padding-bottom:15px;
265
+ }
266
+
267
+
268
+ #search {
269
+ border-top: 1px solid #999;
270
+ padding: 20px 0 0px 2px;
271
+ }
272
+
273
+ #search input[name=search] {
274
+ border: 1px solid #999;
275
+ background-color: #fff;
276
+ padding: 5px 7px 4px 7px;
277
+ width: 205px;
278
+ color: #000;
279
+ }
280
+
281
+ #search input.empty {
282
+ color: #000;
283
+ }
284
+
285
+ #search .state {
286
+ width: 14px;
287
+ height: 14px;
288
+ background-image: url('../images/sprite.png');
289
+ float: right;
290
+ margin-top: 6px;
291
+ cursor: pointer;
292
+ background-position: -131px -13px;
293
+ }
294
+
295
+ #search .state.searching {
296
+ background-position: -11px -13px;
297
+ }
298
+
299
+
300
+ #search .results {
301
+ max-height: 300px; /* You can adjust this height as needed */
302
+ overflow-y: auto; /* Enables vertical scrolling */
303
+ margin-top: 5px;
304
+ border: 1px solid #ccc;
305
+ border-radius: 4px;
306
+ background-color: #fff;
307
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
308
+ padding: 5px;
309
+ }
310
+
311
+
312
+ #search .results b {
313
+ padding-left: 2px;
314
+ }
315
+
316
+
317
+ #search .results a {
318
+ display: block;
319
+ padding: 5px;
320
+ text-decoration: none;
321
+ color: #333;
322
+ }
323
+
324
+ #search .results a:hover {
325
+ background-color: #f5f5f5;
326
+ }
327
+
328
+
329
+ #attributeselect {
330
+ margin: 20px 0 13px 0 ;
331
+ -webkit-touch-callout: none;
332
+ -webkit-user-select: none;
333
+ -khtml-user-select: none;
334
+ -moz-user-select: none;
335
+ -ms-user-select: none;
336
+ user-select: none;
337
+ }
338
+
339
+ #attributeselect .select {
340
+ border: 1px solid #999;
341
+ padding: 5px 7px 4px 7px;
342
+ color: #fff;
343
+ cursor: pointer;
344
+ background-color: #999;
345
+ background-image: url('../images/sprite.png');
346
+ background-repeat: no-repeat;
347
+ background-position: 200px -144px;
348
+ }
349
+
350
+ #attributeselect .close {
351
+ background-position: 200px -8px;
352
+ }
353
+
354
+ #attributeselect .list {
355
+ display: none;
356
+ border: 1px solid
357
+ #999;
358
+ padding: 6px;
359
+ height: 150px;
360
+ width: 226px;
361
+ overflow-y: scroll;
362
+ overflow-x: hidden;
363
+ background-color: #999;
364
+ /*position: relative;
365
+ left: 240px;
366
+ bottom: 164px;*/
367
+ position:absolute;
368
+ margin-left: 240px;
369
+ margin-top:-164px;
370
+ color: white;
371
+ }
372
+
373
+ #attributeselect .list a {
374
+ display:block;
375
+ padding: 2px;
376
+ text-decoration: none;
377
+ color: #fff;
378
+ }
379
+
380
+ #attributeselect .list a:hover {
381
+ background-color: #fff;
382
+ color: #000;
383
+ }
384
+
385
+ .link h2 {
386
+ font-size: 1em;
387
+ padding-top: 1em;
388
+ }
389
+
390
+ #mainpanel dl {
391
+ padding-bottom:10px;
392
+ }
393
+
394
+ #mainpanel h2 {
395
+ font-size:14px;
396
+ }
397
+
398
+ #mainpanel dt {
399
+ width: 20px;
400
+ height: 20px;
401
+ float: left;
402
+ background-repeat: no-repeat;
403
+ background-image: url('../images/sprite.png');
404
+ }
405
+
406
+ #legend dl {
407
+ }
408
+
409
+ #mainpanel h2 {
410
+ padding-bottom:10px;
411
+ }
412
+
413
+ #legend dd {
414
+ margin-bottom: 8px;
415
+ color: #000;
416
+ }
417
+
418
+ #mainpanel .infos dd {
419
+ margin-bottom: 12px;
420
+ }
421
+
422
+ #mainpanel .node {
423
+ background-position: -11px -119px;
424
+ }
425
+
426
+ #mainpanel .edge {
427
+ background-position: -51px -122px;
428
+ }
429
+
430
+ #mainpanel .colours {
431
+
432
+ background-image:url('../images/rainbow.png');
433
+
434
+ }
435
+ #legend .note {
436
+ margin-bottom: 8px;
437
+
438
+ }
439
+
440
+ #mainpanel .regions {
441
+ background-position: -171px -13px;
442
+ }
443
+
444
+ #mainpanel .download {
445
+ background-position: -51px -13px;
446
+ }
447
+
448
+ #mainpanel .moreinformation {
449
+ background: url('../images/info.png');
450
+ background-repeat: no-repeat;
451
+ margin-left: 5px;
452
+ }
453
+
454
+ #copyright {
455
+ margin:0 auto;
456
+ position: fixed;
457
+ right: 40px;
458
+ bottom: 25px;
459
+ z-index:0;
460
+ }
461
+
462
+ #copyright a {
463
+ color: #000;
464
+ }
465
+
466
+ #copyright .explanation {
467
+ display: none;
468
+ }
469
+
470
+ #zoom {
471
+ z-index:999;
472
+ position: fixed;
473
+ left: 45%;
474
+ bottom: 25px;
475
+ margin:0 auto;
476
+ padding: 0;
477
+ -webkit-touch-callout: none;
478
+ -webkit-user-select: none;
479
+ -khtml-user-select: none;
480
+ -moz-user-select: none;
481
+ -ms-user-select: none;
482
+ user-select: none;
483
+ text-align:left;
484
+ }
485
+
486
+ #zoom .z {
487
+ background:#fff;
488
+ background-color:rgba(255,255,255,0.7);
489
+ width: 60px;
490
+ height: 60px;
491
+ cursor: pointer;
492
+ border:1px solid #ccc;
493
+ float:left;
494
+ margin-right:4px;
495
+ background-repeat:no-repeat;
496
+ }
497
+
498
+ #zoom .z[rel=center] {
499
+ background-image: url('../images/zoom_reset.png');
500
+ background-position:center;
501
+ }
502
+
503
+ #zoom .z[rel=in] {
504
+ background-image: url('../images/zoom_in.png');
505
+ background-position:center;
506
+ }
507
+
508
+ #zoom .z[rel=out] {
509
+ background-image: url('../images/zoom_out.png');
510
+ background-position:center;
511
+ }
512
+
513
+ .line {
514
+ font-size: 12px;
515
+ color: #000;
516
+ text-decoration: none;
517
+ font-weight: bold;
518
+ cursor: pointer;
519
+ cursor: hand;
520
+ }
521
+
522
+ #information {
523
+ display: none;
524
+ background: #fff;
525
+ padding: 1px 10px 10px 10px;
526
+ }
527
+
528
+ #information h3 {
529
+ margin: 14px 0 4px 0;
530
+ }
531
+
532
+ #information p {
533
+ margin: 0 0 4px 0;
534
+ }
535
+
536
+ #information .button {
537
+ width: 14px;
538
+ height: 14px;
539
+ background-image: url('../images/sprite.png');
540
+ border: 1px solid #999;
541
+ display: inline-block;
542
+ *display: inline;
543
+ *zoom: 1;
544
+ }
545
+
546
+ #information .button span {
547
+ display: none;
548
+ }
549
+
550
+ #information .button.plus {
551
+ background-position: -91px -122px;
552
+ }
553
+
554
+ #information .button.moins {
555
+ background-position: -131px -122px;
556
+ }
557
+
558
+ #minify {
559
+ background-color: #fff;
560
+ padding: 4px 4px 4px 25px;
561
+ cursor: pointer;
562
+ background-image: url('../images/sprite.png');
563
+ background-repeat: no-repeat;
564
+ background-position: -167px -118px;
565
+ position: absolute;
566
+ top: 65px;
567
+ left: 15px;
568
+ display: none;
569
+ }
570
+
571
+ #minifier {
572
+ position: absolute;
573
+ width: 20px;
574
+ height: 16px;
575
+ background-image: url('../images/sprite.png');
576
+ background-repeat: no-repeat;
577
+ background-position: -45px -147px;
578
+ cursor: pointer;
579
+ display: none;
580
+ }
581
+
582
+
583
+
584
+ #colorLegend {
585
+ margin-top: 10px;
586
+ max-height: 200px;
587
+ overflow-y: auto;
588
+ }
589
+
590
+ #colorLegend ul {
591
+ list-style: none;
592
+ padding: 0;
593
+ margin: 0;
594
+ }
595
+
596
+ #colorLegend li {
597
+ margin-bottom: 5px;
598
+ font-size: 12px;
599
+ white-space: nowrap;
600
+ }
601
+
602
+ #coloringselect {
603
+ margin-top: 10px;
604
+ }
605
+
606
+ #coloringselect .list {
607
+ background-color: #fff;
608
+ border: 1px solid #ccc;
609
+ display: none;
610
+ max-height: 150px;
611
+ overflow-y: auto;
612
+ }
613
+
614
+ #coloringselect .list a {
615
+ display: block;
616
+ padding: 5px;
617
+ text-decoration: none;
618
+ }
619
+
620
+ #coloringselect .list a:hover {
621
+ background-color: #f0f0f0;
622
+ }
623
+
624
+ #coloringselect .select {
625
+ background-color: #fff;
626
+ border: 1px solid #ccc;
627
+ cursor: pointer;
628
+ padding: 5px;
629
+ position: relative;
630
+ }
631
+
632
+ #coloringselect .select.close:after {
633
+ content: '▲';
634
+ position: absolute;
635
+ right: 8px;
636
+ }
637
+
638
+ #coloringselect .select:after {
639
+ content: '▼';
640
+ position: absolute;
641
+ right: 8px;
642
+ }
643
+
644
+
645
+
646
+
647
+ #atlasselect {
648
+ margin-top: 10px;
649
+ }
650
+
651
+ #atlasselect .list {
652
+ background-color: #fff;
653
+ border: 1px solid #ccc;
654
+ display: none;
655
+ max-height: 150px;
656
+ overflow-y: auto;
657
+ }
658
+
659
+ #atlasselect .list a {
660
+ display: block;
661
+ padding: 5px;
662
+ text-decoration: none;
663
+ }
664
+
665
+ #atlasselect .list a:hover {
666
+ background-color: #f0f0f0;
667
+ }
668
+
669
+ #atlasselect .select {
670
+ background-color: #fff;
671
+ border: 1px solid #ccc;
672
+ cursor: pointer;
673
+ padding: 5px;
674
+ position: relative;
675
+ }
676
+
677
+ #atlasselect .select.close:after {
678
+ content: '▲';
679
+ position: absolute;
680
+ right: 8px;
681
+ }
682
+
683
+ #atlasselect .select:after {
684
+ content: '▼';
685
+ position: absolute;
686
+ right: 8px;
687
+ }
688
+
css/tablet.css ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ #developercontainer {
2
+ display:none;
3
+ }
htaccess_example ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ AddType application/json json
2
+ AddType text/xml gexf
images/blank.gif ADDED
images/fancybox_loading.gif ADDED
images/fancybox_sprite.png ADDED
images/info.png ADDED
images/rainbow.png ADDED
images/sprite.png ADDED
images/zoom_in.png ADDED
images/zoom_out.png ADDED
images/zoom_reset.png ADDED
index.html ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" itemscope itemtype="http://schema.org/Map">
3
+
4
+ <head>
5
+ <title>Model Atlas</title>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7
+ <meta charset="utf-8">
8
+ <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1,user-scalable=no" />
9
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
10
+
11
+
12
+ <!--[if IE]><script type="text/javascript" src="js/excanvas.js"></script><![endif]--> <!-- js/default.js -->
13
+ <script src="js/jquery/jquery.min.js" type="text/javascript"></script>
14
+ <script src="js/sigma/sigma.min.js" type="text/javascript" language="javascript"></script>
15
+ <script src="js/sigma/sigma.parseJson.js" type="text/javascript" language="javascript"></script>
16
+ <script src="js/fancybox/jquery.fancybox.pack.js" type="text/javascript" language="javascript"></script>
17
+ <script src="js/main.js" type="text/javascript" language="javascript"></script>
18
+
19
+ <link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox.css"/>
20
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
21
+ <link rel="stylesheet" media="screen and (max-height: 770px)" href="css/tablet.css" />
22
+
23
+ </head>
24
+
25
+
26
+ <body>
27
+ <div class="sigma-parent">
28
+ <div class="sigma-expand" id="sigma-canvas"></div>
29
+ </div>
30
+ <div id="mainpanel">
31
+ <div class="col">
32
+ <div id="title"></div>
33
+ <div id="titletext"></div>
34
+ <div class="info cf">
35
+ </div>
36
+ <div id="legend">
37
+ <div class="box">
38
+ <h2>Legend:</h2>
39
+ <div id="colorLegend"></div>
40
+ </dl>
41
+ </div>
42
+ </div>
43
+ <div class="b1">
44
+ <form>
45
+ <div id="search" class="cf"><h2>Search:</h2>
46
+ <input type="text" name="search" value="Search by name" class="empty"/><div class="state"></div>
47
+ <div class="results"></div>
48
+ </div>
49
+
50
+ <div class="cf" id="attributeselect"><h2>Group Selector:</h2>
51
+ <div class="select">Select Group</div>
52
+ <div class="list cf"></div>
53
+ </div>
54
+
55
+ <div class="cf" id="coloringselect"><h2>Color By:</h2>
56
+ <div class="select">Select Attribute</div>
57
+ <div class="list cf"></div>
58
+ </div>
59
+
60
+
61
+ <div class="cf" id="atlasselect"><h2>Atlas:</h2>
62
+ <div class="select">Select Atlas</div>
63
+ <div class="list cf"></div>
64
+ </div>
65
+
66
+
67
+ </form>
68
+ </div>
69
+ </div>
70
+ <div id="information">
71
+ </div>
72
+ </div>
73
+ <div id="zoom">
74
+ <div class="z" rel="in"></div> <div class="z" rel="out"></div> <div class="z" rel="center"></div>
75
+ </div>
76
+ <div id="attributepane">
77
+ <div class="text">
78
+ <div title="Close" class="left-close returntext"><div class="c cf"><span>Return to the full network</span></div></div>
79
+ <div class="headertext">
80
+ <span>Information Pane</span>
81
+ </div>
82
+ <div class="nodeattributes">
83
+ <div class="name"></div>
84
+ <div class="data"></div>
85
+ <div class="p">Connections:</div>
86
+ <div class="link">
87
+ <ul>
88
+ </ul>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </div>
93
+
94
+ <div id="developercontainer">
95
+ <p>Web rendering powered by <a href="https://sigmajs.org/" target="_blank">SigmaJS</a>, graph visualization by <a href="https://gephi.org/" target="_blank">Gephi</a>.</p>
96
+ <p>Web integration adapted by <a href="https://horwitz.ai/" target="_blank">Eliahu Horwitz</a> based on the <a href="https://github.com/oxfordinternetinstitute/gephi-plugins/tree/sigmaexporter-plugin" target="_blank" title="Gephi SigmaJS plugin">Gephi SigmaJS plugin </a> by <a href="https://www.oii.ox.ac.uk" target="_blank" title="Oxford Internet Institute">Oxford Internet Institute</a> and <a href="https://jisc.ac.uk" target="_blank" title="JISC">JISC</a>.</p>
97
+ </div>
98
+
99
+ <!-- Default Statcounter code for Model Atlas HF Space
100
+ https://huggingface.co/spaces/Eliahu/Model-Atlas -->
101
+ <script type="text/javascript">
102
+ var sc_project=13102932;
103
+ var sc_invisible=1;
104
+ var sc_security="830309d4";
105
+ </script>
106
+ <script type="text/javascript"
107
+ src="https://www.statcounter.com/counter/counter.js"
108
+ async></script>
109
+ <noscript><div class="statcounter"><a title="Web Analytics"
110
+ href="https://statcounter.com/" target="_blank"><img
111
+ class="statcounter"
112
+ src="https://c.statcounter.com/13102932/0/830309d4/1/"
113
+ alt="Web Analytics"
114
+ referrerPolicy="no-referrer-when-downgrade"></a></div></noscript>
115
+ <!-- End of Statcounter Code -->
116
+
117
+ </body>
118
+ </html>
js/excanvas.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.createElement("canvas").getContext||function(){function S(){return this.context_||(this.context_=new z(this))}function T(a,b,c){var g=J.call(arguments,2);return function(){return a.apply(b,g.concat(J.call(arguments)))}}function K(a){return(""+a).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function L(a){a.namespaces.g_vml_||a.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");a.namespaces.g_o_||a.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");
2
+ a.styleSheets.ex_canvas_||(a=a.createStyleSheet(),a.owningElement.id="ex_canvas_",a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}")}function U(a){var b=a.srcElement;switch(a.propertyName){case "width":b.getContext().clearRect();b.style.width=b.attributes.width.nodeValue+"px";b.firstChild.style.width=b.clientWidth+"px";break;case "height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+
3
+ "px"}}function V(a){a=a.srcElement;a.firstChild&&(a.firstChild.style.width=a.clientWidth+"px",a.firstChild.style.height=a.clientHeight+"px")}function A(){return[[1,0,0],[0,1,0],[0,0,1]]}function q(a,b){for(var c=A(),g=0;3>g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function M(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=
4
+ a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function N(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function B(a,b,c){return Math.min(c,Math.max(b,a))}function C(a,b,c){0>c&&c++;1<c&&c--;return 1>6*c?a+6*(b-a)*c:
5
+ 1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function D(a){if(a in E)return E[a];var b,c=1,a=""+a;if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=N(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=s[B(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=N(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=B(parseFloat(e[1])/100,0,1);e=B(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=C(d,f,b+1/3);e=C(d,f,b);b=C(d,f,b-1/3)}b="#"+s[Math.floor(255*
6
+ g)]+s[Math.floor(255*e)]+s[Math.floor(255*b)];c=c[3]}else b=W[a]||a;return E[a]={color:b,alpha:c}}function z(a){this.m_=A();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*n;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",
7
+ c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function O(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function P(a,b){var c=D(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("<g_vml_:stroke",
8
+ ' opacity="',c,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',X[a.lineCap]||"square",'"',' weight="',e,'px"',' color="',g,'" />')}function Q(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,h=g.x-c.x,l=g.y-c.y;if(e instanceof t){var i=0,j=g=0,r=0,k=1;if("gradient"==e.type_){var i=e.x1_/f,c=e.y1_/d,m=p(a,e.x0_/f,e.y0_/d),i=p(a,i,c),i=180*Math.atan2(i.x-m.x,i.y-m.y)/Math.PI;0>i&&(i+=360);1.0E-6>i&&(i=0)}else m=p(a,e.x0_,e.y0_),g=(m.x-c.x)/h,j=(m.y-c.y)/l,h/=f*
9
+ n,l/=d*n,k=u.max(h,l),r=2*e.r0_/k,k=2*e.r1_/k-r;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});for(var d=f.length,m=f[0].color,c=f[d-1].color,h=f[0].alpha*a.globalAlpha,a=f[d-1].alpha*a.globalAlpha,l=[],o=0;o<d;o++){var q=f[o];l.push(q.offset*k+r+" "+q.color)}b.push('<g_vml_:fill type="',e.type_,'"',' method="none" focus="100%"',' color="',m,'"',' color2="',c,'"',' colors="',l.join(","),'"',' opacity="',a,'"',' g_o_:opacity2="',h,'"',' angle="',i,'"',' focusposition="',g,",",j,'" />')}else e instanceof
10
+ F?h&&l&&b.push("<g_vml_:fill",' position="',-c.x/h*f*f,",",-c.y/l*d*d,'"',' type="tile"',' src="',e.src_,'" />'):(e=D(a.fillStyle),b.push('<g_vml_:fill color="',e.color,'" opacity="',e.alpha*a.globalAlpha,'" />'))}function p(a,b,c){a=a.m_;return{x:n*(b*a[0][0]+c*a[1][0]+a[2][0])-o,y:n*(b*a[0][1]+c*a[1][1]+a[2][1])-o}}function w(a,b,c){isFinite(b[0][0])&&isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1])&&(a.m_=b,c&&(a.lineScale_=Y(Z(b[0][0]*b[1][1]-b[0][1]*
11
+ b[1][0]))))}function t(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function F(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new x("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new x("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new x("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height}
12
+ function x(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var u=Math,h=u.round,G=u.sin,H=u.cos,Z=u.abs,Y=u.sqrt,n=10,o=n/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var J=Array.prototype.slice;L(document);var R={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",T(this.init_,this,a))},init_:function(a){for(var a=a.getElementsByTagName("canvas"),b=0;b<a.length;b++)this.initElement(a[b])},initElement:function(a){if(!a.getContext){a.getContext=
13
+ S;L(a.ownerDocument);a.innerHTML="";a.attachEvent("onpropertychange",U);a.attachEvent("onresize",V);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth;b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};R.init();for(var s=[],d=0;16>d;d++)for(var y=0;16>y;y++)s[16*d+y]=d.toString(16)+y.toString(16);var W={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",
14
+ bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",
15
+ darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",
16
+ ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",
17
+ mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",
18
+ peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},
19
+ E={},I={},X={butt:"flat",round:"round"},d=z.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=p(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=p(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo=
20
+ function(a,b,c,g,e,f){e=p(this,e,f);a=p(this,a,b);c=p(this,c,g);O(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=p(this,a,b);c=p(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};O(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){var c=c*n,d=f?"at":"wa",h=a+H(g)*c-o,l=b+G(g)*c-o,g=a+H(e)*c-o,e=b+G(e)*c-o;h==g&&!f&&(h+=0.125);a=p(this,a,b);h=p(this,h,l);g=p(this,g,e);this.currentPath_.push({type:d,
21
+ x:a.x,y:a.y,radius:c,xStart:h.x,yStart:h.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+
22
+ c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new t("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new t("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,o,v,l,i;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var j=a.width,r=a.height;a.runtimeStyle.width=
23
+ e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],o=v=0,l=e=j,i=d=r;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],o=v=0,l=j,i=r;else if(9==arguments.length)o=arguments[1],v=arguments[2],l=arguments[3],i=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var k=p(this,c,g),m=[];m.push(" <g_vml_:group",' coordsize="',10*n,",",10*n,'"',' coordorigin="0,0"',' style="width:',
24
+ 10,"px;height:",10,"px;position:absolute;");if(1!=this.m_[0][0]||this.m_[0][1]||1!=this.m_[1][1]||this.m_[1][0]){var q=[];q.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",h(k.x/n),",","Dy=",h(k.y/n),"");var s=p(this,c+e,g),t=p(this,c,g+d);c=p(this,c+e,g+d);k.x=u.max(k.x,s.x,t.x,c.x);k.y=u.max(k.y,s.y,t.y,c.y);m.push("padding:0 ",h(k.x/n),"px ",h(k.y/n),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",q.join(""),", sizingmethod='clip');")}else m.push("top:",
25
+ h(k.y/n),"px;left:",h(k.x/n),"px;");m.push(' ">','<g_vml_:image src="',a.src,'"',' style="width:',n*e,"px;"," height:",n*d,'px"',' cropleft="',o/j,'"',' croptop="',v/r,'"',' cropright="',(j-o-l)/j,'"',' cropbottom="',(r-v-i)/r,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",m.join(""))};d.stroke=function(a){var b=[];b.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"',' coordsize="',10*n,",",10*n,'"',
26
+ ' stroked="',!a,'"',' path="');for(var c={x:null,y:null},d={x:null,y:null},e=0;e<this.currentPath_.length;e++){var f=this.currentPath_[e];switch(f.type){case "moveTo":b.push(" m ",h(f.x),",",h(f.y));break;case "lineTo":b.push(" l ",h(f.x),",",h(f.y));break;case "close":b.push(" x ");f=null;break;case "bezierCurveTo":b.push(" c ",h(f.cp1x),",",h(f.cp1y),",",h(f.cp2x),",",h(f.cp2y),",",h(f.x),",",h(f.y));break;case "at":case "wa":b.push(" ",f.type," ",h(f.x-this.arcScaleX_*f.radius),",",h(f.y-this.arcScaleY_*
27
+ f.radius)," ",h(f.x+this.arcScaleX_*f.radius),",",h(f.y+this.arcScaleY_*f.radius)," ",h(f.xStart),",",h(f.yStart)," ",h(f.xEnd),",",h(f.yEnd))}if(f){if(null==c.x||f.x<c.x)c.x=f.x;if(null==d.x||f.x>d.x)d.x=f.x;if(null==c.y||f.y<c.y)c.y=f.y;if(null==d.y||f.y>d.y)d.y=f.y}}b.push(' ">');a?Q(this,b,c,d):P(this,b);b.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a=
28
+ {};M(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=q(A(),this.m_)};d.restore=function(){this.aStack_.length&&(M(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){w(this,q([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=H(a),a=G(a);w(this,q([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;w(this,q([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){w(this,q([[a,
29
+ b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){w(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_,d=0,o=1E3,q=0,l=[],i;i=this.font;if(I[i])i=I[i];else{var j=document.createElement("div").style;try{j.font=i}catch(r){}i=I[i]={style:j.fontStyle||"normal",variant:j.fontVariant||"normal",weight:j.fontWeight||"normal",size:j.fontSize||10,family:j.fontFamily||"sans-serif"}}var j=i,k=this.element_;i={};for(var m in j)i[m]=j[m];m=parseFloat(k.currentStyle.fontSize);
30
+ k=parseFloat(j.size);i.size="number"==typeof j.size?j.size:-1!=j.size.indexOf("px")?k:-1!=j.size.indexOf("em")?m*k:-1!=j.size.indexOf("%")?m/100*k:-1!=j.size.indexOf("pt")?k/0.75:m;i.size*=0.981;m=i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family;k=this.element_.currentStyle;j=this.textAlign.toLowerCase();switch(j){case "left":case "center":case "right":break;case "end":j="ltr"==k.direction?"right":"left";break;case "start":j="rtl"==k.direction?"right":"left";break;default:j="left"}switch(this.textBaseline){case "hanging":case "top":q=
31
+ i.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":q=-i.size/2.25}switch(j){case "right":d=1E3;o=0.05;break;case "center":d=o=500}b=p(this,b+0,c+q);l.push('<g_vml_:line from="',-d,' 0" to="',o,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!e,'" stroked="',!!e,'" style="position:absolute;width:1px;height:1px;">');e?P(this,l):Q(this,l,{x:-d,y:0},{x:o,y:i.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+
32
+ ","+f[1][1].toFixed(3)+",0,0";b=h(b.x/n)+","+h(b.y/n);l.push('<g_vml_:skew on="t" matrix="',e,'" ',' offset="',b,'" origin="',d,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',K(a),'" style="v-text-align:',j,";font:",K(m),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",l.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a,b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd",
33
+ '<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>'),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){};d.arcTo=function(){};d.createPattern=function(a,b){return new F(a,b)};t.prototype.addColorStop=function(a,b){b=D(b);this.colors_.push({offset:a,
34
+ color:b.color,alpha:b.alpha})};d=x.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR=13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=R;CanvasRenderingContext2D=z;CanvasGradient=
35
+ t;CanvasPattern=F;DOMException=x}();
js/fancybox/jquery.fancybox.css ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ .fancybox-tmp iframe, .fancybox-tmp object {
3
+ vertical-align: top;
4
+ padding: 0;
5
+ margin: 0;
6
+ }
7
+
8
+ .fancybox-wrap {
9
+ position: absolute;
10
+ top: 0;
11
+ left: 0;
12
+ z-index: 8020;
13
+ }
14
+
15
+ .fancybox-skin {
16
+ position: relative;
17
+ padding: 0;
18
+ margin: 0;
19
+ background: #f9f9f9;
20
+ color: #444;
21
+ text-shadow: none;
22
+ -webkit-border-radius: 4px;
23
+ -moz-border-radius: 4px;
24
+ border-radius: 4px;
25
+ }
26
+
27
+ .fancybox-opened {
28
+ z-index: 8030;
29
+ }
30
+
31
+ .fancybox-opened .fancybox-skin {
32
+ -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
33
+ -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
34
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
35
+ }
36
+
37
+ .fancybox-outer, .fancybox-inner {
38
+ padding: 0;
39
+ margin: 0;
40
+ position: relative;
41
+ outline: none;
42
+ }
43
+
44
+ .fancybox-inner {
45
+ overflow: hidden;
46
+ }
47
+
48
+ .fancybox-type-iframe .fancybox-inner {
49
+ -webkit-overflow-scrolling: touch;
50
+ }
51
+
52
+ .fancybox-error {
53
+ color: #444;
54
+ font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
55
+ margin: 0;
56
+ padding: 10px;
57
+ }
58
+
59
+ .fancybox-image, .fancybox-iframe {
60
+ display: block;
61
+ width: 100%;
62
+ height: 100%;
63
+ border: 0;
64
+ padding: 0;
65
+ margin: 0;
66
+ vertical-align: top;
67
+ }
68
+
69
+ .fancybox-image {
70
+ max-width: 100%;
71
+ max-height: 100%;
72
+ }
73
+
74
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
75
+ background-image: url('../../images/fancybox_sprite.png');
76
+ }
77
+
78
+ #fancybox-loading {
79
+ position: fixed;
80
+ top: 50%;
81
+ left: 50%;
82
+ margin-top: -22px;
83
+ margin-left: -22px;
84
+ background-position: 0 -108px;
85
+ opacity: 0.8;
86
+ cursor: pointer;
87
+ z-index: 8020;
88
+ }
89
+
90
+ #fancybox-loading div {
91
+ width: 44px;
92
+ height: 44px;
93
+ background: url('../../images/fancybox_loading.gif') center center no-repeat;
94
+ }
95
+
96
+ .fancybox-close {
97
+ position: absolute;
98
+ top: -18px;
99
+ right: -18px;
100
+ width: 36px;
101
+ height: 36px;
102
+ cursor: pointer;
103
+ z-index: 8040;
104
+ }
105
+
106
+ .fancybox-nav {
107
+ position: absolute;
108
+ top: 0;
109
+ width: 40%;
110
+ height: 100%;
111
+ cursor: pointer;
112
+ background: transparent url('../../images/blank.gif'); /* helps IE */
113
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
114
+ z-index: 8040;
115
+ }
116
+
117
+ .fancybox-prev {
118
+ left: 0;
119
+ }
120
+
121
+ .fancybox-next {
122
+ right: 0;
123
+ }
124
+
125
+ .fancybox-nav span {
126
+ position: absolute;
127
+ top: 50%;
128
+ width: 36px;
129
+ height: 34px;
130
+ margin-top: -18px;
131
+ cursor: pointer;
132
+ z-index: 8040;
133
+ visibility: hidden;
134
+ }
135
+
136
+ .fancybox-prev span {
137
+ left: 20px;
138
+ background-position: 0 -36px;
139
+ }
140
+
141
+ .fancybox-next span {
142
+ right: 20px;
143
+ background-position: 0 -72px;
144
+ }
145
+
146
+ .fancybox-nav:hover span {
147
+ visibility: visible;
148
+ }
149
+
150
+ .fancybox-tmp {
151
+ position: absolute;
152
+ top: -9999px;
153
+ left: -9999px;
154
+ padding: 0;
155
+ overflow: visible;
156
+ visibility: hidden;
157
+ }
158
+
159
+ /* Overlay helper */
160
+
161
+ #fancybox-overlay {
162
+ position: absolute;
163
+ top: 0;
164
+ left: 0;
165
+ overflow: hidden;
166
+ display: none;
167
+ z-index: 8010;
168
+ background: #000;
169
+ }
170
+
171
+ #fancybox-overlay.overlay-fixed {
172
+ position: fixed;
173
+ bottom: 0;
174
+ right: 0;
175
+ }
176
+
177
+ /* Title helper */
178
+
179
+ .fancybox-title {
180
+ visibility: hidden;
181
+ font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
182
+ position: relative;
183
+ text-shadow: none;
184
+ z-index: 8050;
185
+ }
186
+
187
+ .fancybox-opened .fancybox-title {
188
+ visibility: visible;
189
+ }
190
+
191
+ .fancybox-title-float-wrap {
192
+ position: absolute;
193
+ bottom: 0;
194
+ right: 50%;
195
+ margin-bottom: -35px;
196
+ z-index: 8030;
197
+ text-align: center;
198
+ }
199
+
200
+ .fancybox-title-float-wrap .child {
201
+ display: inline-block;
202
+ margin-right: -100%;
203
+ padding: 2px 20px;
204
+ background: transparent; /* Fallback for web browsers that doesn't support RGBa */
205
+ background: rgba(0, 0, 0, 0.8);
206
+ -webkit-border-radius: 15px;
207
+ -moz-border-radius: 15px;
208
+ border-radius: 15px;
209
+ text-shadow: 0 1px 2px #222;
210
+ color: #FFF;
211
+ font-weight: bold;
212
+ line-height: 24px;
213
+ white-space: nowrap;
214
+ }
215
+
216
+ .fancybox-title-outside-wrap {
217
+ position: relative;
218
+ margin-top: 10px;
219
+ color: #fff;
220
+ }
221
+
222
+ .fancybox-title-inside-wrap {
223
+ margin-top: 10px;
224
+ }
225
+
226
+ .fancybox-title-over-wrap {
227
+ position: absolute;
228
+ bottom: 0;
229
+ left: 0;
230
+ color: #fff;
231
+ padding: 10px;
232
+ background: #000;
233
+ background: rgba(0, 0, 0, .8);
234
+ }
js/fancybox/jquery.fancybox.pack.js ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ (function(s,l,d,t){var m=d(s),q=d(l),a=d.fancybox=function(){a.open.apply(this,arguments)},u=!1,k=l.createTouch!==t,o=function(a){return"string"===d.type(a)},n=function(b,c){c&&o(b)&&0<b.indexOf("%")&&(b=a.getViewport()[c]/100*parseInt(b,10));return Math.round(b)+"px"};d.extend(a,{version:"2.0.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoResize:!k,autoCenter:!k,fitToView:!0,aspectRatio:!1,topRatio:0.5,fixed:!1,scrolling:"auto",
3
+ wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},keys:{next:[13,32,34,39,40],prev:[8,33,37,38],close:[27]},tpl:{wrap:'<div class="fancybox-wrap"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0"'+
4
+ (d.browser.msie?' allowtransparency="true"':"")+"></iframe>",swf:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>',error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
5
+ closeBtn:'<div title="Close" class="fancybox-item fancybox-close"></div>',next:'<a title="Next" class="fancybox-nav fancybox-next"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev"><span></span></a>'},openEffect:"fade",openSpeed:300,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:300,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",
6
+ prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{cursor:"pointer"},closeClick:!0},title:{type:"float"}}},group:{},opts:{},coming:null,current:null,isOpen:!1,isOpened:!1,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(b,c){a.close(!0);b&&!d.isArray(b)&&(b=b instanceof d?d(b).get():[b]);a.isActive=!0;a.opts=d.extend(!0,{},a.defaults,c);d.isPlainObject(c)&&c.keys!==t&&(a.opts.keys=c.keys?
7
+ d.extend({},a.defaults.keys,c.keys):!1);a.group=b;a._start(a.opts.index||0)},cancel:function(){a.coming&&!1===a.trigger("onCancel")||(a.coming=null,a.hideLoading(),a.ajaxLoad&&a.ajaxLoad.abort(),a.ajaxLoad=null,a.imgPreload&&(a.imgPreload.onload=a.imgPreload.onabort=a.imgPreload.onerror=null))},close:function(b){a.cancel();a.current&&!1!==a.trigger("beforeClose")&&(a.unbindEvents(),!a.isOpen||b&&!0===b[0]?(d(".fancybox-wrap").stop().trigger("onReset").remove(),a._afterZoomOut()):(a.isOpen=a.isOpened=
8
+ !1,d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.closeMethod]()))},play:function(b){var c=function(){clearTimeout(a.player.timer)},e=function(){c();a.current&&a.player.isActive&&(a.player.timer=setTimeout(a.next,a.current.playSpeed))},f=function(){c();d("body").unbind(".player");a.player.isActive=!1;a.trigger("onPlayEnd")};if(a.player.isActive||b&&!1===b[0])f();else if(a.current&&(a.current.loop||
9
+ a.current.index<a.group.length-1))a.player.isActive=!0,d("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":f,"beforeLoad.player":c}),e(),a.trigger("onPlayStart")},next:function(){a.current&&a.jumpto(a.current.index+1)},prev:function(){a.current&&a.jumpto(a.current.index-1)},jumpto:function(b){a.current&&(b=parseInt(b,10),1<a.group.length&&a.current.loop&&(b>=a.group.length?b=0:0>b&&(b=a.group.length-1)),a.group[b]!==t&&(a.cancel(),a._start(b)))},reposition:function(b,
10
+ c){var e;a.isOpen&&(e=a._getPosition(c),b&&"scroll"===b.type?(delete e.position,a.wrap.stop(!0,!0).animate(e,200)):a.wrap.css(e))},update:function(b){a.isOpen&&(u||setTimeout(function(){var c=a.current,e=!b||b&&"orientationchange"===b.type;if(u&&(u=!1,c)){if(!b||"scroll"!==b.type||e)c.autoSize&&"iframe"!==c.type&&(a.inner.height("auto"),c.height=a.inner.height()),(c.autoResize||e)&&a._setDimension(),c.canGrow&&"iframe"!==c.type&&a.inner.height("auto");(c.autoCenter||e)&&a.reposition(b);a.trigger("onUpdate")}},
11
+ 200),u=!0)},toggle:function(){a.isOpen&&(a.current.fitToView=!a.current.fitToView,a.update())},hideLoading:function(){q.unbind("keypress.fb");d("#fancybox-loading").remove()},showLoading:function(){a.hideLoading();q.bind("keypress.fb",function(b){27===b.keyCode&&(b.preventDefault(),a.cancel())});d('<div id="fancybox-loading"><div></div></div>').click(a.cancel).appendTo("body")},getViewport:function(){return{x:m.scrollLeft(),y:m.scrollTop(),w:k&&s.innerWidth?s.innerWidth:m.width(),h:k&&s.innerHeight?
12
+ s.innerHeight:m.height()}},unbindEvents:function(){a.wrap&&a.wrap.unbind(".fb");q.unbind(".fb");m.unbind(".fb")},bindEvents:function(){var b=a.current,c=b.keys;b&&(m.bind("resize.fb orientationchange.fb"+(b.autoCenter&&!b.fixed?" scroll.fb":""),a.update),c&&q.bind("keydown.fb",function(b){var f;f=b.target||b.srcElement;if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey&&(!f||!f.type&&!d(f).is("[contenteditable]")))f=b.keyCode,-1<d.inArray(f,c.close)?(a.close(),b.preventDefault()):-1<d.inArray(f,c.next)?
13
+ (a.next(),b.preventDefault()):-1<d.inArray(f,c.prev)&&(a.prev(),b.preventDefault())}),d.fn.mousewheel&&b.mouseWheel&&1<a.group.length&&a.wrap.bind("mousewheel.fb",function(b,c){var d=b.target||null;if(0!==c&&(!d||0===d.clientHeight||d.scrollHeight===d.clientHeight&&d.scrollWidth===d.clientWidth))b.preventDefault(),a[0<c?"prev":"next"]()}))},trigger:function(b,c){var e,f=c||a[-1<d.inArray(b,["onCancel","beforeLoad","afterLoad"])?"coming":"current"];if(f){d.isFunction(f[b])&&(e=f[b].apply(f,Array.prototype.slice.call(arguments,
14
+ 1)));if(!1===e)return!1;f.helpers&&d.each(f.helpers,function(c,e){if(e&&d.isPlainObject(a.helpers[c])&&d.isFunction(a.helpers[c][b]))a.helpers[c][b](e,f)});d.event.trigger(b+".fb")}},isImage:function(a){return o(a)&&a.match(/\.(jpe?g|gif|png|bmp)((\?|#).*)?$/i)},isSWF:function(a){return o(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(b){var c={},e=a.group[b]||null,f,g,i;if(e&&(e.nodeType||e instanceof d))f=!0,d.metadata&&(c=d(e).metadata());c=d.extend(!0,{},a.opts,{index:b,element:e},d.isPlainObject(e)?
15
+ e:c);d.each(["href","title","content","type"],function(b,g){c[g]=a.opts[g]||f&&d(e).attr(g)||c[g]||null});"number"===typeof c.margin&&(c.margin=[c.margin,c.margin,c.margin,c.margin]);c.modal&&d.extend(!0,c,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{css:{cursor:"auto"},closeClick:!1}}});a.coming=c;if(!1===a.trigger("beforeLoad"))a.coming=null;else{g=c.type;b=c.href||e;g||(f&&(g=d(e).data("fancybox-type"),g||(g=(g=e.className.match(/fancybox\.(\w+)/))?
16
+ g[1]:null)),!g&&o(b)&&(a.isImage(b)?g="image":a.isSWF(b)?g="swf":b.match(/^#/)&&(g="inline")),g||(g=f?"inline":"html"),c.type=g);if("inline"===g||"html"===g){if(c.content||(c.content="inline"===g?d(o(b)?b.replace(/.*(?=#[^\s]+$)/,""):b):e),!c.content||!c.content.length)g=null}else b||(g=null);"ajax"===g&&o(b)&&(i=b.split(/\s+/,2),b=i.shift(),c.selector=i.shift());c.href=b;c.group=a.group;c.isDom=f;switch(g){case "image":a._loadImage();break;case "ajax":a._loadAjax();break;case "inline":case "iframe":case "swf":case "html":a._afterLoad();
17
+ break;default:a._error("type")}}},_error:function(b){a.hideLoading();d.extend(a.coming,{type:"html",autoSize:!0,minWidth:0,minHeight:0,padding:15,hasError:b,content:a.coming.tpl.error});a._afterLoad()},_loadImage:function(){var b=a.imgPreload=new Image;b.onload=function(){this.onload=this.onerror=null;a.coming.width=this.width;a.coming.height=this.height;a._afterLoad()};b.onerror=function(){this.onload=this.onerror=null;a._error("image")};b.src=a.coming.href;(b.complete===t||!b.complete)&&a.showLoading()},
18
+ _loadAjax:function(){a.showLoading();a.ajaxLoad=d.ajax(d.extend({},a.coming.ajax,{url:a.coming.href,error:function(b,c){a.coming&&"abort"!==c?a._error("ajax",b):a.hideLoading()},success:function(b,c){"success"===c&&(a.coming.content=b,a._afterLoad())}}))},_preloadImages:function(){var b=a.group,c=a.current,e=b.length,f,g,i,h=Math.min(c.preload,e-1);if(c.preload&&!(2>b.length))for(i=1;i<=h;i+=1)if(f=b[(c.index+i)%e],g=f.href||d(f).attr("href")||f,"image"===f.type||a.isImage(g))(new Image).src=g},_afterLoad:function(){a.hideLoading();
19
+ !a.coming||!1===a.trigger("afterLoad",a.current)?a.coming=!1:(a.isOpened?(d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.prevMethod]()):(d(".fancybox-wrap").stop().trigger("onReset").remove(),a.trigger("afterClose")),a.unbindEvents(),a.isOpen=!1,a.current=a.coming,a.wrap=d(a.current.tpl.wrap).addClass("fancybox-"+(k?"mobile":"desktop")+" fancybox-type-"+a.current.type+" fancybox-tmp "+a.current.wrapCSS).appendTo("body"),
20
+ a.skin=d(".fancybox-skin",a.wrap).css("padding",n(a.current.padding)),a.outer=d(".fancybox-outer",a.wrap),a.inner=d(".fancybox-inner",a.wrap),a._setContent())},_setContent:function(){var b=a.current,c=b.content,e=b.type,f=b.minWidth,g=b.minHeight,i=b.maxWidth,h=b.maxHeight;switch(e){case "inline":case "ajax":case "html":b.selector?c=d("<div>").html(c).find(b.selector):c instanceof d&&(c.parent().hasClass("fancybox-inner")&&c.parents(".fancybox-wrap").unbind("onReset"),c=c.show().detach(),d(a.wrap).bind("onReset",
21
+ function(){c.appendTo("body").hide()}));b.autoSize&&(f=d('<div class="fancybox-wrap '+a.current.wrapCSS+' fancybox-tmp"></div>').appendTo("body").css({minWidth:n(f,"w"),minHeight:n(g,"h"),maxWidth:n(i,"w"),maxHeight:n(h,"h")}).append(c),b.width=f.width(),b.height=f.height(),f.width(a.current.width),f.height()>b.height&&(f.width(b.width+1),b.width=f.width(),b.height=f.height()),c=f.contents().detach(),f.remove());break;case "image":c=b.tpl.image.replace("{href}",b.href);b.aspectRatio=!0;break;case "swf":c=
22
+ b.tpl.swf.replace(/\{width\}/g,b.width).replace(/\{height\}/g,b.height).replace(/\{href\}/g,b.href);break;case "iframe":c=d(b.tpl.iframe.replace("{rnd}",(new Date).getTime())).attr("scrolling",b.scrolling).attr("src",b.href),b.scrolling=k?"scroll":"auto"}if("image"===e||"swf"===e)b.autoSize=!1,b.scrolling="visible";"iframe"===e&&b.autoSize?(a.showLoading(),a._setDimension(),a.inner.css("overflow",b.scrolling),c.bind({onCancel:function(){d(this).unbind();a._afterZoomOut()},load:function(){a.hideLoading();
23
+ try{this.contentWindow.document.location&&(a.current.height=d(this).contents().find("body").height())}catch(b){a.current.autoSize=!1}a[a.isOpen?"_afterZoomIn":"_beforeShow"]()}}).appendTo(a.inner)):(a.inner.append(c),a._beforeShow())},_beforeShow:function(){a.coming=null;a.trigger("beforeShow");a._setDimension();a.wrap.hide().removeClass("fancybox-tmp");a.bindEvents();a._preloadImages();a.transitions[a.isOpened?a.current.nextMethod:a.current.openMethod]()},_setDimension:function(){var b=a.wrap,c=
24
+ a.inner,e=a.current,f=a.getViewport(),g=e.margin,i=2*e.padding,h=e.width,j=e.height,r=e.maxWidth+i,k=e.maxHeight+i,l=e.minWidth+i,m=e.minHeight+i,p;f.w-=g[1]+g[3];f.h-=g[0]+g[2];o(h)&&0<h.indexOf("%")&&(h=(f.w-i)*parseFloat(h)/100);o(j)&&0<j.indexOf("%")&&(j=(f.h-i)*parseFloat(j)/100);g=h/j;h+=i;j+=i;e.fitToView&&(r=Math.min(f.w,r),k=Math.min(f.h,k));if(e.aspectRatio){if(h>r&&(h=r,j=(h-i)/g+i),j>k&&(j=k,h=(j-i)*g+i),h<l&&(h=l,j=(h-i)/g+i),j<m)j=m,h=(j-i)*g+i}else h=Math.max(l,Math.min(h,r)),j=Math.max(m,
25
+ Math.min(j,k));h=Math.round(h);j=Math.round(j);d(b.add(c)).width("auto").height("auto");c.width(h-i).height(j-i);b.width(h);p=b.height();if(h>r||p>k)for(;(h>r||p>k)&&h>l&&p>m;)j-=10,e.aspectRatio?(h=Math.round((j-i)*g+i),h<l&&(h=l,j=(h-i)/g+i)):h-=10,c.width(h-i).height(j-i),b.width(h),p=b.height();e.dim={width:n(h),height:n(p)};e.canGrow=e.autoSize&&j>m&&j<k;e.canShrink=!1;e.canExpand=!1;if(h-i<e.width||j-i<e.height)e.canExpand=!0;else if((h>f.w||p>f.h)&&h>l&&j>m)e.canShrink=!0;a.innerSpace=p-i-
26
+ c.height()},_getPosition:function(b){var c=a.current,e=a.getViewport(),f=c.margin,d=a.wrap.width()+f[1]+f[3],i=a.wrap.height()+f[0]+f[2],h={position:"absolute",top:f[0]+e.y,left:f[3]+e.x};c.autoCenter&&c.fixed&&!b&&i<=e.h&&d<=e.w&&(h={position:"fixed",top:f[0],left:f[3]});h.top=n(Math.max(h.top,h.top+(e.h-i)*c.topRatio));h.left=n(Math.max(h.left,h.left+0.5*(e.w-d)));return h},_afterZoomIn:function(){var b=a.current,c=b?b.scrolling:"no";if(b&&(a.isOpen=a.isOpened=!0,a.wrap.addClass("fancybox-opened"),
27
+ a.inner.css("overflow","yes"===c?"scroll":"no"===c?"hidden":c),a.trigger("afterShow"),a.update(),(b.closeClick||b.nextClick)&&a.inner.css("cursor","pointer").bind("click.fb",function(c){if(!d(c.target).is("a")&&!d(c.target).parent().is("a"))a[b.closeClick?"close":"next"]()}),b.closeBtn&&d(b.tpl.closeBtn).appendTo(a.skin).bind("click.fb",a.close),b.arrows&&1<a.group.length&&((b.loop||0<b.index)&&d(b.tpl.prev).appendTo(a.outer).bind("click.fb",a.prev),(b.loop||b.index<a.group.length-1)&&d(b.tpl.next).appendTo(a.outer).bind("click.fb",
28
+ a.next)),a.opts.autoPlay&&!a.player.isActive))a.opts.autoPlay=!1,a.play()},_afterZoomOut:function(){var b=a.current;a.wrap.trigger("onReset").remove();d.extend(a,{group:{},opts:{},current:null,isActive:!1,isOpened:!1,isOpen:!1,wrap:null,skin:null,outer:null,inner:null});a.trigger("afterClose",b)}});a.transitions={getOrigPosition:function(){var b=a.current,c=b.element,e=b.padding,f=d(b.orig),g={},i=50,h=50;!f.length&&b.isDom&&d(c).is(":visible")&&(f=d(c).find("img:first"),f.length||(f=d(c)));f.length?
29
+ (g=f.offset(),f.is("img")&&(i=f.outerWidth(),h=f.outerHeight())):(b=a.getViewport(),g.top=b.y+0.5*(b.h-h),g.left=b.x+0.5*(b.w-i));return g={top:n(g.top-e),left:n(g.left-e),width:n(i+2*e),height:n(h+2*e)}},step:function(b,c){var e=c.prop,d,g;if("width"===e||"height"===e)d=Math.ceil(b-2*a.current.padding),"height"===e&&(g=(b-c.start)/(c.end-c.start),c.start>c.end&&(g=1-g),d-=a.innerSpace*g),a.inner[e](d)},zoomIn:function(){var b=a.wrap,c=a.current,e=c.openEffect,f="elastic"===e,g=d.extend({},c.dim,
30
+ a._getPosition(f)),i=d.extend({opacity:1},g);delete i.position;f?(g=this.getOrigPosition(),c.openOpacity&&(g.opacity=0),a.outer.add(a.inner).width("auto").height("auto")):"fade"===e&&(g.opacity=0);b.css(g).show().animate(i,{duration:"none"===e?0:c.openSpeed,easing:c.openEasing,step:f?this.step:null,complete:a._afterZoomIn})},zoomOut:function(){var b=a.wrap,c=a.current,d=c.openEffect,f="elastic"===d,g={opacity:0};f&&("fixed"===b.css("position")&&b.css(a._getPosition(!0)),g=this.getOrigPosition(),c.closeOpacity&&
31
+ (g.opacity=0));b.animate(g,{duration:"none"===d?0:c.closeSpeed,easing:c.closeEasing,step:f?this.step:null,complete:a._afterZoomOut})},changeIn:function(){var b=a.wrap,c=a.current,d=c.nextEffect,f="elastic"===d,g=a._getPosition(f),i={opacity:1};g.opacity=0;f&&(g.top=n(parseInt(g.top,10)-200),i.top="+=200px");b.css(g).show().animate(i,{duration:"none"===d?0:c.nextSpeed,easing:c.nextEasing,complete:a._afterZoomIn})},changeOut:function(){var b=a.wrap,c=a.current,e=c.prevEffect,f={opacity:0};b.removeClass("fancybox-opened");
32
+ "elastic"===e&&(f.top="+=200px");b.animate(f,{duration:"none"===e?0:c.prevSpeed,easing:c.prevEasing,complete:function(){d(this).trigger("onReset").remove()}})}};a.helpers.overlay={overlay:null,update:function(){var a,c;this.overlay.width("100%").height("100%");d.browser.msie||k?(a=Math.max(l.documentElement.scrollWidth,l.body.scrollWidth),c=Math.max(l.documentElement.offsetWidth,l.body.offsetWidth),a=a<c?m.width():a):a=q.width();this.overlay.width(a).height(q.height())},beforeShow:function(b){this.overlay||
33
+ (b=d.extend(!0,{},a.defaults.helpers.overlay,b),this.overlay=d('<div id="fancybox-overlay"></div>').css(b.css).appendTo("body"),b.closeClick&&this.overlay.bind("click.fb",a.close),a.current.fixed&&!k?this.overlay.addClass("overlay-fixed"):(this.update(),this.onUpdate=function(){this.update()}),this.overlay.fadeTo(b.speedIn,b.opacity))},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut||0,function(){d(this).remove()});this.overlay=null}};a.helpers.title={beforeShow:function(b){var c;
34
+ if(c=a.current.title)c=d('<div class="fancybox-title fancybox-title-'+b.type+'-wrap">'+c+"</div>").appendTo("body"),"float"===b.type&&(c.width(c.width()),c.wrapInner('<span class="child"></span>'),a.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))),c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.skin)}};d.fn.fancybox=function(b){var c=d(this),e=this.selector||"",f,g=function(g){var h=this,j=f,k;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!d(h).is(".fancybox-wrap")&&
35
+ (g.preventDefault(),g=b.groupAttr||"data-fancybox-group",k=d(h).attr(g),k||(g="rel",k=h[g]),k&&""!==k&&"nofollow"!==k&&(h=e.length?d(e):c,h=h.filter("["+g+'="'+k+'"]'),j=h.index(this)),b.index=j,a.open(h,b))},b=b||{};f=b.index||0;e?q.undelegate(e,"click.fb-start").delegate(e,"click.fb-start",g):c.unbind("click.fb-start").bind("click.fb-start",g);return this};d(l).ready(function(){a.defaults.fixed=d.support.fixedPosition||!(d.browser.msie&&6>=d.browser.version)&&!k})})(window,document,jQuery);
js/jquery/jquery.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ /*! jQuery v1.7.2 jquery.com | jquery.org/license */
2
+ (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
3
+ a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement 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){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.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){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
4
+ .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
js/main.js ADDED
@@ -0,0 +1,863 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var sigInst, canvas, $GP
2
+
3
+ //Load configuration file
4
+ var config={};
5
+ var currentColorAttribute = "base_model_relation";
6
+ var currentAtlasFile = "";
7
+
8
+ //For debug allow a config=file.json parameter to specify the config
9
+ function GetQueryStringParams(sParam,defaultVal) {
10
+ var sPageURL = ""+window.location;//.search.substring(1);//This might be causing error in Safari?
11
+ if (sPageURL.indexOf("?")==-1) return defaultVal;
12
+ sPageURL=sPageURL.substr(sPageURL.indexOf("?")+1);
13
+ var sURLVariables = sPageURL.split('&');
14
+ for (var i = 0; i < sURLVariables.length; i++) {
15
+ var sParameterName = sURLVariables[i].split('=');
16
+ if (sParameterName[0] == sParam) {
17
+ return sParameterName[1];
18
+ }
19
+ }
20
+ return defaultVal;
21
+ }
22
+
23
+
24
+ jQuery.getJSON(GetQueryStringParams("config","config.json"), function(data, textStatus, jqXHR) {
25
+ config=data;
26
+
27
+ currentAtlasFile = config.data;
28
+
29
+ if (config.type!="network") {
30
+ //bad config
31
+ alert("Invalid configuration settings.")
32
+ return;
33
+ }
34
+
35
+ //As soon as page is ready (and data ready) set up it
36
+ $(document).ready(setupGUI(config));
37
+ });//End JSON Config load
38
+
39
+
40
+ // FUNCTION DECLARATIONS
41
+
42
+ Object.size = function(obj) {
43
+ var size = 0, key;
44
+ for (key in obj) {
45
+ if (obj.hasOwnProperty(key)) size++;
46
+ }
47
+ return size;
48
+ };
49
+
50
+
51
+ function initSigma(config) {
52
+ var data=config.data
53
+
54
+ var drawProps, graphProps,mouseProps;
55
+ if (config.sigma && config.sigma.drawingProperties)
56
+ drawProps=config.sigma.drawingProperties;
57
+ else
58
+ drawProps={
59
+ defaultLabelColor: "#000",
60
+ defaultLabelSize: 14,
61
+ defaultLabelBGColor: "#ddd",
62
+ defaultHoverLabelBGColor: "#002147",
63
+ defaultLabelHoverColor: "#fff",
64
+ labelThreshold: 10,
65
+ defaultEdgeType: "curve",
66
+ hoverFontStyle: "bold",
67
+ fontStyle: "bold",
68
+ activeFontStyle: "bold"
69
+ };
70
+
71
+ if (config.sigma && config.sigma.graphProperties)
72
+ graphProps=config.sigma.graphProperties;
73
+ else
74
+ graphProps={
75
+ minNodeSize: 1,
76
+ maxNodeSize: 7,
77
+ minEdgeSize: 0.2,
78
+ maxEdgeSize: 0.5
79
+ };
80
+
81
+ if (config.sigma && config.sigma.mouseProperties)
82
+ mouseProps=config.sigma.mouseProperties;
83
+ else
84
+ mouseProps={
85
+ minRatio: 0.75, // How far can we zoom out?
86
+ maxRatio: 20, // How far can we zoom in?
87
+ };
88
+
89
+ var a = sigma.init(document.getElementById("sigma-canvas")).drawingProperties(drawProps).graphProperties(graphProps).mouseProperties(mouseProps);
90
+ sigInst = a;
91
+ a.active = !1;
92
+ a.neighbors = {};
93
+ a.detail = !1;
94
+
95
+
96
+ dataReady = function() {
97
+ a.clusters = {};
98
+
99
+ // Initialize node clusters based on current coloring
100
+ a.iterNodes(function (b) {
101
+ a.clusters[b.color] || (a.clusters[b.color] = []);
102
+ a.clusters[b.color].push(b.id);
103
+
104
+ // Make sure colors are properly copied from the JSON to node.attr
105
+ if (!b.attr) b.attr = {};
106
+ if (b.colors && !b.attr.colors) {
107
+ b.attr.colors = b.colors;
108
+ }
109
+ });
110
+
111
+ a.bind("upnodes", function (a) {
112
+ nodeActive(a.content[0]);
113
+ });
114
+
115
+ a.draw();
116
+ configSigmaElements(config);
117
+
118
+ // Create the color legend
119
+ updateColorLegend();
120
+
121
+ // Find available color attributes from nodes
122
+ var colorAttributes = [];
123
+ var colorAttrsFound = {};
124
+
125
+ a.iterNodes(function(node) {
126
+ if (node.attr && node.attr.colors) {
127
+ for (var attr in node.attr.colors) {
128
+ if (!colorAttrsFound[attr]) {
129
+ colorAttrsFound[attr] = true;
130
+ colorAttributes.push('<div style="line-height:12px"><a href="#" style="color:black;" data-attr="' + attr + '">'+attr+'</a></div>');
131
+ }
132
+ }
133
+ } else if (node.colors) {
134
+ // If colors are in the original structure, copy them to attr
135
+ if (!node.attr) node.attr = {};
136
+ node.attr.colors = node.colors;
137
+
138
+ for (var attr in node.colors) {
139
+ if (!colorAttrsFound[attr]) {
140
+ colorAttrsFound[attr] = true;
141
+ colorAttributes.push('<div style="line-height:12px"><a href="#" style="color:black;" data-attr="' + attr + '">'+attr+'</a></div>');
142
+ }
143
+ }
144
+ }
145
+ });
146
+
147
+ $GP.coloring.content(colorAttributes.join(""));
148
+ $GP.coloring.select.text(currentColorAttribute);
149
+ }
150
+
151
+ if (data.indexOf("gexf")>0 || data.indexOf("xml")>0)
152
+ a.parseGexf(data,dataReady);
153
+ else
154
+ a.parseJson(data,dataReady);
155
+ gexf = sigmaInst = null;
156
+ }
157
+
158
+
159
+ function setupGUI(config) {
160
+ // Initialise main interface elements
161
+ var logo=""; // Logo elements
162
+ if (config.logo.file) {
163
+
164
+ logo = "<img src=\"" + config.logo.file +"\"";
165
+ if (config.logo.text) logo+=" alt=\"" + config.logo.text + "\"";
166
+ logo+=">";
167
+ } else if (config.logo.text) {
168
+ logo="<h1>"+config.logo.text+"</h1>";
169
+ }
170
+ if (config.logo.link) logo="<a href=\"" + config.logo.link + "\">"+logo+"</a>";
171
+ $("#maintitle").html(logo);
172
+
173
+ // #title
174
+ $("#title").html("<h2>"+config.text.title+"</h2>");
175
+
176
+ // #titletext
177
+ $("#titletext").html(config.text.intro);
178
+
179
+ // More information
180
+ if (config.text.more) {
181
+ $("#information").html(config.text.more);
182
+ } else {
183
+ //hide more information link
184
+ $("#moreinformation").hide();
185
+ }
186
+
187
+ // Legend
188
+
189
+ // Node
190
+ if (config.legend.nodeLabel) {
191
+ $(".node").next().html(config.legend.nodeLabel);
192
+ } else {
193
+ //hide more information link
194
+ $(".node").hide();
195
+ }
196
+ // Edge
197
+ if (config.legend.edgeLabel) {
198
+ $(".edge").next().html(config.legend.edgeLabel);
199
+ } else {
200
+ //hide more information link
201
+ $(".edge").hide();
202
+ }
203
+ // Colours
204
+ if (config.legend.nodeLabel) {
205
+ $(".colours").next().html(config.legend.colorLabel);
206
+ } else {
207
+ //hide more information link
208
+ $(".colours").hide();
209
+ }
210
+
211
+
212
+ $GP = {
213
+ calculating: !1,
214
+ showgroup: !1
215
+ };
216
+ $GP.intro = $("#intro");
217
+ $GP.minifier = $GP.intro.find("#minifier");
218
+ $GP.mini = $("#minify");
219
+ $GP.info = $("#attributepane");
220
+ $GP.info_donnees = $GP.info.find(".nodeattributes");
221
+ $GP.info_name = $GP.info.find(".name");
222
+ $GP.info_link = $GP.info.find(".link");
223
+ $GP.info_data = $GP.info.find(".data");
224
+ $GP.info_close = $GP.info.find(".returntext");
225
+ $GP.info_close2 = $GP.info.find(".close");
226
+ $GP.info_p = $GP.info.find(".p");
227
+ $GP.info_close.click(nodeNormal);
228
+ $GP.info_close2.click(nodeNormal);
229
+ $GP.form = $("#mainpanel").find("form");
230
+ $GP.search = new Search($GP.form.find("#search"));
231
+ if (!config.features.search) {
232
+ $("#search").hide();
233
+ }
234
+ if (!config.features.groupSelectorAttribute) {
235
+ $("#attributeselect").hide();
236
+ }
237
+ $GP.cluster = new Cluster($GP.form.find("#attributeselect"));
238
+ $GP.coloring = new ColorSelector($GP.form.find("#coloringselect"));
239
+
240
+
241
+
242
+ $GP.atlas = new AtlasSelector($GP.form.find("#atlasselect"));
243
+ var atlases = getAvailableAtlases();
244
+ var atlasLinks = [];
245
+ for (var i = 0; i < atlases.length; i++) {
246
+ atlasLinks.push('<div style="line-height:12px"><a href="#" data-file="' + atlases[i].file + '" style="color:black;">' + atlases[i].name + '</a></div>');
247
+ }
248
+
249
+ $GP.atlas.content(atlasLinks.join(""));
250
+ $GP.atlas.select.text(atlases[0].name); // Set default atlas name
251
+
252
+
253
+ config.GP=$GP;
254
+ initSigma(config);
255
+ }
256
+
257
+ function configSigmaElements(config) {
258
+ $GP=config.GP;
259
+
260
+ // Node hover behaviour
261
+ if (config.features.hoverBehavior == "dim") {
262
+
263
+ var greyColor = '#ccc';
264
+ sigInst.bind('overnodes',function(event){
265
+ var nodes = event.content;
266
+ var neighbors = {};
267
+ sigInst.iterEdges(function(e){
268
+ if(nodes.indexOf(e.source)<0 && nodes.indexOf(e.target)<0){
269
+ if(!e.attr['grey']){
270
+ e.attr['true_color'] = e.color;
271
+ e.color = greyColor;
272
+ e.attr['grey'] = 1;
273
+ }
274
+ }else{
275
+ e.color = e.attr['grey'] ? e.attr['true_color'] : e.color;
276
+ e.attr['grey'] = 0;
277
+
278
+ neighbors[e.source] = 1;
279
+ neighbors[e.target] = 1;
280
+ }
281
+ }).iterNodes(function(n){
282
+ if(!neighbors[n.id]){
283
+ if(!n.attr['grey']){
284
+ n.attr['true_color'] = n.color;
285
+ n.color = greyColor;
286
+ n.attr['grey'] = 1;
287
+ }
288
+ }else{
289
+ n.color = n.attr['grey'] ? n.attr['true_color'] : n.color;
290
+ n.attr['grey'] = 0;
291
+ }
292
+ }).draw(2,2,2);
293
+ }).bind('outnodes',function(){
294
+ sigInst.iterEdges(function(e){
295
+ e.color = e.attr['grey'] ? e.attr['true_color'] : e.color;
296
+ e.attr['grey'] = 0;
297
+ }).iterNodes(function(n){
298
+ n.color = n.attr['grey'] ? n.attr['true_color'] : n.color;
299
+ n.attr['grey'] = 0;
300
+ }).draw(2,2,2);
301
+ });
302
+
303
+ } else if (config.features.hoverBehavior == "hide") {
304
+
305
+ sigInst.bind('overnodes',function(event){
306
+ var nodes = event.content;
307
+ var neighbors = {};
308
+ sigInst.iterEdges(function(e){
309
+ if(nodes.indexOf(e.source)>=0 || nodes.indexOf(e.target)>=0){
310
+ neighbors[e.source] = 1;
311
+ neighbors[e.target] = 1;
312
+ }
313
+ }).iterNodes(function(n){
314
+ if(!neighbors[n.id]){
315
+ n.hidden = 1;
316
+ }else{
317
+ n.hidden = 0;
318
+ }
319
+ }).draw(2,2,2);
320
+ }).bind('outnodes',function(){
321
+ sigInst.iterEdges(function(e){
322
+ e.hidden = 0;
323
+ }).iterNodes(function(n){
324
+ n.hidden = 0;
325
+ }).draw(2,2,2);
326
+ });
327
+
328
+ }
329
+ $GP.bg = $(sigInst._core.domElements.bg);
330
+ $GP.bg2 = $(sigInst._core.domElements.bg2);
331
+ var a = [],
332
+ b,x=1;
333
+ for (b in sigInst.clusters) a.push('<div style="line-height:12px"><a href="#' + b + '"><div style="width:40px;height:12px;border:1px solid #fff;background:' + b + ';display:inline-block"></div> Group ' + (x++) + ' (' + sigInst.clusters[b].length + ' members)</a></div>');
334
+ //a.sort();
335
+ $GP.cluster.content(a.join(""));
336
+ b = {
337
+ minWidth: 400,
338
+ maxWidth: 800,
339
+ maxHeight: 600
340
+ };// minHeight: 300,
341
+ $("a.fb").fancybox(b);
342
+ $("#zoom").find("div.z").each(function () {
343
+ var a = $(this),
344
+ b = a.attr("rel");
345
+ a.click(function () {
346
+ if (b == "center") {
347
+ sigInst.position(0,0,1).draw();
348
+ } else {
349
+ var a = sigInst._core;
350
+ sigInst.zoomTo(a.domElements.nodes.width / 2, a.domElements.nodes.height / 2, a.mousecaptor.ratio * ("in" == b ? 1.5 : 0.5));
351
+ }
352
+
353
+ })
354
+ });
355
+ $GP.mini.click(function () {
356
+ $GP.mini.hide();
357
+ $GP.intro.show();
358
+ $GP.minifier.show()
359
+ });
360
+ $GP.minifier.click(function () {
361
+ $GP.intro.hide();
362
+ $GP.minifier.hide();
363
+ $GP.mini.show()
364
+ });
365
+ $GP.intro.find("#showGroups").click(function () {
366
+ !0 == $GP.showgroup ? showGroups(!1) : showGroups(!0)
367
+ });
368
+ a = window.location.hash.substr(1);
369
+ if (0 < a.length) switch (a) {
370
+ case "Groups":
371
+ showGroups(!0);
372
+ break;
373
+ case "information":
374
+ $.fancybox.open($("#information"), b);
375
+ break;
376
+ default:
377
+ $GP.search.exactMatch = !0, $GP.search.search(a)
378
+ $GP.search.clean();
379
+ }
380
+ // $GP.coloring = new ColorSelector($GP.form.find("#coloringselect"));
381
+
382
+ }
383
+
384
+ function Search(a) {
385
+ this.input = a.find("input[name=search]");
386
+ this.state = a.find(".state");
387
+ this.results = a.find(".results");
388
+ this.exactMatch = !1;
389
+ this.lastSearch = "";
390
+ this.searching = !1;
391
+ var b = this;
392
+ this.input.focus(function () {
393
+ var a = $(this);
394
+ a.data("focus") || (a.data("focus", !0), a.removeClass("empty"));
395
+ b.clean()
396
+ });
397
+ this.input.keydown(function (a) {
398
+ if (13 == a.which) return b.state.addClass("searching"), b.search(b.input.val()), !1
399
+ });
400
+ this.state.click(function () {
401
+ var a = b.input.val();
402
+ b.searching && a == b.lastSearch ? b.close() : (b.state.addClass("searching"), b.search(a))
403
+ });
404
+ this.dom = a;
405
+ this.close = function () {
406
+ this.state.removeClass("searching");
407
+ this.results.hide();
408
+ this.searching = !1;
409
+ this.input.val("");//SAH -- let's erase string when we close
410
+ nodeNormal()
411
+ };
412
+ this.clean = function () {
413
+ this.results.empty().hide();
414
+ this.state.removeClass("searching");
415
+ this.input.val("");
416
+ };
417
+ this.search = function (a) {
418
+ var b = !1,
419
+ c = [],
420
+ b = this.exactMatch ? ("^" + a + "$").toLowerCase() : a.toLowerCase(),
421
+ g = RegExp(b);
422
+ this.exactMatch = !1;
423
+ this.searching = !0;
424
+ this.lastSearch = a;
425
+ this.results.empty();
426
+ if (2 >= a.length) this.results.html("<i>You must search for a name with a minimum of 3 letters.</i>");
427
+ else {
428
+ sigInst.iterNodes(function (a) {
429
+ g.test(a.label.toLowerCase()) && c.push({
430
+ id: a.id,
431
+ name: a.label
432
+ })
433
+ });
434
+ c.length ? (b = !0, nodeActive(c[0].id)) : b = showCluster(a);
435
+ a = ["<b>Search Results: </b>"];
436
+ if (1 < c.length) for (var d = 0, h = c.length; d < h; d++) a.push('<a href="#' + c[d].name + '" onclick="nodeActive(\'' + c[d].id + "')\">" + c[d].name + "</a>");
437
+ 0 == c.length && !b && a.push("<i>No results found.</i>");
438
+ 1 < a.length && this.results.html(a.join(""));
439
+ }
440
+ if(c.length!=1) this.results.show();
441
+ if(c.length==1) this.results.hide();
442
+ }
443
+ }
444
+
445
+ function Cluster(a) {
446
+ this.cluster = a;
447
+ this.display = !1;
448
+ this.list = this.cluster.find(".list");
449
+ this.list.empty();
450
+ this.select = this.cluster.find(".select");
451
+ this.select.click(function () {
452
+ $GP.cluster.toggle()
453
+ });
454
+ this.toggle = function () {
455
+ this.display ? this.hide() : this.show()
456
+ };
457
+ this.content = function (a) {
458
+ this.list.html(a);
459
+ this.list.find("a").click(function () {
460
+ var a = $(this).attr("href").substr(1);
461
+ showCluster(a)
462
+ })
463
+ };
464
+ this.hide = function () {
465
+ this.display = !1;
466
+ this.list.hide();
467
+ this.select.removeClass("close")
468
+ };
469
+ this.show = function () {
470
+ this.display = !0;
471
+ this.list.show();
472
+ this.select.addClass("close")
473
+ }
474
+ }
475
+
476
+ // Add this after the Cluster constructor
477
+ function ColorSelector(a) {
478
+ this.coloring = a;
479
+ this.display = false;
480
+ this.list = this.coloring.find(".list");
481
+ this.list.empty();
482
+ this.select = this.coloring.find(".select");
483
+ this.select.click(function () {
484
+ $GP.coloring.toggle();
485
+ });
486
+ this.toggle = function () {
487
+ this.display ? this.hide() : this.show();
488
+ };
489
+ this.content = function (a) {
490
+ this.list.html(a);
491
+ this.list.find("a").click(function () {
492
+ var a = $(this).attr("data-attr");
493
+ changeNodeColors(a);
494
+ });
495
+ };
496
+ this.hide = function () {
497
+ this.display = false;
498
+ this.list.hide();
499
+ this.select.removeClass("close");
500
+ };
501
+ this.show = function () {
502
+ this.display = true;
503
+ this.list.show();
504
+ this.select.addClass("close");
505
+ };
506
+ }
507
+
508
+
509
+ // Add this function to change node colors
510
+ function changeNodeColors(attribute) {
511
+ currentColorAttribute = attribute;
512
+ $GP.coloring.select.text(attribute);
513
+ $GP.coloring.hide();
514
+
515
+ // Reset clusters
516
+ sigInst.clusters = {};
517
+
518
+ // Update node colors based on the selected attribute
519
+ sigInst.iterNodes(function (n) {
520
+ if (n.attr && n.attr.colors && n.attr.colors[attribute]) {
521
+ n.color = n.attr.colors[attribute];
522
+ }
523
+
524
+ // Update clusters
525
+ sigInst.clusters[n.color] || (sigInst.clusters[n.color] = []);
526
+ if (sigInst.clusters[n.color].indexOf(n.id) === -1) {
527
+ sigInst.clusters[n.color].push(n.id);
528
+ }
529
+ });
530
+
531
+
532
+ // Update node colors based on the selected attribute
533
+ sigInst.iterEdges(function (e) {
534
+ if (e.attr && e.attr.colors && e.attr.colors[attribute]) {
535
+ e.color = e.attr.colors[attribute];
536
+ }
537
+ });
538
+
539
+
540
+ // Update color legend
541
+ updateColorLegend();
542
+
543
+ // Redraw the graph
544
+ sigInst.draw(2, 2, 2);
545
+ }
546
+
547
+
548
+
549
+ function updateColorLegend() {
550
+ var legendColors = {};
551
+ var legendHtml = "";
552
+
553
+ // Collect unique colors and their values
554
+ sigInst.iterNodes(function (n) {
555
+ if (n.attr && n.attr.colors && n.attr.colors[currentColorAttribute]) {
556
+ var color = n.attr.colors[currentColorAttribute];
557
+ var attrValue = "";
558
+
559
+ // Try to get the attribute value from node attributes
560
+ if (n.attr.attributes && n.attr.attributes[currentColorAttribute]) {
561
+ attrValue = n.attr.attributes[currentColorAttribute];
562
+ } else {
563
+ // If not found in attributes, use a generic label
564
+ attrValue = "Value " + Object.keys(legendColors).length;
565
+ }
566
+
567
+ if (!legendColors[color]) {
568
+ legendColors[color] = attrValue;
569
+ }
570
+ }
571
+ });
572
+
573
+ // Create legend HTML
574
+ for (var color in legendColors) {
575
+ legendHtml += '<li><div style="width:20px;height:12px;background:' + color +
576
+ ';display:inline-block;margin-right:5px;border:1px solid #ccc;"></div>' +
577
+ legendColors[color] + '</li>';
578
+ }
579
+
580
+ legendHtml += "</ul>";
581
+ $("#colorLegend").html(legendHtml);
582
+ }
583
+
584
+
585
+ function showGroups(a) {
586
+ a ? ($GP.intro.find("#showGroups").text("Hide groups"), $GP.bg.show(), $GP.bg2.hide(), $GP.showgroup = !0) : ($GP.intro.find("#showGroups").text("View Groups"), $GP.bg.hide(), $GP.bg2.show(), $GP.showgroup = !1)
587
+ }
588
+
589
+ function nodeNormal() {
590
+ !0 != $GP.calculating && !1 != sigInst.detail && (showGroups(!1), $GP.calculating = !0, sigInst.detail = !0, $GP.info.delay(400).animate({width:'hide'},350),$GP.cluster.hide(), sigInst.iterEdges(function (a) {
591
+ a.attr.color = !1;
592
+ a.hidden = !1
593
+ }), sigInst.iterNodes(function (a) {
594
+ a.hidden = !1;
595
+ a.attr.color = !1;
596
+ a.attr.lineWidth = !1;
597
+ a.attr.size = !1
598
+ }), sigInst.draw(2, 2, 2, 2), sigInst.neighbors = {}, sigInst.active = !1, $GP.calculating = !1, window.location.hash = "")
599
+ }
600
+
601
+ function nodeActive(a) {
602
+
603
+ var groupByDirection=false;
604
+ if (config.informationPanel.groupByEdgeDirection && config.informationPanel.groupByEdgeDirection==true) groupByDirection=true;
605
+
606
+ sigInst.neighbors = {};
607
+ sigInst.detail = !0;
608
+ var b = sigInst._core.graph.nodesIndex[a];
609
+ showGroups(!1);
610
+ var outgoing={},incoming={},mutual={};//SAH
611
+ sigInst.iterEdges(function (b) {
612
+ b.attr.lineWidth = !1;
613
+ b.hidden = !0;
614
+
615
+ n={
616
+ name: b.label,
617
+ colour: b.color
618
+ };
619
+
620
+ if (a==b.source) outgoing[b.target]=n; //SAH
621
+ else if (a==b.target) incoming[b.source]=n; //SAH
622
+ if (a == b.source || a == b.target) sigInst.neighbors[a == b.target ? b.source : b.target] = n;
623
+ b.hidden = !1, b.attr.color = "rgba(0, 0, 0, 1)";
624
+ });
625
+ var f = [];
626
+ sigInst.iterNodes(function (a) {
627
+ a.hidden = !0;
628
+ a.attr.lineWidth = !1;
629
+ a.attr.color = a.color
630
+ });
631
+
632
+ if (groupByDirection) {
633
+ //SAH - Compute intersection for mutual and remove these from incoming/outgoing
634
+ for (e in outgoing) {
635
+ //name=outgoing[e];
636
+ if (e in incoming) {
637
+ mutual[e]=outgoing[e];
638
+ delete incoming[e];
639
+ delete outgoing[e];
640
+ }
641
+ }
642
+ }
643
+
644
+ var createList=function(c) {
645
+ var f = [];
646
+ var e = [],
647
+ //c = sigInst.neighbors,
648
+ g;
649
+ for (g in c) {
650
+ var d = sigInst._core.graph.nodesIndex[g];
651
+ d.hidden = !1;
652
+ d.attr.lineWidth = !1;
653
+ d.attr.color = c[g].colour;
654
+ a != g && e.push({
655
+ id: g,
656
+ name: d.label,
657
+ group: (c[g].name)? c[g].name:"",
658
+ colour: c[g].colour
659
+ })
660
+ }
661
+ e.sort(function (a, b) {
662
+ var c = a.group.toLowerCase(),
663
+ d = b.group.toLowerCase(),
664
+ e = a.name.toLowerCase(),
665
+ f = b.name.toLowerCase();
666
+ return c != d ? c < d ? -1 : c > d ? 1 : 0 : e < f ? -1 : e > f ? 1 : 0
667
+ });
668
+ d = "";
669
+ for (g in e) {
670
+ c = e[g];
671
+ /*if (c.group != d) {
672
+ d = c.group;
673
+ f.push('<li class="cf" rel="' + c.color + '"><div class=""></div><div class="">' + d + "</div></li>");
674
+ }*/
675
+ f.push('<li class="membership"><a href="#' + c.name + '" onmouseover="sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex[\'' + c.id + '\'])\" onclick=\"nodeActive(\'' + c.id + '\')" onmouseout="sigInst.refresh()">' + c.name + "</a></li>");
676
+ }
677
+ return f;
678
+ }
679
+
680
+ /*console.log("mutual:");
681
+ console.log(mutual);
682
+ console.log("incoming:");
683
+ console.log(incoming);
684
+ console.log("outgoing:");
685
+ console.log(outgoing);*/
686
+
687
+
688
+ var f=[];
689
+
690
+ //console.log("neighbors:");
691
+ //console.log(sigInst.neighbors);
692
+
693
+ if (groupByDirection) {
694
+ size=Object.size(mutual);
695
+ f.push("<h2>Mututal (" + size + ")</h2>");
696
+ (size>0)? f=f.concat(createList(mutual)) : f.push("No mutual links<br>");
697
+ size=Object.size(incoming);
698
+ f.push("<h2>Incoming (" + size + ")</h2>");
699
+ (size>0)? f=f.concat(createList(incoming)) : f.push("No incoming links<br>");
700
+ size=Object.size(outgoing);
701
+ f.push("<h2>Outgoing (" + size + ")</h2>");
702
+ (size>0)? f=f.concat(createList(outgoing)) : f.push("No outgoing links<br>");
703
+ } else {
704
+ f=f.concat(createList(sigInst.neighbors));
705
+ }
706
+ //b is object of active node -- SAH
707
+ b.hidden = !1;
708
+ b.attr.color = b.color;
709
+ b.attr.lineWidth = 6;
710
+ b.attr.strokeStyle = "#000000";
711
+ sigInst.draw(2, 2, 2, 2);
712
+
713
+ $GP.info_link.find("ul").html(f.join(""));
714
+ $GP.info_link.find("li").each(function () {
715
+ var a = $(this),
716
+ b = a.attr("rel");
717
+ });
718
+ f = b.attr;
719
+ if (f.attributes) {
720
+ var image_attribute = false;
721
+ if (config.informationPanel.imageAttribute) {
722
+ image_attribute=config.informationPanel.imageAttribute;
723
+ }
724
+ e = [];
725
+
726
+ e.push('<span><strong>Model page:</strong> <a href=\"https://huggingface.co/' + f.attributes['id'] + '\" target=\"_blank\">https://huggingface.co/' + f.attributes['id'] + '</a> </span><br/>')
727
+ e.push('<span><strong>Update model information:</strong> <a href=\"https://huggingface.co/'+ f.attributes['id'] + '/edit/main/README.md\" target=\"_blank\">edit</a> </span><br/>')
728
+ temp_array = [];
729
+ g = 0;
730
+ for (var attr in f.attributes) {
731
+ var d = f.attributes[attr],
732
+ h = "";
733
+ if (attr!=image_attribute) {
734
+ h = '<span><strong>' + attr + ':</strong> ' + d + '</span><br/>'
735
+ }
736
+ //temp_array.push(f.attributes[g].attr);
737
+ e.push(h)
738
+ }
739
+
740
+ if (image_attribute) {
741
+ //image_index = jQuery.inArray(image_attribute, temp_array);
742
+ $GP.info_name.html("<div><img src=" + f.attributes[image_attribute] + " style=\"vertical-align:middle\" /> <span onmouseover=\"sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex['" + b.id + '\'])" onmouseout="sigInst.refresh()">' + b.label + "</span></div>");
743
+ } else {
744
+ $GP.info_name.html("<div><span onmouseover=\"sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex['" + b.id + '\'])" onmouseout="sigInst.refresh()">' + b.label + "</span></div>");
745
+ }
746
+ // Image field for attribute pane
747
+ $GP.info_data.html(e.join("<br/>"))
748
+ }
749
+ $GP.info_data.show();
750
+
751
+ $GP.info_p.html("Connections:");
752
+ $GP.info.animate({width:'show'},350);
753
+ $GP.info_donnees.hide();
754
+ $GP.info_donnees.show();
755
+ sigInst.active = a;
756
+ window.location.hash = b.label;
757
+ }
758
+
759
+ function showCluster(a) {
760
+ var b = sigInst.clusters[a];
761
+ if (b && 0 < b.length) {
762
+ showGroups(!1);
763
+ sigInst.detail = !0;
764
+ b.sort();
765
+ sigInst.iterEdges(function (a) {
766
+ a.hidden = !1;
767
+ a.attr.lineWidth = !1;
768
+ a.attr.color = !1
769
+ });
770
+ sigInst.iterNodes(function (a) {
771
+ a.hidden = !0
772
+ });
773
+ for (var f = [], e = [], c = 0, g = b.length; c < g; c++) {
774
+ var d = sigInst._core.graph.nodesIndex[b[c]];
775
+ !0 == d.hidden && (e.push(b[c]), d.hidden = !1, d.attr.lineWidth = !1, d.attr.color = d.color, f.push('<li class="membership"><a href="#'+d.label+'" onmouseover="sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex[\'' + d.id + "'])\" onclick=\"nodeActive('" + d.id + '\')" onmouseout="sigInst.refresh()">' + d.label + "</a></li>"))
776
+ }
777
+ sigInst.clusters[a] = e;
778
+ sigInst.draw(2, 2, 2, 2);
779
+ $GP.info_name.html("<b>" + a + "</b>");
780
+ $GP.info_data.hide();
781
+ $GP.info_p.html("Group Members:");
782
+ $GP.info_link.find("ul").html(f.join(""));
783
+ $GP.info.animate({width:'show'},350);
784
+ $GP.search.clean();
785
+ $GP.cluster.hide();
786
+ return !0
787
+ }
788
+ return !1
789
+ }
790
+
791
+
792
+
793
+ function AtlasSelector(a) {
794
+ this.atlas = a;
795
+ this.display = false;
796
+ this.list = this.atlas.find(".list");
797
+ this.list.empty();
798
+ this.select = this.atlas.find(".select");
799
+ this.select.click(function () {
800
+ $GP.atlas.toggle();
801
+ });
802
+ this.toggle = function () {
803
+ this.display ? this.hide() : this.show();
804
+ };
805
+ this.content = function (a) {
806
+ this.list.html(a);
807
+ this.list.find("a").click(function () {
808
+ var dataFile = $(this).attr("data-file");
809
+ loadNewAtlas(dataFile);
810
+ });
811
+ };
812
+ this.hide = function () {
813
+ this.display = false;
814
+ this.list.hide();
815
+ this.select.removeClass("close");
816
+ };
817
+ this.show = function () {
818
+ this.display = true;
819
+ this.list.show();
820
+ this.select.addClass("close");
821
+ };
822
+ }
823
+
824
+ function getAvailableAtlases() {
825
+ return [
826
+ { name: "Modalities Atlas", file: "modalities_data.json" },
827
+ { name: "Large NLP Atlas", file: "large_nlp_data.json" },
828
+ ];
829
+ }
830
+
831
+ function loadNewAtlas(dataFile) {
832
+ // Update the currently selected atlas in the dropdown
833
+ $GP.atlas.select.text(getAtlasNameByFile(dataFile));
834
+ $GP.atlas.hide();
835
+
836
+ config.data = dataFile;
837
+ reinitializeSigma(config);
838
+ }
839
+
840
+ function reinitializeSigma(config) {
841
+ // Remove the old sigma instance
842
+ if (sigInst) {
843
+ sigInst.kill();
844
+ }
845
+
846
+ // Recreate the sigma canvas
847
+ $(".sigma-expand").empty();
848
+
849
+ // Initialize new sigma instance
850
+ initSigma(config);
851
+ }
852
+
853
+
854
+ function getAtlasNameByFile(dataFile) {
855
+ var atlases = getAvailableAtlases();
856
+ for (var i = 0; i < atlases.length; i++) {
857
+ if (atlases[i].file === dataFile) {
858
+ return atlases[i].name;
859
+ }
860
+ }
861
+ return "Unknown Atlas";
862
+ }
863
+
js/sigma/_sigma.min.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* sigmajs.org - an open-source light-weight JavaScript graph drawing library - Version: 0.1 - Author: Alexis Jacomy - License: MIT */
2
+ var sigma={tools:{},classes:{},instances:{}};
3
+ (function(){Array.prototype.some||(Array.prototype.some=function(g,i){var k=this.length;if("function"!=typeof g)throw new TypeError;for(var m=0;m<k;m++)if(m in this&&g.call(i,this[m],m,this))return!0;return!1});Array.prototype.forEach||(Array.prototype.forEach=function(g,i){var k=this.length;if(typeof g!="function")throw new TypeError;for(var m=0;m<k;m++)m in this&&g.call(i,this[m],m,this)});Array.prototype.map||(Array.prototype.map=function(g,i){var k=this.length;if(typeof g!="function")throw new TypeError;
4
+ for(var m=Array(k),b=0;b<k;b++)b in this&&(m[b]=g.call(i,this[b],b,this));return m});Array.prototype.filter||(Array.prototype.filter=function(g,i){var k=this.length;if(typeof g!="function")throw new TypeError;for(var m=[],b=0;b<k;b++)if(b in this){var j=this[b];g.call(i,j,b,this)&&m.push(j)}return m});if(!Object.keys){var i=Object,q=Object.prototype.hasOwnProperty,g=!{toString:null}.propertyIsEnumerable("toString"),p="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),
5
+ z=p.length;i.keys=function(i){if(typeof i!=="object"&&typeof i!=="function"||i===null)throw new TypeError("Object.keys called on non-object");var x=[],k;for(k in i)q.call(i,k)&&x.push(k);if(g)for(k=0;k<z;k++)q.call(i,p[k])&&x.push(p[k]);return x}}})();sigma.classes.Cascade=function(){this.p={};this.config=function(i,q){if("string"==typeof i&&void 0==q)return this.p[i];var g="object"==typeof i&&void 0==q?i:{};"string"==typeof i&&(g[i]=q);for(var p in g)void 0!=this.p[p]&&(this.p[p]=g[p]);return this}};
6
+ sigma.classes.EventDispatcher=function(){var i={},q=this;this.one=function(g,p){if(!p||!g)return q;("string"==typeof g?g.split(" "):g).forEach(function(g){i[g]||(i[g]=[]);i[g].push({h:p,one:!0})});return q};this.bind=function(g,p){if(!p||!g)return q;("string"==typeof g?g.split(" "):g).forEach(function(g){i[g]||(i[g]=[]);i[g].push({h:p,one:!1})});return q};this.unbind=function(g,p){g||(i={});var z="string"==typeof g?g.split(" "):g;p?z.forEach(function(g){i[g]&&(i[g]=i[g].filter(function(g){return g.h!=
7
+ p}));i[g]&&0==i[g].length&&delete i[g]}):z.forEach(function(g){delete i[g]});return q};this.dispatch=function(g,p){i[g]&&(i[g].forEach(function(i){i.h({type:g,content:p,target:q})}),i[g]=i[g].filter(function(g){return!g.one}));return q}};
8
+ (function(){function i(){function b(a){return{x:a.x,y:a.y,size:a.size,degree:a.degree,inDegree:a.inDegree,outDegree:a.outDegree,displayX:a.displayX,displayY:a.displayY,displaySize:a.displaySize,label:a.label,id:a.id,color:a.color,fixed:a.fixed,active:a.active,hidden:a.hidden,forceLabel:a.forceLabel,attr:a.attr}}function j(a){return{source:a.source.id,target:a.target.id,size:a.size,type:a.type,weight:a.weight,displaySize:a.displaySize,label:a.label,hidden:a.hidden,id:a.id,attr:a.attr,color:a.color}}
9
+ function f(){c.nodes=[];c.nodesIndex={};c.edges=[];c.edgesIndex={};return c}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var c=this;this.p={minNodeSize:0,maxNodeSize:0,minEdgeSize:0,maxEdgeSize:0,scalingMode:"inside",nodesPowRatio:0.5,edgesPowRatio:0};this.borders={};f();this.addNode=function(a,b){if(c.nodesIndex[a])throw Error('Node "'+a+'" already exists.');var b=b||{},d={x:0,y:0,size:1,degree:0,inDegree:0,outDegree:0,fixed:!1,active:!1,hidden:!1,forceLabel:!1,label:a.toString(),
10
+ id:a.toString(),attr:{}},f;for(f in b)switch(f){case "id":break;case "x":case "y":case "size":d[f]=+b[f];break;case "fixed":case "active":case "hidden":case "forceLabel":d[f]=!!b[f];break;case "color":case "label":d[f]=b[f];break;default:d.attr[f]=b[f]}c.nodes.push(d);c.nodesIndex[a.toString()]=d;return c};this.addEdge=function(a,b,d,f){if(c.edgesIndex[a])throw Error('Edge "'+a+'" already exists.');if(!c.nodesIndex[b])throw Error("Edge's source \""+b+'" does not exist yet.');if(!c.nodesIndex[d])throw Error("Edge's target \""+
11
+ d+'" does not exist yet.');f=f||{};b={source:c.nodesIndex[b],target:c.nodesIndex[d],size:1,weight:1,displaySize:0.5,label:a.toString(),id:a.toString(),hidden:!1,attr:{}};b.source.degree++;b.source.outDegree++;b.target.degree++;b.target.inDegree++;for(var o in f)switch(o){case "id":case "source":case "target":break;case "hidden":b[o]=!!f[o];break;case "size":case "weight":b[o]=+f[o];break;case "color":b[o]=f[o].toString();break;case "type":b[o]=f[o].toString();break;case "label":b[o]=f[o];break;default:b.attr[o]=
12
+ f[o]}c.edges.push(b);c.edgesIndex[a.toString()]=b;return c};this.dropNode=function(a){((a instanceof Array?a:[a])||[]).forEach(function(a){if(c.nodesIndex[a]){var b=null;c.nodes.some(function(c,f){return c.id==a?(b=f,!0):!1});null!=b&&c.nodes.splice(b,1);delete c.nodesIndex[a];c.edges=c.edges.filter(function(b){return b.source.id==a?(delete c.edgesIndex[b.id],b.target.degree--,b.target.inDegree--,!1):b.target.id==a?(delete c.edgesIndex[b.id],b.source.degree--,b.source.outDegree--,!1):!0})}else sigma.log('Node "'+
13
+ a+'" does not exist.')});return c};this.dropEdge=function(a){((a instanceof Array?a:[a])||[]).forEach(function(a){if(c.edgesIndex[a]){c.edgesIndex[a].source.degree--;c.edgesIndex[a].source.outDegree--;c.edgesIndex[a].target.degree--;c.edgesIndex[a].target.inDegree--;var b=null;c.edges.some(function(c,f){return c.id==a?(b=f,!0):!1});null!=b&&c.edges.splice(b,1);delete c.edgesIndex[a]}else sigma.log('Edge "'+a+'" does not exist.')});return c};this.iterEdges=function(a,b){var d=b?b.map(function(a){return c.edgesIndex[a]}):
14
+ c.edges,f=d.map(j);f.forEach(a);d.forEach(function(a,b){var d=f[b],l;for(l in d)switch(l){case "id":case "displaySize":break;case "weight":case "size":a[l]=+d[l];break;case "source":case "target":a[l]=c.nodesIndex[l]||a[l];break;case "hidden":a[l]=!!d[l];break;case "color":case "label":case "type":a[l]=(d[l]||"").toString();break;default:a.attr[l]=d[l]}});return c};this.iterNodes=function(a,f){var d=f?f.map(function(a){return c.nodesIndex[a]}):c.nodes,j=d.map(b);j.forEach(a);d.forEach(function(a,
15
+ b){var d=j[b],c;for(c in d)switch(c){case "id":case "attr":case "degree":case "inDegree":case "outDegree":case "displayX":case "displayY":case "displaySize":break;case "x":case "y":case "size":a[c]=+d[c];break;case "fixed":case "active":case "hidden":case "forceLabel":a[c]=!!d[c];break;case "color":case "label":a[c]=(d[c]||"").toString();break;default:a.attr[c]=d[c]}});return c};this.getEdges=function(a){var b=((a instanceof Array?a:[a])||[]).map(function(a){return j(c.edgesIndex[a])});return a instanceof
16
+ Array?b:b[0]};this.getNodes=function(a){var f=((a instanceof Array?a:[a])||[]).map(function(a){return b(c.nodesIndex[a])});return a instanceof Array?f:f[0]};this.empty=f;this.rescale=function(a,b,d,f){var j=0,h=0;d&&c.nodes.forEach(function(a){h=Math.max(a.size,h)});f&&c.edges.forEach(function(a){j=Math.max(a.size,j)});var h=h||1,j=j||1,g,l,s,t;d&&c.nodes.forEach(function(a){l=Math.max(a.x,l||a.x);g=Math.min(a.x,g||a.x);t=Math.max(a.y,t||a.y);s=Math.min(a.y,s||a.y)});var A="outside"==c.p.scalingMode?
17
+ Math.max(a/Math.max(l-g,1),b/Math.max(t-s,1)):Math.min(a/Math.max(l-g,1),b/Math.max(t-s,1)),i=(c.p.maxNodeSize||h)/A;l+=i;g-=i;t+=i;s-=i;var A="outside"==c.p.scalingMode?Math.max(a/Math.max(l-g,1),b/Math.max(t-s,1)):Math.min(a/Math.max(l-g,1),b/Math.max(t-s,1)),u,k;!c.p.maxNodeSize&&!c.p.minNodeSize?(u=1,k=0):c.p.maxNodeSize==c.p.minNodeSize?(u=0,k=c.p.maxNodeSize):(u=(c.p.maxNodeSize-c.p.minNodeSize)/h,k=c.p.minNodeSize);var B,E;!c.p.maxEdgeSize&&!c.p.minEdgeSize?(B=1,E=0):(B=c.p.maxEdgeSize==c.p.minEdgeSize?
18
+ 0:(c.p.maxEdgeSize-c.p.minEdgeSize)/j,E=c.p.minEdgeSize);d&&c.nodes.forEach(function(c){c.displaySize=c.size*u+k;if(!c.fixed){c.displayX=(c.x-(l+g)/2)*A+a/2;c.displayY=(c.y-(t+s)/2)*A+b/2}});f&&c.edges.forEach(function(a){a.displaySize=a.size*B+E});return c};this.translate=function(a,b,d,f,j){var h=Math.pow(d,c.p.nodesPowRatio);f&&c.nodes.forEach(function(c){c.fixed||(c.displayX=c.displayX*d+a,c.displayY=c.displayY*d+b);c.displaySize*=h});h=Math.pow(d,c.p.edgesPowRatio);j&&c.edges.forEach(function(a){a.displaySize*=
19
+ h});return c};this.setBorders=function(){c.borders={};c.nodes.forEach(function(a){c.borders.minX=Math.min(void 0==c.borders.minX?a.displayX-a.displaySize:c.borders.minX,a.displayX-a.displaySize);c.borders.maxX=Math.max(void 0==c.borders.maxX?a.displayX+a.displaySize:c.borders.maxX,a.displayX+a.displaySize);c.borders.minY=Math.min(void 0==c.borders.minY?a.displayY-a.displaySize:c.borders.minY,a.displayY-a.displaySize);c.borders.maxY=Math.max(void 0==c.borders.maxY?a.displayY-a.displaySize:c.borders.maxY,
20
+ a.displayY-a.displaySize)})};this.checkHover=function(a,b){var d,f,j,h=[],g=[];c.nodes.forEach(function(c){if(c.hidden)c.hover=!1;else{d=Math.abs(c.displayX-a);f=Math.abs(c.displayY-b);j=c.displaySize;var s=c.hover,t=d<j&&f<j&&Math.sqrt(d*d+f*f)<j;s&&!t?(c.hover=!1,g.push(c.id)):t&&!s&&(c.hover=!0,h.push(c.id))}});h.length&&c.dispatch("overnodes",h);g.length&&c.dispatch("outnodes",g);return c}}function q(b,j){function f(){var a;a="<p>GLOBAL :</p>";for(var b in c.p.globalProbes)a+="<p>"+b+" : "+c.p.globalProbes[b]()+
21
+ "</p>";a+="<br><p>LOCAL :</p>";for(b in c.p.localProbes)a+="<p>"+b+" : "+c.p.localProbes[b]()+"</p>";c.p.dom.innerHTML=a;return c}sigma.classes.Cascade.call(this);var c=this;this.instance=b;this.monitoring=!1;this.p={fps:40,dom:j,globalProbes:{"Time (ms)":sigma.chronos.getExecutionTime,Queue:sigma.chronos.getQueuedTasksCount,Tasks:sigma.chronos.getTasksCount,FPS:sigma.chronos.getFPS},localProbes:{"Nodes count":function(){return c.instance.graph.nodes.length},"Edges count":function(){return c.instance.graph.edges.length}}};
22
+ this.activate=function(){c.monitoring||(c.monitoring=window.setInterval(f,1E3/c.p.fps));return c};this.desactivate=function(){c.monitoring&&(window.clearInterval(c.monitoring),c.monitoring=null,c.p.dom.innerHTML="");return c}}function g(b){var j=b.changedTouches[0],f="";switch(b.type){case "touchstart":f="mousedown";break;case "touchmove":f="mousemove";break;case "touchend":f="mouseup";break;default:return}var c=document.createEvent("MouseEvent");c.initMouseEvent(f,!0,!0,window,1,j.posX,j.posY,j.clientX,
23
+ j.clientY,!1,!1,!1,!1,0,null);j.target.dispatchEvent(c);b.preventDefault()}function p(b){function j(b){a.p.mouseEnabled&&(f(a.mouseX,a.mouseY,a.ratio*(0<(void 0!=b.wheelDelta&&b.wheelDelta||void 0!=b.detail&&-b.detail)?a.p.zoomMultiply:1/a.p.zoomMultiply)),a.p.blockScroll&&(b.preventDefault?b.preventDefault():b.returnValue=!1))}function f(b,d,f){if(!a.isMouseDown&&(window.clearInterval(a.interpolationID),m=void 0!=f,w=a.stageX,n=b,o=a.stageY,l=d,h=f||a.ratio,h=Math.min(Math.max(h,a.p.minRatio),a.p.maxRatio),
24
+ u=a.p.directZooming?1-(m?a.p.zoomDelta:a.p.dragDelta):0,a.ratio!=h||a.stageX!=n||a.stageY!=l))c(),a.interpolationID=window.setInterval(c,50),a.dispatch("startinterpolate")}function c(){u+=m?a.p.zoomDelta:a.p.dragDelta;u=Math.min(u,1);var b=sigma.easing.quadratic.easeout(u),c=a.ratio;a.ratio=c*(1-b)+h*b;m?(a.stageX=n+(a.stageX-n)*a.ratio/c,a.stageY=l+(a.stageY-l)*a.ratio/c):(a.stageX=w*(1-b)+n*b,a.stageY=o*(1-b)+l*b);a.dispatch("interpolate");1<=u&&(window.clearInterval(a.interpolationID),b=a.ratio,
25
+ m?(a.ratio=h,a.stageX=n+(a.stageX-n)*a.ratio/b,a.stageY=l+(a.stageY-l)*a.ratio/b):(a.stageX=n,a.stageY=l),a.dispatch("stopinterpolate"))}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var a=this;this.p={minRatio:1,maxRatio:32,marginRatio:1,zoomDelta:0.1,dragDelta:0.3,zoomMultiply:2,directZooming:!1,blockScroll:!0,inertia:1.1,mouseEnabled:!0,touchEnabled:!0};var i=0,d=0,w=0,o=0,h=1,n=0,l=0,s=0,t=0,A=0,k=0,u=0,m=!1;this.stageY=this.stageX=0;this.ratio=1;this.mouseY=this.mouseX=
26
+ 0;this.isTouchDown=this.isMouseDown=!1;b.addEventListener("DOMMouseScroll",j,!0);b.addEventListener("mousewheel",j,!0);b.addEventListener("mousemove",function(b){a.mouseX=void 0!=b.offsetX&&b.offsetX||void 0!=b.layerX&&b.layerX||void 0!=b.clientX&&b.clientX;a.mouseY=void 0!=b.offsetY&&b.offsetY||void 0!=b.layerY&&b.layerY||void 0!=b.clientY&&b.clientY;if(a.isMouseDown){var c=a.mouseX-i+w,h=a.mouseY-d+o;if(c!=a.stageX||h!=a.stageY)t=s,k=A,s=c,A=h,a.stageX=c,a.stageY=h,a.dispatch("drag")}a.dispatch("move");
27
+ b.preventDefault?b.preventDefault():b.returnValue=!1},!0);b.addEventListener("mousedown",function(b){a.p.mouseEnabled&&(a.isMouseDown=!0,a.dispatch("mousedown"),w=a.stageX,o=a.stageY,i=a.mouseX,d=a.mouseY,t=s=a.stageX,k=A=a.stageY,a.dispatch("startdrag"),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);document.addEventListener("mouseup",function(b){a.p.mouseEnabled&&a.isMouseDown&&(a.isMouseDown=!1,a.dispatch("mouseup"),(w!=a.stageX||o!=a.stageY)&&f(a.stageX+a.p.inertia*(a.stageX-t),a.stageY+
28
+ a.p.inertia*(a.stageY-k)),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);b.addEventListener("touchstart",g,!0);b.addEventListener("touchmove",g,!0);document.addEventListener("touchend",g,!0);b.addEventListener("touchcancel",g,!0);this.checkBorders=function(){return a};this.interpolate=f}function z(b,j,f,c,a,g,d){function i(a){var b=c,d="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*a.displaySize;b.font=(h.p.hoverFontStyle||h.p.fontStyle||"")+" "+d+"px "+(h.p.hoverFont||
29
+ h.p.font||"");b.fillStyle="node"==h.p.labelHoverBGColor?a.color||h.p.defaultNodeColor:h.p.defaultHoverLabelBGColor;b.beginPath();h.p.labelHoverShadow&&(b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=4,b.shadowColor=h.p.labelHoverShadowColor);sigma.tools.drawRoundRect(b,Math.round(a.displayX-d/2-2),Math.round(a.displayY-d/2-2),Math.round(b.measureText(a.label).width+1.5*a.displaySize+d/2+4),Math.round(d+4),Math.round(d/2+2),"left");b.closePath();b.fill();b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur=
30
+ 0;b.beginPath();b.fillStyle="node"==h.p.nodeBorderColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeBorderColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize+h.p.borderSize,0,2*Math.PI,!0);b.closePath();b.fill();b.beginPath();b.fillStyle="node"==h.p.nodeHoverColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeHoverColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize,0,2*Math.PI,!0);b.closePath();b.fill();b.fillStyle="node"==h.p.labelHoverColor?a.color||h.p.defaultNodeColor:
31
+ h.p.defaultLabelHoverColor;b.fillText(a.label,Math.round(a.displayX+1.5*a.displaySize),Math.round(a.displayY+d/2-3));return h}function o(a){if(isNaN(a.x)||isNaN(a.y))throw Error("A node's coordinate is not a number (id: "+a.id+")");return!a.hidden&&a.displayX+a.displaySize>-n/3&&a.displayX-a.displaySize<4*n/3&&a.displayY+a.displaySize>-l/3&&a.displayY-a.displaySize<4*l/3}sigma.classes.Cascade.call(this);var h=this;this.p={labelColor:"default",defaultLabelColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff",
32
+ labelHoverShadow:!0,labelHoverShadowColor:"#000",labelHoverColor:"default",defaultLabelHoverColor:"#000",labelActiveBGColor:"default",defaultActiveLabelBGColor:"#fff",labelActiveShadow:!0,labelActiveShadowColor:"#000",labelActiveColor:"default",defaultLabelActiveColor:"#000",labelSize:"fixed",defaultLabelSize:12,labelSizeRatio:2,labelThreshold:6,font:"Arial",hoverFont:"",activeFont:"",fontStyle:"",hoverFontStyle:"",activeFontStyle:"",edgeColor:"source",defaultEdgeColor:"#aaa",defaultEdgeType:"line",
33
+ defaultNodeColor:"#aaa",nodeHoverColor:"node",defaultNodeHoverColor:"#fff",nodeActiveColor:"node",defaultNodeActiveColor:"#fff",borderSize:0,nodeBorderColor:"node",defaultNodeBorderColor:"#fff",edgesSpeed:200,nodesSpeed:200,labelsSpeed:200};var n=g,l=d;this.currentLabelIndex=this.currentNodeIndex=this.currentEdgeIndex=0;this.task_drawLabel=function(){for(var b=a.nodes.length,c=0;c++<h.p.labelsSpeed&&h.currentLabelIndex<b;)if(h.isOnScreen(a.nodes[h.currentLabelIndex])){var d=a.nodes[h.currentLabelIndex++],
34
+ j=f;if(d.displaySize>=h.p.labelThreshold||d.forceLabel){var g="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*d.displaySize;j.font=h.p.fontStyle+g+"px "+h.p.font;j.fillStyle="node"==h.p.labelColor?d.color||h.p.defaultNodeColor:h.p.defaultLabelColor;j.fillText(d.label,Math.round(d.displayX+1.5*d.displaySize),Math.round(d.displayY+g/2-3))}}else h.currentLabelIndex++;return h.currentLabelIndex<b};this.task_drawEdge=function(){for(var b=a.edges.length,c,d,f=0;f++<h.p.edgesSpeed&&h.currentEdgeIndex<
35
+ b;)if(e=a.edges[h.currentEdgeIndex],c=e.source,d=e.target,e.hidden||c.hidden||d.hidden||!h.isOnScreen(c)&&!h.isOnScreen(d))h.currentEdgeIndex++;else{c=a.edges[h.currentEdgeIndex++];d=c.source.displayX;var g=c.source.displayY,o=c.target.displayX,i=c.target.displayY,l=c.color;if(!l)switch(h.p.edgeColor){case "source":l=c.source.color||h.p.defaultNodeColor;break;case "target":l=c.target.color||h.p.defaultNodeColor;break;default:l=h.p.defaultEdgeColor}var n=j;switch(c.type||h.p.defaultEdgeType){case "curve":n.strokeStyle=
36
+ l;n.lineWidth=c.displaySize/3;n.beginPath();n.moveTo(d,g);n.quadraticCurveTo((d+o)/2+(i-g)/4,(g+i)/2+(d-o)/4,o,i);n.stroke();break;default:n.strokeStyle=l,n.lineWidth=c.displaySize/3,n.beginPath(),n.moveTo(d,g),n.lineTo(o,i),n.stroke()}}return h.currentEdgeIndex<b};this.task_drawNode=function(){for(var c=a.nodes.length,d=0;d++<h.p.nodesSpeed&&h.currentNodeIndex<c;)if(h.isOnScreen(a.nodes[h.currentNodeIndex])){var f=a.nodes[h.currentNodeIndex++],j=Math.round(10*f.displaySize)/10,g=b;g.fillStyle=f.color;
37
+ g.beginPath();g.arc(f.displayX,f.displayY,j,0,2*Math.PI,!0);g.closePath();g.fill();f.hover&&i(f)}else h.currentNodeIndex++;return h.currentNodeIndex<c};this.drawActiveNode=function(a){var b=c;if(!o(a))return h;var d="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*a.displaySize;b.font=(h.p.activeFontStyle||h.p.fontStyle||"")+" "+d+"px "+(h.p.activeFont||h.p.font||"");b.fillStyle="node"==h.p.labelHoverBGColor?a.color||h.p.defaultNodeColor:h.p.defaultActiveLabelBGColor;b.beginPath();h.p.labelActiveShadow&&
38
+ (b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=4,b.shadowColor=h.p.labelActiveShadowColor);sigma.tools.drawRoundRect(b,Math.round(a.displayX-d/2-2),Math.round(a.displayY-d/2-2),Math.round(b.measureText(a.label).width+1.5*a.displaySize+d/2+4),Math.round(d+4),Math.round(d/2+2),"left");b.closePath();b.fill();b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur=0;b.beginPath();b.fillStyle="node"==h.p.nodeBorderColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeBorderColor;b.arc(Math.round(a.displayX),
39
+ Math.round(a.displayY),a.displaySize+h.p.borderSize,0,2*Math.PI,!0);b.closePath();b.fill();b.beginPath();b.fillStyle="node"==h.p.nodeActiveColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeActiveColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize,0,2*Math.PI,!0);b.closePath();b.fill();b.fillStyle="node"==h.p.labelActiveColor?a.color||h.p.defaultNodeColor:h.p.defaultLabelActiveColor;b.fillText(a.label,Math.round(a.displayX+1.5*a.displaySize),Math.round(a.displayY+d/2-3));return h};
40
+ this.drawHoverNode=i;this.isOnScreen=o;this.resize=function(a,b){n=a;l=b;return h}}function F(b,g){function f(){sigma.chronos.removeTask("node_"+d.id,2).removeTask("edge_"+d.id,2).removeTask("label_"+d.id,2).stopTasks();return d}function c(a,b){d.domElements[a]=document.createElement(b);d.domElements[a].style.position="absolute";d.domElements[a].setAttribute("id","sigma_"+a+"_"+d.id);d.domElements[a].setAttribute("class","sigma_"+a+"_"+b);d.domElements[a].setAttribute("width",d.width+"px");d.domElements[a].setAttribute("height",
41
+ d.height+"px");d.domRoot.appendChild(d.domElements[a]);return d}function a(){d.p.drawHoverNodes&&(d.graph.checkHover(d.mousecaptor.mouseX,d.mousecaptor.mouseY),d.graph.nodes.forEach(function(a){a.hover&&!a.active&&d.plotter.drawHoverNode(a)}));return d}function D(){d.p.drawActiveNodes&&d.graph.nodes.forEach(function(a){a.active&&d.plotter.drawActiveNode(a)});return d}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var d=this;this.id=g.toString();this.p={auto:!0,drawNodes:2,
42
+ drawEdges:1,drawLabels:2,lastNodes:2,lastEdges:0,lastLabels:2,drawHoverNodes:!0,drawActiveNodes:!0};this.domRoot=b;this.width=this.domRoot.offsetWidth;this.height=this.domRoot.offsetHeight;this.graph=new i;this.domElements={};c("edges","canvas");c("nodes","canvas");c("labels","canvas");c("hover","canvas");c("monitor","div");c("mouse","canvas");this.plotter=new z(this.domElements.nodes.getContext("2d"),this.domElements.edges.getContext("2d"),this.domElements.labels.getContext("2d"),this.domElements.hover.getContext("2d"),
43
+ this.graph,this.width,this.height);this.monitor=new q(this,this.domElements.monitor);this.mousecaptor=new p(this.domElements.mouse,this.id);this.mousecaptor.bind("drag interpolate",function(){d.draw(d.p.auto?2:d.p.drawNodes,d.p.auto?0:d.p.drawEdges,d.p.auto?2:d.p.drawLabels,!0)}).bind("stopdrag stopinterpolate",function(){d.draw(d.p.auto?2:d.p.drawNodes,d.p.auto?1:d.p.drawEdges,d.p.auto?2:d.p.drawLabels,!0)}).bind("mousedown mouseup",function(a){var b=d.graph.nodes.filter(function(a){return!!a.hover}).map(function(a){return a.id});
44
+ d.dispatch("mousedown"==a.type?"downgraph":"upgraph");b.length&&d.dispatch("mousedown"==a.type?"downnodes":"upnodes",b)}).bind("move",function(){d.domElements.hover.getContext("2d").clearRect(0,0,d.domElements.hover.width,d.domElements.hover.height);a();D()});sigma.chronos.bind("startgenerators",function(){sigma.chronos.getGeneratorsIDs().some(function(a){return!!a.match(RegExp("_ext_"+d.id+"$",""))})&&d.draw(d.p.auto?2:d.p.drawNodes,d.p.auto?0:d.p.drawEdges,d.p.auto?2:d.p.drawLabels)}).bind("stopgenerators",
45
+ function(){d.draw()});for(var w=0;w<m.plugins.length;w++)m.plugins[w](this);this.draw=function(a,b,c,g){if(g&&sigma.chronos.getGeneratorsIDs().some(function(a){return!!a.match(RegExp("_ext_"+d.id+"$",""))}))return d;a=void 0==a?d.p.drawNodes:a;b=void 0==b?d.p.drawEdges:b;c=void 0==c?d.p.drawLabels:c;g={nodes:a,edges:b,labels:c};d.p.lastNodes=a;d.p.lastEdges=b;d.p.lastLabels=c;f();d.graph.rescale(d.width,d.height,0<a,0<b).setBorders();d.mousecaptor.checkBorders(d.graph.borders,d.width,d.height);d.graph.translate(d.mousecaptor.stageX,
46
+ d.mousecaptor.stageY,d.mousecaptor.ratio,0<a,0<b);d.dispatch("graphscaled");for(var j in d.domElements)"canvas"==d.domElements[j].nodeName.toLowerCase()&&(void 0==g[j]||0<=g[j])&&d.domElements[j].getContext("2d").clearRect(0,0,d.domElements[j].width,d.domElements[j].height);d.plotter.currentEdgeIndex=0;d.plotter.currentNodeIndex=0;d.plotter.currentLabelIndex=0;j=null;g=!1;if(a)if(1<a)for(;d.plotter.task_drawNode(););else sigma.chronos.addTask(d.plotter.task_drawNode,"node_"+d.id,!1),g=!0,j="node_"+
47
+ d.id;if(c)if(1<c)for(;d.plotter.task_drawLabel(););else j?sigma.chronos.queueTask(d.plotter.task_drawLabel,"label_"+d.id,j):sigma.chronos.addTask(d.plotter.task_drawLabel,"label_"+d.id,!1),g=!0,j="label_"+d.id;if(b)if(1<b)for(;d.plotter.task_drawEdge(););else j?sigma.chronos.queueTask(d.plotter.task_drawEdge,"edge_"+d.id,j):sigma.chronos.addTask(d.plotter.task_drawEdge,"edge_"+d.id,!1),g=!0,j="edge_"+d.id;d.dispatch("draw");d.refresh();g&&sigma.chronos.runTasks();return d};this.resize=function(a,
48
+ b){var c=d.width,f=d.height;void 0!=a&&void 0!=b?(d.width=a,d.height=b):(d.width=d.domRoot.offsetWidth,d.height=d.domRoot.offsetHeight);if(c!=d.width||f!=d.height){for(var j in d.domElements)d.domElements[j].setAttribute("width",d.width+"px"),d.domElements[j].setAttribute("height",d.height+"px");d.plotter.resize(d.width,d.height);d.draw(d.p.lastNodes,d.p.lastEdges,d.p.lastLabels,!0)}return d};this.refresh=function(){d.domElements.hover.getContext("2d").clearRect(0,0,d.domElements.hover.width,d.domElements.hover.height);
49
+ a();D();return d};this.drawHover=a;this.drawActive=D;this.clearSchedule=f;window.addEventListener("resize",function(){d.resize()})}function x(b){var j=this;sigma.classes.EventDispatcher.call(this);this._core=b;this.kill=function(){};this.getID=function(){return b.id};this.configProperties=function(f,c){var a=b.config(f,c);return a==b?j:a};this.drawingProperties=function(f,c){var a=b.plotter.config(f,c);return a==b.plotter?j:a};this.mouseProperties=function(f,c){var a=b.mousecaptor.config(f,c);return a==
50
+ b.mousecaptor?j:a};this.graphProperties=function(f,c){var a=b.graph.config(f,c);return a==b.graph?j:a};this.getMouse=function(){return{mouseX:b.mousecaptor.mouseX,mouseY:b.mousecaptor.mouseY,down:b.mousecaptor.isMouseDown}};this.position=function(f,c,a){if(0==arguments.length)return{stageX:b.mousecaptor.stageX,stageY:b.mousecaptor.stageY,ratio:b.mousecaptor.ratio};b.mousecaptor.stageX=void 0!=f?f:b.mousecaptor.stageX;b.mousecaptor.stageY=void 0!=c?c:b.mousecaptor.stageY;b.mousecaptor.ratio=void 0!=
51
+ a?a:b.mousecaptor.ratio;return j};this.goTo=function(f,c,a){b.mousecaptor.interpolate(f,c,a);return j};this.zoomTo=function(f,c,a){a=Math.min(Math.max(b.mousecaptor.config("minRatio"),a),b.mousecaptor.config("maxRatio"));a==b.mousecaptor.ratio?b.mousecaptor.interpolate(f-b.width/2+b.mousecaptor.stageX,c-b.height/2+b.mousecaptor.stageY):b.mousecaptor.interpolate((a*f-b.mousecaptor.ratio*b.width/2)/(a-b.mousecaptor.ratio),(a*c-b.mousecaptor.ratio*b.height/2)/(a-b.mousecaptor.ratio),a);return j};this.resize=
52
+ function(f,c){b.resize(f,c);return j};this.draw=function(f,c,a,g){b.draw(f,c,a,g);return j};this.refresh=function(){b.refresh();return j};this.addGenerator=function(f,c,a){sigma.chronos.addGenerator(f+"_ext_"+b.id,c,a);return j};this.removeGenerator=function(f){sigma.chronos.removeGenerator(f+"_ext_"+b.id);return j};this.addNode=function(f,c){b.graph.addNode(f,c);return j};this.addEdge=function(f,c,a,g){b.graph.addEdge(f,c,a,g);return j};this.dropNode=function(f){b.graph.dropNode(f);return j};this.dropEdge=
53
+ function(f){b.graph.dropEdge(f);return j};this.pushGraph=function(f,c){f.nodes&&f.nodes.forEach(function(a){a.id&&(!c||!b.graph.nodesIndex[a.id])&&j.addNode(a.id,a)});f.edges&&f.edges.forEach(function(a){(validID=a.source&&a.target&&a.id)&&(!c||!b.graph.edgesIndex[a.id])&&j.addNode(a.id,a.source,a.target,a)});return j};this.emptyGraph=function(){b.graph.empty();return j};this.getNodesCount=function(){return b.graph.nodes.length};this.getEdgesCount=function(){return b.graph.edges.length};this.iterNodes=
54
+ function(f,c){b.graph.iterNodes(f,c);return j};this.iterEdges=function(f,c){b.graph.iterEdges(f,c);return j};this.getNodes=function(f){return b.graph.getNodes(f)};this.getEdges=function(f){return b.graph.getEdges(f)};this.activateMonitoring=function(){return b.monitor.activate()};this.desactivateMonitoring=function(){return b.monitor.desactivate()};b.bind("downnodes upnodes downgraph upgraph",function(b){j.dispatch(b.type,b.content)});b.graph.bind("overnodes outnodes",function(b){j.dispatch(b.type,
55
+ b.content)})}var k=0,m={plugins:[]};sigma.init=function(b){b=new F(b,(++k).toString());sigma.instances[k]=new x(b);return sigma.instances[k]};sigma.addPlugin=function(b,g,f){x.prototype[b]=g;m.plugins.push(f)};sigma.chronos=new function(){function b(a){window.setTimeout(a,0);return h}function g(){for(h.dispatch("frameinserted");n&&v.length&&f(););!n||!v.length?a():(B=(new Date).getTime(),m++,z=u-p,q=p-z,h.dispatch("insertframe"),b(g))}function f(){C%=v.length;if(!v[C].task()){var a=v[C].taskName;
56
+ y=y.filter(function(b){b.taskParent==a&&v.push({taskName:b.taskName,task:b.task});return b.taskParent!=a});h.dispatch("killed",v.splice(C--,1)[0])}C++;u=(new Date).getTime()-B;return u<=q}function c(){n=!0;m=C=0;x=B=(new Date).getTime();h.dispatch("start");h.dispatch("insertframe");b(g);return h}function a(){h.dispatch("stop");n=!1;return h}function i(a,b,d){if("function"!=typeof a)throw Error('Task "'+b+'" is not a function');v.push({taskName:b,task:a});n=!(!n&&!(d&&c()||1));return h}function d(a){return a?
57
+ Object.keys(r).filter(function(a){return!!r[a].on}).length:Object.keys(r).length}function w(){Object.keys(r).length?(h.dispatch("startgenerators"),h.unbind("killed",o),b(function(){for(var a in r)r[a].on=!0,i(r[a].task,a,!1)}),h.bind("killed",o).runTasks()):h.dispatch("stopgenerators");return h}function o(a){void 0!=r[a.content.taskName]&&(r[a.content.taskName].del||!r[a.content.taskName].condition()?delete r[a.content.taskName]:r[a.content.taskName].on=!1,0==d(!0)&&w())}sigma.classes.EventDispatcher.call(this);
58
+ var h=this,n=!1,l=80,k=0,m=0,p=1E3/l,q=p,u=0,x=0,B=0,z=0,r={},v=[],y=[],C=0;this.frequency=function(a){return void 0!=a?(l=Math.abs(1*a),p=1E3/l,m=0,h):l};this.runTasks=c;this.stopTasks=a;this.insertFrame=b;this.addTask=i;this.queueTask=function(a,b,c){if("function"!=typeof a)throw Error('Task "'+b+'" is not a function');if(!v.concat(y).some(function(a){return a.taskName==c}))throw Error('Parent task "'+c+'" of "'+b+'" is not attached.');y.push({taskParent:c,taskName:b,task:a});return h};this.removeTask=
59
+ function(b,c){if(void 0==b)v=[],1==c?y=[]:2==c&&(v=y,y=[]),a();else{var d="string"==typeof b?b:"";v=v.filter(function(a){return("string"==typeof b?a.taskName==b:a.task==b)?(d=a.taskName,!1):!0});0<c&&(y=y.filter(function(a){1==c&&a.taskParent==d&&v.push(a);return a.taskParent!=d}))}n=!(v.length&&(!a()||1));return h};this.addGenerator=function(a,b,c){if(void 0!=r[a])return h;r[a]={task:b,condition:c};0==d(!0)&&w();return h};this.removeGenerator=function(a){r[a]&&(r[a].on=!1,r[a].del=!0);return h};
60
+ this.startGenerators=w;this.getGeneratorsIDs=function(){return Object.keys(r)};this.getFPS=function(){n&&(k=Math.round(1E4*(m/((new Date).getTime()-x)))/10);return k};this.getTasksCount=function(){return v.length};this.getQueuedTasksCount=function(){return y.length};this.getExecutionTime=function(){return B-x};return this};sigma.debugMode=0;sigma.log=function(){if(1==sigma.debugMode)for(var b in arguments)console.log(arguments[b]);else if(1<sigma.debugMode)for(b in arguments)throw Error(arguments[b]);
61
+ return sigma};sigma.easing={linear:{},quadratic:{}};sigma.easing.linear.easenone=function(b){return b};sigma.easing.quadratic.easein=function(b){return b*b};sigma.easing.quadratic.easeout=function(b){return-b*(b-2)};sigma.easing.quadratic.easeinout=function(b){return 1>(b*=2)?0.5*b*b:-0.5*(--b*(b-2)-1)};sigma.tools.drawRoundRect=function(b,g,f,c,a,i,d){var i=i?i:0,k=d?d:[],k="string"==typeof k?k.split(" "):k,d=i&&(0<=k.indexOf("topleft")||0<=k.indexOf("top")||0<=k.indexOf("left")),m=i&&(0<=k.indexOf("topright")||
62
+ 0<=k.indexOf("top")||0<=k.indexOf("right")),h=i&&(0<=k.indexOf("bottomleft")||0<=k.indexOf("bottom")||0<=k.indexOf("left")),k=i&&(0<=k.indexOf("bottomright")||0<=k.indexOf("bottom")||0<=k.indexOf("right"));b.moveTo(g,f+i);d?b.arcTo(g,f,g+i,f,i):b.lineTo(g,f);m?(b.lineTo(g+c-i,f),b.arcTo(g+c,f,g+c,f+i,i)):b.lineTo(g+c,f);k?(b.lineTo(g+c,f+a-i),b.arcTo(g+c,f+a,g+c-i,f+a,i)):b.lineTo(g+c,f+a);h?(b.lineTo(g+i,f+a),b.arcTo(g,f+a,g,f+a-i,i)):b.lineTo(g,f+a);b.lineTo(g,f+i)};sigma.tools.getRGB=function(b,
63
+ g){var b=b.toString(),f={r:0,g:0,b:0};if(3<=b.length&&"#"==b.charAt(0)){var c=b.length-1;6==c?f={r:parseInt(b.charAt(1)+b.charAt(2),16),g:parseInt(b.charAt(3)+b.charAt(4),16),b:parseInt(b.charAt(5)+b.charAt(5),16)}:3==c&&(f={r:parseInt(b.charAt(1)+b.charAt(1),16),g:parseInt(b.charAt(2)+b.charAt(2),16),b:parseInt(b.charAt(3)+b.charAt(3),16)})}g&&(f=[f.r,f.g,f.b]);return f};sigma.tools.rgbToHex=function(b,g,f){return sigma.tools.toHex(b)+sigma.tools.toHex(g)+sigma.tools.toHex(f)};sigma.tools.toHex=
64
+ function(b){b=parseInt(b,10);if(isNaN(b))return"00";b=Math.max(0,Math.min(b,255));return"0123456789ABCDEF".charAt((b-b%16)/16)+"0123456789ABCDEF".charAt(b%16)};sigma.publicPrototype=x.prototype})();
js/sigma/parseGexf_fin.js ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Mathieu Jacomy @ Sciences Po Médialab & WebAtlas
2
+ // (requires sigma.js to be loaded)
3
+ sigma.publicPrototype.parseGexf = function(gexfPath) {
4
+ // Load XML file:
5
+ var gexfhttp, gexf;
6
+ var sigmaInstance = this;
7
+ gexfhttp = window.XMLHttpRequest ?
8
+ new XMLHttpRequest() :
9
+ new ActiveXObject('Microsoft.XMLHTTP');
10
+
11
+ gexfhttp.overrideMimeType('text/xml');
12
+ gexfhttp.open('GET', gexfPath, false);
13
+ gexfhttp.send();
14
+ gexf = gexfhttp.responseXML;
15
+
16
+ var viz='http://www.gexf.net/1.2draft/viz'; // Vis namespace
17
+ var i, j, k;
18
+
19
+ // Parse Attributes
20
+ // This is confusing, so I'll comment heavily
21
+ var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json
22
+ var nodesAttributesDict = {};
23
+ var edgesAttributes = []; // The list of attributes of the edges of the graph that we build in json
24
+ var edgesAttributesDict = {};
25
+ var attributesNodes = gexf.getElementsByTagName('attributes'); // In the gexf (that is an xml), the list of xml nodes 'attributes' (note the plural 's')
26
+
27
+ for(i = 0; i<attributesNodes.length; i++){
28
+ var attributesNode = attributesNodes[i]; // attributesNode is each xml node 'attributes' (plural)
29
+ if(attributesNode.getAttribute('class') == 'node'){
30
+ var attributeNodes = attributesNode.getElementsByTagName('attribute'); // The list of xml nodes 'attribute' (no 's')
31
+ for(j = 0; j<attributeNodes.length; j++){
32
+ var attributeNode = attributeNodes[j]; // Each xml node 'attribute'
33
+
34
+ var id = attributeNode.getAttribute('id'),
35
+ title = attributeNode.getAttribute('title'),
36
+ type = attributeNode.getAttribute('type');
37
+
38
+ var attribute = {id:id, title:title, type:type};
39
+ nodesAttributes.push(attribute);
40
+ nodesAttributesDict[id] = title
41
+
42
+ }
43
+ } else if(attributesNode.getAttribute('class') == 'edge'){
44
+ var attributeNodes = attributesNode.getElementsByTagName('attribute'); // The list of xml nodes 'attribute' (no 's')
45
+ for(j = 0; j<attributeNodes.length; j++){
46
+ var attributeNode = attributeNodes[j]; // Each xml node 'attribute'
47
+
48
+ var id = attributeNode.getAttribute('id'),
49
+ title = attributeNode.getAttribute('title'),
50
+ type = attributeNode.getAttribute('type');
51
+
52
+ var attribute = {id:id, title:title, type:type};
53
+ edgesAttributes.push(attribute);
54
+ edgesAttributesDict[id] = title
55
+
56
+ }
57
+ }
58
+ }
59
+
60
+ var nodes = []; // The nodes of the graph
61
+ var nodesNodes = gexf.getElementsByTagName('nodes') // The list of xml nodes 'nodes' (plural)
62
+
63
+ for(i=0; i<nodesNodes.length; i++){
64
+ var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural)
65
+ var nodeNodes = nodesNode.getElementsByTagName('node'); // The list of xml nodes 'node' (no 's')
66
+
67
+ for(j=0; j<nodeNodes.length; j++){
68
+ var nodeNode = nodeNodes[j]; // Each xml node 'node' (no 's')
69
+
70
+ window.NODE = nodeNode;
71
+
72
+ var id = nodeNode.getAttribute('id');
73
+ var label = nodeNode.getAttribute('label') || id;
74
+
75
+ //viz
76
+ var size = 1;
77
+ var x = 100 - 200*Math.random();
78
+ var y = 100 - 200*Math.random();
79
+ var color;
80
+
81
+ var sizeNodes = nodeNode.getElementsByTagName('size');
82
+ sizeNodes = sizeNodes.length ?
83
+ sizeNodes :
84
+ nodeNode.getElementsByTagNameNS('*','size');
85
+ if(sizeNodes.length>0){
86
+ sizeNode = sizeNodes[0];
87
+ size = parseFloat(sizeNode.getAttribute('value'));
88
+ }
89
+
90
+ var positionNodes = nodeNode.getElementsByTagName('position');
91
+ positionNodes = positionNodes.length ?
92
+ positionNodes :
93
+ nodeNode.getElementsByTagNameNS('*','position');
94
+ if(positionNodes.length>0){
95
+ var positionNode = positionNodes[0];
96
+ x = parseFloat(positionNode.getAttribute('x'));
97
+ y = parseFloat(positionNode.getAttribute('y'));
98
+ }
99
+
100
+ var colorNodes = nodeNode.getElementsByTagName('color');
101
+ colorNodes = colorNodes.length ?
102
+ colorNodes :
103
+ nodeNode.getElementsByTagNameNS('*','color');
104
+ if(colorNodes.length>0){
105
+ colorNode = colorNodes[0];
106
+ color = '#'+sigma.tools.rgbToHex(parseFloat(colorNode.getAttribute('r')),
107
+ parseFloat(colorNode.getAttribute('g')),
108
+ parseFloat(colorNode.getAttribute('b')));
109
+ }
110
+
111
+ var colorsProcessed = {};
112
+ if (nodeJSON.colors) {
113
+ for (var key in nodeJSON.colors) {
114
+ if (nodeJSON.colors.hasOwnProperty(key)) {
115
+ // Get the rgb string for this property, e.g., "rgb(198,116,255)"
116
+ var rgbStr = nodeJSON.colors[key];
117
+ // Remove "rgb(" and ")" then split by comma to extract r, g, b values
118
+ var rgbArr = rgbStr.replace(/rgb\(|\)/g, '').split(',');
119
+ var r_val = parseInt(rgbArr[0].trim(), 10);
120
+ var g_val = parseInt(rgbArr[1].trim(), 10);
121
+ var b_val = parseInt(rgbArr[2].trim(), 10);
122
+ // Convert to hex and store under the corresponding key
123
+ colorsProcessed[key] = '#' + sigma.tools.rgbToHex(r_val, g_val, b_val);
124
+ }
125
+ }
126
+ }
127
+
128
+ // Create Node
129
+ var node = {label:label, size:size, x:x, y:y, attributes:{}, color:color, colors: colorsProcessed}; // The graph node
130
+
131
+ // Attribute values
132
+ var attvalueNodes = nodeNode.getElementsByTagName('attvalue');
133
+ for(k=0; k<attvalueNodes.length; k++){
134
+ var attvalueNode = attvalueNodes[k];
135
+ var attr = attvalueNode.getAttribute('for');
136
+ var val = attvalueNode.getAttribute('value');
137
+ node.attributes[nodesAttributesDict[attr]] = val;
138
+ }
139
+
140
+ sigmaInstance.addNode(id,node);
141
+ }
142
+ }
143
+
144
+ var edges = [];
145
+ var edgeId = 0;
146
+ var edgesNodes = gexf.getElementsByTagName('edges');
147
+ for(i=0; i<edgesNodes.length; i++){
148
+ var edgesNode = edgesNodes[i];
149
+ var edgeNodes = edgesNode.getElementsByTagName('edge');
150
+ for(j=0; j<edgeNodes.length; j++){
151
+ var edgeNode = edgeNodes[j];
152
+ var source = edgeNode.getAttribute('source');
153
+ var target = edgeNode.getAttribute('target');
154
+ var label = edgeNode.getAttribute('label');
155
+ var edge = {
156
+ id: j,
157
+ sourceID: source,
158
+ targetID: target,
159
+ label: label,
160
+ attributes: {}
161
+ };
162
+
163
+ var attrs = edgeNode.attributes;
164
+ for(var i=0;i<attrs.length;i++) {
165
+ var n = attrs[i].name;
166
+ if(n == 'source' || n =='target' || n=='label')
167
+ continue;
168
+ edge.attributes[n]=attrs[i].value;
169
+ }
170
+
171
+ var weight = edgeNode.getAttribute('weight');
172
+ if(weight!=undefined){
173
+ edge['weight'] = weight;
174
+ }
175
+
176
+ var attvalueNodes = edgeNode.getElementsByTagName('attvalue');
177
+ for(k=0; k<attvalueNodes.length; k++){
178
+ var attvalueNode = attvalueNodes[k];
179
+ var attr = attvalueNode.getAttribute('for');
180
+ var val = attvalueNode.getAttribute('value');
181
+ edge.attributes[edgesAttributesDict[attr]] = val;
182
+ }
183
+
184
+ sigmaInstance.addEdge(edgeId++,source,target,edge);
185
+ }
186
+ }
187
+ };
js/sigma/sigma.js ADDED
@@ -0,0 +1,1392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* sigmajs.org - an open-source light-weight JavaScript graph drawing library - Facenuke - Author: Alexis Jacomy - License: MIT */
2
+ var sigma = {
3
+ tools: {},
4
+ classes: {},
5
+ instances: {}
6
+ };
7
+ (function () {
8
+ Array.prototype.some || (Array.prototype.some = function (g, n) {
9
+ var i = this.length;
10
+ if ("function" != typeof g) throw new TypeError;
11
+ for (var k = 0; k < i; k++) if (k in this && g.call(n, this[k], k, this)) return !0;
12
+ return !1
13
+ });
14
+ Array.prototype.forEach || (Array.prototype.forEach = function (g, n) {
15
+ var i = this.length;
16
+ if (typeof g != "function") throw new TypeError;
17
+ for (var k = 0; k < i; k++) k in this && g.call(n, this[k], k, this)
18
+ });
19
+ Array.prototype.map || (Array.prototype.map = function (g, n) {
20
+ var i = this.length;
21
+ if (typeof g != "function") throw new TypeError;
22
+ for (var k = Array(i), o = 0; o < i; o++) o in this && (k[o] = g.call(n, this[o], o, this));
23
+ return k
24
+ });
25
+ Array.prototype.filter || (Array.prototype.filter = function (g, n) {
26
+ var i = this.length;
27
+ if (typeof g != "function") throw new TypeError;
28
+ for (var k = [], o = 0; o < i; o++) if (o in this) {
29
+ var t = this[o];
30
+ g.call(n, t, o, this) && k.push(t)
31
+ }
32
+ return k
33
+ });
34
+ Array.prototype.indexOf || (Array.prototype.indexOf = function (g) {
35
+ for (var n = 0; n < this.length; n++) if (this[n] === g) return n;
36
+ return -1
37
+ });
38
+ Object.keys || (Object.keys = function () {
39
+ var g = Object.prototype.hasOwnProperty,
40
+ n = !{
41
+ toString: null
42
+ }.propertyIsEnumerable("toString"),
43
+ i = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],
44
+ k = i.length;
45
+ return function (o) {
46
+ if (typeof o !== "object" && typeof o !== "function" || o === null) throw new TypeError("Object.keys called on non-object");
47
+ var t = [],
48
+ s;
49
+ for (s in o) g.call(o, s) && t.push(s);
50
+ if (n) for (s = 0; s < k; s++) g.call(o, i[s]) && t.push(i[s]);
51
+ return t
52
+ }
53
+ }())
54
+ })();
55
+ sigma.classes.Cascade = function () {
56
+ this.p = {};
57
+ this.config = function (g, n) {
58
+ if ("string" == typeof g && void 0 == n) return this.p[g];
59
+ var i = "object" == typeof g && void 0 == n ? g : {};
60
+ "string" == typeof g && (i[g] = n);
61
+ for (var k in i) void 0 != this.p[k] && (this.p[k] = i[k]);
62
+ return this
63
+ }
64
+ };
65
+ sigma.classes.EventDispatcher = function () {
66
+ var g = {},
67
+ n = this;
68
+ this.one = function (i, k) {
69
+ if (!k || !i) return n;
70
+ ("string" == typeof i ? i.split(" ") : i).forEach(function (i) {
71
+ g[i] || (g[i] = []);
72
+ g[i].push({
73
+ h: k,
74
+ one: !0
75
+ })
76
+ });
77
+ return n
78
+ };
79
+ this.bind = function (i, k) {
80
+ if (!k || !i) return n;
81
+ ("string" == typeof i ? i.split(" ") : i).forEach(function (i) {
82
+ g[i] || (g[i] = []);
83
+ g[i].push({
84
+ h: k,
85
+ one: !1
86
+ })
87
+ });
88
+ return n
89
+ };
90
+ this.unbind = function (i, k) {
91
+ i || (g = {});
92
+ var o = "string" == typeof i ? i.split(" ") : i;
93
+ k ? o.forEach(function (i) {
94
+ g[i] && (g[i] = g[i].filter(function (i) {
95
+ return i.h != k
96
+ }));
97
+ g[i] && 0 == g[i].length && delete g[i]
98
+ }) : o.forEach(function (i) {
99
+ delete g[i]
100
+ });
101
+ return n
102
+ };
103
+ this.dispatch = function (i, k) {
104
+ sigma.action = i;
105
+ g[i] && (g[i].forEach(function (g) {
106
+ g.h({
107
+ type: i,
108
+ content: k,
109
+ target: n
110
+ })
111
+ }), g[i] = g[i].filter(function (i) {
112
+ return !i.one
113
+ }));
114
+ return n
115
+ }
116
+ };
117
+ (function () {
118
+ var g;
119
+
120
+ function n() {
121
+ function b(d) {
122
+ return {
123
+ x: d.x,
124
+ y: d.y,
125
+ size: d.size,
126
+ degree: d.degree,
127
+ inDegree: d.inDegree,
128
+ outDegree: d.outDegree,
129
+ displayX: d.displayX,
130
+ displayY: d.displayY,
131
+ displaySize: d.displaySize,
132
+ label: d.label,
133
+ id: d.id,
134
+ color: d.color,
135
+ fixed: d.fixed,
136
+ active: d.active,
137
+ hidden: d.hidden,
138
+ attr: d.attr
139
+ }
140
+ }
141
+ function i(d) {
142
+ return {
143
+ source: d.source.id,
144
+ target: d.target.id,
145
+ size: d.size,
146
+ type: d.type,
147
+ weight: d.weight,
148
+ displaySize: d.displaySize,
149
+ label: d.label,
150
+ hidden: d.hidden,
151
+ id: d.id,
152
+ attr: d.attr,
153
+ color: d.color
154
+ }
155
+ }
156
+ function h() {
157
+ c.nodes = [];
158
+ c.nodesBG = [];
159
+ c.nodesIndex = {};
160
+ c.nodesBGIndex = {};
161
+ c.edges = [];
162
+ c.edgesIndex = {};
163
+ return c
164
+ }
165
+ sigma.classes.Cascade.call(this);
166
+ sigma.classes.EventDispatcher.call(this);
167
+ var c = this;
168
+ this.p = {
169
+ minNodeSize: 0,
170
+ maxNodeSize: 0,
171
+ minEdgeSize: 0,
172
+ maxEdgeSize: 0,
173
+ minBGSize: 0,
174
+ maxBGSize: 0,
175
+ scalingMode: "inside",
176
+ nodesPowRatio: 0.5,
177
+ edgesPowRatio: 0
178
+ };
179
+ this.borders = {};
180
+ h();
181
+ this.addNode = function (d, b) {
182
+ if (c.nodesIndex[d]) throw Error('Node "' + d + '" already exists.');
183
+ var b = b || {},
184
+ a = {
185
+ x: 0,
186
+ y: 0,
187
+ size: 1,
188
+ degree: 0,
189
+ inDegree: 0,
190
+ outDegree: 0,
191
+ fixed: !1,
192
+ active: !1,
193
+ hidden: !1,
194
+ label: d.toString(),
195
+ id: d.toString(),
196
+ attr: {}
197
+ },
198
+ f;
199
+ for (f in b) switch (f) {
200
+ case "id":
201
+ break;
202
+ case "x":
203
+ case "y":
204
+ case "size":
205
+ a[f] = +b[f];
206
+ break;
207
+ case "fixed":
208
+ case "active":
209
+ case "hidden":
210
+ a[f] = !! b[f];
211
+ break;
212
+ case "color":
213
+ case "label":
214
+ a[f] = b[f];
215
+ break;
216
+ default:
217
+ a.attr[f] = b[f]
218
+ }
219
+ c.nodes.push(a);
220
+ c.nodesIndex[d.toString()] = a;
221
+ return c
222
+ };
223
+ this.addNodeBG = function (d, b) {
224
+ if (c.nodesBGIndex[d]) throw Error('NodeBG "' + d + '" already exists.');
225
+ var b = b || {},
226
+ a = {
227
+ x: 0,
228
+ y: 0,
229
+ size: 1,
230
+ fixed: !1,
231
+ active: !1,
232
+ hidden: !1,
233
+ label: d.toString(),
234
+ id: d.toString(),
235
+ attr: {}
236
+ },
237
+ f;
238
+ for (f in b) switch (f) {
239
+ case "id":
240
+ break;
241
+ case "x":
242
+ case "y":
243
+ case "size":
244
+ a[f] = +b[f];
245
+ break;
246
+ case "fixed":
247
+ case "active":
248
+ case "hidden":
249
+ a[f] = !! b[f];
250
+ break;
251
+ case "color":
252
+ case "label":
253
+ a[f] = b[f];
254
+ break;
255
+ default:
256
+ a.attr[f] = b[f]
257
+ }
258
+ c.nodesBG.push(a);
259
+ c.nodesBGIndex[d.toString()] = a;
260
+ return c
261
+ };
262
+ this.addEdge = function (d, b, a, f) {
263
+ if (c.edgesIndex[d]) throw Error('Edge "' + d + '" already exists.');
264
+ if (!c.nodesIndex[b]) throw Error("Edge's source \"" + b + '" does not exist yet.');
265
+ if (!c.nodesIndex[a]) throw Error("Edge's target \"" + a + '" does not exist yet.');
266
+ f = f || {};
267
+ b = {
268
+ source: c.nodesIndex[b],
269
+ target: c.nodesIndex[a],
270
+ size: 1,
271
+ weight: 1,
272
+ displaySize: 0.5,
273
+ label: d.toString(),
274
+ id: d.toString(),
275
+ hidden: !1,
276
+ attr: {}
277
+ };
278
+ b.source.degree++;
279
+ b.source.outDegree++;
280
+ b.target.degree++;
281
+ b.target.inDegree++;
282
+ for (var h in f) switch (h) {
283
+ case "id":
284
+ case "source":
285
+ case "target":
286
+ break;
287
+ case "hidden":
288
+ b[h] = !! f[h];
289
+ break;
290
+ case "size":
291
+ case "weight":
292
+ b[h] = +f[h];
293
+ break;
294
+ case "color":
295
+ b[h] = f[h].toString();
296
+ break;
297
+ case "type":
298
+ b[h] = f[h].toString();
299
+ break;
300
+ case "label":
301
+ b[h] = f[h];
302
+ break;
303
+ default:
304
+ b.attr[h] = f[h]
305
+ }
306
+ c.edges.push(b);
307
+ c.edgesIndex[d.toString()] = b;
308
+ return c
309
+ };
310
+ this.dropNode = function (b) {
311
+ ((b instanceof Array ? b : [b]) || []).forEach(function (b) {
312
+ if (c.nodesIndex[b]) {
313
+ var a = null;
314
+ c.nodes.some(function (d, c) {
315
+ return d.id == b ? (a = c, !0) : !1
316
+ });
317
+ null != a && c.nodes.splice(a, 1);
318
+ delete c.nodesIndex[b];
319
+ c.edges = c.edges.filter(function (a) {
320
+ return a.source.id == b ? (delete c.edgesIndex[a.id], a.target.degree--, a.target.inDegree--, !1) : a.target.id == b ? (delete c.edgesIndex[a.id], a.source.degree--, a.source.outDegree--, !1) : !0
321
+ })
322
+ } else sigma.log('Node "' + b + '" does not exist.')
323
+ });
324
+ return c
325
+ };
326
+ this.dropEdge = function (b) {
327
+ ((b instanceof Array ? b : [b]) || []).forEach(function (b) {
328
+ if (c.edgesIndex[b]) {
329
+ c.edgesIndex[b].source.degree--;
330
+ c.edgesIndex[b].source.outDegree--;
331
+ c.edgesIndex[b].target.degree--;
332
+ c.edgesIndex[b].target.inDegree--;
333
+ var a = null;
334
+ c.edges.some(function (d, c) {
335
+ return d.id == b ? (a = c, !0) : !1
336
+ });
337
+ null != a && c.edges.splice(a, 1);
338
+ delete c.edgesIndex[b]
339
+ } else sigma.log('Edge "' + b + '" does not exist.')
340
+ });
341
+ return c
342
+ };
343
+ this.iterEdges = function (b, h) {
344
+ var a = h ? h.map(function (a) {
345
+ return c.edgesIndex[a]
346
+ }) : c.edges,
347
+ f = a.map(i);
348
+ f.forEach(b);
349
+ a.forEach(function (a, b) {
350
+ var d = f[b],
351
+ j;
352
+ for (j in d) switch (j) {
353
+ case "id":
354
+ case "displaySize":
355
+ break;
356
+ case "weight":
357
+ case "size":
358
+ a[j] = +d[j];
359
+ break;
360
+ case "source":
361
+ case "target":
362
+ a[j] = c.nodesIndex[j] || a[j];
363
+ break;
364
+ case "hidden":
365
+ a[j] = !! d[j];
366
+ break;
367
+ case "color":
368
+ case "label":
369
+ case "type":
370
+ a[j] = (d[j] || "").toString();
371
+ break;
372
+ default:
373
+ a.attr[j] = d[j]
374
+ }
375
+ });
376
+ return c
377
+ };
378
+ this.iterNodes = function (d, h) {
379
+ var a = h ? h.map(function (a) {
380
+ return c.nodesIndex[a]
381
+ }) : c.nodes,
382
+ f = a.map(b);
383
+ f.forEach(d);
384
+ a.forEach(function (a, b) {
385
+ var d = f[b],
386
+ c;
387
+ for (c in d) switch (c) {
388
+ case "id":
389
+ case "attr":
390
+ case "degree":
391
+ case "inDegree":
392
+ case "outDegree":
393
+ case "displayX":
394
+ case "displayY":
395
+ case "displaySize":
396
+ break;
397
+ case "x":
398
+ case "y":
399
+ case "size":
400
+ a[c] = +d[c];
401
+ break;
402
+ case "fixed":
403
+ case "active":
404
+ case "hidden":
405
+ a[c] = !! d[c];
406
+ break;
407
+ case "color":
408
+ case "label":
409
+ a[c] = d[c].toString();
410
+ break;
411
+ default:
412
+ a.attr[c] = d[c]
413
+ }
414
+ });
415
+ return c
416
+ };
417
+ this.getEdges = function (b) {
418
+ var h = ((b instanceof Array ? b : [b]) || []).map(function (a) {
419
+ return i(c.edgesIndex[a])
420
+ });
421
+ return b instanceof Array ? h : h[0]
422
+ };
423
+ this.getNodes = function (d) {
424
+ var h = ((d instanceof Array ? d : [d]) || []).map(function (a) {
425
+ return b(c.nodesIndex[a])
426
+ });
427
+ return d instanceof Array ? h : h[0]
428
+ };
429
+ this.empty = h;
430
+ this.rescale = function (b, h, a, f, i) {
431
+ var l = 0,
432
+ m = 0,
433
+ j = 0,
434
+ g = Math;
435
+ a && c.nodes.forEach(function (a) {
436
+ m = g.max(a.size, m)
437
+ });
438
+ f && c.edges.forEach(function (a) {
439
+ l = g.max(a.size, l)
440
+ });
441
+ i && c.nodesBG.forEach(function (a) {
442
+ j = g.max(a.size, j)
443
+ });
444
+ var m = m || 1,
445
+ j = j || 1,
446
+ l = l || 1,
447
+ v, q, A, w;
448
+ a && c.nodes.forEach(function (a) {
449
+ q = g.max(a.x, q || a.x);
450
+ v = g.min(a.x, v || a.x);
451
+ w = g.max(a.y, w || a.y);
452
+ A = g.min(a.y, A || a.y)
453
+ });
454
+ var u = "outside" == c.p.scalingMode ? g.max(b / g.max(q - v, 1), h / g.max(w - A, 1)) : g.min(b / g.max(q - v, 1), h / g.max(w - A, 1)),
455
+ u = u - u / 20,
456
+ x, k;
457
+ !c.p.maxNodeSize && !c.p.minNodeSize ? (x = 1, k = 0) : c.p.maxNodeSize == c.p.minNodeSize ? (x = 0, k = c.p.maxNodeSize) : (x = (c.p.maxNodeSize - c.p.minNodeSize) / m, k = c.p.minNodeSize);
458
+ var p, r;
459
+ !c.p.maxEdgeSize && !c.p.minEdgeSize ? (p = 1, r = 0) : (p = c.p.maxEdgeSize == c.p.minEdgeSize ? 0 : (c.p.maxEdgeSize - c.p.minEdgeSize) / l, r = c.p.minEdgeSize);
460
+ a && c.nodes.forEach(function (a) {
461
+ a.displaySize = a.size * x + k;
462
+ if (!a.fixed) {
463
+ a.displayX = (a.x - (q + v) / 2) * u + b / 2;
464
+ a.displayY = (a.y - (w + A) / 2) * u + h / 2
465
+ }
466
+ });
467
+ i && c.nodesBG.forEach(function (a) {
468
+ a.displaySize = a.size * g.sqrt(sigInst._core.mousecaptor.ratio * u);
469
+ if (!a.fixed) {
470
+ a.displayX = (a.x - (q + v) / 2) * u + b / 2;
471
+ a.displayY = (a.y - (w + A) / 2) * u + h / 2
472
+ }
473
+ });
474
+ f && c.edges.forEach(function (a) {
475
+ a.displaySize = a.size * p + r
476
+ });
477
+ return c
478
+ };
479
+ this.translate = function (b, h, a, f, i, g) {
480
+ var m = Math.pow(a, c.p.nodesPowRatio);
481
+ f && c.nodes.forEach(function (c) {
482
+ c.fixed || (c.displayX = c.displayX * a + b, c.displayY = c.displayY * a + h);
483
+ c.displaySize *= m
484
+ });
485
+ g && c.nodesBG.forEach(function (c) {
486
+ c.fixed || (c.displayX = c.displayX * a + b, c.displayY = c.displayY * a + h);
487
+ c.displaySize *= m
488
+ });
489
+ m = Math.pow(a, c.p.edgesPowRatio);
490
+ i && c.edges.forEach(function (a) {
491
+ a.displaySize *= m
492
+ });
493
+ return c
494
+ };
495
+ this.setBorders = function () {
496
+ c.borders = {};
497
+ c.nodes.forEach(function (b) {
498
+ c.borders.minX = Math.min(void 0 == c.borders.minX ? b.displayX - b.displaySize : c.borders.minX, b.displayX - b.displaySize);
499
+ c.borders.maxX = Math.max(void 0 == c.borders.maxX ? b.displayX + b.displaySize : c.borders.maxX, b.displayX + b.displaySize);
500
+ c.borders.minY = Math.min(void 0 == c.borders.minY ? b.displayY - b.displaySize : c.borders.minY, b.displayY - b.displaySize);
501
+ c.borders.maxY = Math.max(void 0 == c.borders.maxY ? b.displayY - b.displaySize : c.borders.maxY, b.displayY - b.displaySize)
502
+ })
503
+ };
504
+ this.checkHover = function (b, h) {
505
+ var a, f, i, g = [],
506
+ m = [];
507
+ c.nodes.forEach(function (c) {
508
+ if (c.hidden) c.hover = !1;
509
+ else {
510
+ a = Math.abs(c.displayX - b);
511
+ f = Math.abs(c.displayY - h);
512
+ i = c.displaySize;
513
+ var v = c.hover,
514
+ k = a < i && f < i && Math.sqrt(a * a + f * f) < i;
515
+ v && !k ? (c.hover = !1, m.push(c.id)) : k && !v && (c.hover = !0, g.push(c.id))
516
+ }
517
+ });
518
+ g.length && c.dispatch("overnodes", g);
519
+ m.length && c.dispatch("outnodes", m);
520
+ return c
521
+ }
522
+ }
523
+ function i(b, i) {
524
+ function h() {
525
+ var b;
526
+ b = "<p>GLOBAL :</p>";
527
+ for (var h in c.p.globalProbes) b += "<p>" + h + " : " + c.p.globalProbes[h]() + "</p>";
528
+ b += "<br><p>LOCAL :</p>";
529
+ for (h in c.p.localProbes) b += "<p>" + h + " : " + c.p.localProbes[h]() + "</p>";
530
+ c.p.dom.innerHTML = b;
531
+ return c
532
+ }
533
+ sigma.classes.Cascade.call(this);
534
+ var c = this;
535
+ this.instance = b;
536
+ this.monitoring = !1;
537
+ this.p = {
538
+ fps: 40,
539
+ dom: i,
540
+ globalProbes: {
541
+ "Time (ms)": sigma.chronos.getExecutionTime,
542
+ Queue: sigma.chronos.getQueuedTasksCount,
543
+ Tasks: sigma.chronos.getTasksCount,
544
+ FPS: sigma.chronos.getFPS
545
+ },
546
+ localProbes: {
547
+ "Nodes count": function () {
548
+ return c.instance.graph.nodes.length
549
+ },
550
+ "Edges count": function () {
551
+ return c.instance.graph.edges.length
552
+ }
553
+ }
554
+ };
555
+ this.activate = function () {
556
+ c.monitoring || (c.monitoring = window.setInterval(h, 1E3 / c.p.fps));
557
+ return c
558
+ };
559
+ this.desactivate = function () {
560
+ c.monitoring && (window.clearInterval(c.monitoring), c.monitoring = null, c.p.dom.innerHTML = "");
561
+ return c
562
+ }
563
+ }
564
+ function k(b) {
565
+ function i(a) {
566
+ f.mouseX = void 0 != a.offsetX && a.offsetX || void 0 != a.layerX && a.layerX || void 0 != a.clientX && a.clientX;
567
+ f.mouseY = void 0 != a.offsetY && a.offsetY || void 0 != a.layerY && a.layerY || void 0 != a.clientY && a.clientY;
568
+ if (f.isMouseDown) {
569
+ var b = f.mouseX - k + m,
570
+ c = f.mouseY - l + j;
571
+ if (b != f.stageX || c != f.stageY) w = A, x = u, A = b, u = c, f.stageX = b, f.stageY = c, f.dispatch("drag")
572
+ }
573
+ f.dispatch("move");
574
+ a.preventDefault ? a.preventDefault() : a.returnValue = !1
575
+ }
576
+ function h(a) {
577
+ f.p.mouseEnabled && f.isMouseDown && (f.isMouseDown = !1, f.dispatch("mouseup"), (m != f.stageX || j != f.stageY) && g(f.stageX + f.p.inertia * (f.stageX - w), f.stageY + f.p.inertia * (f.stageY - x)), a.preventDefault ? a.preventDefault() : a.returnValue = !1)
578
+ }
579
+ function c(a) {
580
+ f.p.mouseEnabled && (f.isMouseDown = !0, f.dispatch("mousedown"), m = f.stageX, j = f.stageY, k = f.mouseX, l = f.mouseY, w = A = f.stageX, x = u = f.stageY, f.dispatch("startdrag"), a.preventDefault ? a.preventDefault() : a.returnValue = !1)
581
+ }
582
+ function d(a) {
583
+ f.p.mouseEnabled && (g(f.mouseX, f.mouseY, f.ratio * (0 < (void 0 != a.wheelDelta && a.wheelDelta || void 0 != a.detail && -a.detail) ? f.p.zoomMultiply : 1 / f.p.zoomMultiply)), f.p.blockScroll && (a.preventDefault ? a.preventDefault() : a.returnValue = !1))
584
+ }
585
+ function g(b, c, d) {
586
+ if (!f.isMouseDown && (window.clearInterval(f.interpolationID), p = void 0 != d, m = f.stageX, y = b, j = f.stageY, q = c, n = d || f.ratio, n = Math.min(Math.max(n, f.p.minRatio), f.p.maxRatio), B = f.p.directZooming ? 1 - (p ? f.p.zoomDelta : f.p.dragDelta) : 0, f.ratio != n || f.stageX != y || f.stageY != q)) a(), f.interpolationID = window.setInterval(a, 50), f.dispatch("startinterpolate")
587
+ }
588
+ function a() {
589
+ B += p ? f.p.zoomDelta : f.p.dragDelta;
590
+ B = Math.min(B, 1);
591
+ var a = sigma.easing.quadratic.easeout(B),
592
+ b = f.ratio;
593
+ f.ratio = b * (1 - a) + n * a;
594
+ p ? (f.stageX = y + (f.stageX - y) * f.ratio / b, f.stageY = q + (f.stageY - q) * f.ratio / b) : (f.stageX = m * (1 - a) + y * a, f.stageY = j * (1 - a) + q * a);
595
+ f.dispatch("interpolate");
596
+ 1 <= B && (window.clearInterval(f.interpolationID), a = f.ratio, p ? (f.ratio = n, f.stageX = y + (f.stageX - y) * f.ratio / a, f.stageY = q + (f.stageY - q) * f.ratio / a) : (f.stageX = y, f.stageY = q), f.dispatch("stopinterpolate"))
597
+ }
598
+ sigma.classes.Cascade.call(this);
599
+ sigma.classes.EventDispatcher.call(this);
600
+ var f = this;
601
+ this.p = {
602
+ minRatio: 1,
603
+ maxRatio: 32,
604
+ marginRatio: 1,
605
+ zoomDelta: 0.1,
606
+ dragDelta: 0.3,
607
+ zoomMultiply: 2,
608
+ directZooming: !1,
609
+ blockScroll: !0,
610
+ inertia: 1.1,
611
+ mouseEnabled: !0
612
+ };
613
+ var k = 0,
614
+ l = 0,
615
+ m = 0,
616
+ j = 0,
617
+ n = 1,
618
+ y = 0,
619
+ q = 0,
620
+ A = 0,
621
+ w = 0,
622
+ u = 0,
623
+ x = 0,
624
+ B = 0,
625
+ p = !1;
626
+ this.stageY = this.stageX = 0;
627
+ this.ratio = 1;
628
+ this.mouseY = this.mouseX = 0;
629
+ this.isMouseDown = !1;
630
+ b.addEventListener && document.addEventListener ? (b.addEventListener("DOMMouseScroll", d, !0), b.addEventListener("mousewheel", d, !0), b.addEventListener("mousemove", i, !0), b.addEventListener("mousedown", c, !0), document.addEventListener("mouseup", h, !0)) : (b.attachEvent("onDOMMouseScroll", d), b.attachEvent("onmousewheel", d), b.attachEvent("onmousemove", i), b.attachEvent("onmousedown", c), document.attachEvent("onmouseup", h));
631
+ this.checkBorders = function () {
632
+ return f
633
+ };
634
+ this.interpolate = g
635
+ }
636
+ function o(b, i, h, c, d, g, a, f, k) {
637
+ function l(a) {
638
+ var b = c,
639
+ d = Math.round,
640
+ f = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * a.displaySize;
641
+ b.font = (j.p.hoverFontStyle || j.p.fontStyle || "") + " " + f + "px " + (j.p.hoverFont || j.p.font || "");
642
+ b.fillStyle = "node" == j.p.labelHoverBGColor ? a.color || j.p.defaultNodeColor : j.p.defaultHoverLabelBGColor;
643
+ j.p.labelHoverShadow && (b.shadowOffsetX = 0, b.shadowOffsetY = 0, b.shadowBlur = 4, b.shadowColor = j.p.labelHoverShadowColor);
644
+ var h = d(a.displayX + 10),
645
+ g = d(a.displayY - f / 2 - 2),
646
+ i = d(b.measureText(a.label).width + 6),
647
+ m = d(f + 4);
648
+ d(f / 2 + 2);
649
+ b.fillRect(h, g, i, m);
650
+ b.shadowOffsetX = 0;
651
+ b.shadowOffsetY = 0;
652
+ b.shadowBlur = 0;
653
+ b.fillStyle = "node" == j.p.labelHoverColor ? a.color || j.p.defaultNodeColor : j.p.defaultLabelHoverColor;
654
+ b.fillText(a.label, h + 4, g + m - 3);
655
+ return j
656
+ }
657
+ function m(a) {
658
+ if (isNaN(a.x) || isNaN(a.y)) throw Error("A node's coordinate is not a number (id: " + a.id + ")");
659
+ return !a.hidden && a.displayX + a.displaySize > -n / 3 && a.displayX - a.displaySize < 4 * n / 3 && a.displayY + a.displaySize > -y / 3 && a.displayY - a.displaySize < 4 * y / 3
660
+ }
661
+ sigma.classes.Cascade.call(this);
662
+ var j = this;
663
+ this.contexts = {
664
+ node: b,
665
+ edge: i,
666
+ label: h,
667
+ hover: c,
668
+ bg: d,
669
+ bg2: g
670
+ };
671
+ this.p = {
672
+ labelColor: "default",
673
+ defaultLabelColor: "#fff",
674
+ labelHoverBGColor: "default",
675
+ defaultHoverLabelBGColor: "#fff",
676
+ labelHoverShadow: !0,
677
+ labelHoverShadowColor: "#000",
678
+ labelHoverColor: "default",
679
+ defaultLabelHoverColor: "#000",
680
+ labelActiveBGColor: "default",
681
+ defaultActiveLabelBGColor: "#fff",
682
+ labelActiveShadow: !0,
683
+ labelActiveShadowColor: "#000",
684
+ labelActiveColor: "default",
685
+ defaultLabelActiveColor: "#000",
686
+ labelSize: "fixed",
687
+ defaultLabelSize: 12,
688
+ labelSizeRatio: 2,
689
+ labelThreshold: 6,
690
+ font: "Arial",
691
+ hoverFont: "",
692
+ activeFont: "",
693
+ fontStyle: "",
694
+ hoverFontStyle: "",
695
+ activeFontStyle: "",
696
+ edgeColor: "source",
697
+ defaultEdgeColor: "#aaa",
698
+ defaultEdgeType: "line",
699
+ defaultNodeColor: "#aaa",
700
+ nodeHoverColor: "node",
701
+ defaultNodeHoverColor: "#fff",
702
+ nodeActiveColor: "node",
703
+ defaultNodeActiveColor: "#fff",
704
+ borderSize: 0,
705
+ nodeBorderColor: "node",
706
+ defaultNodeBorderColor: "#fff",
707
+ edgesSpeed: 200,
708
+ nodesSpeed: 200,
709
+ nodesBGSpeed: 200,
710
+ labelsSpeed: 200
711
+ };
712
+ var n = f,
713
+ y = k;
714
+ this.currentBGIndex = this.currentLabelIndex = this.currentBGIndex = this.currentNodeIndex = this.currentEdgeIndex = 0;
715
+ this.task_drawLabel = function () {
716
+ for (var b = a.nodes.length, c = 0; c++ < j.p.labelsSpeed && j.currentLabelIndex < b;) if (j.isOnScreen(a.nodes[j.currentLabelIndex])) {
717
+ var d = a.nodes[j.currentLabelIndex++],
718
+ f = h;
719
+ if (d.displaySize >= j.p.labelThreshold) {
720
+ var g = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * d.displaySize;
721
+ f.font = (j.p.hoverFontStyle || j.p.fontStyle || "") + " " + g + "px " + (j.p.hoverFont || j.p.font || "");
722
+ var i = Math.round,
723
+ m = i(d.displayX + 10),
724
+ l = i(d.displayY + g / 2 - 2),
725
+ k = i(f.measureText(d.label).width + 6),
726
+ v = i(g + 4);
727
+ i(g / 2 + 2);
728
+ f.font = j.p.fontStyle + g + "px " + j.p.font;
729
+ f.fillStyle = "#258EA4";
730
+ f.fillRect(m, l - v + 3, k, v);
731
+ f.fillStyle = "#fff";
732
+ f.fillText(d.label, m + 4, l)
733
+ }
734
+ } else j.currentLabelIndex++;
735
+ return j.currentLabelIndex < b
736
+ };
737
+ this.task_drawEdge = function () {
738
+ for (var b = a.edges.length, c, d, f = 0, h; f++ < j.p.edgesSpeed && j.currentEdgeIndex < b;) if (h = a.edges[j.currentEdgeIndex], c = h.source, d = h.target, h.hidden || c.hidden || d.hidden || !j.isOnScreen(c) && !j.isOnScreen(d)) j.currentEdgeIndex++;
739
+ else {
740
+ c = a.edges[j.currentEdgeIndex++];
741
+ d = c.source.displayX;
742
+ h = c.source.displayY;
743
+ var g = c.target.displayX,
744
+ m = c.target.displayY,
745
+ l = void 0;
746
+ // l = c.attr.color ? c.attr.color : "rgba(255, 0, 0, .6)";
747
+ if (!l) switch (j.p.edgeColor) {
748
+ case "source":
749
+ l = c.source.color || j.p.defaultNodeColor;
750
+ break;
751
+ case "target":
752
+ l = c.target.color || j.p.defaultNodeColor;
753
+ break;
754
+ default:
755
+ l = j.p.defaultEdgeColor
756
+ }
757
+ var k = i;
758
+ k.strokeStyle = l;
759
+ k.lineWidth = c.attr.lineWidth ? c.attr.lineWidth : 0.2;
760
+ switch (c.type || j.p.defaultEdgeType) {
761
+ case "curve":
762
+ k.beginPath();
763
+ k.moveTo(d, h);
764
+ k.quadraticCurveTo((d + g) / 2 + (m - h) / 4, (h + m) / 2 + (d - g) / 4, g, m);
765
+ k.stroke();
766
+ break;
767
+ default:
768
+ k.beginPath(), k.moveTo(d, h), k.lineTo(g, m), k.stroke()
769
+ }
770
+ }
771
+ return j.currentEdgeIndex < b
772
+ };
773
+ this.task_drawNode = function () {
774
+ for (var b = a.nodes.length, c = 0; c++ < j.p.nodesSpeed && j.currentNodeIndex < b;) j.isOnScreen(a.nodes[j.currentNodeIndex]) ? j.drawNode(a.nodes[j.currentNodeIndex++]) : j.currentNodeIndex++;
775
+ return j.currentNodeIndex < b
776
+ };
777
+ this.task_drawBG = function () {
778
+ for (var b = a.nodesBG.length, c = 0; c++ < j.p.nodesBGSpeed && j.currentBGIndex < b;) j.drawBG(a.nodesBG[j.currentBGIndex++]);
779
+ return j.currentBGIndex < b
780
+ };
781
+ this.drawBG = function (a) {
782
+ var b = Math,
783
+ c = b.round(10 * a.displaySize) / 10,
784
+ f = a.displayX,
785
+ h = a.displayY;
786
+ d.fillStyle = "#fff";
787
+ d.beginPath();
788
+ d.arc(f, h, c, 0, 2 * b.PI, !0);
789
+ d.closePath();
790
+ d.fill();
791
+ var g = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * a.displaySize,
792
+ b = b.round,
793
+ i, m, l;
794
+ i = d.measureText(a.label).width;
795
+ l = c * a.attr.deltaX / 100;
796
+ var k = c * a.attr.deltaY / 100;
797
+ switch (a.attr.position) {
798
+ default: c = b(f - l - c - i - 13);
799
+ l = b(h + k);
800
+ i = c;
801
+ m = l - 3;
802
+ f = b(f);
803
+ h = b(h + k);
804
+ break;
805
+ case "right":
806
+ c = b(f + l + a.displaySize + 8 + i), l = b(h + k), i = c - i, m = l - 3, f = b(f), h = b(h + k)
807
+ }
808
+ d.font = g + "px sans-serif";
809
+ d.fillStyle = "#fff";
810
+ d.fillText(a.label, i, m);
811
+ d.strokeStyle = "#fff";
812
+ d.lineWidth = 0.7;
813
+ d.save();
814
+ d.moveTo(c, l);
815
+ d.lineTo(f, h);
816
+ d.stroke();
817
+ d.restore();
818
+ return j
819
+ };
820
+ this.drawNode = function (a) {
821
+ var c = Math.round(10 * a.displaySize) / 10;
822
+ b.fillStyle = a.attr.color ? a.attr.color : "#ff0000";
823
+ b.strokeStyle = a.attr.strokeStyle ? a.attr.strokeStyle : "#000";
824
+ a.attr.lineWidth && (b.lineWidth = a.attr.lineWidth);
825
+ var d = 2 * Math.PI;
826
+ 1 > c && (c = 1);
827
+ var f = a.displayX,
828
+ h = a.displayY,
829
+ i = 9 * c;
830
+ // m = b.createRadialGradient(f, h, i - 7, f, h, i);
831
+ // m.addColorStop(0, "#ff0000");
832
+ // m.addColorStop(1, "rgba(255, 255, 255, 0)");
833
+ //g.fillStyle = m;
834
+ b.beginPath();
835
+ b.arc(f, h, 1.4 * c, 0, d, !0);
836
+ b.closePath();
837
+ a.attr.lineWidth && b.stroke();
838
+ b.fill();
839
+ a.hover && l(a);
840
+ return j
841
+ };
842
+ this.getCtx = function (a) {
843
+ return j.contexts[a] ? j.contexts[a] : !1
844
+ };
845
+ this.drawActiveNode = function (a) {
846
+ var b = c;
847
+ if (!m(a)) return j;
848
+ var d = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * a.displaySize;
849
+ b.font = (j.p.activeFontStyle || j.p.fontStyle || "") + " " + d + "px " + (j.p.activeFont || j.p.font || "");
850
+ b.fillStyle = "node" == j.p.labelHoverBGColor ? a.color || j.p.defaultNodeColor : j.p.defaultActiveLabelBGColor;
851
+ b.beginPath();
852
+ j.p.labelActiveShadow && (b.shadowOffsetX = 0, b.shadowOffsetY = 0, b.shadowBlur = 4, b.shadowColor = j.p.labelActiveShadowColor);
853
+ sigma.tools.drawRoundRect(b, Math.round(a.displayX - d / 2 - 2), Math.round(a.displayY - d / 2 - 2), Math.round(b.measureText(a.label).width + 1.5 * a.displaySize + d / 2 + 4), Math.round(d + 4), Math.round(d / 2 + 2), "left");
854
+ b.closePath();
855
+ b.fill();
856
+ b.shadowOffsetX = 0;
857
+ b.shadowOffsetY = 0;
858
+ b.shadowBlur = 0;
859
+ b.beginPath();
860
+ b.fillStyle = "node" == j.p.nodeBorderColor ? a.color || j.p.defaultNodeColor : j.p.defaultNodeBorderColor;
861
+ b.arc(Math.round(a.displayX), Math.round(a.displayY), a.displaySize + j.p.borderSize, 0, 2 * Math.PI, !0);
862
+ b.closePath();
863
+ b.fill();
864
+ b.beginPath();
865
+ b.fillStyle = "node" == j.p.nodeActiveColor ? a.color || j.p.defaultNodeColor : j.p.defaultNodeActiveColor;
866
+ b.arc(Math.round(a.displayX), Math.round(a.displayY), a.displaySize, 0, 2 * Math.PI, !0);
867
+ b.closePath();
868
+ b.fill();
869
+ b.fillStyle = "node" == j.p.labelActiveColor ? a.color || j.p.defaultNodeColor : j.p.defaultLabelActiveColor;
870
+ b.fillText(a.label, Math.round(a.displayX + 1.5 * a.displaySize), Math.round(a.displayY + d / 2 - 3));
871
+ return j
872
+ };
873
+ this.drawHoverNode = l;
874
+ this.isOnScreen = m;
875
+ this.resize = function (a, b) {
876
+ n = a;
877
+ y = b;
878
+ return j
879
+ }
880
+ }
881
+ function t(b, v) {
882
+ function h() {
883
+ sigma.chronos.removeTask("node_" + a.id, 2).removeTask("edge_" + a.id, 2).removeTask("label_" + a.id, 2).stopTasks();
884
+ return a
885
+ }
886
+ function c(b, c) {
887
+ var d = document.createElement(c);
888
+ d.style.position = "absolute";
889
+ d.setAttribute("id", "sigma_" + b + "_" + a.id);
890
+ d.setAttribute("class", "sigma_" + b + "_" + c);
891
+ d.setAttribute("width", a.width);
892
+ d.setAttribute("height", a.height);
893
+ a.domRoot.appendChild(d);
894
+ "undefined" != typeof G_vmlCanvasManager && "canvas" == c && (d = G_vmlCanvasManager.initElement(d));
895
+ a.domElements[b] = d;
896
+ d.getContext && (a.contexts[b] = d.getContext("2d"));
897
+ return a
898
+ }
899
+
900
+ function d() {
901
+ a.p.drawHoverNodes && (a.graph.checkHover(a.mousecaptor.mouseX, a.mousecaptor.mouseY), a.domElements.mouse.style.cursor = "default", a.graph.nodes.forEach(function (b) {
902
+ b.hover && !b.active && (a.domElements.mouse.style.cursor = "pointer", a.plotter.drawHoverNode(b))
903
+ }));
904
+ return a
905
+ }
906
+ function s() {
907
+ a.p.drawActiveNodes && a.graph.nodes.forEach(function (b) {
908
+ b.active && a.plotter.drawActiveNode(b)
909
+ });
910
+ return a
911
+ }
912
+ sigma.classes.Cascade.call(this);
913
+ sigma.classes.EventDispatcher.call(this);
914
+ var a = this;
915
+ this.id = v.toString();
916
+ this.p = {
917
+ auto: !0,
918
+ drawNodes: 2,
919
+ drawEdges: 1,
920
+ drawLabels: 2,
921
+ drawBG: 2,
922
+ lastNodes: 2,
923
+ lastEdges: 0,
924
+ lastLabels: 2,
925
+ lastBG: 2,
926
+ drawHoverNodes: !0,
927
+ drawActiveNodes: !0
928
+ };
929
+ this.domRoot = b;
930
+ this.width = this.domRoot.offsetWidth;
931
+ this.height = this.domRoot.offsetHeight;
932
+ this.graph = new n;
933
+ this.domElements = {};
934
+ this.contexts = {};
935
+ c("bg", "canvas");
936
+ c("bg2", "canvas");
937
+ c("edges", "canvas");
938
+ c("nodes", "canvas");
939
+ c("labels", "canvas");
940
+ c("hover", "canvas");
941
+ c("monitor", "div");
942
+ c("mouse", "canvas");
943
+ this.plotter = new o(this.contexts.nodes, this.contexts.edges, this.contexts.labels, this.contexts.hover, this.contexts.bg, this.contexts.bg2, this.graph, this.width, this.height);
944
+ this.monitor = new i(this, this.domElements.monitor);
945
+ this.mousecaptor = new k(this.domElements.mouse, this.id);
946
+ this.mousecaptor.bind("drag interpolate", function () {
947
+ a.draw(a.p.auto ? 2 : a.p.drawNodes, a.p.auto ? 0 : a.p.drawEdges, a.p.auto ? 2 : a.p.drawLabels, a.p.auto ? 2 : a.p.drawBG, !0)
948
+ }).bind("stopdrag stopinterpolate", function () {
949
+ a.draw(a.p.auto ? 2 : a.p.drawNodes, a.p.auto ? 1 : a.p.drawEdges, a.p.auto ? 2 : a.p.drawLabels, a.p.auto ? 2 : a.p.drawBG, !0)
950
+ }).bind("mousedown mouseup", function (b) {
951
+ var c = a.graph.nodes.filter(function (a) {
952
+ return !!a.hover
953
+ }).map(function (a) {
954
+ return a.id
955
+ });
956
+ a.dispatch("mousedown" == b.type ? "downgraph" : "upgraph");
957
+ c.length && a.dispatch("mousedown" == b.type ? "downnodes" : "upnodes", c)
958
+ }).bind("move", function () {
959
+ a.contexts.hover.clearRect(0, 0, a.domElements.hover.width, a.domElements.hover.height);
960
+ d();
961
+ s()
962
+ });
963
+ sigma.chronos.bind("startgenerators", function () {
964
+ sigma.chronos.getGeneratorsIDs().some(function (b) {
965
+ return !!b.match(RegExp("_ext_" + a.id + "$", ""))
966
+ }) && a.draw(a.p.auto ? 2 : a.p.drawNodes, a.p.auto ? 0 : a.p.drawEdges, a.p.auto ? 2 : a.p.drawLabels)
967
+ }).bind("stopgenerators", function () {
968
+ a.draw()
969
+ });
970
+ for (var f = 0; f < g.length; f++) g[f](this);
971
+ this.draw = function (b, c, d, f, i) {
972
+ if (i && sigma.chronos.getGeneratorsIDs().some(function (b) {
973
+ return !!b.match(RegExp("_ext_" + a.id + "$", ""))
974
+ })) return a;
975
+ b = void 0 == b ? a.p.drawNodes : b;
976
+ c = void 0 == c ? a.p.drawEdges : c;
977
+ d = void 0 == d ? a.p.drawLabels : d;
978
+ f = void 0 == f ? a.p.drawBG : f;
979
+ i = {
980
+ nodes: b,
981
+ edges: c,
982
+ labels: d,
983
+ bg: f
984
+ };
985
+ a.p.lastNodes = b;
986
+ a.p.lastEdges = c;
987
+ a.p.lastLabels = d;
988
+ a.p.lastBG = f;
989
+ h();
990
+ a.graph.rescale(a.width, a.height, 0 < b, 0 < c, 0 < f).setBorders();
991
+ a.mousecaptor.checkBorders(a.graph.borders, a.width, a.height);
992
+ a.graph.translate(a.mousecaptor.stageX, a.mousecaptor.stageY, a.mousecaptor.ratio, 0 < b, 0 < c, 0 < f);
993
+ a.dispatch("graphscaled");
994
+ for (var g in a.domElements) "canvas" == a.domElements[g].nodeName.toLowerCase() && (void 0 == i[g] || 0 <= i[g]) && a.contexts[g].clearRect(0, 0, a.domElements[g].width, a.domElements[g].height);
995
+ a.plotter.currentEdgeIndex = 0;
996
+ a.plotter.currentNodeIndex = 0;
997
+ a.plotter.currentLabelIndex = 0;
998
+ a.plotter.currentBGIndex = 0;
999
+ g = null;
1000
+ i = !1;
1001
+ if (f) if (1 < f) for (; a.plotter.task_drawBG(););
1002
+ else sigma.chronos.addTask(a.plotter.task_drawBG, "bg_" + a.id, !1), i = !0, g = "bg_" + a.id;
1003
+ if (b) if (1 < b) for (; a.plotter.task_drawNode(););
1004
+ else sigma.chronos.addTask(a.plotter.task_drawNode, "node_" + a.id, !1), i = !0, g = "node_" + a.id;
1005
+ if (d) if (1 < d) for (; a.plotter.task_drawLabel(););
1006
+ else g ? sigma.chronos.queueTask(a.plotter.task_drawLabel, "label_" + a.id, g) : sigma.chronos.addTask(a.plotter.task_drawLabel, "label_" + a.id, !1), i = !0, g = "label_" + a.id;
1007
+ if (c) if (1 < c) for (; a.plotter.task_drawEdge(););
1008
+ else g ? sigma.chronos.queueTask(a.plotter.task_drawEdge, "edge_" + a.id, g) : sigma.chronos.addTask(a.plotter.task_drawEdge, "edge_" + a.id, !1), i = !0, g = "edge_" + a.id;
1009
+ a.dispatch("draw");
1010
+ a.refresh();
1011
+ i && sigma.chronos.runTasks();
1012
+ return a
1013
+ };
1014
+ this.resize = function (b, c) {
1015
+ var d = a.width,
1016
+ f = a.height;
1017
+ void 0 != b && void 0 != c ? (a.width = b, a.height = c) : (a.width = a.domRoot.offsetWidth, a.height = a.domRoot.offsetHeight);
1018
+ if (d != a.width || f != a.height) {
1019
+ for (var h in a.domElements) a.domElements[h].setAttribute("width", a.width + "px"), a.domElements[h].setAttribute("height", a.height + "px");
1020
+ a.plotter.resize(a.width, a.height);
1021
+ a.draw(a.p.lastNodes, a.p.lastEdges, a.p.lastLabels, a.p.drawBG, !0)
1022
+ }
1023
+ return a
1024
+ };
1025
+ this.refresh = function () {
1026
+ a.contexts.hover.clearRect(0, 0, a.domElements.hover.width, a.domElements.hover.height);
1027
+ d();
1028
+ s();
1029
+ return a
1030
+ };
1031
+ this.drawHover = d;
1032
+ this.drawActive = s;
1033
+ this.clearSchedule = h;
1034
+ window.addEventListener ? window.addEventListener("resize", function () {
1035
+ a.resize()
1036
+ }, !1) : window.attachEvent("onresize", function () {
1037
+ a.resize()
1038
+ })
1039
+ }
1040
+ function s(b) {
1041
+ var g = this;
1042
+ sigma.classes.EventDispatcher.call(this);
1043
+ this._core = b;
1044
+ this.kill = function () {};
1045
+ this.getID = function () {
1046
+ return b.id
1047
+ };
1048
+ this.configProperties = function (h, c) {
1049
+ var d = b.config(h, c);
1050
+ return d == b ? g : d
1051
+ };
1052
+ this.drawingProperties = function (h, c) {
1053
+ var d = b.plotter.config(h, c);
1054
+ return d == b.plotter ? g : d
1055
+ };
1056
+ this.mouseProperties = function (h, c) {
1057
+ var d = b.mousecaptor.config(h, c);
1058
+ return d == b.mousecaptor ? g : d
1059
+ };
1060
+ this.graphProperties = function (h, c) {
1061
+ var d = b.graph.config(h, c);
1062
+ return d == b.graph ? g : d
1063
+ };
1064
+ this.getMouse = function () {
1065
+ return {
1066
+ mouseX: b.mousecaptor.mouseX,
1067
+ mouseY: b.mousecaptor.mouseY,
1068
+ down: b.mousecaptor.isMouseDown
1069
+ }
1070
+ };
1071
+ this.position = function (h, c, d) {
1072
+ if (0 == arguments.length) return {
1073
+ stageX: b.mousecaptor.stageX,
1074
+ stageY: b.mousecaptor.stageY,
1075
+ ratio: b.mousecaptor.ratio
1076
+ };
1077
+ b.mousecaptor.stageX = void 0 != h ? h : b.mousecaptor.stageX;
1078
+ b.mousecaptor.stageY = void 0 != c ? c : b.mousecaptor.stageY;
1079
+ b.mousecaptor.ratio = void 0 != d ? d : b.mousecaptor.ratio;
1080
+ return g
1081
+ };
1082
+ this.goTo = function (h, c, d) {
1083
+ b.mousecaptor.interpolate(h, c, d);
1084
+ return g
1085
+ };
1086
+ this.zoomTo = function (h, c, d) {
1087
+ d = Math.min(Math.max(b.mousecaptor.config("minRatio"), d), b.mousecaptor.config("maxRatio"));
1088
+ d == b.mousecaptor.ratio ? b.mousecaptor.interpolate(h - b.width / 2 + b.mousecaptor.stageX, c - b.height / 2 + b.mousecaptor.stageY) : b.mousecaptor.interpolate((d * h - b.mousecaptor.ratio * b.width / 2) / (d - b.mousecaptor.ratio), (d * c - b.mousecaptor.ratio * b.height / 2) / (d - b.mousecaptor.ratio), d);
1089
+ return g
1090
+ };
1091
+ this.resize = function (h, c) {
1092
+ b.resize(h, c);
1093
+ return g
1094
+ };
1095
+ this.draw = function (h, c, d, i, a) {
1096
+ b.draw(h, c, d, i, a);
1097
+ return g
1098
+ };
1099
+ this.refresh = function () {
1100
+ b.refresh();
1101
+ return g
1102
+ };
1103
+ this.addGenerator = function (h, c, d) {
1104
+ sigma.chronos.addGenerator(h + "_ext_" + b.id, c, d);
1105
+ return g
1106
+ };
1107
+ this.removeGenerator = function (h) {
1108
+ sigma.chronos.removeGenerator(h + "_ext_" + b.id);
1109
+ return g
1110
+ };
1111
+ this.addNode = function (h, c) {
1112
+ b.graph.addNode(h, c);
1113
+ return g
1114
+ };
1115
+ this.addNodeBG = function (h, c) {
1116
+ b.graph.addNodeBG(h, c);
1117
+ return g
1118
+ };
1119
+ this.addEdge = function (h, c, d, i) {
1120
+ b.graph.addEdge(h, c, d, i);
1121
+ return g
1122
+ };
1123
+ this.dropNode = function (h) {
1124
+ b.graph.dropNode(h);
1125
+ return g
1126
+ };
1127
+ this.dropEdge = function (h) {
1128
+ b.graph.dropEdge(h);
1129
+ return g
1130
+ };
1131
+ this.pushGraph = function (h, c) {
1132
+ h.nodes && h.nodes.forEach(function (d) {
1133
+ d.id && (!c || !b.graph.nodesIndex[d.id]) && g.addNode(d.id, d)
1134
+ });
1135
+ h.edges && h.edges.forEach(function (d) {
1136
+ (validID = d.source && d.target && d.id) && (!c || !b.graph.edgesIndex[d.id]) && g.addNode(d.id, d.source, d.target, d)
1137
+ });
1138
+ return g
1139
+ };
1140
+ this.emptyGraph = function () {
1141
+ b.graph.empty();
1142
+ return g
1143
+ };
1144
+ this.getNodesCount = function () {
1145
+ return b.graph.nodes.length
1146
+ };
1147
+ this.getEdgesCount = function () {
1148
+ return b.graph.edges.length
1149
+ };
1150
+ this.iterNodes = function (h, c) {
1151
+ b.graph.iterNodes(h, c);
1152
+ return g
1153
+ };
1154
+ this.iterEdges = function (h, c) {
1155
+ b.graph.iterEdges(h, c);
1156
+ return g
1157
+ };
1158
+ this.getNodes = function (h) {
1159
+ return b.graph.getNodes(h)
1160
+ };
1161
+ this.getEdges = function (h) {
1162
+ return b.graph.getEdges(h)
1163
+ };
1164
+ this.activateMonitoring = function () {
1165
+ return b.monitor.activate()
1166
+ };
1167
+ this.desactivateMonitoring = function () {
1168
+ return b.monitor.desactivate()
1169
+ };
1170
+ b.bind("downnodes upnodes downgraph upgraph", function (b) {
1171
+ g.dispatch(b.type, b.content)
1172
+ });
1173
+ b.graph.bind("overnodes outnodes", function (b) {
1174
+ g.dispatch(b.type, b.content)
1175
+ })
1176
+ }
1177
+ var C = 0;
1178
+ g = void 0;
1179
+ g = [];
1180
+ sigma.init = function (b) {
1181
+ b = new t(b, (++C).toString());
1182
+ sigma.instances[C] = new s(b);
1183
+ return sigma.instances[C]
1184
+ };
1185
+ sigma.addPlugin = function (b, i, h) {
1186
+ s.prototype[b] = i;
1187
+ g.push(h)
1188
+ };
1189
+ sigma.chronos = new function () {
1190
+ function b(a) {
1191
+ window.setTimeout(a, 0);
1192
+ return l
1193
+ }
1194
+ function g() {
1195
+ for (l.dispatch("frameinserted"); m && r.length && h(););
1196
+ !m || !r.length ? d() : (x = (new Date).getTime(), o++, B = w - q, s = q - B, l.dispatch("insertframe"), b(g))
1197
+ }
1198
+ function h() {
1199
+ t %= r.length;
1200
+ if (!r[t].task()) {
1201
+ var a = r[t].taskName;
1202
+ z = z.filter(function (b) {
1203
+ b.taskParent == a && r.push({
1204
+ taskName: b.taskName,
1205
+ task: b.task
1206
+ });
1207
+ return b.taskParent != a
1208
+ });
1209
+ l.dispatch("killed", r.splice(t--, 1)[0])
1210
+ }
1211
+ t++;
1212
+ w = (new Date).getTime() - x;
1213
+ return w <= s
1214
+ }
1215
+ function c() {
1216
+ m = !0;
1217
+ o = t = 0;
1218
+ u = x = (new Date).getTime();
1219
+ l.dispatch("start");
1220
+ l.dispatch("insertframe");
1221
+ b(g);
1222
+ return l
1223
+ }
1224
+ function d() {
1225
+ l.dispatch("stop");
1226
+ m = !1;
1227
+ return l
1228
+ }
1229
+ function i(a, b, d) {
1230
+ if ("function" != typeof a) throw Error('Task "' + b + '" is not a function');
1231
+ r.push({
1232
+ taskName: b,
1233
+ task: a
1234
+ });
1235
+ m = !(!m && !(d && c() || 1));
1236
+ return l
1237
+ }
1238
+ function a(a) {
1239
+ return a ? Object.keys(p).filter(function (a) {
1240
+ return !!p[a].on
1241
+ }).length : Object.keys(p).length
1242
+ }
1243
+ function f() {
1244
+ Object.keys(p).length ? (l.dispatch("startgenerators"), l.unbind("killed", k), b(function () {
1245
+ for (var a in p) p[a].on = !0, i(p[a].task, a, !1)
1246
+ }), l.bind("killed", k).runTasks()) : l.dispatch("stopgenerators");
1247
+ return l
1248
+ }
1249
+ function k(b) {
1250
+ void 0 != p[b.content.taskName] && (p[b.content.taskName].del || !p[b.content.taskName].condition() ? delete p[b.content.taskName] : p[b.content.taskName].on = !1, 0 == a(!0) && f())
1251
+ }
1252
+ sigma.classes.EventDispatcher.call(this);
1253
+ var l = this,
1254
+ m = !1,
1255
+ j = 80,
1256
+ n = 0,
1257
+ o = 0,
1258
+ q = 1E3 / j,
1259
+ s = q,
1260
+ w = 0,
1261
+ u = 0,
1262
+ x = 0,
1263
+ B = 0,
1264
+ p = {},
1265
+ r = [],
1266
+ z = [],
1267
+ t = 0;
1268
+ this.frequency = function (a) {
1269
+ return void 0 != a ? (j = Math.abs(1 * a), q = 1E3 / j, o = 0, l) : j
1270
+ };
1271
+ this.runTasks = c;
1272
+ this.stopTasks = d;
1273
+ this.insertFrame = b;
1274
+ this.addTask = i;
1275
+ this.queueTask = function (a, b, c) {
1276
+ if ("function" != typeof a) throw Error('Task "' + b + '" is not a function');
1277
+ if (!r.concat(z).some(function (a) {
1278
+ return a.taskName == c
1279
+ })) throw Error('Parent task "' + c + '" of "' + b + '" is not attached.');
1280
+ z.push({
1281
+ taskParent: c,
1282
+ taskName: b,
1283
+ task: a
1284
+ });
1285
+ return l
1286
+ };
1287
+ this.removeTask = function (a, b) {
1288
+ if (void 0 == a) r = [], 1 == b ? z = [] : 2 == b && (r = z, z = []), d();
1289
+ else {
1290
+ var c = "string" == typeof a ? a : "";
1291
+ r = r.filter(function (b) {
1292
+ return ("string" == typeof a ? b.taskName == a : b.task == a) ? (c = b.taskName, !1) : !0
1293
+ });
1294
+ 0 < b && (z = z.filter(function (a) {
1295
+ 1 == b && a.taskParent == c && r.push(a);
1296
+ return a.taskParent != c
1297
+ }))
1298
+ }
1299
+ m = !(r.length && (!d() || 1));
1300
+ return l
1301
+ };
1302
+ this.addGenerator = function (b, c, d) {
1303
+ if (void 0 != p[b]) return l;
1304
+ p[b] = {
1305
+ task: c,
1306
+ condition: d
1307
+ };
1308
+ 0 == a(!0) && f();
1309
+ return l
1310
+ };
1311
+ this.removeGenerator = function (a) {
1312
+ p[a] && (p[a].on = !1, p[a].del = !0);
1313
+ return l
1314
+ };
1315
+ this.startGenerators = f;
1316
+ this.getGeneratorsIDs = function () {
1317
+ return Object.keys(p)
1318
+ };
1319
+ this.getFPS = function () {
1320
+ m && (n = Math.round(1E4 * (o / ((new Date).getTime() - u))) / 10);
1321
+ return n
1322
+ };
1323
+ this.getTasksCount = function () {
1324
+ return r.length
1325
+ };
1326
+ this.getQueuedTasksCount = function () {
1327
+ return z.length
1328
+ };
1329
+ this.getExecutionTime = function () {
1330
+ return x - u
1331
+ };
1332
+ return this
1333
+ };
1334
+ sigma.debugMode = 0;
1335
+ sigma.log = function () {
1336
+ if (1 == sigma.debugMode) for (var b in arguments) console.log(arguments[b]);
1337
+ else if (1 < sigma.debugMode) for (b in arguments) throw Error(arguments[b]);
1338
+ return sigma
1339
+ };
1340
+ sigma.easing = {
1341
+ linear: {},
1342
+ quadratic: {}
1343
+ };
1344
+ sigma.easing.linear.easenone = function (b) {
1345
+ return b
1346
+ };
1347
+ sigma.easing.quadratic.easein = function (b) {
1348
+ return b * b
1349
+ };
1350
+ sigma.easing.quadratic.easeout = function (b) {
1351
+ return -b * (b - 2)
1352
+ };
1353
+ sigma.easing.quadratic.easeinout = function (b) {
1354
+ return 1 > (b *= 2) ? 0.5 * b * b : -0.5 * (--b * (b - 2) - 1)
1355
+ };
1356
+ sigma.tools.drawRoundRect = function (b, g, h, c, d) {
1357
+ b.fillStyle = "#009BE1";
1358
+ b.fillRect(g + e, h + e, c, d)
1359
+ };
1360
+ sigma.tools.getRGB = function (b, g) {
1361
+ var b = b.toString(),
1362
+ h = {
1363
+ r: 0,
1364
+ g: 0,
1365
+ b: 0
1366
+ };
1367
+ if (3 <= b.length && "#" == b.charAt(0)) {
1368
+ var c = b.length - 1;
1369
+ 6 == c ? h = {
1370
+ r: parseInt(b.charAt(1) + b.charAt(2), 16),
1371
+ g: parseInt(b.charAt(3) + b.charAt(4), 16),
1372
+ b: parseInt(b.charAt(5) + b.charAt(5), 16)
1373
+ } : 3 == c && (h = {
1374
+ r: parseInt(b.charAt(1) + b.charAt(1), 16),
1375
+ g: parseInt(b.charAt(2) + b.charAt(2), 16),
1376
+ b: parseInt(b.charAt(3) + b.charAt(3), 16)
1377
+ })
1378
+ }
1379
+ g && (h = [h.r, h.g, h.b]);
1380
+ return h
1381
+ };
1382
+ sigma.tools.rgbToHex = function (b, g, h) {
1383
+ return sigma.tools.toHex(b) + sigma.tools.toHex(g) + sigma.tools.toHex(h)
1384
+ };
1385
+ sigma.tools.toHex = function (b) {
1386
+ b = parseInt(b, 10);
1387
+ if (isNaN(b)) return "00";
1388
+ b = Math.max(0, Math.min(b, 255));
1389
+ return "0123456789ABCDEF".charAt((b - b % 16) / 16) + "0123456789ABCDEF".charAt(b % 16)
1390
+ };
1391
+ sigma.publicPrototype = s.prototype
1392
+ })();
js/sigma/sigma.min.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* sigmajs.org - an open-source light-weight JavaScript graph drawing library - Version: 0.1 - Author: Alexis Jacomy - License: MIT */
2
+ var sigma={tools:{},classes:{},instances:{}};
3
+ (function(){Array.prototype.some||(Array.prototype.some=function(g,i){var k=this.length;if("function"!=typeof g)throw new TypeError;for(var m=0;m<k;m++)if(m in this&&g.call(i,this[m],m,this))return!0;return!1});Array.prototype.forEach||(Array.prototype.forEach=function(g,i){var k=this.length;if(typeof g!="function")throw new TypeError;for(var m=0;m<k;m++)m in this&&g.call(i,this[m],m,this)});Array.prototype.map||(Array.prototype.map=function(g,i){var k=this.length;if(typeof g!="function")throw new TypeError;
4
+ for(var m=Array(k),b=0;b<k;b++)b in this&&(m[b]=g.call(i,this[b],b,this));return m});Array.prototype.filter||(Array.prototype.filter=function(g,i){var k=this.length;if(typeof g!="function")throw new TypeError;for(var m=[],b=0;b<k;b++)if(b in this){var j=this[b];g.call(i,j,b,this)&&m.push(j)}return m});if(!Object.keys){var i=Object,q=Object.prototype.hasOwnProperty,g=!{toString:null}.propertyIsEnumerable("toString"),p="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),
5
+ z=p.length;i.keys=function(i){if(typeof i!=="object"&&typeof i!=="function"||i===null)throw new TypeError("Object.keys called on non-object");var x=[],k;for(k in i)q.call(i,k)&&x.push(k);if(g)for(k=0;k<z;k++)q.call(i,p[k])&&x.push(p[k]);return x}}})();sigma.classes.Cascade=function(){this.p={};this.config=function(i,q){if("string"==typeof i&&void 0==q)return this.p[i];var g="object"==typeof i&&void 0==q?i:{};"string"==typeof i&&(g[i]=q);for(var p in g)void 0!=this.p[p]&&(this.p[p]=g[p]);return this}};
6
+ sigma.classes.EventDispatcher=function(){var i={},q=this;this.one=function(g,p){if(!p||!g)return q;("string"==typeof g?g.split(" "):g).forEach(function(g){i[g]||(i[g]=[]);i[g].push({h:p,one:!0})});return q};this.bind=function(g,p){if(!p||!g)return q;("string"==typeof g?g.split(" "):g).forEach(function(g){i[g]||(i[g]=[]);i[g].push({h:p,one:!1})});return q};this.unbind=function(g,p){g||(i={});var z="string"==typeof g?g.split(" "):g;p?z.forEach(function(g){i[g]&&(i[g]=i[g].filter(function(g){return g.h!=
7
+ p}));i[g]&&0==i[g].length&&delete i[g]}):z.forEach(function(g){delete i[g]});return q};this.dispatch=function(g,p){i[g]&&(i[g].forEach(function(i){i.h({type:g,content:p,target:q})}),i[g]=i[g].filter(function(g){return!g.one}));return q}};
8
+ (function(){function i(){function b(a){return{x:a.x,y:a.y,size:a.size,degree:a.degree,inDegree:a.inDegree,outDegree:a.outDegree,displayX:a.displayX,displayY:a.displayY,displaySize:a.displaySize,label:a.label,id:a.id,color:a.color,fixed:a.fixed,active:a.active,hidden:a.hidden,forceLabel:a.forceLabel,attr:a.attr}}function j(a){return{source:a.source.id,target:a.target.id,size:a.size,type:a.type,weight:a.weight,displaySize:a.displaySize,label:a.label,hidden:a.hidden,id:a.id,attr:a.attr,color:a.color}}
9
+ function f(){c.nodes=[];c.nodesIndex={};c.edges=[];c.edgesIndex={};return c}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var c=this;this.p={minNodeSize:0,maxNodeSize:0,minEdgeSize:0,maxEdgeSize:0,scalingMode:"inside",nodesPowRatio:0.5,edgesPowRatio:0};this.borders={};f();this.addNode=function(a,b){if(c.nodesIndex[a])throw Error('Node "'+a+'" already exists.');var b=b||{},d={x:0,y:0,size:1,degree:0,inDegree:0,outDegree:0,fixed:!1,active:!1,hidden:!1,forceLabel:!1,label:a.toString(),
10
+ id:a.toString(),attr:{}},f;for(f in b)switch(f){case "id":break;case "x":case "y":case "size":d[f]=+b[f];break;case "fixed":case "active":case "hidden":case "forceLabel":d[f]=!!b[f];break;case "color":case "label":d[f]=b[f];break;default:d.attr[f]=b[f]}c.nodes.push(d);c.nodesIndex[a.toString()]=d;return c};this.addEdge=function(a,b,d,f){if(c.edgesIndex[a])throw Error('Edge "'+a+'" already exists.');if(!c.nodesIndex[b])throw Error("Edge's source \""+b+'" does not exist yet.');if(!c.nodesIndex[d])throw Error("Edge's target \""+
11
+ d+'" does not exist yet.');f=f||{};b={source:c.nodesIndex[b],target:c.nodesIndex[d],size:1,weight:1,displaySize:0.5,label:a.toString(),id:a.toString(),hidden:!1,attr:{}};b.source.degree++;b.source.outDegree++;b.target.degree++;b.target.inDegree++;for(var o in f)switch(o){case "id":case "source":case "target":break;case "hidden":b[o]=!!f[o];break;case "size":case "weight":b[o]=+f[o];break;case "color":b[o]=f[o].toString();break;case "type":b[o]=f[o].toString();break;case "label":b[o]=f[o];break;default:b.attr[o]=
12
+ f[o]}c.edges.push(b);c.edgesIndex[a.toString()]=b;return c};this.dropNode=function(a){((a instanceof Array?a:[a])||[]).forEach(function(a){if(c.nodesIndex[a]){var b=null;c.nodes.some(function(c,f){return c.id==a?(b=f,!0):!1});null!=b&&c.nodes.splice(b,1);delete c.nodesIndex[a];c.edges=c.edges.filter(function(b){return b.source.id==a?(delete c.edgesIndex[b.id],b.target.degree--,b.target.inDegree--,!1):b.target.id==a?(delete c.edgesIndex[b.id],b.source.degree--,b.source.outDegree--,!1):!0})}else sigma.log('Node "'+
13
+ a+'" does not exist.')});return c};this.dropEdge=function(a){((a instanceof Array?a:[a])||[]).forEach(function(a){if(c.edgesIndex[a]){c.edgesIndex[a].source.degree--;c.edgesIndex[a].source.outDegree--;c.edgesIndex[a].target.degree--;c.edgesIndex[a].target.inDegree--;var b=null;c.edges.some(function(c,f){return c.id==a?(b=f,!0):!1});null!=b&&c.edges.splice(b,1);delete c.edgesIndex[a]}else sigma.log('Edge "'+a+'" does not exist.')});return c};this.iterEdges=function(a,b){var d=b?b.map(function(a){return c.edgesIndex[a]}):
14
+ c.edges,f=d.map(j);f.forEach(a);d.forEach(function(a,b){var d=f[b],l;for(l in d)switch(l){case "id":case "displaySize":break;case "weight":case "size":a[l]=+d[l];break;case "source":case "target":a[l]=c.nodesIndex[l]||a[l];break;case "hidden":a[l]=!!d[l];break;case "color":case "label":case "type":a[l]=(d[l]||"").toString();break;default:a.attr[l]=d[l]}});return c};this.iterNodes=function(a,f){var d=f?f.map(function(a){return c.nodesIndex[a]}):c.nodes,j=d.map(b);j.forEach(a);d.forEach(function(a,
15
+ b){var d=j[b],c;for(c in d)switch(c){case "id":case "attr":case "degree":case "inDegree":case "outDegree":case "displayX":case "displayY":case "displaySize":break;case "x":case "y":case "size":a[c]=+d[c];break;case "fixed":case "active":case "hidden":case "forceLabel":a[c]=!!d[c];break;case "color":case "label":a[c]=(d[c]||"").toString();break;default:a.attr[c]=d[c]}});return c};this.getEdges=function(a){var b=((a instanceof Array?a:[a])||[]).map(function(a){return j(c.edgesIndex[a])});return a instanceof
16
+ Array?b:b[0]};this.getNodes=function(a){var f=((a instanceof Array?a:[a])||[]).map(function(a){return b(c.nodesIndex[a])});return a instanceof Array?f:f[0]};this.empty=f;this.rescale=function(a,b,d,f){var j=0,h=0;d&&c.nodes.forEach(function(a){h=Math.max(a.size,h)});f&&c.edges.forEach(function(a){j=Math.max(a.size,j)});var h=h||1,j=j||1,g,l,s,t;d&&c.nodes.forEach(function(a){l=Math.max(a.x,l||a.x);g=Math.min(a.x,g||a.x);t=Math.max(a.y,t||a.y);s=Math.min(a.y,s||a.y)});var A="outside"==c.p.scalingMode?
17
+ Math.max(a/Math.max(l-g,1),b/Math.max(t-s,1)):Math.min(a/Math.max(l-g,1),b/Math.max(t-s,1)),i=(c.p.maxNodeSize||h)/A;l+=i;g-=i;t+=i;s-=i;var A="outside"==c.p.scalingMode?Math.max(a/Math.max(l-g,1),b/Math.max(t-s,1)):Math.min(a/Math.max(l-g,1),b/Math.max(t-s,1)),u,k;!c.p.maxNodeSize&&!c.p.minNodeSize?(u=1,k=0):c.p.maxNodeSize==c.p.minNodeSize?(u=0,k=c.p.maxNodeSize):(u=(c.p.maxNodeSize-c.p.minNodeSize)/h,k=c.p.minNodeSize);var B,E;!c.p.maxEdgeSize&&!c.p.minEdgeSize?(B=1,E=0):(B=c.p.maxEdgeSize==c.p.minEdgeSize?
18
+ 0:(c.p.maxEdgeSize-c.p.minEdgeSize)/j,E=c.p.minEdgeSize);d&&c.nodes.forEach(function(c){c.displaySize=c.size*u+k;if(!c.fixed){c.displayX=(c.x-(l+g)/2)*A+a/2;c.displayY=(c.y-(t+s)/2)*A+b/2}});f&&c.edges.forEach(function(a){a.displaySize=a.size*B+E});return c};this.translate=function(a,b,d,f,j){var h=Math.pow(d,c.p.nodesPowRatio);f&&c.nodes.forEach(function(c){c.fixed||(c.displayX=c.displayX*d+a,c.displayY=c.displayY*d+b);c.displaySize*=h});h=Math.pow(d,c.p.edgesPowRatio);j&&c.edges.forEach(function(a){a.displaySize*=
19
+ h});return c};this.setBorders=function(){c.borders={};c.nodes.forEach(function(a){c.borders.minX=Math.min(void 0==c.borders.minX?a.displayX-a.displaySize:c.borders.minX,a.displayX-a.displaySize);c.borders.maxX=Math.max(void 0==c.borders.maxX?a.displayX+a.displaySize:c.borders.maxX,a.displayX+a.displaySize);c.borders.minY=Math.min(void 0==c.borders.minY?a.displayY-a.displaySize:c.borders.minY,a.displayY-a.displaySize);c.borders.maxY=Math.max(void 0==c.borders.maxY?a.displayY-a.displaySize:c.borders.maxY,
20
+ a.displayY-a.displaySize)})};this.checkHover=function(a,b){var d,f,j,h=[],g=[];c.nodes.forEach(function(c){if(c.hidden)c.hover=!1;else{d=Math.abs(c.displayX-a);f=Math.abs(c.displayY-b);j=c.displaySize;var s=c.hover,t=d<j&&f<j&&Math.sqrt(d*d+f*f)<j;s&&!t?(c.hover=!1,g.push(c.id)):t&&!s&&(c.hover=!0,h.push(c.id))}});h.length&&c.dispatch("overnodes",h);g.length&&c.dispatch("outnodes",g);return c}}function q(b,j){function f(){var a;a="<p>GLOBAL :</p>";for(var b in c.p.globalProbes)a+="<p>"+b+" : "+c.p.globalProbes[b]()+
21
+ "</p>";a+="<br><p>LOCAL :</p>";for(b in c.p.localProbes)a+="<p>"+b+" : "+c.p.localProbes[b]()+"</p>";c.p.dom.innerHTML=a;return c}sigma.classes.Cascade.call(this);var c=this;this.instance=b;this.monitoring=!1;this.p={fps:40,dom:j,globalProbes:{"Time (ms)":sigma.chronos.getExecutionTime,Queue:sigma.chronos.getQueuedTasksCount,Tasks:sigma.chronos.getTasksCount,FPS:sigma.chronos.getFPS},localProbes:{"Nodes count":function(){return c.instance.graph.nodes.length},"Edges count":function(){return c.instance.graph.edges.length}}};
22
+ this.activate=function(){c.monitoring||(c.monitoring=window.setInterval(f,1E3/c.p.fps));return c};this.desactivate=function(){c.monitoring&&(window.clearInterval(c.monitoring),c.monitoring=null,c.p.dom.innerHTML="");return c}}function g(b){var j=b.changedTouches[0],f="";switch(b.type){case "touchstart":f="mousedown";break;case "touchmove":f="mousemove";break;case "touchend":f="mouseup";break;default:return}var c=document.createEvent("MouseEvent");c.initMouseEvent(f,!0,!0,window,1,j.posX,j.posY,j.clientX,
23
+ j.clientY,!1,!1,!1,!1,0,null);j.target.dispatchEvent(c);b.preventDefault()}function p(b){function j(b){a.p.mouseEnabled&&(f(a.mouseX,a.mouseY,a.ratio*(0<(void 0!=b.wheelDelta&&b.wheelDelta||void 0!=b.detail&&-b.detail)?a.p.zoomMultiply:1/a.p.zoomMultiply)),a.p.blockScroll&&(b.preventDefault?b.preventDefault():b.returnValue=!1))}function f(b,d,f){if(!a.isMouseDown&&(window.clearInterval(a.interpolationID),m=void 0!=f,w=a.stageX,n=b,o=a.stageY,l=d,h=f||a.ratio,h=Math.min(Math.max(h,a.p.minRatio),a.p.maxRatio),
24
+ u=a.p.directZooming?1-(m?a.p.zoomDelta:a.p.dragDelta):0,a.ratio!=h||a.stageX!=n||a.stageY!=l))c(),a.interpolationID=window.setInterval(c,50),a.dispatch("startinterpolate")}function c(){u+=m?a.p.zoomDelta:a.p.dragDelta;u=Math.min(u,1);var b=sigma.easing.quadratic.easeout(u),c=a.ratio;a.ratio=c*(1-b)+h*b;m?(a.stageX=n+(a.stageX-n)*a.ratio/c,a.stageY=l+(a.stageY-l)*a.ratio/c):(a.stageX=w*(1-b)+n*b,a.stageY=o*(1-b)+l*b);a.dispatch("interpolate");1<=u&&(window.clearInterval(a.interpolationID),b=a.ratio,
25
+ m?(a.ratio=h,a.stageX=n+(a.stageX-n)*a.ratio/b,a.stageY=l+(a.stageY-l)*a.ratio/b):(a.stageX=n,a.stageY=l),a.dispatch("stopinterpolate"))}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var a=this;this.p={minRatio:1,maxRatio:32,marginRatio:1,zoomDelta:0.1,dragDelta:0.3,zoomMultiply:2,directZooming:!1,blockScroll:!0,inertia:1.1,mouseEnabled:!0,touchEnabled:!0};var i=0,d=0,w=0,o=0,h=1,n=0,l=0,s=0,t=0,A=0,k=0,u=0,m=!1;this.stageY=this.stageX=0;this.ratio=1;this.mouseY=this.mouseX=
26
+ 0;this.isTouchDown=this.isMouseDown=!1;b.addEventListener("DOMMouseScroll",j,!0);b.addEventListener("mousewheel",j,!0);b.addEventListener("mousemove",function(b){a.mouseX=void 0!=b.offsetX&&b.offsetX||void 0!=b.layerX&&b.layerX||void 0!=b.clientX&&b.clientX;a.mouseY=void 0!=b.offsetY&&b.offsetY||void 0!=b.layerY&&b.layerY||void 0!=b.clientY&&b.clientY;if(a.isMouseDown){var c=a.mouseX-i+w,h=a.mouseY-d+o;if(c!=a.stageX||h!=a.stageY)t=s,k=A,s=c,A=h,a.stageX=c,a.stageY=h,a.dispatch("drag")}a.dispatch("move");
27
+ b.preventDefault?b.preventDefault():b.returnValue=!1},!0);b.addEventListener("mousedown",function(b){a.p.mouseEnabled&&(a.isMouseDown=!0,a.dispatch("mousedown"),w=a.stageX,o=a.stageY,i=a.mouseX,d=a.mouseY,t=s=a.stageX,k=A=a.stageY,a.dispatch("startdrag"),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);document.addEventListener("mouseup",function(b){a.p.mouseEnabled&&a.isMouseDown&&(a.isMouseDown=!1,a.dispatch("mouseup"),(w!=a.stageX||o!=a.stageY)&&f(a.stageX+a.p.inertia*(a.stageX-t),a.stageY+
28
+ a.p.inertia*(a.stageY-k)),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);b.addEventListener("touchstart",g,!0);b.addEventListener("touchmove",g,!0);document.addEventListener("touchend",g,!0);b.addEventListener("touchcancel",g,!0);this.checkBorders=function(){return a};this.interpolate=f}function z(b,j,f,c,a,g,d){function i(a){var b=c,d="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*a.displaySize;b.font=(h.p.hoverFontStyle||h.p.fontStyle||"")+" "+d+"px "+(h.p.hoverFont||
29
+ h.p.font||"");b.fillStyle="node"==h.p.labelHoverBGColor?a.color||h.p.defaultNodeColor:h.p.defaultHoverLabelBGColor;b.beginPath();h.p.labelHoverShadow&&(b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=4,b.shadowColor=h.p.labelHoverShadowColor);sigma.tools.drawRoundRect(b,Math.round(a.displayX-d/2-2),Math.round(a.displayY-d/2-2),Math.round(b.measureText(a.label).width+1.5*a.displaySize+d/2+4),Math.round(d+4),Math.round(d/2+2),"left");b.closePath();b.fill();b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur=
30
+ 0;b.beginPath();b.fillStyle="node"==h.p.nodeBorderColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeBorderColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize+h.p.borderSize,0,2*Math.PI,!0);b.closePath();b.fill();b.beginPath();b.fillStyle="node"==h.p.nodeHoverColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeHoverColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize,0,2*Math.PI,!0);b.closePath();b.fill();b.fillStyle="node"==h.p.labelHoverColor?a.color||h.p.defaultNodeColor:
31
+ h.p.defaultLabelHoverColor;b.fillText(a.label,Math.round(a.displayX+1.5*a.displaySize),Math.round(a.displayY+d/2-3));return h}function o(a){if(isNaN(a.x)||isNaN(a.y))throw Error("A node's coordinate is not a number (id: "+a.id+")");return!a.hidden&&a.displayX+a.displaySize>-n/3&&a.displayX-a.displaySize<4*n/3&&a.displayY+a.displaySize>-l/3&&a.displayY-a.displaySize<4*l/3}sigma.classes.Cascade.call(this);var h=this;this.p={labelColor:"default",defaultLabelColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff",
32
+ labelHoverShadow:!0,labelHoverShadowColor:"#000",labelHoverColor:"default",defaultLabelHoverColor:"#000",labelActiveBGColor:"default",defaultActiveLabelBGColor:"#fff",labelActiveShadow:!0,labelActiveShadowColor:"#000",labelActiveColor:"default",defaultLabelActiveColor:"#000",labelSize:"fixed",defaultLabelSize:12,labelSizeRatio:2,labelThreshold:6,font:"Arial",hoverFont:"",activeFont:"",fontStyle:"",hoverFontStyle:"",activeFontStyle:"",edgeColor:"source",defaultEdgeColor:"#aaa",defaultEdgeType:"line",
33
+ defaultNodeColor:"#aaa",nodeHoverColor:"node",defaultNodeHoverColor:"#fff",nodeActiveColor:"node",defaultNodeActiveColor:"#fff",borderSize:0,nodeBorderColor:"node",defaultNodeBorderColor:"#fff",edgesSpeed:200,nodesSpeed:200,labelsSpeed:200};var n=g,l=d;this.currentLabelIndex=this.currentNodeIndex=this.currentEdgeIndex=0;this.task_drawLabel=function(){for(var b=a.nodes.length,c=0;c++<h.p.labelsSpeed&&h.currentLabelIndex<b;)if(h.isOnScreen(a.nodes[h.currentLabelIndex])){var d=a.nodes[h.currentLabelIndex++],
34
+ j=f;if(d.displaySize>=h.p.labelThreshold||d.forceLabel){var g="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*d.displaySize;j.font=h.p.fontStyle+g+"px "+h.p.font;j.fillStyle="node"==h.p.labelColor?d.color||h.p.defaultNodeColor:h.p.defaultLabelColor;j.fillText(d.label,Math.round(d.displayX+1.5*d.displaySize),Math.round(d.displayY+g/2-3))}}else h.currentLabelIndex++;return h.currentLabelIndex<b};this.task_drawEdge=function(){for(var b=a.edges.length,c,d,f=0;f++<h.p.edgesSpeed&&h.currentEdgeIndex<
35
+ b;)if(e=a.edges[h.currentEdgeIndex],c=e.source,d=e.target,e.hidden||c.hidden||d.hidden||!h.isOnScreen(c)&&!h.isOnScreen(d))h.currentEdgeIndex++;else{c=a.edges[h.currentEdgeIndex++];d=c.source.displayX;var g=c.source.displayY,o=c.target.displayX,i=c.target.displayY,l=c.color;if(!l)switch(h.p.edgeColor){case "source":l=c.source.color||h.p.defaultNodeColor;break;case "target":l=c.target.color||h.p.defaultNodeColor;break;default:l=h.p.defaultEdgeColor}var n=j;switch(c.type||h.p.defaultEdgeType){case "curve":n.strokeStyle=
36
+ l;n.lineWidth=c.displaySize/3;n.beginPath();n.moveTo(d,g);n.quadraticCurveTo((d+o)/2+(i-g)/4,(g+i)/2+(d-o)/4,o,i);n.stroke();break;default:n.strokeStyle=l,n.lineWidth=c.displaySize/3,n.beginPath(),n.moveTo(d,g),n.lineTo(o,i),n.stroke()}}return h.currentEdgeIndex<b};this.task_drawNode=function(){for(var c=a.nodes.length,d=0;d++<h.p.nodesSpeed&&h.currentNodeIndex<c;)if(h.isOnScreen(a.nodes[h.currentNodeIndex])){var f=a.nodes[h.currentNodeIndex++],j=Math.round(10*f.displaySize)/10,g=b;g.fillStyle=f.color;
37
+ g.beginPath();g.arc(f.displayX,f.displayY,j,0,2*Math.PI,!0);g.closePath();g.fill();f.hover&&i(f)}else h.currentNodeIndex++;return h.currentNodeIndex<c};this.drawActiveNode=function(a){var b=c;if(!o(a))return h;var d="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*a.displaySize;b.font=(h.p.activeFontStyle||h.p.fontStyle||"")+" "+d+"px "+(h.p.activeFont||h.p.font||"");b.fillStyle="node"==h.p.labelHoverBGColor?a.color||h.p.defaultNodeColor:h.p.defaultActiveLabelBGColor;b.beginPath();h.p.labelActiveShadow&&
38
+ (b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=4,b.shadowColor=h.p.labelActiveShadowColor);sigma.tools.drawRoundRect(b,Math.round(a.displayX-d/2-2),Math.round(a.displayY-d/2-2),Math.round(b.measureText(a.label).width+1.5*a.displaySize+d/2+4),Math.round(d+4),Math.round(d/2+2),"left");b.closePath();b.fill();b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur=0;b.beginPath();b.fillStyle="node"==h.p.nodeBorderColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeBorderColor;b.arc(Math.round(a.displayX),
39
+ Math.round(a.displayY),a.displaySize+h.p.borderSize,0,2*Math.PI,!0);b.closePath();b.fill();b.beginPath();b.fillStyle="node"==h.p.nodeActiveColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeActiveColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize,0,2*Math.PI,!0);b.closePath();b.fill();b.fillStyle="node"==h.p.labelActiveColor?a.color||h.p.defaultNodeColor:h.p.defaultLabelActiveColor;b.fillText(a.label,Math.round(a.displayX+1.5*a.displaySize),Math.round(a.displayY+d/2-3));return h};
40
+ this.drawHoverNode=i;this.isOnScreen=o;this.resize=function(a,b){n=a;l=b;return h}}function F(b,g){function f(){sigma.chronos.removeTask("node_"+d.id,2).removeTask("edge_"+d.id,2).removeTask("label_"+d.id,2).stopTasks();return d}function c(a,b){d.domElements[a]=document.createElement(b);d.domElements[a].style.position="absolute";d.domElements[a].setAttribute("id","sigma_"+a+"_"+d.id);d.domElements[a].setAttribute("class","sigma_"+a+"_"+b);d.domElements[a].setAttribute("width",d.width+"px");d.domElements[a].setAttribute("height",
41
+ d.height+"px");d.domRoot.appendChild(d.domElements[a]);return d}function a(){d.p.drawHoverNodes&&(d.graph.checkHover(d.mousecaptor.mouseX,d.mousecaptor.mouseY),d.graph.nodes.forEach(function(a){a.hover&&!a.active&&d.plotter.drawHoverNode(a)}));return d}function D(){d.p.drawActiveNodes&&d.graph.nodes.forEach(function(a){a.active&&d.plotter.drawActiveNode(a)});return d}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var d=this;this.id=g.toString();this.p={auto:!0,drawNodes:2,
42
+ drawEdges:1,drawLabels:2,lastNodes:2,lastEdges:0,lastLabels:2,drawHoverNodes:!0,drawActiveNodes:!0};this.domRoot=b;this.width=this.domRoot.offsetWidth;this.height=this.domRoot.offsetHeight;this.graph=new i;this.domElements={};c("edges","canvas");c("nodes","canvas");c("labels","canvas");c("hover","canvas");c("monitor","div");c("mouse","canvas");this.plotter=new z(this.domElements.nodes.getContext("2d"),this.domElements.edges.getContext("2d"),this.domElements.labels.getContext("2d"),this.domElements.hover.getContext("2d"),
43
+ this.graph,this.width,this.height);this.monitor=new q(this,this.domElements.monitor);this.mousecaptor=new p(this.domElements.mouse,this.id);this.mousecaptor.bind("drag interpolate",function(){d.draw(d.p.auto?2:d.p.drawNodes,d.p.auto?0:d.p.drawEdges,d.p.auto?2:d.p.drawLabels,!0)}).bind("stopdrag stopinterpolate",function(){d.draw(d.p.auto?2:d.p.drawNodes,d.p.auto?1:d.p.drawEdges,d.p.auto?2:d.p.drawLabels,!0)}).bind("mousedown mouseup",function(a){var b=d.graph.nodes.filter(function(a){return!!a.hover}).map(function(a){return a.id});
44
+ d.dispatch("mousedown"==a.type?"downgraph":"upgraph");b.length&&d.dispatch("mousedown"==a.type?"downnodes":"upnodes",b)}).bind("move",function(){d.domElements.hover.getContext("2d").clearRect(0,0,d.domElements.hover.width,d.domElements.hover.height);a();D()});sigma.chronos.bind("startgenerators",function(){sigma.chronos.getGeneratorsIDs().some(function(a){return!!a.match(RegExp("_ext_"+d.id+"$",""))})&&d.draw(d.p.auto?2:d.p.drawNodes,d.p.auto?0:d.p.drawEdges,d.p.auto?2:d.p.drawLabels)}).bind("stopgenerators",
45
+ function(){d.draw()});for(var w=0;w<m.plugins.length;w++)m.plugins[w](this);this.draw=function(a,b,c,g){if(g&&sigma.chronos.getGeneratorsIDs().some(function(a){return!!a.match(RegExp("_ext_"+d.id+"$",""))}))return d;a=void 0==a?d.p.drawNodes:a;b=void 0==b?d.p.drawEdges:b;c=void 0==c?d.p.drawLabels:c;g={nodes:a,edges:b,labels:c};d.p.lastNodes=a;d.p.lastEdges=b;d.p.lastLabels=c;f();d.graph.rescale(d.width,d.height,0<a,0<b).setBorders();d.mousecaptor.checkBorders(d.graph.borders,d.width,d.height);d.graph.translate(d.mousecaptor.stageX,
46
+ d.mousecaptor.stageY,d.mousecaptor.ratio,0<a,0<b);d.dispatch("graphscaled");for(var j in d.domElements)"canvas"==d.domElements[j].nodeName.toLowerCase()&&(void 0==g[j]||0<=g[j])&&d.domElements[j].getContext("2d").clearRect(0,0,d.domElements[j].width,d.domElements[j].height);d.plotter.currentEdgeIndex=0;d.plotter.currentNodeIndex=0;d.plotter.currentLabelIndex=0;j=null;g=!1;if(a)if(1<a)for(;d.plotter.task_drawNode(););else sigma.chronos.addTask(d.plotter.task_drawNode,"node_"+d.id,!1),g=!0,j="node_"+
47
+ d.id;if(c)if(1<c)for(;d.plotter.task_drawLabel(););else j?sigma.chronos.queueTask(d.plotter.task_drawLabel,"label_"+d.id,j):sigma.chronos.addTask(d.plotter.task_drawLabel,"label_"+d.id,!1),g=!0,j="label_"+d.id;if(b)if(1<b)for(;d.plotter.task_drawEdge(););else j?sigma.chronos.queueTask(d.plotter.task_drawEdge,"edge_"+d.id,j):sigma.chronos.addTask(d.plotter.task_drawEdge,"edge_"+d.id,!1),g=!0,j="edge_"+d.id;d.dispatch("draw");d.refresh();g&&sigma.chronos.runTasks();return d};this.resize=function(a,
48
+ b){var c=d.width,f=d.height;void 0!=a&&void 0!=b?(d.width=a,d.height=b):(d.width=d.domRoot.offsetWidth,d.height=d.domRoot.offsetHeight);if(c!=d.width||f!=d.height){for(var j in d.domElements)d.domElements[j].setAttribute("width",d.width+"px"),d.domElements[j].setAttribute("height",d.height+"px");d.plotter.resize(d.width,d.height);d.draw(d.p.lastNodes,d.p.lastEdges,d.p.lastLabels,!0)}return d};this.refresh=function(){d.domElements.hover.getContext("2d").clearRect(0,0,d.domElements.hover.width,d.domElements.hover.height);
49
+ a();D();return d};this.drawHover=a;this.drawActive=D;this.clearSchedule=f;window.addEventListener("resize",function(){d.resize()})}function x(b){var j=this;sigma.classes.EventDispatcher.call(this);this._core=b;this.kill=function(){};this.getID=function(){return b.id};this.configProperties=function(f,c){var a=b.config(f,c);return a==b?j:a};this.drawingProperties=function(f,c){var a=b.plotter.config(f,c);return a==b.plotter?j:a};this.mouseProperties=function(f,c){var a=b.mousecaptor.config(f,c);return a==
50
+ b.mousecaptor?j:a};this.graphProperties=function(f,c){var a=b.graph.config(f,c);return a==b.graph?j:a};this.getMouse=function(){return{mouseX:b.mousecaptor.mouseX,mouseY:b.mousecaptor.mouseY,down:b.mousecaptor.isMouseDown}};this.position=function(f,c,a){if(0==arguments.length)return{stageX:b.mousecaptor.stageX,stageY:b.mousecaptor.stageY,ratio:b.mousecaptor.ratio};b.mousecaptor.stageX=void 0!=f?f:b.mousecaptor.stageX;b.mousecaptor.stageY=void 0!=c?c:b.mousecaptor.stageY;b.mousecaptor.ratio=void 0!=
51
+ a?a:b.mousecaptor.ratio;return j};this.goTo=function(f,c,a){b.mousecaptor.interpolate(f,c,a);return j};this.zoomTo=function(f,c,a){a=Math.min(Math.max(b.mousecaptor.config("minRatio"),a),b.mousecaptor.config("maxRatio"));a==b.mousecaptor.ratio?b.mousecaptor.interpolate(f-b.width/2+b.mousecaptor.stageX,c-b.height/2+b.mousecaptor.stageY):b.mousecaptor.interpolate((a*f-b.mousecaptor.ratio*b.width/2)/(a-b.mousecaptor.ratio),(a*c-b.mousecaptor.ratio*b.height/2)/(a-b.mousecaptor.ratio),a);return j};this.resize=
52
+ function(f,c){b.resize(f,c);return j};this.draw=function(f,c,a,g){b.draw(f,c,a,g);return j};this.refresh=function(){b.refresh();return j};this.addGenerator=function(f,c,a){sigma.chronos.addGenerator(f+"_ext_"+b.id,c,a);return j};this.removeGenerator=function(f){sigma.chronos.removeGenerator(f+"_ext_"+b.id);return j};this.addNode=function(f,c){b.graph.addNode(f,c);return j};this.addEdge=function(f,c,a,g){b.graph.addEdge(f,c,a,g);return j};this.dropNode=function(f){b.graph.dropNode(f);return j};this.dropEdge=
53
+ function(f){b.graph.dropEdge(f);return j};this.pushGraph=function(f,c){f.nodes&&f.nodes.forEach(function(a){a.id&&(!c||!b.graph.nodesIndex[a.id])&&j.addNode(a.id,a)});f.edges&&f.edges.forEach(function(a){(validID=a.source&&a.target&&a.id)&&(!c||!b.graph.edgesIndex[a.id])&&j.addNode(a.id,a.source,a.target,a)});return j};this.emptyGraph=function(){b.graph.empty();return j};this.getNodesCount=function(){return b.graph.nodes.length};this.getEdgesCount=function(){return b.graph.edges.length};this.iterNodes=
54
+ function(f,c){b.graph.iterNodes(f,c);return j};this.iterEdges=function(f,c){b.graph.iterEdges(f,c);return j};this.getNodes=function(f){return b.graph.getNodes(f)};this.getEdges=function(f){return b.graph.getEdges(f)};this.activateMonitoring=function(){return b.monitor.activate()};this.desactivateMonitoring=function(){return b.monitor.desactivate()};b.bind("downnodes upnodes downgraph upgraph",function(b){j.dispatch(b.type,b.content)});b.graph.bind("overnodes outnodes",function(b){j.dispatch(b.type,
55
+ b.content)})}var k=0,m={plugins:[]};sigma.init=function(b){b=new F(b,(++k).toString());sigma.instances[k]=new x(b);return sigma.instances[k]};sigma.addPlugin=function(b,g,f){x.prototype[b]=g;m.plugins.push(f)};sigma.chronos=new function(){function b(a){window.setTimeout(a,0);return h}function g(){for(h.dispatch("frameinserted");n&&v.length&&f(););!n||!v.length?a():(B=(new Date).getTime(),m++,z=u-p,q=p-z,h.dispatch("insertframe"),b(g))}function f(){C%=v.length;if(!v[C].task()){var a=v[C].taskName;
56
+ y=y.filter(function(b){b.taskParent==a&&v.push({taskName:b.taskName,task:b.task});return b.taskParent!=a});h.dispatch("killed",v.splice(C--,1)[0])}C++;u=(new Date).getTime()-B;return u<=q}function c(){n=!0;m=C=0;x=B=(new Date).getTime();h.dispatch("start");h.dispatch("insertframe");b(g);return h}function a(){h.dispatch("stop");n=!1;return h}function i(a,b,d){if("function"!=typeof a)throw Error('Task "'+b+'" is not a function');v.push({taskName:b,task:a});n=!(!n&&!(d&&c()||1));return h}function d(a){return a?
57
+ Object.keys(r).filter(function(a){return!!r[a].on}).length:Object.keys(r).length}function w(){Object.keys(r).length?(h.dispatch("startgenerators"),h.unbind("killed",o),b(function(){for(var a in r)r[a].on=!0,i(r[a].task,a,!1)}),h.bind("killed",o).runTasks()):h.dispatch("stopgenerators");return h}function o(a){void 0!=r[a.content.taskName]&&(r[a.content.taskName].del||!r[a.content.taskName].condition()?delete r[a.content.taskName]:r[a.content.taskName].on=!1,0==d(!0)&&w())}sigma.classes.EventDispatcher.call(this);
58
+ var h=this,n=!1,l=80,k=0,m=0,p=1E3/l,q=p,u=0,x=0,B=0,z=0,r={},v=[],y=[],C=0;this.frequency=function(a){return void 0!=a?(l=Math.abs(1*a),p=1E3/l,m=0,h):l};this.runTasks=c;this.stopTasks=a;this.insertFrame=b;this.addTask=i;this.queueTask=function(a,b,c){if("function"!=typeof a)throw Error('Task "'+b+'" is not a function');if(!v.concat(y).some(function(a){return a.taskName==c}))throw Error('Parent task "'+c+'" of "'+b+'" is not attached.');y.push({taskParent:c,taskName:b,task:a});return h};this.removeTask=
59
+ function(b,c){if(void 0==b)v=[],1==c?y=[]:2==c&&(v=y,y=[]),a();else{var d="string"==typeof b?b:"";v=v.filter(function(a){return("string"==typeof b?a.taskName==b:a.task==b)?(d=a.taskName,!1):!0});0<c&&(y=y.filter(function(a){1==c&&a.taskParent==d&&v.push(a);return a.taskParent!=d}))}n=!(v.length&&(!a()||1));return h};this.addGenerator=function(a,b,c){if(void 0!=r[a])return h;r[a]={task:b,condition:c};0==d(!0)&&w();return h};this.removeGenerator=function(a){r[a]&&(r[a].on=!1,r[a].del=!0);return h};
60
+ this.startGenerators=w;this.getGeneratorsIDs=function(){return Object.keys(r)};this.getFPS=function(){n&&(k=Math.round(1E4*(m/((new Date).getTime()-x)))/10);return k};this.getTasksCount=function(){return v.length};this.getQueuedTasksCount=function(){return y.length};this.getExecutionTime=function(){return B-x};return this};sigma.debugMode=0;sigma.log=function(){if(1==sigma.debugMode)for(var b in arguments)console.log(arguments[b]);else if(1<sigma.debugMode)for(b in arguments)throw Error(arguments[b]);
61
+ return sigma};sigma.easing={linear:{},quadratic:{}};sigma.easing.linear.easenone=function(b){return b};sigma.easing.quadratic.easein=function(b){return b*b};sigma.easing.quadratic.easeout=function(b){return-b*(b-2)};sigma.easing.quadratic.easeinout=function(b){return 1>(b*=2)?0.5*b*b:-0.5*(--b*(b-2)-1)};sigma.tools.drawRoundRect=function(b,g,f,c,a,i,d){var i=i?i:0,k=d?d:[],k="string"==typeof k?k.split(" "):k,d=i&&(0<=k.indexOf("topleft")||0<=k.indexOf("top")||0<=k.indexOf("left")),m=i&&(0<=k.indexOf("topright")||
62
+ 0<=k.indexOf("top")||0<=k.indexOf("right")),h=i&&(0<=k.indexOf("bottomleft")||0<=k.indexOf("bottom")||0<=k.indexOf("left")),k=i&&(0<=k.indexOf("bottomright")||0<=k.indexOf("bottom")||0<=k.indexOf("right"));b.moveTo(g,f+i);d?b.arcTo(g,f,g+i,f,i):b.lineTo(g,f);m?(b.lineTo(g+c-i,f),b.arcTo(g+c,f,g+c,f+i,i)):b.lineTo(g+c,f);k?(b.lineTo(g+c,f+a-i),b.arcTo(g+c,f+a,g+c-i,f+a,i)):b.lineTo(g+c,f+a);h?(b.lineTo(g+i,f+a),b.arcTo(g,f+a,g,f+a-i,i)):b.lineTo(g,f+a);b.lineTo(g,f+i)};sigma.tools.getRGB=function(b,
63
+ g){var b=b.toString(),f={r:0,g:0,b:0};if(3<=b.length&&"#"==b.charAt(0)){var c=b.length-1;6==c?f={r:parseInt(b.charAt(1)+b.charAt(2),16),g:parseInt(b.charAt(3)+b.charAt(4),16),b:parseInt(b.charAt(5)+b.charAt(5),16)}:3==c&&(f={r:parseInt(b.charAt(1)+b.charAt(1),16),g:parseInt(b.charAt(2)+b.charAt(2),16),b:parseInt(b.charAt(3)+b.charAt(3),16)})}g&&(f=[f.r,f.g,f.b]);return f};sigma.tools.rgbToHex=function(b,g,f){return sigma.tools.toHex(b)+sigma.tools.toHex(g)+sigma.tools.toHex(f)};sigma.tools.toHex=
64
+ function(b){b=parseInt(b,10);if(isNaN(b))return"00";b=Math.max(0,Math.min(b,255));return"0123456789ABCDEF".charAt((b-b%16)/16)+"0123456789ABCDEF".charAt(b%16)};sigma.publicPrototype=x.prototype})();
js/sigma/sigma.parseGexf.js ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Mathieu Jacomy @ Sciences Po M�dialab & WebAtlas
2
+ // (requires sigma.js to be loaded)
3
+ sigma.publicPrototype.parseGexf = function(gexfPath,callback) {
4
+ // Load XML file:
5
+ var gexfhttp, gexf;
6
+ var sigmaInstance = this;
7
+ gexfhttp = window.XMLHttpRequest ?
8
+ new XMLHttpRequest() :
9
+ new ActiveXObject('Microsoft.XMLHTTP');
10
+
11
+ gexfhttp.overrideMimeType('text/xml');
12
+ gexfhttp.open('GET', gexfPath, false);
13
+ gexfhttp.send();
14
+ gexf = gexfhttp.responseXML;
15
+
16
+ var viz='http://www.gexf.net/1.2draft/viz'; // Vis namespace
17
+ var i, j, k;
18
+
19
+ // Parse Attributes
20
+ // This is confusing, so I'll comment heavily
21
+ var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json
22
+ var nodesAttributesDict = {};
23
+ var edgesAttributes = []; // The list of attributes of the edges of the graph that we build in json
24
+ var edgesAttributesDict = {};
25
+ var attributesNodes = gexf.getElementsByTagName('attributes'); // In the gexf (that is an xml), the list of xml nodes 'attributes' (note the plural 's')
26
+
27
+ for(i = 0; i<attributesNodes.length; i++){
28
+ var attributesNode = attributesNodes[i]; // attributesNode is each xml node 'attributes' (plural)
29
+ if(attributesNode.getAttribute('class') == 'node'){
30
+ var attributeNodes = attributesNode.getElementsByTagName('attribute'); // The list of xml nodes 'attribute' (no 's')
31
+ for(j = 0; j<attributeNodes.length; j++){
32
+ var attributeNode = attributeNodes[j]; // Each xml node 'attribute'
33
+
34
+ var id = attributeNode.getAttribute('id'),
35
+ title = attributeNode.getAttribute('title'),
36
+ type = attributeNode.getAttribute('type');
37
+
38
+ var attribute = {id:id, title:title, type:type};
39
+ nodesAttributes.push(attribute);
40
+ nodesAttributesDict[id] = title
41
+
42
+ }
43
+ } else if(attributesNode.getAttribute('class') == 'edge'){
44
+ var attributeNodes = attributesNode.getElementsByTagName('attribute'); // The list of xml nodes 'attribute' (no 's')
45
+ for(j = 0; j<attributeNodes.length; j++){
46
+ var attributeNode = attributeNodes[j]; // Each xml node 'attribute'
47
+
48
+ var id = attributeNode.getAttribute('id'),
49
+ title = attributeNode.getAttribute('title'),
50
+ type = attributeNode.getAttribute('type');
51
+
52
+ var attribute = {id:id, title:title, type:type};
53
+ edgesAttributes.push(attribute);
54
+ edgesAttributesDict[id] = title
55
+
56
+ }
57
+ }
58
+ }
59
+
60
+ var nodes = []; // The nodes of the graph
61
+ var nodesNodes = gexf.getElementsByTagName('nodes') // The list of xml nodes 'nodes' (plural)
62
+
63
+ for(i=0; i<nodesNodes.length; i++){
64
+ var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural)
65
+ var nodeNodes = nodesNode.getElementsByTagName('node'); // The list of xml nodes 'node' (no 's')
66
+
67
+ for(j=0; j<nodeNodes.length; j++){
68
+ var nodeNode = nodeNodes[j]; // Each xml node 'node' (no 's')
69
+
70
+ window.NODE = nodeNode;
71
+
72
+ var id = nodeNode.getAttribute('id');
73
+ var label = nodeNode.getAttribute('label') || id;
74
+
75
+ //viz
76
+ var size = 1;
77
+ var x = 100 - 200*Math.random();
78
+ var y = 100 - 200*Math.random();
79
+ var color;
80
+
81
+ var sizeNodes = nodeNode.getElementsByTagName('size');
82
+ sizeNodes = sizeNodes.length ?
83
+ sizeNodes :
84
+ nodeNode.getElementsByTagNameNS('*','size');
85
+ if(sizeNodes.length>0){
86
+ sizeNode = sizeNodes[0];
87
+ size = parseFloat(sizeNode.getAttribute('value'));
88
+ }
89
+
90
+ var positionNodes = nodeNode.getElementsByTagName('position');
91
+ positionNodes = positionNodes.length ?
92
+ positionNodes :
93
+ nodeNode.getElementsByTagNameNS('*','position');
94
+ if(positionNodes.length>0){
95
+ var positionNode = positionNodes[0];
96
+ x = parseFloat(positionNode.getAttribute('x'));
97
+ y = parseFloat(positionNode.getAttribute('y'));
98
+ }
99
+
100
+
101
+ var colorNodes = nodeNode.getElementsByTagName('color');
102
+ colorNodes = colorNodes.length ?
103
+ colorNodes :
104
+ nodeNode.getElementsByTagNameNS('*','color');
105
+ if(colorNodes.length>0){
106
+ colorNode = colorNodes[0];
107
+ color = '#'+sigma.tools.rgbToHex(parseFloat(colorNode.getAttribute('r')),
108
+ parseFloat(colorNode.getAttribute('g')),
109
+ parseFloat(colorNode.getAttribute('b')));
110
+ }
111
+
112
+ var colorsProcessed = {};
113
+ if (nodeJSON.colors) {
114
+ for (var key in nodeJSON.colors) {
115
+ if (nodeJSON.colors.hasOwnProperty(key)) {
116
+ // Get the rgb string for this property, e.g., "rgb(198,116,255)"
117
+ var rgbStr = nodeJSON.colors[key];
118
+ // Remove "rgb(" and ")" then split by comma to extract r, g, b values
119
+ var rgbArr = rgbStr.replace(/rgb\(|\)/g, '').split(',');
120
+ var r_val = parseInt(rgbArr[0].trim(), 10);
121
+ var g_val = parseInt(rgbArr[1].trim(), 10);
122
+ var b_val = parseInt(rgbArr[2].trim(), 10);
123
+ // Convert to hex and store under the corresponding key
124
+ colorsProcessed[key] = '#' + sigma.tools.rgbToHex(r_val, g_val, b_val);
125
+ }
126
+ }
127
+ }
128
+
129
+ // Create Node
130
+ var node = {label:label, size:size, x:x, y:y, attributes:{}, color:color, colors: colorsProcessed}; // The graph node
131
+
132
+ // Attribute values
133
+ var attvalueNodes = nodeNode.getElementsByTagName('attvalue');
134
+ for(k=0; k<attvalueNodes.length; k++){
135
+ var attvalueNode = attvalueNodes[k];
136
+ var attr = attvalueNode.getAttribute('for');
137
+ var val = attvalueNode.getAttribute('value');
138
+ node.attributes[nodesAttributesDict[attr]] = val;
139
+ }
140
+
141
+ sigmaInstance.addNode(id,node);
142
+ }
143
+ }
144
+
145
+ var edges = [];
146
+ var edgeId = 0;
147
+ var edgesNodes = gexf.getElementsByTagName('edges');
148
+ for(i=0; i<edgesNodes.length; i++){
149
+ var edgesNode = edgesNodes[i];
150
+ var edgeNodes = edgesNode.getElementsByTagName('edge');
151
+ for(j=0; j<edgeNodes.length; j++){
152
+ var edgeNode = edgeNodes[j];
153
+ var source = edgeNode.getAttribute('source');
154
+ var target = edgeNode.getAttribute('target');
155
+ var label = edgeNode.getAttribute('label');
156
+ var edge = {
157
+ id: j,
158
+ source: source,
159
+ target: target,
160
+ label: label,
161
+ attributes: {}
162
+ };
163
+
164
+ var attrs = edgeNode.attributes;
165
+ for(var i=0;i<attrs.length;i++) {
166
+ var n = attrs[i].name;
167
+ if(n == 'source' || n =='target' || n=='label')
168
+ continue;
169
+ edge.attributes[n]=attrs[i].value;
170
+ }
171
+
172
+ var attvalueNodes = edgeNode.getElementsByTagName('attvalue');
173
+ for(k=0; k<attvalueNodes.length; k++){
174
+ var attvalueNode = attvalueNodes[k];
175
+ var attr = attvalueNode.getAttribute('for');
176
+ var val = attvalueNode.getAttribute('value');
177
+ edge.attributes[edgesAttributesDict[attr]] = val;
178
+ }
179
+
180
+ sigmaInstance.addEdge(edgeId++,source,target,edge);
181
+ }
182
+ }
183
+ if (callback) callback.call(this);//Trigger the data ready function
184
+ };
js/sigma/sigma.parseJson.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Scott Hale (Oxford Internet Institute)
2
+ // Requires sigma.js and jquery to be loaded
3
+ // based on parseGexf from Mathieu Jacomy @ Sciences Po M�dialab & WebAtlas
4
+
5
+ sigma.publicPrototype.parseJson = function(jsonPath,callback) {
6
+ var sigmaInstance = this;
7
+ jQuery.getJSON(jsonPath, function(data) {
8
+ for (i=0; i<data.nodes.length; i++){
9
+ var id=data.nodes[i].id;
10
+ //window.NODE = data.nodes[i];//In the original, but not sure purpose
11
+ sigmaInstance.addNode(id,data.nodes[i]);
12
+ }
13
+
14
+ for(j=0; j<data.edges.length; j++){
15
+ var edgeNode = data.edges[j];
16
+
17
+ var source = edgeNode.source;
18
+ var target = edgeNode.target;
19
+ var label = edgeNode.label;
20
+ var eid = edgeNode.id;
21
+
22
+ sigmaInstance.addEdge(eid,source,target,edgeNode);
23
+ }
24
+
25
+ if (callback) callback.call(this);//Trigger the data ready function
26
+
27
+ });//end jquery getJSON function
28
+ };//end sigma.parseJson function
large_nlp_data.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c379344784a26dc6e92ddb9361fb8d714ccda59f7928be1c608ec7ebf0435048
3
+ size 287111586
modalities_data.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39a3bc35188ac15bcdf299a7c6cf5c42977a8cd734b2c93b82af238776ed0ff4
3
+ size 39897257
web.config ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <configuration>
2
+
3
+ <system.webServer>
4
+
5
+ <staticContent>
6
+ <mimeMap fileExtension=".json" mimeType="application/json" />
7
+ <mimeMap fileExtension=".gexf" mimeType="text/xml" />
8
+ </staticContent>
9
+
10
+ </system.webServer>
11
+
12
+ </configuration>