Compare commits
963 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44b3ce7082 | ||
|
|
09e0f4e36c | ||
|
|
9999332107 | ||
|
|
d4ec7e5357 | ||
|
|
064b3caf08 | ||
|
|
c83d2e9513 | ||
|
|
48ff516215 | ||
|
|
cdccbb59ab | ||
|
|
2fe5a863ac | ||
|
|
7d1fccf474 | ||
|
|
0a8dbc8831 | ||
|
|
177a3c2cbd | ||
|
|
9f22e634f5 | ||
|
|
55a8c7b540 | ||
|
|
76c11fe65a | ||
|
|
b15ed00feb | ||
|
|
fc3ff34c2d | ||
|
|
5faa0f55bc | ||
|
|
77f0731c3e | ||
|
|
ffff623852 | ||
|
|
a6bc40b506 | ||
|
|
a034515019 | ||
|
|
49c8f23bf7 | ||
|
|
29b7a71812 | ||
|
|
8de3283dd1 | ||
|
|
4bbe5b3358 | ||
|
|
3dd3af4a73 | ||
|
|
7e7b129822 | ||
|
|
8bcc1d81d2 | ||
|
|
aa8e92e9a5 | ||
|
|
a8196ec99e | ||
|
|
bd3034819e | ||
|
|
7bb86c4e2a | ||
|
|
94ed21d1cf | ||
|
|
1bb7c31ee4 | ||
|
|
06d12b376c | ||
|
|
e9c8137fd8 | ||
|
|
eaaddf40d2 | ||
|
|
3e0c565019 | ||
|
|
984603112f | ||
|
|
fe29246256 | ||
|
|
84d0664112 | ||
|
|
3d3c59cea6 | ||
|
|
7940428b9b | ||
|
|
2e485b9ac5 | ||
|
|
b76aa926f6 | ||
|
|
58d81546da | ||
|
|
7a480990c6 | ||
|
|
afb10efd83 | ||
|
|
e2f05e137f | ||
|
|
d72ade9c70 | ||
|
|
64650fcdee | ||
|
|
e1acb7df13 | ||
|
|
319a30cf3a | ||
|
|
e631f1b313 | ||
|
|
617f31b47f | ||
|
|
61e9aac92d | ||
|
|
75812804f4 | ||
|
|
b60f36f211 | ||
|
|
e342c878d0 | ||
|
|
c6b3cadf55 | ||
|
|
869a361d09 | ||
|
|
f83119e188 | ||
|
|
578c4b444c | ||
|
|
d63f9be03f | ||
|
|
62fe02415a | ||
|
|
481970c763 | ||
|
|
7c8dc66ba1 | ||
|
|
20ffbf5a82 | ||
|
|
2b6f26b214 | ||
|
|
d743ec2d2b | ||
|
|
dfab332285 | ||
|
|
bbbce8a981 | ||
|
|
0dc4ccb42f | ||
|
|
b46c2c2527 | ||
|
|
3b128f844b | ||
|
|
d38b3d09ba | ||
|
|
d35c5ffa04 | ||
|
|
eb7243233e | ||
|
|
21bf629505 | ||
|
|
702022001d | ||
|
|
d9549ad634 | ||
|
|
daf91dbf95 | ||
|
|
2bc19120d9 | ||
|
|
8ddfa8cd68 | ||
|
|
076d10358e | ||
|
|
5930983641 | ||
|
|
a0c5cb51aa | ||
|
|
8e659745fd | ||
|
|
87297d2a07 | ||
|
|
8f23611f1a | ||
|
|
e2affb0f38 | ||
|
|
26e6041b7a | ||
|
|
81707a45d5 | ||
|
|
805f2b28a9 | ||
|
|
22aa02895e | ||
|
|
6bb89778b2 | ||
|
|
6631b9e78f | ||
|
|
7f7d5b32da | ||
|
|
52def444ab | ||
|
|
7d52ab7c54 | ||
|
|
852b324819 | ||
|
|
e019441ede | ||
|
|
ac8f8d0dd6 | ||
|
|
3fa2e7e12e | ||
|
|
5d099491df | ||
|
|
d7ca0f7734 | ||
|
|
5d31338b02 | ||
|
|
a44b81d240 | ||
|
|
742e499de0 | ||
|
|
eb395d6d2d | ||
|
|
a1383c34b5 | ||
|
|
e538da3959 | ||
|
|
687a072dc8 | ||
|
|
5dc9881241 | ||
|
|
0b3a7e2f0f | ||
|
|
123455a5bb | ||
|
|
34c8d8dd2e | ||
|
|
3f4c92d739 | ||
|
|
eb10245df1 | ||
|
|
2dbfcbb378 | ||
|
|
a717f5c030 | ||
|
|
3a711790c5 | ||
|
|
5d77cb0396 | ||
|
|
9972ea578b | ||
|
|
0bb3762397 | ||
|
|
fbd6e21152 | ||
|
|
bea62537df | ||
|
|
fdbe4c5bd5 | ||
|
|
91e779a52c | ||
|
|
e2c5e92cd3 | ||
|
|
5929676ea2 | ||
|
|
36e180ab91 | ||
|
|
1e8fe22553 | ||
|
|
8e1bd2d8f3 | ||
|
|
239ce262ef | ||
|
|
5be66e98c2 | ||
|
|
cacd072c15 | ||
|
|
14c6a1bf23 | ||
|
|
b27dfd4c77 | ||
|
|
4622e9658d | ||
|
|
f8bda517c3 | ||
|
|
de3d9fdb8b | ||
|
|
c6291bea52 | ||
|
|
a266e3c898 | ||
|
|
f9c34d6808 | ||
|
|
10a91cac2f | ||
|
|
f7e25e9c63 | ||
|
|
5f821a58a3 | ||
|
|
4a2ad4e6f9 | ||
|
|
4a2bbb52c1 | ||
|
|
ed401199bd | ||
|
|
eee3a263f5 | ||
|
|
eca1d9aabd | ||
|
|
33ff9cfbb6 | ||
|
|
de8e6d7174 | ||
|
|
cd9332cddf | ||
|
|
fb4a861c0d | ||
|
|
c30460df4c | ||
|
|
31e86a36f8 | ||
|
|
0b4fe85b33 | ||
|
|
99e7a1705a | ||
|
|
27c6259b53 | ||
|
|
1ecae14bae | ||
|
|
c56a09f318 | ||
|
|
ffec2699ea | ||
|
|
46faf0280c | ||
|
|
3b774ed507 | ||
|
|
9c62bbbc05 | ||
|
|
dc6b1ef47b | ||
|
|
1f8e1d2a29 | ||
|
|
b30a948601 | ||
|
|
e90568e044 | ||
|
|
c74b5ba3a2 | ||
|
|
2085d6afad | ||
|
|
8bfdbd0fed | ||
|
|
cc3dc6aff0 | ||
|
|
d01284d147 | ||
|
|
7b7d5118d6 | ||
|
|
a03a7dcb4a | ||
|
|
dfae413afc | ||
|
|
253642a85e | ||
|
|
ce64c8e7d1 | ||
|
|
d7ae0105c3 | ||
|
|
e7320e7bd3 | ||
|
|
a214565803 | ||
|
|
61f1290bea | ||
|
|
ba5e512d10 | ||
|
|
624e4bca40 | ||
|
|
613237727d | ||
|
|
fd2ddca6f2 | ||
|
|
e114c18031 | ||
|
|
49e22742de | ||
|
|
422d7942ef | ||
|
|
a63e7162bc | ||
|
|
1f973b72b8 | ||
|
|
d3dd97f167 | ||
|
|
f0f17e0041 | ||
|
|
d6fa8bf233 | ||
|
|
ec5e685a1c | ||
|
|
c88b95751c | ||
|
|
72ae25bc53 | ||
|
|
02e5cc1da8 | ||
|
|
3d092df56d | ||
|
|
912d5c700c | ||
|
|
6d3c492518 | ||
|
|
5e29e3f1cb | ||
|
|
0558495760 | ||
|
|
0471dfa2f8 | ||
|
|
7883e6544e | ||
|
|
6da87e4a79 | ||
|
|
bafe4fff93 | ||
|
|
da782398a2 | ||
|
|
4b26b46f6a | ||
|
|
0f1e69a2df | ||
|
|
85f2bd464c | ||
|
|
8a4956b736 | ||
|
|
4a369af4c7 | ||
|
|
9749305ecd | ||
|
|
639178dbdc | ||
|
|
62d038b547 | ||
|
|
9b80e3a33b | ||
|
|
0ea54f0458 | ||
|
|
374c52f71f | ||
|
|
60f63e125a | ||
|
|
7cfa7f3de4 | ||
|
|
92409831c2 | ||
|
|
e04790a628 | ||
|
|
cd7bf40508 | ||
|
|
dc378e9ce7 | ||
|
|
5fcdcec1a8 | ||
|
|
8773704c8b | ||
|
|
291fd1857e | ||
|
|
0aa4aeaddc | ||
|
|
ca81f1b2e8 | ||
|
|
fca3a14410 | ||
|
|
d105e80ed8 | ||
|
|
ce63faa597 | ||
|
|
25c1b63a00 | ||
|
|
548728abba | ||
|
|
2ebdbd565a | ||
|
|
86376616ff | ||
|
|
7c6865f948 | ||
|
|
c2da0070f5 | ||
|
|
bf2a2aed66 | ||
|
|
403ea0a0e1 | ||
|
|
27976cbe1a | ||
|
|
70147396a4 | ||
|
|
d6aed16e7c | ||
|
|
0414bae820 | ||
|
|
620866bc39 | ||
|
|
55f080e33f | ||
|
|
9f2b1b03d7 | ||
|
|
c0a0f3aaf5 | ||
|
|
7726b5c56b | ||
|
|
3daff8ab8a | ||
|
|
428c2097c7 | ||
|
|
7786583ecf | ||
|
|
9b79ea7d30 | ||
|
|
3dc8436362 | ||
|
|
9f1f2a4845 | ||
|
|
40204e8133 | ||
|
|
133b1067c5 | ||
|
|
5c8287203e | ||
|
|
061bbb1914 | ||
|
|
572168ef20 | ||
|
|
1aa27f2da3 | ||
|
|
be76614c90 | ||
|
|
e26d355fb7 | ||
|
|
d8dbcef5dd | ||
|
|
5d6a6590bf | ||
|
|
7dfdfe5b50 | ||
|
|
36fcc460f4 | ||
|
|
24b03d42d6 | ||
|
|
60275d3637 | ||
|
|
9b5b471802 | ||
|
|
1edb96f526 | ||
|
|
f949bdcfe4 | ||
|
|
21a45a940e | ||
|
|
fb61dfd39d | ||
|
|
9b5940505b | ||
|
|
8c07a67fe9 | ||
|
|
0f9687ce62 | ||
|
|
1460e46d1f | ||
|
|
692521c49d | ||
|
|
2f1d8cc196 | ||
|
|
eeabb47fb6 | ||
|
|
e078f584eb | ||
|
|
f86322545a | ||
|
|
720e19a01f | ||
|
|
3560fed86e | ||
|
|
5f8f5a9f85 | ||
|
|
1aae24b831 | ||
|
|
b544b1c3d4 | ||
|
|
f462f87183 | ||
|
|
6ed7ef25b2 | ||
|
|
bc79d09f2d | ||
|
|
5b2becb87f | ||
|
|
cd808fb5a5 | ||
|
|
c8a4e40bcf | ||
|
|
911b6c9679 | ||
|
|
03041f87c3 | ||
|
|
360c53d6ca | ||
|
|
3f1d555c71 | ||
|
|
ae1d72265c | ||
|
|
9570c65d88 | ||
|
|
3e0b04509a | ||
|
|
0884379e0b | ||
|
|
ec16532028 | ||
|
|
c8f13544a8 | ||
|
|
44bfe55413 | ||
|
|
b95c1adc86 | ||
|
|
b3a94c26d9 | ||
|
|
159c7238a8 | ||
|
|
70f40bab1d | ||
|
|
6c1a9dc14b | ||
|
|
816381a6a8 | ||
|
|
dd84bca638 | ||
|
|
a5d2019a39 | ||
|
|
26cee564c9 | ||
|
|
316b8a1375 | ||
|
|
618b25df08 | ||
|
|
8f9c4cd217 | ||
|
|
c6e2e33e87 | ||
|
|
db605ea7ca | ||
|
|
a1507d4844 | ||
|
|
c6340a64fe | ||
|
|
265b440c37 | ||
|
|
ea8e6d978d | ||
|
|
c3f5bc6bfb | ||
|
|
e322f6dbe2 | ||
|
|
83059a013c | ||
|
|
e374392450 | ||
|
|
72d505b2f1 | ||
|
|
a11bff0c7b | ||
|
|
a820ee4c82 | ||
|
|
a18be78bd3 | ||
|
|
83b5806cec | ||
|
|
4d7a1199ea | ||
|
|
d47cac563a | ||
|
|
2969290c63 | ||
|
|
277557cd99 | ||
|
|
21db7d438b | ||
|
|
61ff2da15c | ||
|
|
ad8296a535 | ||
|
|
aec3318f4c | ||
|
|
3297c3a2e2 | ||
|
|
84759de36f | ||
|
|
a562126f2f | ||
|
|
1901134601 | ||
|
|
eecb6986ee | ||
|
|
508cada017 | ||
|
|
2abae2f21a | ||
|
|
82c17dbde2 | ||
|
|
425499b3aa | ||
|
|
96605766bb | ||
|
|
161012b0a7 | ||
|
|
0669a053db | ||
|
|
ab66e77740 | ||
|
|
381cd53551 | ||
|
|
1f0e92a752 | ||
|
|
98b3496717 | ||
|
|
4200e2e4e4 | ||
|
|
e239ae1aba | ||
|
|
2acfc307b7 | ||
|
|
186f1cf714 | ||
|
|
a5cf42b7c8 | ||
|
|
fd7dba8860 | ||
|
|
32d7e365d2 | ||
|
|
1078cc1c91 | ||
|
|
c97fc370cd | ||
|
|
fca8da118e | ||
|
|
dda56405e6 | ||
|
|
f0f23d491c | ||
|
|
44c10d720a | ||
|
|
690e5a7f9c | ||
|
|
e4fdbc3cb4 | ||
|
|
fe2b86ba83 | ||
|
|
8fb9557520 | ||
|
|
25c91b398a | ||
|
|
8a524dd98f | ||
|
|
7371f8927c | ||
|
|
3d4f58d564 | ||
|
|
f0e32c88ec | ||
|
|
5ae3eccaf1 | ||
|
|
093f12254f | ||
|
|
3a8afe2969 | ||
|
|
fff5ae97f2 | ||
|
|
3c626e3ea5 | ||
|
|
26f57141a1 | ||
|
|
419aa9dcba | ||
|
|
3f15456b9c | ||
|
|
f67a2fa865 | ||
|
|
0f6de542bf | ||
|
|
1a529841e0 | ||
|
|
a9bf6a0e3b | ||
|
|
76dcd7d96e | ||
|
|
6aa1361b1a | ||
|
|
f623a4ecef | ||
|
|
aa465a12aa | ||
|
|
81ba623423 | ||
|
|
4f6f6cca0f | ||
|
|
56346f2a52 | ||
|
|
edcd3f5145 | ||
|
|
7acd3d5297 | ||
|
|
1732c16778 | ||
|
|
913d440c61 | ||
|
|
8cdb4d48f2 | ||
|
|
907ac05c00 | ||
|
|
067558529c | ||
|
|
c97e653ba1 | ||
|
|
9a935ba90c | ||
|
|
134ed51517 | ||
|
|
993dd84af9 | ||
|
|
28e3ab73fa | ||
|
|
70a5efa1d6 | ||
|
|
a51a355a53 | ||
|
|
fdd0a33571 | ||
|
|
6547d03b91 | ||
|
|
cc0c2f1b3c | ||
|
|
c80c59c692 | ||
|
|
10de191dd5 | ||
|
|
1626cec089 | ||
|
|
0404776d87 | ||
|
|
4398fca1bd | ||
|
|
e94ca12f9f | ||
|
|
036c2f6a1c | ||
|
|
611304e257 | ||
|
|
cf26447f7c | ||
|
|
e5b8e04dde | ||
|
|
bb201e6ca4 | ||
|
|
bb58d633c0 | ||
|
|
56ff8755d4 | ||
|
|
57fc027f77 | ||
|
|
bdb7c226f1 | ||
|
|
17e32017a7 | ||
|
|
2c772d0f4c | ||
|
|
769ff84a65 | ||
|
|
fd1fbd4843 | ||
|
|
eaa9430e26 | ||
|
|
2e5de88445 | ||
|
|
b4b9910203 | ||
|
|
afeeadd665 | ||
|
|
fcbeb10159 | ||
|
|
65227f601e | ||
|
|
56ae4dcd12 | ||
|
|
2b2c8e6b82 | ||
|
|
49c032315c | ||
|
|
15109f801e | ||
|
|
3de0a16a9d | ||
|
|
bb49b0c16a | ||
|
|
9561414985 | ||
|
|
db7354ab72 | ||
|
|
34396dbbec | ||
|
|
d842a2f62e | ||
|
|
a17c32bed0 | ||
|
|
fab0b91a79 | ||
|
|
88974d552d | ||
|
|
b90a38ce8b | ||
|
|
b3df27c362 | ||
|
|
854ea26ab7 | ||
|
|
e385b3499b | ||
|
|
77d323b38c | ||
|
|
64eeb091b8 | ||
|
|
65f5f8e8e2 | ||
|
|
6b3ee1aaaf | ||
|
|
27ca48c6bb | ||
|
|
2786c776e3 | ||
|
|
23cd5b906b | ||
|
|
0f9d20129d | ||
|
|
4649bd3906 | ||
|
|
3048ac2f6d | ||
|
|
8679377fcf | ||
|
|
db5264af3c | ||
|
|
059fbb9e5d | ||
|
|
01303c1e31 | ||
|
|
a8aaa793a0 | ||
|
|
c5698e82da | ||
|
|
ec12f7a5e7 | ||
|
|
b87fec554f | ||
|
|
740981376d | ||
|
|
8694364aa3 | ||
|
|
f1b1fee6e4 | ||
|
|
915596b23e | ||
|
|
6d65cb77ec | ||
|
|
51e2f8e49b | ||
|
|
0a7fc356b6 | ||
|
|
ff0f05a1c1 | ||
|
|
0ea9362d06 | ||
|
|
9d3932bd82 | ||
|
|
8c787fa7f7 | ||
|
|
2508e71324 | ||
|
|
b2f4f96ef9 | ||
|
|
fdae297fca | ||
|
|
36488fd836 | ||
|
|
ee01c944b4 | ||
|
|
d7f4f392d2 | ||
|
|
1756093618 | ||
|
|
1734c6e6bf | ||
|
|
839f345fa3 | ||
|
|
d69b5385e4 | ||
|
|
eb6b5755e7 | ||
|
|
9c65d9f957 | ||
|
|
cfa187f7d9 | ||
|
|
30d0fbeae6 | ||
|
|
9b21656314 | ||
|
|
b1b06a38af | ||
|
|
d2fffe5b88 | ||
|
|
09d560888e | ||
|
|
fa28326ed6 | ||
|
|
9ea4a6b7b6 | ||
|
|
ffa6fafcc1 | ||
|
|
4be5b80ff6 | ||
|
|
5028b07aaa | ||
|
|
7ce5dcdead | ||
|
|
7d8571b0e1 | ||
|
|
fca2fe2c8a | ||
|
|
75576577e0 | ||
|
|
eafc46f6c4 | ||
|
|
c0c36d3338 | ||
|
|
6a73b0820e | ||
|
|
bcb5eda7d8 | ||
|
|
2c833b5028 | ||
|
|
6821603980 | ||
|
|
8bec45cd58 | ||
|
|
ce0f44fb47 | ||
|
|
c740562dd8 | ||
|
|
63a1c8b63e | ||
|
|
112cdb4842 | ||
|
|
2d5f045c29 | ||
|
|
c43ff29f5d | ||
|
|
4c0e3c4db9 | ||
|
|
7995a57f77 | ||
|
|
0a47378f7f | ||
|
|
8e9a244cdd | ||
|
|
5f1a4ea08d | ||
|
|
034b19d85d | ||
|
|
68cb7ea471 | ||
|
|
d9a3ba0dd1 | ||
|
|
663e1d8336 | ||
|
|
31332f4f53 | ||
|
|
cb7163dd19 | ||
|
|
946029a3f7 | ||
|
|
69cbb6e109 | ||
|
|
6054f6bfe1 | ||
|
|
ae7b9f5fcb | ||
|
|
68dc6b9527 | ||
|
|
292cdfd5a0 | ||
|
|
28e2dee605 | ||
|
|
6d79ab2552 | ||
|
|
da17e424ea | ||
|
|
028c25afd3 | ||
|
|
9c2151dc37 | ||
|
|
9e9bd16b18 | ||
|
|
3f138aec22 | ||
|
|
e9f66e7c89 | ||
|
|
6be64b363c | ||
|
|
51230f21f5 | ||
|
|
e12540ba66 | ||
|
|
a6b1bee2af | ||
|
|
6187cdafe3 | ||
|
|
880f785d04 | ||
|
|
5aedcfd6a7 | ||
|
|
6ff1a2c236 | ||
|
|
317f888383 | ||
|
|
33f1f9abde | ||
|
|
913406b568 | ||
|
|
6a74d102a4 | ||
|
|
e9e36cebcb | ||
|
|
af6bf7a232 | ||
|
|
5720a7a5e3 | ||
|
|
449c946423 | ||
|
|
54a2a0da48 | ||
|
|
e209fedb27 | ||
|
|
12494f3008 | ||
|
|
7f60b46488 | ||
|
|
1c9ecd96d4 | ||
|
|
1f84803b91 | ||
|
|
3f6116f28f | ||
|
|
4ea0eb94d4 | ||
|
|
e222bc631a | ||
|
|
9c07c7fe4f | ||
|
|
35d74e18de | ||
|
|
266be2c25f | ||
|
|
b7cb090144 | ||
|
|
30e257bc2b | ||
|
|
fbd5679fb1 | ||
|
|
9db7234f24 | ||
|
|
220b2dc912 | ||
|
|
83c2420038 | ||
|
|
73913f450b | ||
|
|
bb966e7e6f | ||
|
|
b4adc127a4 | ||
|
|
2bc343b524 | ||
|
|
1f4d6eb0df | ||
|
|
ee936fe1a1 | ||
|
|
f6d9239b37 | ||
|
|
512e5b0240 | ||
|
|
600148f501 | ||
|
|
8791a4f696 | ||
|
|
ef40a8a925 | ||
|
|
2473e87947 | ||
|
|
bbe1dfb53d | ||
|
|
3bc27b1a02 | ||
|
|
ec4c6e140b | ||
|
|
545cc1074c | ||
|
|
9c0f4822bc | ||
|
|
5040ec109b | ||
|
|
25b216d7ef | ||
|
|
e475c847d7 | ||
|
|
e7c55c1ad6 | ||
|
|
cd8fcadd29 | ||
|
|
f78b6b30d9 | ||
|
|
cc6a991464 | ||
|
|
81d487dd89 | ||
|
|
af2795c07f | ||
|
|
178d9fb8d5 | ||
|
|
9bd12eb782 | ||
|
|
ef66650997 | ||
|
|
fcffcdde1b | ||
|
|
7de892ccac | ||
|
|
f90f2e051a | ||
|
|
24f49c8d83 | ||
|
|
a4ebaf15ab | ||
|
|
54a46dccc3 | ||
|
|
9747d5057d | ||
|
|
7f5c97d0be | ||
|
|
1933a76631 | ||
|
|
c20d7f9754 | ||
|
|
6b46dc7e89 | ||
|
|
0c1a26170c | ||
|
|
244ee08d7d | ||
|
|
a3acbca24b | ||
|
|
d77e4ed581 | ||
|
|
b928abb956 | ||
|
|
a46ef8d1a6 | ||
|
|
a5d459749f | ||
|
|
7dfa383968 | ||
|
|
036483d195 | ||
|
|
2c950f74bc | ||
|
|
2c59dcd929 | ||
|
|
658d14f31d | ||
|
|
819f4d2151 | ||
|
|
9b214d75df | ||
|
|
e0891a2d71 | ||
|
|
34a4876761 | ||
|
|
13ead0085d | ||
|
|
9e63270fc5 | ||
|
|
eccab3cd57 | ||
|
|
6446daf1a6 | ||
|
|
821602ef1c | ||
|
|
dc3512de9f | ||
|
|
36e9cb7108 | ||
|
|
42f4531720 | ||
|
|
d1fb379a40 | ||
|
|
e27bdb965c | ||
|
|
54fc6df3da | ||
|
|
9dd8f62c8a | ||
|
|
1db19148e7 | ||
|
|
93a01506e4 | ||
|
|
4767ed790c | ||
|
|
e39211347c | ||
|
|
a8cdbb65fe | ||
|
|
ff74ff4149 | ||
|
|
96e47f3d27 | ||
|
|
be52c181ea | ||
|
|
507f2ec544 | ||
|
|
fe00c628f4 | ||
|
|
e9387d322c | ||
|
|
2e3b135fe9 | ||
|
|
d28cc15be2 | ||
|
|
d15bd23800 | ||
|
|
90fe45c52d | ||
|
|
8f7be71905 | ||
|
|
5d583637c4 | ||
|
|
0efb4285c1 | ||
|
|
6dc543ca18 | ||
|
|
e93e1ddeb9 | ||
|
|
d5459f5996 | ||
|
|
c6420a910d | ||
|
|
f8e67b8e68 | ||
|
|
9ffcd382b4 | ||
|
|
725746badf | ||
|
|
9d5290de91 | ||
|
|
1bb0b58cce | ||
|
|
32f0ebbe61 | ||
|
|
25a1d74627 | ||
|
|
355b2f09bf | ||
|
|
01621f75b6 | ||
|
|
242e8a3bd6 | ||
|
|
010c26e716 | ||
|
|
e7bad10663 | ||
|
|
16242f98ce | ||
|
|
14a447b3d8 | ||
|
|
a2088fa500 | ||
|
|
87af68c092 | ||
|
|
06daad87ca | ||
|
|
0b4b86f6c9 | ||
|
|
10626904af | ||
|
|
90cca8a3eb | ||
|
|
8da0141cac | ||
|
|
39e123aaf4 | ||
|
|
24fd17f072 | ||
|
|
9270cc47b5 | ||
|
|
3721db34ab | ||
|
|
e85ae351c7 | ||
|
|
a56ba245ea | ||
|
|
d162eed4c7 | ||
|
|
43fea34f61 | ||
|
|
f7c960fc0d | ||
|
|
ee1933389a | ||
|
|
fdc9d5f1fd | ||
|
|
bad40b6125 | ||
|
|
d76ce85327 | ||
|
|
d3df072a22 | ||
|
|
4b3009a195 | ||
|
|
b72b0d60cb | ||
|
|
5841e62c66 | ||
|
|
9bd0c01702 | ||
|
|
6d86b3a950 | ||
|
|
5ff9b02c89 | ||
|
|
80934ea232 | ||
|
|
5acfa2bf3a | ||
|
|
4fada52e04 | ||
|
|
e1c8e95e11 | ||
|
|
1dfebad790 | ||
|
|
37ffe63d13 | ||
|
|
cc14c34dc2 | ||
|
|
e0cf4e644b | ||
|
|
aad55fc3db | ||
|
|
ba2b459220 | ||
|
|
086669fbe0 | ||
|
|
4cc3fcb6e8 | ||
|
|
8781053dbe | ||
|
|
bdac8974d8 | ||
|
|
9ae24141a3 | ||
|
|
e773efdc59 | ||
|
|
8f94bd1fbd | ||
|
|
d24d83d52a | ||
|
|
c938017baa | ||
|
|
728eea3ae1 | ||
|
|
88f9c1e539 | ||
|
|
76540c20f3 | ||
|
|
70761cf1d9 | ||
|
|
ace913a97d | ||
|
|
d6e269c7f6 | ||
|
|
ec10550b3a | ||
|
|
86e2374b48 | ||
|
|
d156dacbb9 | ||
|
|
1af5517da0 | ||
|
|
e5d34890a9 | ||
|
|
183b2548cf | ||
|
|
d2de489e3a | ||
|
|
90f8dbd86e | ||
|
|
3508ce19f3 | ||
|
|
00188c9818 | ||
|
|
499232f0e6 | ||
|
|
17471a12d2 | ||
|
|
de4b5eeda7 | ||
|
|
d0a0193707 | ||
|
|
5269a26b69 | ||
|
|
8dc6ad587f | ||
|
|
757339c52d | ||
|
|
6e289339d7 | ||
|
|
3ff0a44a1c | ||
|
|
0562228e9a | ||
|
|
0b6993bb7c | ||
|
|
4a19d90d48 | ||
|
|
038b1bcf7b | ||
|
|
a707c2fe8e | ||
|
|
3bb119f578 | ||
|
|
2a92600fa7 | ||
|
|
e80e1dab4d | ||
|
|
45d59d75ba | ||
|
|
28cd4c3ee9 | ||
|
|
e7c44274b0 | ||
|
|
3b2e0e34ef | ||
|
|
2276df07bd | ||
|
|
758ff03520 | ||
|
|
c3ac172960 | ||
|
|
562b4eb531 | ||
|
|
b1f8e845df | ||
|
|
bda869ea54 | ||
|
|
19cfbf082a | ||
|
|
07078bdd1f | ||
|
|
03657a98e1 | ||
|
|
b3f64abfae | ||
|
|
5d73c8f002 | ||
|
|
ba0882762d | ||
|
|
bb8855b628 | ||
|
|
883d5917f5 | ||
|
|
0275e99fe2 | ||
|
|
5d109077e5 | ||
|
|
540851ab6a | ||
|
|
6b920fa5e6 | ||
|
|
d1498bb9fb | ||
|
|
54eeef173a | ||
|
|
723ddf8cda | ||
|
|
9f12552907 | ||
|
|
a8b6fa413e | ||
|
|
76aae8ce42 | ||
|
|
ad0c287053 | ||
|
|
4a11a3559d | ||
|
|
1faa5a80e4 | ||
|
|
f1d3df1ec0 | ||
|
|
e7c94d3351 | ||
|
|
954f76dcf5 | ||
|
|
43037c0ff9 | ||
|
|
93df901b71 | ||
|
|
e97e645eda | ||
|
|
4a03ba3874 | ||
|
|
7f637e4acc | ||
|
|
8f3eeefafd | ||
|
|
5dc550a0ce | ||
|
|
6fe322da27 | ||
|
|
3cfe7c9a56 | ||
|
|
be7d5917cb | ||
|
|
ca28aa6ebd | ||
|
|
e76360c1b5 | ||
|
|
265ca8ba67 | ||
|
|
b0d942d0ec | ||
|
|
6c25905ae4 | ||
|
|
80a39393fe | ||
|
|
d4aed71abf | ||
|
|
ebb72bb992 | ||
|
|
8ffcd30b4d | ||
|
|
06804c37e2 | ||
|
|
1acca0278c | ||
|
|
639c8d4171 | ||
|
|
d77c9d3fca | ||
|
|
2c7cc2c191 | ||
|
|
d7c74b8004 | ||
|
|
aaa8003418 | ||
|
|
86890b13c6 | ||
|
|
39158b0eb6 | ||
|
|
87f1d55bc2 | ||
|
|
14343b5410 | ||
|
|
ffdac30b3c | ||
|
|
244c8dc391 | ||
|
|
e593344461 | ||
|
|
74c46f6e93 | ||
|
|
bbfd8aa249 | ||
|
|
2705a488ad | ||
|
|
850c253e08 | ||
|
|
80e0e3fcd7 | ||
|
|
2cc2d696f1 | ||
|
|
8a83a6b5be | ||
|
|
002d5338a0 | ||
|
|
743aa472f0 | ||
|
|
ba85d5d351 | ||
|
|
4e2ef908dc | ||
|
|
f5dd05ba8e | ||
|
|
17eda2a4cc | ||
|
|
d219c6e019 | ||
|
|
2dc539747b | ||
|
|
e941de50e8 | ||
|
|
63052257a2 | ||
|
|
ac5d2a714e | ||
|
|
59f78c16b1 | ||
|
|
3f7f8133df | ||
|
|
fef5e1ce2c | ||
|
|
0b97b3864f | ||
|
|
3d1330c85d | ||
|
|
041c0cc322 | ||
|
|
e72712640c | ||
|
|
6830195127 | ||
|
|
f9b5d6644d | ||
|
|
40f9eeda36 | ||
|
|
0fa0b0b1ea | ||
|
|
ff0b23f200 | ||
|
|
5456d4081b | ||
|
|
8948fae780 | ||
|
|
ee4542a699 | ||
|
|
31e4e631f9 | ||
|
|
cbf20b3271 | ||
|
|
a65fd50723 | ||
|
|
63a6aac2d8 | ||
|
|
afde4804c9 | ||
|
|
bc8ec9cd3e | ||
|
|
b63ab18e29 | ||
|
|
e7325f58c3 | ||
|
|
7b35bb8c96 | ||
|
|
e84671ce5d | ||
|
|
b01d50fe05 | ||
|
|
3f163051b1 | ||
|
|
4f1d03e1d4 | ||
|
|
fc39e4a225 | ||
|
|
bf88ad7fc8 | ||
|
|
11ba02067e | ||
|
|
952afa05ce | ||
|
|
3131cc3160 | ||
|
|
792f768479 | ||
|
|
ff312a15dd | ||
|
|
36207c9a98 | ||
|
|
b92105e888 | ||
|
|
35bd7c55d0 | ||
|
|
9f19c302d8 | ||
|
|
87b1ac776f | ||
|
|
41e401b05e | ||
|
|
d88da3589d | ||
|
|
9638c393bb | ||
|
|
9961ddc2a8 | ||
|
|
2d40dfd8d4 | ||
|
|
99c9bdf71d | ||
|
|
4fcd25ec88 | ||
|
|
440218da67 | ||
|
|
fefdb9fc8d | ||
|
|
21a0eff593 | ||
|
|
8825a094ae | ||
|
|
aa49ce5c56 | ||
|
|
1522d3385d | ||
|
|
510c41440a | ||
|
|
aa0c34ba1c | ||
|
|
af87e6ef62 | ||
|
|
30291ce6e6 | ||
|
|
890c2eb564 | ||
|
|
67a269b89c | ||
|
|
4b9ee81a78 | ||
|
|
4343f4d229 | ||
|
|
2162baa6c0 | ||
|
|
7e7f792710 | ||
|
|
1bbd9e24b0 | ||
|
|
6435aaa64f | ||
|
|
999aae0a33 | ||
|
|
ba795639b4 | ||
|
|
4c4b205721 | ||
|
|
b3c550b7c0 | ||
|
|
eb8953e784 | ||
|
|
b88b292d5d | ||
|
|
5f42c3b319 | ||
|
|
5b27ae0371 | ||
|
|
f26b1da1b5 | ||
|
|
7a853e2dcb | ||
|
|
9b22748bd0 | ||
|
|
c1e9dd3373 | ||
|
|
8cbbc47043 | ||
|
|
81b3567133 | ||
|
|
fc6568f390 | ||
|
|
8e30fe2946 | ||
|
|
6c811a3261 | ||
|
|
afbe5aa540 | ||
|
|
324afd2d6c | ||
|
|
58d94ef61e | ||
|
|
39974b0982 | ||
|
|
323d7306e2 | ||
|
|
251e228ce4 | ||
|
|
a99f3f217a | ||
|
|
e2acbee113 | ||
|
|
37b69eddf2 | ||
|
|
f0322e6f2c | ||
|
|
756587d080 | ||
|
|
1ad2c92324 | ||
|
|
e5433adf78 | ||
|
|
ed765f75d8 | ||
|
|
4136f1b377 | ||
|
|
860339b90e | ||
|
|
03254a0c0f | ||
|
|
a76081c979 | ||
|
|
71a207079f | ||
|
|
f6e724c4c5 | ||
|
|
4251b36b25 | ||
|
|
b8f39cbfdf | ||
|
|
088c621862 |
4
.gitattributes
vendored
@@ -1 +1,5 @@
|
||||
* text=auto
|
||||
*.html text eol=lf
|
||||
*.js text eol=lf
|
||||
*.md text eol=lf
|
||||
*.sh text eol=lf
|
||||
|
||||
11
.gitignore
vendored
@@ -1,5 +1,10 @@
|
||||
.DS_Store
|
||||
*.custom.*
|
||||
node_modules/
|
||||
vendor/closure-compiler/
|
||||
vendor/uglifyjs/
|
||||
*.template.*
|
||||
*.map
|
||||
/*.min.*
|
||||
modularize
|
||||
node_modules
|
||||
dist/*.backbone.*
|
||||
dist/*.legacy.*
|
||||
dist/*.mobile.*
|
||||
|
||||
12
.jamignore
@@ -1,12 +0,0 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.md
|
||||
*.txt
|
||||
build.js
|
||||
index.js
|
||||
build/
|
||||
doc/
|
||||
node_modules/
|
||||
perf/
|
||||
test/
|
||||
vendor/
|
||||
26
.npmignore
@@ -1,26 +0,0 @@
|
||||
.*
|
||||
*.custom.*
|
||||
*.d.ts
|
||||
CONTRIBUTING.md
|
||||
doc/*.php
|
||||
node_modules/
|
||||
perf/*.html
|
||||
perf/*-ui.js
|
||||
perf/*.sh
|
||||
test/*.html
|
||||
test/*-ui.js
|
||||
test/*.sh
|
||||
vendor/*.gz
|
||||
vendor/backbone/
|
||||
vendor/benchmark.js/*.jar
|
||||
vendor/closure-compiler/
|
||||
vendor/docdown/
|
||||
vendor/firebug-lite/
|
||||
vendor/json3/
|
||||
vendor/jquery/
|
||||
vendor/qunit/qunit/*.css
|
||||
vendor/qunit/qunit/*-1.8.0.js
|
||||
vendor/requirejs/
|
||||
vendor/underscore/*-min.js
|
||||
vendor/uglifyjs/
|
||||
vendor/underscore/test/
|
||||
84
.travis.yml
@@ -1,20 +1,80 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.9
|
||||
- "0.6"
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
env:
|
||||
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js"
|
||||
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
|
||||
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
|
||||
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
|
||||
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m40s"
|
||||
global:
|
||||
- BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false
|
||||
- SAUCE_USERNAME="jdalton"
|
||||
- secure: "woILQltl1pI3DgadZ5NrcqntdPvnRmQBwIVNZL91Ht5d9snIhgyAixI6xNAS8F8BzD9RzqzVPHay5sHfn+GhNaojcaiHs1nXAbdyclevMyfP+3MQ1HGfMSU0bv1GdT35LJ+C0u4Y3SuuZSbBlNEeLXRPMngPZahf4xL8RsZz/is="
|
||||
matrix:
|
||||
- BUILD="compat"
|
||||
- BUILD="modern"
|
||||
- BUILD="legacy"
|
||||
- BUILD="mobile"
|
||||
- BIN="phantomjs" BUILD="compat"
|
||||
- BIN="phantomjs" BUILD="legacy"
|
||||
- BIN="phantomjs" BUILD="mobile"
|
||||
matrix:
|
||||
include:
|
||||
- node_js: "0.10"
|
||||
env: BIN="istanbul"
|
||||
- node_js: "0.10"
|
||||
env: BIN="narwhal" BUILD="compat"
|
||||
- node_js: "0.10"
|
||||
env: BIN="narwhal" BUILD="legacy"
|
||||
- node_js: "0.10"
|
||||
env: BIN="rhino" BUILD="compat"
|
||||
- node_js: "0.10"
|
||||
env: BIN="rhino" BUILD="legacy"
|
||||
- node_js: "0.10"
|
||||
env: BIN="rhino" BUILD="compat" OPTION="-require"
|
||||
- node_js: "0.10"
|
||||
env: BIN="rhino" BUILD="legacy" OPTION="-require"
|
||||
- node_js: "0.10"
|
||||
env: BIN="ringo" BUILD="compat"
|
||||
- node_js: "0.10"
|
||||
env: BIN="ringo" BUILD="legacy"
|
||||
- node_js: "0.8"
|
||||
env: SAUCE_LABS=true BUILD="compat"
|
||||
- node_js: "0.8"
|
||||
env: SAUCE_LABS=true BUILD="modern"
|
||||
- node_js: "0.8"
|
||||
env: SAUCE_LABS=true BUILD="legacy"
|
||||
- node_js: "0.8"
|
||||
env: SAUCE_LABS=true BUILD="mobile"
|
||||
- node_js: "0.8"
|
||||
env: SAUCE_LABS=true BUILD="underscore"
|
||||
git:
|
||||
depth: 1
|
||||
depth: 10
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
before_script:
|
||||
- "tar -xzvf vendor/closure-compiler.tar.gz -C vendor"
|
||||
- "tar -xzvf vendor/uglifyjs.tar.gz -C vendor"
|
||||
before_install:
|
||||
- "([ $BUILD == 'legacy' ] || [ $BUILD == 'mobile' ] || [ $BUILD == 'modern' ]) && MAKE=true || true"
|
||||
- "([ $BUILD == 'compat' ] || [ $BUILD == 'legacy' ]) && COMPAT=true || true"
|
||||
- "[ $SAUCE_LABS != false ] && npm i ecstatic@\"~0.4.0\" request@\"~2.27.0\" sauce-tunnel@\"~1.1.0\" || true"
|
||||
- "[ $BIN == 'istanbul' ] && npm i -g istanbul@\"~0.1.0\" || true"
|
||||
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
|
||||
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
|
||||
- "[ $BIN == 'rhino' ] && sudo mkdir /opt/rhino-1.7R5 && sudo wget -O /opt/rhino-1.7R5/js.jar https://oss.sonatype.org/content/repositories/snapshots/org/mozilla/rhino/1.7R5-SNAPSHOT/rhino-1.7R5-20120629.144839-4.jar || true"
|
||||
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
|
||||
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
|
||||
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
|
||||
- "[ $MAKE != false ] && git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
|
||||
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
|
||||
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
|
||||
script:
|
||||
$TEST_COMMAND
|
||||
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
|
||||
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || cd ./test"
|
||||
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
|
||||
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
|
||||
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js \"test/index.html?build=lodash-$BUILD\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js \"test/index.html?build=../dist/lodash.$BUILD.js\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/backbone.html?build=lodash-$BUILD\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/backbone.html?build=../dist/lodash.$BUILD.js\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/underscore.html?build=lodash-$BUILD\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/underscore.html?build=../dist/lodash.$BUILD.js\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js \"test/index.html?build=lodash-$BUILD&compat=7\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js \"test/index.html?build=../dist/lodash.$BUILD.js&compat=7\""
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Contributing to Lo-Dash
|
||||
|
||||
If you’d like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
|
||||
Please make sure to [search the issue tracker](https://github.com/bestiejs/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
|
||||
Please make sure to [search the issue tracker](https://github.com/lodash/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
|
||||
|
||||
## Tests
|
||||
|
||||
Include updated unit tests in the `test` directory as part of your pull request.
|
||||
You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser.
|
||||
You can run the tests from the command line via `node test/test`, or open `test/index.html` in a web browser.
|
||||
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
|
||||
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
|
||||
|
||||
@@ -15,7 +15,7 @@ The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscore
|
||||
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
|
||||
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
|
||||
|
||||
For more information about CLAs, please check out Alex Russell’s excellent post, ["Why Do I Need to Sign This?"](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||
For more information about CLAs, please check out Alex Russell’s excellent post, [“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas,
|
||||
DocumentCloud Inc. <http://underscorejs.org/>
|
||||
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
306
README.md
@@ -1,192 +1,101 @@
|
||||
# Lo-Dash <sup>v1.0.1</sup>
|
||||
[](http://travis-ci.org/bestiejs/lodash)
|
||||
|
||||
An alternative to Underscore.js, delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
|
||||
# Lo-Dash v2.3.0
|
||||
A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).
|
||||
|
||||
## Download
|
||||
|
||||
* Lo-Dash builds (for modern environments):<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.min.js)
|
||||
Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds.
|
||||
|
||||
* Lo-Dash compatibility builds (for legacy and modern environments):<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.compat.min.js)
|
||||
* Modern builds perfect for newer browsers/environments:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.min.js)
|
||||
|
||||
* Underscore compatibility builds:<br>
|
||||
[Development](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.js) and
|
||||
[Production](https://raw.github.com/bestiejs/lodash/v1.0.1/dist/lodash.underscore.min.js)
|
||||
* Compatibility builds for older environment support too:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.compat.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.compat.min.js)
|
||||
|
||||
* CDN copies of ≤ v1.0.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
|
||||
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.js),
|
||||
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js),<br>
|
||||
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.js),
|
||||
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.min.js),<br>
|
||||
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.js), and
|
||||
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.min.js)
|
||||
* Underscore builds to use as a drop-in replacement:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.underscore.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.underscore.min.js)
|
||||
|
||||
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
|
||||
CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash). For smaller file sizes, create [custom builds](http://lodash.com/custom-builds) with only the features needed.
|
||||
|
||||
Love modules? We’ve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-es6](https://github.com/lodash/lodash-es6), [lodash-node](https://npmjs.org/package/lodash-node), & [npm packages](https://npmjs.org/browse/keyword/lodash-modularized) per method.
|
||||
|
||||
## Dive in
|
||||
|
||||
We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
|
||||
There’s plenty of **[documentation](http://lodash.com/docs)**, [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).<br>
|
||||
Check out <a href="http://devdocs.io/lodash/">DevDocs</a> as a fast, organized, & searchable interface for our documentation.
|
||||
|
||||
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
|
||||
The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).<br>
|
||||
A list of upcoming features is available on our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).
|
||||
|
||||
## Features *not* in Underscore
|
||||
|
||||
* AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.)
|
||||
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
|
||||
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
|
||||
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
|
||||
* [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
|
||||
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
|
||||
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex`
|
||||
* [_.create](http://lodash.com/docs#create) for easier object inheritance
|
||||
* [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins
|
||||
* [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions
|
||||
* [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept additional `options` for more control
|
||||
* [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys
|
||||
* [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early
|
||||
* [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties
|
||||
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties
|
||||
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object`
|
||||
* [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions
|
||||
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
|
||||
* [_.noop](http://lodash.com/docs#noop) for function placeholders
|
||||
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior
|
||||
* [_.partialRight](http://lodash.com/docs#partialRight) for [partial application](http://lodash.com/docs#partial) from the right
|
||||
* [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays
|
||||
* [_.random](http://lodash.com/docs#random) supports returning floating-point numbers
|
||||
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking
|
||||
* [_.support](http://lodash.com/docs#support) for flagging environment features
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6)
|
||||
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
|
||||
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||
* [_.zip](http://lodash.com/docs#zip) is capable of unzipping values
|
||||
* [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), &
|
||||
[more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks
|
||||
* [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), &
|
||||
[more](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.forEachRight, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.where") accept strings
|
||||
* [_.filter](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), &
|
||||
[more](http://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands
|
||||
* [_.findLast](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), &
|
||||
[more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight") right-associative methods
|
||||
|
||||
## Resources
|
||||
|
||||
For more information check out these articles, screencasts, and other videos over Lo-Dash:
|
||||
* Podcasts
|
||||
- [JavaScript Jabber](http://javascriptjabber.com/079-jsj-lo-dash-with-john-david-dalton/)
|
||||
|
||||
* Posts
|
||||
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
|
||||
- [Custom builds in Lo-Dash 2.0](http://kitcambridge.be/blog/custom-builds-in-lo-dash-2-dot-0/)
|
||||
|
||||
* Videos
|
||||
- [Introducing Lo-Dash](https://vimeo.com/44154599)
|
||||
- [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
|
||||
- [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600)
|
||||
- [Unit testing in Lo-Dash](https://vimeo.com/45865290)
|
||||
- [Lo-Dash’s approach to native method use](https://vimeo.com/48576012)
|
||||
- [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
|
||||
- [Introduction](https://vimeo.com/44154599)
|
||||
- [Origins](https://vimeo.com/44154600)
|
||||
- [Optimizations & builds](https://vimeo.com/44154601)
|
||||
- [Native method use](https://vimeo.com/48576012)
|
||||
- [Testing](https://vimeo.com/45865290)
|
||||
- [CascadiaJS ’12](http://www.youtube.com/watch?v=dpPy4f_SeEk)
|
||||
|
||||
## Features
|
||||
|
||||
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
|
||||
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
|
||||
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
|
||||
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
|
||||
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
|
||||
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
|
||||
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
|
||||
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties
|
||||
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties
|
||||
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
|
||||
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
|
||||
* [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
|
||||
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
|
||||
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
|
||||
* [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
|
||||
[and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
|
||||
* [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map),
|
||||
[and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
|
||||
A list of other community created podcasts, posts, & videos is available on our [wiki](https://github.com/lodash/lodash/wiki/Resources).
|
||||
|
||||
## Support
|
||||
|
||||
Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
|
||||
Tested in Chrome 5~30, Firefox 2~25, IE 6-11, Opera 9.25~17, Safari 3-7, Node.js 0.6.8-0.10.21, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.
|
||||
|
||||
## Custom builds
|
||||
Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.<br>
|
||||
[](https://saucelabs.com/ "Sauce Labs: Selenium Testing & More")
|
||||
|
||||
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
|
||||
To top it off, we handle all method dependency and alias mapping for you.
|
||||
|
||||
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
|
||||
```bash
|
||||
lodash backbone
|
||||
```
|
||||
|
||||
* CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
|
||||
The `csp` modifier is an alais of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html).
|
||||
```bash
|
||||
lodash csp
|
||||
```
|
||||
|
||||
* Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
|
||||
```bash
|
||||
lodash legacy
|
||||
```
|
||||
|
||||
* Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument.
|
||||
```bash
|
||||
lodash modern
|
||||
```
|
||||
|
||||
* Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument.
|
||||
```bash
|
||||
lodash mobile
|
||||
```
|
||||
|
||||
* Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
|
||||
```bash
|
||||
lodash strict
|
||||
```
|
||||
|
||||
* Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
|
||||
```bash
|
||||
lodash underscore
|
||||
```
|
||||
|
||||
Custom builds may be created using the following commands:
|
||||
|
||||
* Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
|
||||
Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
|
||||
```bash
|
||||
lodash category=collections,functions
|
||||
lodash category="collections, functions"
|
||||
```
|
||||
|
||||
* Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
|
||||
Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
|
||||
```bash
|
||||
lodash exports=amd,commonjs,node
|
||||
lodash exports="amd, commonjs, node"
|
||||
```
|
||||
|
||||
* Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
|
||||
```bash
|
||||
lodash iife="!function(window,undefined){%output%}(this)"
|
||||
```
|
||||
|
||||
* Use the `include` argument to pass comma separated method/category names to include in the build.
|
||||
```bash
|
||||
lodash include=each,filter,map
|
||||
lodash include="each, filter, map"
|
||||
```
|
||||
|
||||
* Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
|
||||
```bash
|
||||
lodash underscore minus=result,shuffle
|
||||
lodash underscore minus="result, shuffle"
|
||||
```
|
||||
|
||||
* Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
|
||||
```bash
|
||||
lodash backbone plus=random,template
|
||||
lodash backbone plus="random, template"
|
||||
```
|
||||
|
||||
* Use the `template` argument to pass the file path pattern used to match template files to precompile.
|
||||
```bash
|
||||
lodash template="./*.jst"
|
||||
```
|
||||
|
||||
* Use the `settings` argument to pass the template settings used when precompiling templates.
|
||||
```bash
|
||||
lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
|
||||
```
|
||||
|
||||
* Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
|
||||
```bash
|
||||
lodash moduleId="underscore"
|
||||
```
|
||||
|
||||
All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.<br>
|
||||
Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
|
||||
|
||||
The following options are also supported:
|
||||
|
||||
* `-c`, `--stdout` ......... Write output to standard output
|
||||
* `-d`, `--debug` ........... Write only the non-minified development output
|
||||
* `-h`, `--help` ............. Display help information
|
||||
* `-m`, `--minify` ......... Write only the minified production output
|
||||
* `-o`, `--output` ......... Write output to a given path/filename
|
||||
* `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL
|
||||
* `-s`, `--silent` ......... Skip status updates normally logged to the console
|
||||
* `-V`, `--version` ....... Output current version of Lo-Dash
|
||||
|
||||
The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
|
||||
|
||||
## Installation and usage
|
||||
## Installation & usage
|
||||
|
||||
In browsers:
|
||||
|
||||
@@ -197,34 +106,23 @@ In browsers:
|
||||
Using [`npm`](http://npmjs.org/):
|
||||
|
||||
```bash
|
||||
npm install lodash
|
||||
npm i --save lodash
|
||||
|
||||
npm install -g lodash
|
||||
npm link lodash
|
||||
{sudo} npm i -g lodash
|
||||
npm ln lodash
|
||||
```
|
||||
|
||||
To avoid potential issues, update `npm` before installing Lo-Dash:
|
||||
|
||||
```bash
|
||||
npm install npm -g
|
||||
```
|
||||
|
||||
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
||||
In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var _ = require('lodash');
|
||||
|
||||
// or as a drop-in replacement for Underscore
|
||||
var _ = require('lodash/lodash.underscore');
|
||||
// or as Underscore
|
||||
var _ = require('lodash/dist/lodash.underscore');
|
||||
```
|
||||
|
||||
**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.
|
||||
|
||||
In [RingoJS v0.7.0-](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var _ = require('lodash')._;
|
||||
```
|
||||
**Notes:**
|
||||
* Don’t assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL
|
||||
* If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory *before* requiring it
|
||||
|
||||
In [Rhino](http://www.mozilla.org/rhino/):
|
||||
|
||||
@@ -232,45 +130,27 @@ In [Rhino](http://www.mozilla.org/rhino/):
|
||||
load('lodash.js');
|
||||
```
|
||||
|
||||
In an AMD loader like [RequireJS](http://requirejs.org/):
|
||||
In an AMD loader:
|
||||
|
||||
```js
|
||||
require({
|
||||
'paths': {
|
||||
'underscore': 'path/to/lodash'
|
||||
}
|
||||
'packages': [
|
||||
{ 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }
|
||||
]
|
||||
},
|
||||
['underscore'], function(_) {
|
||||
['lodash'], function(_) {
|
||||
console.log(_.VERSION);
|
||||
});
|
||||
```
|
||||
|
||||
## Release Notes
|
||||
|
||||
### <sup>v1.0.1</sup>
|
||||
|
||||
* Add support for specifying source map URLs in `-p`/`--source-map` build options
|
||||
* Ensured the second argument passed to `_.assign` is not treated as a `callback`
|
||||
* Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL`
|
||||
* Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed
|
||||
* Made `_.defer` use `setImmediate`, in Node.js, when available
|
||||
* Made `_.where` search arrays for values regardless of their index position
|
||||
* Removed dead code from `_.template`
|
||||
|
||||
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
|
||||
|
||||
## BestieJS
|
||||
|
||||
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
|
||||
|
||||
## Author
|
||||
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||
|---|
|
||||
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Kit Cambridge](http://kitcambridge.github.com/)
|
||||
[](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|---|---|
|
||||
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||
|
||||
23
bower.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "2.3.0",
|
||||
"main": "dist/lodash.compat.js",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.template.*",
|
||||
"*.map",
|
||||
"*.md",
|
||||
"/*.min.*",
|
||||
"/lodash.js",
|
||||
"index.js",
|
||||
"component.json",
|
||||
"package.json",
|
||||
"doc",
|
||||
"modularize",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
753
build/minify.js
@@ -1,753 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** Load Node modules */
|
||||
var fs = require('fs'),
|
||||
https = require('https'),
|
||||
path = require('path'),
|
||||
spawn = require('child_process').spawn,
|
||||
zlib = require('zlib'),
|
||||
tar = require('../vendor/tar/tar.js'),
|
||||
_ = require('../lodash.js');
|
||||
|
||||
/** Load other modules */
|
||||
var preprocess = require('./pre-compile.js'),
|
||||
postprocess = require('./post-compile.js');
|
||||
|
||||
/** The Git object ID of `closure-compiler.tar.gz` */
|
||||
var closureId = '23cf67d0f0b979d97631fc108a2a43bb82225994';
|
||||
|
||||
/** The Git object ID of `uglifyjs.tar.gz` */
|
||||
var uglifyId = 'a934fb18f8fa2768c6a68de44b6e035fe96a268b';
|
||||
|
||||
/** The path of the directory that is the base of the repository */
|
||||
var basePath = fs.realpathSync(path.join(__dirname, '..'));
|
||||
|
||||
/** The path of the `vendor` directory */
|
||||
var vendorPath = path.join(basePath, 'vendor');
|
||||
|
||||
/** The path to the Closure Compiler `.jar` */
|
||||
var closurePath = path.join(vendorPath, 'closure-compiler', 'compiler.jar');
|
||||
|
||||
/** The path to the UglifyJS module */
|
||||
var uglifyPath = path.join(vendorPath, 'uglifyjs', 'tools', 'node.js');
|
||||
|
||||
/** The Closure Compiler command-line options */
|
||||
var closureOptions = ['--warning_level=QUIET'];
|
||||
|
||||
/** The media type for raw blob data */
|
||||
var mediaType = 'application/vnd.github.v3.raw';
|
||||
|
||||
/** Used to reference parts of the blob href */
|
||||
var location = (function() {
|
||||
var host = 'api.github.com',
|
||||
origin = 'https://api.github.com',
|
||||
pathname = '/repos/bestiejs/lodash/git/blobs';
|
||||
|
||||
return {
|
||||
'host': host,
|
||||
'href': origin + pathname,
|
||||
'origin': origin,
|
||||
'pathname': pathname
|
||||
};
|
||||
}());
|
||||
|
||||
/** The Closure Compiler optimization modes */
|
||||
var optimizationModes = {
|
||||
'simple': 'SIMPLE_OPTIMIZATIONS',
|
||||
'advanced': 'ADVANCED_OPTIMIZATIONS'
|
||||
};
|
||||
|
||||
/** Reassign `existsSync` for older versions of Node */
|
||||
fs.existsSync || (fs.existsSync = path.existsSync);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Minifies a given Lo-Dash `source` and invokes the `options.onComplete`
|
||||
* callback when finished. The `onComplete` callback is invoked with one
|
||||
* argument; (outputSource).
|
||||
*
|
||||
* @param {Array|String} [source=''] The source to minify or array of commands.
|
||||
* -o, --output - Write output to a given path/filename.
|
||||
* -s, --silent - Skip status updates normally logged to the console.
|
||||
* -t, --template - Applies template specific minifier options.
|
||||
*
|
||||
* @param {Object} [options={}] The options object.
|
||||
* outputPath - Write output to a given path/filename.
|
||||
* isSilent - Skip status updates normally logged to the console.
|
||||
* isTemplate - Applies template specific minifier options.
|
||||
* onComplete - The function called once minification has finished.
|
||||
*/
|
||||
function minify(source, options) {
|
||||
// used to specify the source map URL
|
||||
var sourceMapURL;
|
||||
|
||||
// used to specify the default minifer modes
|
||||
var modes = ['simple', 'advanced', 'hybrid'];
|
||||
|
||||
source || (source = '');
|
||||
options || (options = {});
|
||||
|
||||
// juggle arguments
|
||||
if (Array.isArray(source)) {
|
||||
// convert commands to an options object
|
||||
options = source;
|
||||
|
||||
// used to report invalid command-line arguments
|
||||
var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) {
|
||||
if (/^(?:-o|--output)$/.test(options[index - 1]) ||
|
||||
/^modes=.*$/.test(value)) {
|
||||
return true;
|
||||
}
|
||||
var result = [
|
||||
'-o', '--output',
|
||||
'-p', '--source-map',
|
||||
'-s', '--silent',
|
||||
'-t', '--template'
|
||||
].indexOf(value) > -1;
|
||||
|
||||
if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) {
|
||||
result = true;
|
||||
sourceMapURL = value;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
// report invalid arguments
|
||||
if (invalidArgs.length) {
|
||||
console.log(
|
||||
'\n' +
|
||||
'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') +
|
||||
' passed: ' + invalidArgs.join(', ')
|
||||
);
|
||||
return;
|
||||
}
|
||||
var filePath = options[options.length - 1],
|
||||
isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1,
|
||||
isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1,
|
||||
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
|
||||
outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js');
|
||||
|
||||
modes = options.reduce(function(result, value) {
|
||||
var match = value.match(/modes=(.*)$/);
|
||||
return match ? match[1].split(/, */) : result;
|
||||
}, modes);
|
||||
|
||||
outputPath = options.reduce(function(result, value, index) {
|
||||
if (/-o|--output/.test(value)) {
|
||||
result = options[index + 1];
|
||||
result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result));
|
||||
}
|
||||
return result;
|
||||
}, outputPath);
|
||||
|
||||
options = {
|
||||
'filePath': filePath,
|
||||
'isMapped': isMapped,
|
||||
'isSilent': isSilent,
|
||||
'isTemplate': isTemplate,
|
||||
'modes': modes,
|
||||
'outputPath': outputPath,
|
||||
'sourceMapURL': sourceMapURL
|
||||
};
|
||||
|
||||
source = fs.readFileSync(filePath, 'utf8');
|
||||
}
|
||||
|
||||
modes = options.modes || modes;
|
||||
if (options.isMapped) {
|
||||
modes = modes.filter(function(mode) {
|
||||
return mode != 'hybrid';
|
||||
});
|
||||
}
|
||||
if (options.isTemplate) {
|
||||
modes = modes.filter(function(mode) {
|
||||
return mode != 'advanced';
|
||||
});
|
||||
}
|
||||
options.modes = modes;
|
||||
|
||||
// fetch the Closure Compiler
|
||||
getDependency({
|
||||
'id': 'closure-compiler',
|
||||
'hashId': closureId,
|
||||
'path': vendorPath,
|
||||
'title': 'the Closure Compiler',
|
||||
'onComplete': function(exception) {
|
||||
var error = exception;
|
||||
|
||||
// fetch UglifyJS
|
||||
getDependency({
|
||||
'id': 'uglifyjs',
|
||||
'hashId': uglifyId,
|
||||
'title': 'UglifyJS',
|
||||
'path': vendorPath,
|
||||
'onComplete': function(exception) {
|
||||
error || (error = exception);
|
||||
if (!error) {
|
||||
new Minify(source, options);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The Minify constructor used to keep state of each `minify` invocation.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {String} source The source to minify.
|
||||
* @param {Object} options The options object.
|
||||
* outputPath - Write output to a given path/filename.
|
||||
* isSilent - Skip status updates normally logged to the console.
|
||||
* isTemplate - Applies template specific minifier options.
|
||||
* onComplete - The function called once minification has finished.
|
||||
*/
|
||||
function Minify(source, options) {
|
||||
// juggle arguments
|
||||
if (typeof source == 'object' && source) {
|
||||
options = source || options;
|
||||
source = options.source || '';
|
||||
}
|
||||
this.compiled = { 'simple': {}, 'advanced': {} };
|
||||
this.hybrid = { 'simple': {}, 'advanced': {} };
|
||||
this.uglified = {};
|
||||
|
||||
this.filePath = options.filePath;
|
||||
this.isMapped = !!options.isMapped;
|
||||
this.isSilent = !!options.isSilent;
|
||||
this.isTemplate = !!options.isTemplate;
|
||||
this.outputPath = options.outputPath;
|
||||
this.sourceMapURL = options.sourceMapURL;
|
||||
|
||||
var modes = this.modes = options.modes;
|
||||
source = this.source = preprocess(source, options);
|
||||
|
||||
this.onComplete = options.onComplete || function(data) {
|
||||
var outputPath = this.outputPath,
|
||||
sourceMap = data.sourceMap;
|
||||
|
||||
fs.writeFileSync(outputPath, data.source, 'utf8');
|
||||
if (sourceMap) {
|
||||
fs.writeFileSync(getMapPath(outputPath), sourceMap, 'utf8');
|
||||
}
|
||||
};
|
||||
|
||||
// begin the minification process
|
||||
if (modes.indexOf('simple') > -1) {
|
||||
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
|
||||
} else if (modes.indexOf('advanced') > -1) {
|
||||
onClosureSimpleGzip.call(this);
|
||||
} else {
|
||||
onClosureAdvancedGzip.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Fetches a required `.tar.gz` dependency with the given Git object ID from
|
||||
* the Lo-Dash repo on GitHub. The object ID may be obtained by running
|
||||
* `git hash-object path/to/dependency.tar.gz`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} options The options object.
|
||||
* id - The Git object ID of the `.tar.gz` file.
|
||||
* onComplete - The function called once the extraction has finished.
|
||||
* path - The path of the extraction directory.
|
||||
* title - The dependency's title used in status updates logged to the console.
|
||||
*/
|
||||
function getDependency(options) {
|
||||
options || (options = {});
|
||||
|
||||
var ran,
|
||||
destPath = options.path,
|
||||
hashId = options.hashId,
|
||||
id = options.id,
|
||||
onComplete = options.onComplete,
|
||||
title = options.title;
|
||||
|
||||
// exit early if dependency exists
|
||||
if (fs.existsSync(path.join(destPath, id))) {
|
||||
onComplete();
|
||||
return;
|
||||
}
|
||||
var callback = function(exception) {
|
||||
if (ran) {
|
||||
return;
|
||||
}
|
||||
if (exception) {
|
||||
console.error([
|
||||
'There was a problem installing ' + title + '.',
|
||||
'Try running the command as root, via `sudo`, or manually install by running:',
|
||||
'',
|
||||
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'",
|
||||
''
|
||||
].join('\n'));
|
||||
}
|
||||
ran = true;
|
||||
process.removeListener('uncaughtException', callback);
|
||||
onComplete(exception);
|
||||
};
|
||||
|
||||
console.log('Downloading ' + title + '...');
|
||||
process.on('uncaughtException', callback);
|
||||
|
||||
https.get({
|
||||
'host': location.host,
|
||||
'path': location.pathname + '/' + hashId,
|
||||
'headers': {
|
||||
// By default, all GitHub blob API endpoints return a JSON document
|
||||
// containing Base64-encoded blob data. Overriding the `Accept` header
|
||||
// with the GitHub raw media type returns the blob data directly.
|
||||
// See http://developer.github.com/v3/media/.
|
||||
'Accept': mediaType
|
||||
}
|
||||
}, function(response) {
|
||||
var decompressor = zlib.createUnzip(),
|
||||
parser = new tar.Extract({ 'path': destPath });
|
||||
|
||||
parser.on('end', callback);
|
||||
response.pipe(decompressor).pipe(parser);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the source map path from the given output path.
|
||||
*
|
||||
* @private
|
||||
* @param {String} outputPath The output path.
|
||||
* @returns {String} Returns the source map path.
|
||||
*/
|
||||
function getMapPath(outputPath) {
|
||||
return path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map');
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Compresses a `source` string using the Closure Compiler. Yields the
|
||||
* minified result, and any exceptions encountered, to a `callback` function.
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The JavaScript source to minify.
|
||||
* @param {String} mode The optimization mode.
|
||||
* @param {Function} callback The function called once the process has completed.
|
||||
*/
|
||||
function closureCompile(source, mode, callback) {
|
||||
var filePath = this.filePath,
|
||||
isAdvanced = mode == 'advanced',
|
||||
isMapped = this.isMapped,
|
||||
options = closureOptions.slice(),
|
||||
outputPath = this.outputPath,
|
||||
mapPath = getMapPath(outputPath),
|
||||
sourceMapURL = this.sourceMapURL || path.basename(mapPath);
|
||||
|
||||
// remove copyright header to make other modifications easier
|
||||
var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0];
|
||||
if (license) {
|
||||
source = source.replace(license, '');
|
||||
}
|
||||
|
||||
var hasIIFE = /^;?\(function[^{]+{\s*/.test(source),
|
||||
isStrict = hasIIFE && /^;?\(function[^{]+{\s*["']use strict["']/.test(source);
|
||||
|
||||
// to avoid stripping the IIFE, convert it to a function call
|
||||
if (hasIIFE && isAdvanced) {
|
||||
source = source
|
||||
.replace(/\(function/, '__iife__$&')
|
||||
.replace(/\(this\)\)([\s;]*(\n\/\/.+)?)$/, ', this)$1');
|
||||
}
|
||||
|
||||
options.push('--compilation_level=' + optimizationModes[mode]);
|
||||
if (isMapped) {
|
||||
options.push('--create_source_map=' + mapPath, '--source_map_format=V3');
|
||||
}
|
||||
|
||||
var compiler = spawn('java', ['-jar', closurePath].concat(options));
|
||||
if (!this.isSilent) {
|
||||
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
|
||||
}
|
||||
|
||||
var error = '';
|
||||
compiler.stderr.on('data', function(data) {
|
||||
error += data;
|
||||
});
|
||||
|
||||
var output = '';
|
||||
compiler.stdout.on('data', function(data) {
|
||||
output += data;
|
||||
});
|
||||
|
||||
compiler.on('exit', function(status) {
|
||||
// `status` contains the process exit code
|
||||
if (status) {
|
||||
var exception = new Error(error);
|
||||
exception.status = status;
|
||||
}
|
||||
// restore IIFE and move exposed vars inside the IIFE
|
||||
if (hasIIFE && isAdvanced) {
|
||||
output = output
|
||||
.replace(/__iife__\(/, '(')
|
||||
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
|
||||
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
|
||||
}
|
||||
// inject "use strict" directive
|
||||
if (isStrict) {
|
||||
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
|
||||
}
|
||||
// restore copyright header
|
||||
if (license) {
|
||||
output = license + output;
|
||||
}
|
||||
if (isMapped) {
|
||||
var mapOutput = fs.readFileSync(mapPath, 'utf8');
|
||||
fs.unlinkSync(mapPath);
|
||||
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
|
||||
|
||||
mapOutput = JSON.parse(mapOutput);
|
||||
mapOutput.file = path.basename(outputPath);
|
||||
mapOutput.sources = [path.basename(filePath)];
|
||||
mapOutput = JSON.stringify(mapOutput, null, 2);
|
||||
}
|
||||
callback(exception, output, mapOutput);
|
||||
});
|
||||
|
||||
// proxy the standard input to the Closure Compiler
|
||||
compiler.stdin.end(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compresses a `source` string using UglifyJS. Yields the result to a
|
||||
* `callback` function. This function is synchronous; the `callback` is used
|
||||
* for symmetry.
|
||||
*
|
||||
* @private
|
||||
* @param {String} source The JavaScript source to minify.
|
||||
* @param {String} label The label to log.
|
||||
* @param {Function} callback The function called once the process has completed.
|
||||
*/
|
||||
function uglify(source, label, callback) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...');
|
||||
}
|
||||
try {
|
||||
var uglifyJS = require(uglifyPath);
|
||||
|
||||
// 1. parse
|
||||
var toplevel = uglifyJS.parse(source);
|
||||
|
||||
// 2. compress
|
||||
// enable unsafe comparisons
|
||||
toplevel.figure_out_scope();
|
||||
toplevel = toplevel.transform(uglifyJS.Compressor({
|
||||
'comparisons': false,
|
||||
'unsafe_comps': true,
|
||||
'warnings': false
|
||||
}));
|
||||
|
||||
// 3. mangle
|
||||
// excluding the `define` function exposed by AMD loaders
|
||||
toplevel.figure_out_scope();
|
||||
toplevel.compute_char_frequency();
|
||||
toplevel.mangle_names({
|
||||
'except': ['define']
|
||||
});
|
||||
|
||||
// 4. output
|
||||
// restrict lines to 500 characters for consistency with the Closure Compiler
|
||||
var stream = uglifyJS.OutputStream({
|
||||
'ascii_only': true,
|
||||
'comments': /@cc_on|@license|@preserve/i,
|
||||
'max_line_len': 500,
|
||||
});
|
||||
|
||||
toplevel.print(stream);
|
||||
}
|
||||
catch(e) {
|
||||
var exception = e;
|
||||
}
|
||||
callback(exception, stream && String(stream));
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The Closure Compiler callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
* @param {String} map The source map output.
|
||||
*/
|
||||
function onClosureSimpleCompile(exception, result, map) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
|
||||
var simple = this.compiled.simple;
|
||||
simple.source = result;
|
||||
simple.sourceMap = map;
|
||||
zlib.gzip(result, onClosureSimpleGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Closure Compiler `gzip` callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onClosureSimpleGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (result != null) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.compiled.simple.gzip = result;
|
||||
}
|
||||
// compile the source using advanced optimizations
|
||||
if (this.modes.indexOf('advanced') > -1) {
|
||||
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
|
||||
} else {
|
||||
onClosureAdvancedGzip.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Closure Compiler callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
* @param {String} map The source map output.
|
||||
*/
|
||||
function onClosureAdvancedCompile(exception, result, map) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
|
||||
var advanced = this.compiled.advanced;
|
||||
advanced.source = result;
|
||||
advanced.sourceMap = map;
|
||||
zlib.gzip(result, onClosureAdvancedGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The Closure Compiler `gzip` callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onClosureAdvancedGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (result != null) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.compiled.advanced.gzip = result;
|
||||
}
|
||||
// minify the source using UglifyJS
|
||||
if (!this.isMapped) {
|
||||
uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this));
|
||||
} else {
|
||||
onComplete.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The UglifyJS callback.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onUglify(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.uglified.source = result;
|
||||
zlib.gzip(result, onUglifyGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The UglifyJS `gzip` callback.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onUglifyGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (result != null) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.uglified.gzip = result;
|
||||
}
|
||||
// minify the already Closure Compiler simple optimized source using UglifyJS
|
||||
var modes = this.modes;
|
||||
if (modes.indexOf('hybrid') > -1) {
|
||||
if (modes.indexOf('simple') > -1) {
|
||||
uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this));
|
||||
} else if (modes.indexOf('advanced') > -1) {
|
||||
onSimpleHybridGzip.call(this);
|
||||
}
|
||||
} else {
|
||||
onComplete.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onSimpleHybrid(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.hybrid.simple.source = result;
|
||||
zlib.gzip(result, onSimpleHybridGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid `gzip` callback for simple optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onSimpleHybridGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (result != null) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.hybrid.simple.gzip = result;
|
||||
}
|
||||
// minify the already Closure Compiler advance optimized source using UglifyJS
|
||||
if (this.modes.indexOf('advanced') > -1) {
|
||||
uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this));
|
||||
} else {
|
||||
onComplete.call(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {String} result The resulting minified source.
|
||||
*/
|
||||
function onAdvancedHybrid(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
result = postprocess(result);
|
||||
this.hybrid.advanced.source = result;
|
||||
zlib.gzip(result, onAdvancedHybridGzip.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* The hybrid `gzip` callback for advanced optimizations.
|
||||
*
|
||||
* @private
|
||||
* @param {Object|Undefined} exception The error object.
|
||||
* @param {Buffer} result The resulting gzipped source.
|
||||
*/
|
||||
function onAdvancedHybridGzip(exception, result) {
|
||||
if (exception) {
|
||||
throw exception;
|
||||
}
|
||||
if (result != null) {
|
||||
if (!this.isSilent) {
|
||||
console.log('Done. Size: %d bytes.', result.length);
|
||||
}
|
||||
this.hybrid.advanced.gzip = result;
|
||||
}
|
||||
// finish by choosing the smallest compressed file
|
||||
onComplete.call(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* The callback executed after the source is minified and gzipped.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function onComplete() {
|
||||
var compiledSimple = this.compiled.simple,
|
||||
compiledAdvanced = this.compiled.advanced,
|
||||
uglified = this.uglified,
|
||||
hybridSimple = this.hybrid.simple,
|
||||
hybridAdvanced = this.hybrid.advanced;
|
||||
|
||||
var objects = [
|
||||
compiledSimple,
|
||||
compiledAdvanced,
|
||||
uglified,
|
||||
hybridSimple,
|
||||
hybridAdvanced
|
||||
];
|
||||
|
||||
var gzips = objects
|
||||
.map(function(data) { return data.gzip; })
|
||||
.filter(Boolean);
|
||||
|
||||
// select the smallest gzipped file and use its minified counterpart as the
|
||||
// official minified release (ties go to the Closure Compiler)
|
||||
var min = gzips.reduce(function(min, gzip) {
|
||||
var length = gzip.length;
|
||||
return min > length ? length : min;
|
||||
}, Infinity);
|
||||
|
||||
// pass the minified source to the "onComplete" callback
|
||||
objects.some(function(data) {
|
||||
var gzip = data.gzip;
|
||||
if (gzip && gzip.length == min) {
|
||||
data.outputPath = this.outputPath;
|
||||
this.onComplete(data);
|
||||
return true;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose `minify`
|
||||
if (module != require.main) {
|
||||
module.exports = minify;
|
||||
}
|
||||
else {
|
||||
// read the Lo-Dash source file from the first argument if the script
|
||||
// was invoked directly (e.g. `node minify.js source.js`) and write to
|
||||
// `<filename>.min.js`
|
||||
(function() {
|
||||
var options = process.argv;
|
||||
if (options.length < 3) {
|
||||
return;
|
||||
}
|
||||
minify(options);
|
||||
}());
|
||||
}
|
||||
}());
|
||||
@@ -1,79 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** The Node filesystem module */
|
||||
var fs = require('fs');
|
||||
|
||||
/** The minimal license/copyright template */
|
||||
var licenseTemplate = [
|
||||
'/**',
|
||||
' * @license',
|
||||
' * Lo-Dash <%= VERSION %> lodash.com/license',
|
||||
' * Underscore.js 1.4.4 underscorejs.org/LICENSE',
|
||||
' */'
|
||||
].join('\n');
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Post-process a given minified Lo-Dash `source`, preparing it for
|
||||
* deployment.
|
||||
*
|
||||
* @param {String} source The source to process.
|
||||
* @returns {String} Returns the processed source.
|
||||
*/
|
||||
function postprocess(source) {
|
||||
// remove copyright header
|
||||
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
|
||||
|
||||
// correct overly aggressive Closure Compiler advanced optimizations
|
||||
source = source
|
||||
.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}')
|
||||
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")');
|
||||
|
||||
// flip `typeof` expressions to help optimize Safari and
|
||||
// correct the AMD module definition for AMD build optimizers
|
||||
// (e.g. from `"number" == typeof x` to `typeof x == "number")
|
||||
source = source.replace(/(\w)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[.\w]+(?!\[)))/g, function(match, other, type, equality, expression) {
|
||||
return (other ? other + ' ' : '') + expression + equality + type;
|
||||
});
|
||||
|
||||
// add trailing semicolon
|
||||
if (source) {
|
||||
source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1');
|
||||
}
|
||||
// exit early if version snippet isn't found
|
||||
var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source);
|
||||
if (!snippet) {
|
||||
return source;
|
||||
}
|
||||
// add new copyright header
|
||||
var version = snippet[2];
|
||||
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose `postprocess`
|
||||
if (module != require.main) {
|
||||
module.exports = postprocess;
|
||||
}
|
||||
else {
|
||||
// read the Lo-Dash source file from the first argument if the script
|
||||
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
|
||||
// the same file
|
||||
(function() {
|
||||
var options = process.argv;
|
||||
if (options.length < 3) {
|
||||
return;
|
||||
}
|
||||
var filePath = options[options.length - 1],
|
||||
source = fs.readFileSync(filePath, 'utf8');
|
||||
|
||||
fs.writeFileSync(filePath, postprocess(source), 'utf8');
|
||||
}());
|
||||
}
|
||||
}());
|
||||
@@ -1,382 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
/** The Node filesystem module */
|
||||
var fs = require('fs');
|
||||
|
||||
/** Used to minify variables embedded in compiled strings */
|
||||
var compiledVars = [
|
||||
'args',
|
||||
'argsIndex',
|
||||
'argsLength',
|
||||
'callback',
|
||||
'collection',
|
||||
'createCallback',
|
||||
'ctor',
|
||||
'guard',
|
||||
'hasOwnProperty',
|
||||
'index',
|
||||
'isArguments',
|
||||
'isArray',
|
||||
'isString',
|
||||
'iterable',
|
||||
'length',
|
||||
'nativeKeys',
|
||||
'object',
|
||||
'objectTypes',
|
||||
'ownIndex',
|
||||
'ownProps',
|
||||
'result',
|
||||
'skipProto',
|
||||
'source',
|
||||
'thisArg'
|
||||
];
|
||||
|
||||
/** Used to minify `compileIterator` option properties */
|
||||
var iteratorOptions = [
|
||||
'args',
|
||||
'arrays',
|
||||
'bottom',
|
||||
'firstArg',
|
||||
'hasDontEnumBug',
|
||||
'hasEnumPrototype',
|
||||
'isKeysFast',
|
||||
'loop',
|
||||
'nonEnumArgs',
|
||||
'noCharByIndex',
|
||||
'shadowed',
|
||||
'top',
|
||||
'useHas'
|
||||
];
|
||||
|
||||
/** Used to minify variables and string values to a single character */
|
||||
var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
||||
minNames.push.apply(minNames, minNames.map(function(value) {
|
||||
return value + value;
|
||||
}));
|
||||
|
||||
/** Used to protect the specified properties from getting minified */
|
||||
var propWhitelist = [
|
||||
'_',
|
||||
'__wrapped__',
|
||||
'after',
|
||||
'all',
|
||||
'amd',
|
||||
'any',
|
||||
'assign',
|
||||
'at',
|
||||
'attachEvent',
|
||||
'bind',
|
||||
'bindAll',
|
||||
'bindKey',
|
||||
'clearTimeout',
|
||||
'clone',
|
||||
'cloneDeep',
|
||||
'collect',
|
||||
'compact',
|
||||
'compose',
|
||||
'contains',
|
||||
'countBy',
|
||||
'criteria',
|
||||
'debounce',
|
||||
'defaults',
|
||||
'defer',
|
||||
'delay',
|
||||
'detect',
|
||||
'difference',
|
||||
'drop',
|
||||
'each',
|
||||
'environment',
|
||||
'escape',
|
||||
'evaluate',
|
||||
'every',
|
||||
'exports',
|
||||
'extend',
|
||||
'filter',
|
||||
'find',
|
||||
'first',
|
||||
'flatten',
|
||||
'foldl',
|
||||
'foldr',
|
||||
'forEach',
|
||||
'forIn',
|
||||
'forOwn',
|
||||
'functions',
|
||||
'global',
|
||||
'groupBy',
|
||||
'has',
|
||||
'head',
|
||||
'imports',
|
||||
'identity',
|
||||
'include',
|
||||
'index',
|
||||
'indexOf',
|
||||
'initial',
|
||||
'inject',
|
||||
'interpolate',
|
||||
'intersection',
|
||||
'invert',
|
||||
'invoke',
|
||||
'isArguments',
|
||||
'isArray',
|
||||
'isBoolean',
|
||||
'isDate',
|
||||
'isElement',
|
||||
'isEmpty',
|
||||
'isEqual',
|
||||
'isEqual',
|
||||
'isFinite',
|
||||
'isFinite',
|
||||
'isFunction',
|
||||
'isNaN',
|
||||
'isNull',
|
||||
'isNumber',
|
||||
'isObject',
|
||||
'isPlainObject',
|
||||
'isRegExp',
|
||||
'isString',
|
||||
'isUndefined',
|
||||
'keys',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
'map',
|
||||
'max',
|
||||
'memoize',
|
||||
'merge',
|
||||
'methods',
|
||||
'min',
|
||||
'mixin',
|
||||
'noConflict',
|
||||
'object',
|
||||
'omit',
|
||||
'once',
|
||||
'opera',
|
||||
'pairs',
|
||||
'partial',
|
||||
'partialRight',
|
||||
'pick',
|
||||
'pluck',
|
||||
'random',
|
||||
'range',
|
||||
'reduce',
|
||||
'reduceRight',
|
||||
'reject',
|
||||
'rest',
|
||||
'result',
|
||||
'select',
|
||||
'setImmediate',
|
||||
'setTimeout',
|
||||
'shuffle',
|
||||
'size',
|
||||
'some',
|
||||
'sortBy',
|
||||
'sortedIndex',
|
||||
'source',
|
||||
'tail',
|
||||
'take',
|
||||
'tap',
|
||||
'template',
|
||||
'templateSettings',
|
||||
'throttle',
|
||||
'times',
|
||||
'toArray',
|
||||
'unescape',
|
||||
'union',
|
||||
'uniq',
|
||||
'unique',
|
||||
'uniqueId',
|
||||
'value',
|
||||
'values',
|
||||
'variable',
|
||||
'VERSION',
|
||||
'where',
|
||||
'without',
|
||||
'wrap',
|
||||
'zip',
|
||||
|
||||
// properties used by the `backbone` and `underscore` builds
|
||||
'__chain__',
|
||||
'chain',
|
||||
'findWhere'
|
||||
];
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Pre-process a given Lo-Dash `source`, preparing it for minification.
|
||||
*
|
||||
* @param {String} [source=''] The source to process.
|
||||
* @param {Object} [options={}] The options object.
|
||||
* @returns {String} Returns the processed source.
|
||||
*/
|
||||
function preprocess(source, options) {
|
||||
source || (source = '');
|
||||
options || (options = {});
|
||||
|
||||
// remove unrecognized JSDoc tags so the Closure Compiler won't complain
|
||||
source = source.replace(/@(?:alias|category)\b.*/g, '');
|
||||
|
||||
if (options.isTemplate) {
|
||||
return source;
|
||||
}
|
||||
// add brackets to whitelisted properties so the Closure Compiler won't mung them
|
||||
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
|
||||
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) {
|
||||
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
|
||||
});
|
||||
|
||||
// remove brackets from `_.escape()` in `_.template`
|
||||
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
|
||||
|
||||
// remove brackets from `collection.indexOf` in `_.contains`
|
||||
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
|
||||
|
||||
// remove brackets from `result[length].value` in `_.sortBy`
|
||||
source = source.replace("result[length]['value']", 'result[length].value');
|
||||
|
||||
// remove whitespace from string literals
|
||||
source = source.replace(/^([ "'\w]+:)? *"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, captured) {
|
||||
// remove object literal property name
|
||||
if (/:$/.test(captured)) {
|
||||
string = string.slice(captured.length);
|
||||
}
|
||||
// avoids removing the '\n' of the `stringEscapes` object
|
||||
string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
|
||||
return match == false || match == '\\n' ? '' : match;
|
||||
});
|
||||
// prepend object literal property name
|
||||
return (captured || '') + string;
|
||||
});
|
||||
|
||||
// remove whitespace from `_.template` related regexes
|
||||
source = source.replace(/reEmptyString\w+ *=.+/g, function(match) {
|
||||
return match.replace(/ |\\n/g, '');
|
||||
});
|
||||
|
||||
// remove newline from double-quoted strings in `_.template`
|
||||
source = source
|
||||
.replace('"__p += \'"', '"__p+=\'"')
|
||||
.replace('"\';\n"', '"\';"')
|
||||
|
||||
// remove debug sourceURL use in `_.template`
|
||||
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
|
||||
|
||||
// minify internal properties used by 'compareAscending' and `_.sortBy`
|
||||
(function() {
|
||||
var properties = ['criteria', 'index', 'value'],
|
||||
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g);
|
||||
|
||||
if (!snippets) {
|
||||
return;
|
||||
}
|
||||
snippets.forEach(function(snippet) {
|
||||
var modified = snippet;
|
||||
|
||||
// minify properties
|
||||
properties.forEach(function(property, index) {
|
||||
var minName = minNames[index],
|
||||
reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'),
|
||||
reDotProp = RegExp('\\.' + property + '\\b', 'g'),
|
||||
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g');
|
||||
|
||||
modified = modified
|
||||
.replace(reBracketProp, "['" + minName + "']")
|
||||
.replace(reDotProp, "['" + minName + "']")
|
||||
.replace(rePropColon, "$1'" + minName + "':");
|
||||
});
|
||||
|
||||
// replace with modified snippet
|
||||
source = source.replace(snippet, modified);
|
||||
});
|
||||
}());
|
||||
|
||||
// minify all compilable snippets
|
||||
var snippets = source.match(
|
||||
RegExp([
|
||||
// match the `iteratorTemplate`
|
||||
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
|
||||
// match methods created by `createIterator` calls
|
||||
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n',
|
||||
// match variables storing `createIterator` options
|
||||
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
|
||||
// match the the `createIterator` function
|
||||
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
|
||||
].join('|'), 'g')
|
||||
);
|
||||
|
||||
// exit early if no compilable snippets
|
||||
if (!snippets) {
|
||||
return source;
|
||||
}
|
||||
|
||||
snippets.forEach(function(snippet, index) {
|
||||
var isCreateIterator = /function createIterator\b/.test(snippet),
|
||||
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
|
||||
modified = snippet;
|
||||
|
||||
// add brackets to iterator option properties so the Closure Compiler won't mung them
|
||||
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), function(match, prop) {
|
||||
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
|
||||
});
|
||||
|
||||
if (isCreateIterator) {
|
||||
// clip before the `factory` call to avoid minifying its arguments
|
||||
source = source.replace(snippet, modified);
|
||||
snippet = modified = modified.replace(/return factory\([\s\S]+$/, '');
|
||||
}
|
||||
// minify `createIterator` option property names
|
||||
iteratorOptions.forEach(function(property, index) {
|
||||
var minName = minNames[index];
|
||||
|
||||
// minify variables in `iteratorTemplate` or property names in everything else
|
||||
modified = isIteratorTemplate
|
||||
? modified.replace(RegExp('\\b' + property + '\\b', 'g'), minName)
|
||||
: modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'");
|
||||
});
|
||||
|
||||
// minify snippet variables / arguments
|
||||
compiledVars.forEach(function(variable, index) {
|
||||
var minName = minNames[index];
|
||||
|
||||
// ensure properties in compiled strings aren't minified
|
||||
modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName);
|
||||
|
||||
// correct `typeof` values
|
||||
if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) {
|
||||
modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + variable + "'");
|
||||
}
|
||||
});
|
||||
|
||||
// replace with modified snippet
|
||||
source = source.replace(snippet, modified);
|
||||
});
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose `preprocess`
|
||||
if (module != require.main) {
|
||||
module.exports = preprocess;
|
||||
}
|
||||
else {
|
||||
// read the Lo-Dash source file from the first argument if the script
|
||||
// was invoked directly (e.g. `node pre-compile.js source.js`) and write to
|
||||
// the same file
|
||||
(function() {
|
||||
var options = process.argv;
|
||||
if (options.length < 3) {
|
||||
return;
|
||||
}
|
||||
var filePath = options[options.length - 1],
|
||||
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
|
||||
source = fs.readFileSync(filePath, 'utf8');
|
||||
|
||||
fs.writeFileSync(filePath, preprocess(source, {
|
||||
'isTemplate': isTemplate
|
||||
}), 'utf8');
|
||||
}());
|
||||
}
|
||||
}());
|
||||
12
component.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"repo": "lodash/lodash",
|
||||
"version": "2.3.0",
|
||||
"description": "A utility library delivering consistency, customization, performance, & extras.",
|
||||
"license": "MIT",
|
||||
"keywords": ["amd", "browser", "client", "functional", "server", "util"],
|
||||
"scripts": [
|
||||
"index.js",
|
||||
"dist/lodash.compat.js"
|
||||
]
|
||||
}
|
||||
11200
dist/lodash.compat.js
vendored
92
dist/lodash.compat.min.js
vendored
@@ -1,42 +1,58 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.0.1 (Custom Build) lodash.com/license
|
||||
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||at);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(St.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return St.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
|
||||
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=W,a=n.apply(c,a),x(a)?a:c):n.apply(c,a)}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,t,r){if(n==W)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=vr(n);return function(t){for(var r=u.length,e=X;r--&&(e=j(t[u[r]],n[u[r]],ft)););return e
|
||||
}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function a(){for(var n,t={e:tt,f:rt,g:Jt,i:Wt,j:Zt,k:jt,b:"l(n)",c:"",h:"",l:"",m:Q},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var j,n="+t.d+",u=n;if(!n)return u;"+t.l+";",t.b?(r+="var o=n.length;j=-1;if("+t.b+"){",t.j&&(r+="if(m(n)){n=n.split('')}"),r+="while(++j<o){"+t.h+"}}else{"):t.i&&(r+="var o=n.length;j=-1;if(o&&k(n)){while(++j<o){j+='';"+t.h+"}}else{"),t.f&&(r+="var v=typeof n=='function';"),t.g&&t.m?(r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];",t.f&&(r+="if(!(v&&j=='prototype')){"),r+=t.h+"",t.f&&(r+="}")):(r+="for(j in n){",(t.f||t.m)&&(r+="if(",t.f&&(r+="!(v&&j=='prototype')"),t.f&&t.m&&(r+="&&"),t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",(t.f||t.m)&&(r+="}")),r+="}",t.e)for(r+="var g=n.constructor;",e=0;7>e;e++)r+="j='"+t.k[e]+"';if(","constructor"==t.k[e]&&(r+="!(g&&g.prototype===n)&&"),r+="i.call(n,j)){"+t.h+"}";
|
||||
return(t.b||t.i)&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(f,St,y,sr,A,ur,Ft)}function c(n){return"\\"+or[n]}function l(n){return gr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return yr[n]}function y(n){return kt.call(n)==Bt}function h(n){var t=X;if(!n||typeof n!="object"||y(n))return t;
|
||||
var r=n.constructor;return!w(r)&&(!nr||!p(n))||r instanceof r?et?(lr(n,function(n,r,e){return t=!St.call(e,r),X}),t===X):(lr(n,function(n,r){t=r}),t===X||St.call(n,t)):t}function m(n){var t=[];return pr(n,function(n,r){t.push(r)}),t}function d(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=X),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";c||(a=n)}if(u=x(a)){var l=kt.call(a);if(!rr[l]||nr&&p(a))return a;var s=sr(a)}if(!u||!r)return u&&!c?s?v(a):hr({},a):a;
|
||||
switch(u=er[l],l){case Pt:case zt:return c?a:new u(+a);case Ct:case Ut:return c?a:new u(a);case Lt:return c?a:u(a.source,gt.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=s?u(a.length):{},s&&(St.call(n,"index")&&(a.index=n.index),St.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(s?$:pr)(c?a:n,function(n,u){a[u]=d(n,r,e,t,o,i)}),a}function _(n){var t=[];return lr(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=vr(n),e=r.length,u={};++t<e;){var o=r[t];
|
||||
u[n[o]]=o}return u}function j(n,t,r,e,u,o){var i=r===ft;if(r&&!i){r=typeof e=="undefined"?r:f(r,e,2);var a=r(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return X;if(n==W||t==W)return n===t;if(l=kt.call(n),c=kt.call(t),l==Bt&&(l=Kt),c==Bt&&(c=Kt),l!=c)return X;switch(l){case Pt:case zt:return+n==+t;case Ct:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Lt:case Ut:return n==t+""
|
||||
}if(c=l==Mt,!c){if(n.__wrapped__||t.__wrapped__)return j(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Kt||nr&&(p(n)||p(t)))return X;var l=!Xt&&y(n)?Object:n.constructor,s=!Xt&&y(t)?Object:t.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return X}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var v=0,a=Q;if(u.push(n),o.push(t),c){if(l=n.length,v=t.length,a=v==n.length,!a&&!i)return a;for(;v--;)if(c=l,s=t[v],i)for(;c--&&!(a=j(n[c],s,r,e,u,o)););else if(!(a=j(n[v],s,r,e,u,o)))break;
|
||||
return a}return lr(t,function(t,i,f){return St.call(f,i)?(v++,a=St.call(n,i)&&j(n[i],t,r,e,u,o)):void 0}),a&&!i&&lr(n,function(n,t,r){return St.call(r,t)?a=-1<--v:void 0}),a}function w(n){return typeof n=="function"}function x(n){return n?ur[typeof n]:X}function O(n){return typeof n=="number"||kt.call(n)==Ct}function A(n){return typeof n=="string"||kt.call(n)==Ut}function S(n,t,r){var e=arguments,u=0,o=2;if(!x(n))return n;if(r===ft)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length),3<o&&"function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):2<o&&"function"==typeof e[o-1]&&(i=e[--o]);
|
||||
for(;++u<o;)(sr(e[u])?$:pr)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=sr(t))||dr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?sr(f)?f:[]:dr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,ft,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=vr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=X;return r=(0>r?qt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):cr(n,function(n){return++e<r?void 0:!(o=n===t)
|
||||
}),o}function I(n,t,r){var e=Q;if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else cr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function N(n,t,r){var e=[];if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else cr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function R(n,t,r){var e;return t=f(t,r),$(n,function(n,r,u){return t(n,r,u)?(e=n,X):void 0}),e}function $(n,t,r){if(t&&typeof r=="undefined"&&sr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==X;);}else cr(n,t,r);
|
||||
return n}function F(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),sr(n))for(;++e<u;)o[e]=t(n[e],e,n);else cr(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function q(n,t,r){var e=-1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),cr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function D(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),sr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else cr(n,function(n,e,o){r=u?(u=X,n):t(r,n,e,o)
|
||||
});return r}function T(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var a=vr(n),o=a.length;else Zt&&A(n)&&(u=n.split(""));return t=f(t,e,4),$(n,function(n,e,f){e=a?a[--o]:--o,r=i?(i=X,u[e]):t(r,u[e],e,f)}),r}function B(n,t,r){var e;if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else cr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++
|
||||
}else if(e=t,e==W||r)return n[0];return v(n,0,Dt(qt(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];sr(o)?Et.apply(u,t?o:P(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?qt(0,u+r):r||0)-1;else if(r)return e=K(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t!="number"&&t!=W){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==W||r?1:qt(0,t);return v(n,e)}function K(n,t,r,e){var u=0,o=n?n.length:u;
|
||||
for(r=r?f(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function L(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=X);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=St.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>z(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function U(n,t){return Ht||It&&2<arguments.length?It.call.apply(It,arguments):i(n,t,v(arguments,2))}function V(n){var r=v(arguments,1);
|
||||
return setTimeout(function(){n.apply(t,r)},1)}function G(n){return n}function H(n){$(_(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return Et.apply(n,arguments),new r(e.apply(r,n))}})}function J(){return this.__wrapped__}var Q=!0,W=null,X=!1,Y=typeof exports=="object"&&exports,Z=typeof module=="object"&&module&&module.exports==Y&&module,nt=typeof global=="object"&&global;nt.global===nt&&(n=nt);var tt,rt,et,ut=[],ot={},it=0,ft=ot,at=30,ct=n._,lt=/&(?:amp|lt|gt|quot|#39);/g,pt=/\b__p\+='';/g,st=/\b(__p\+=)''\+/g,vt=/(__e\(.*?\)|\b__t\))\+'';/g,gt=/\w*$/,yt=RegExp("^"+(ot.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mt=/<%=([\s\S]+?)%>/g,dt=/($^)/,_t=/[&<>"']/g,bt=/['\n\r\t\u2028\u2029\\]/g,jt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),wt=Math.ceil,xt=ut.concat,Ot=Math.floor,At=yt.test(At=Object.getPrototypeOf)&&At,St=ot.hasOwnProperty,Et=ut.push,kt=ot.toString,It=yt.test(It=v.bind)&&It,Nt=yt.test(Nt=Array.isArray)&&Nt,Rt=n.isFinite,$t=n.isNaN,Ft=yt.test(Ft=Object.keys)&&Ft,qt=Math.max,Dt=Math.min,Tt=Math.random,Bt="[object Arguments]",Mt="[object Array]",Pt="[object Boolean]",zt="[object Date]",Ct="[object Number]",Kt="[object Object]",Lt="[object RegExp]",Ut="[object String]",Vt=!!n.attachEvent,Gt=It&&!/\n|true/.test(It+Vt),Ht=It&&!Gt,Jt=Ft&&(Vt||Gt),Qt=(Qt={0:1,length:1},ut.splice.call(Qt,0,1),Qt[0]),Wt=Q;
|
||||
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Wt=!r;tt=!/valueOf/.test(t),rt=n.propertyIsEnumerable("prototype"),et="x"!=t[0]})(1);var Xt=arguments.constructor==Object,Yt=!y(arguments),Zt="xx"!="x"[0]+Object("x")[0];try{var nr=kt.call(document)==Kt&&!({toString:0}+"")}catch(tr){}var rr={"[object Function]":X};rr[Bt]=rr[Mt]=rr[Pt]=rr[zt]=rr[Ct]=rr[Kt]=rr[Lt]=rr[Ut]=Q;var er={};er[Mt]=Array,er[Pt]=Boolean,er[zt]=Date,er[Kt]=Object,er[Ct]=Number,er[Lt]=RegExp,er[Ut]=String;
|
||||
var ur={"boolean":X,"function":Q,object:Q,number:X,string:X,undefined:X},or={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:mt,variable:"",imports:{_:r}};var ir={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},fr={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},ar={l:"if(!r[typeof n])return u;"+fr.l,b:X},cr=a(fr);
|
||||
Yt&&(y=function(n){return n?St.call(n,"callee"):X});var lr=a(fr,ar,{m:X}),pr=a(fr,ar),sr=Nt||function(n){return Xt&&n instanceof Array||kt.call(n)==Mt},vr=Ft?function(n){return x(n)?rt&&typeof n=="function"||Wt&&n.length&&y(n)?m(n):Ft(n):[]}:m,gr={"&":"&","<":"<",">":">",'"':""","'":"'"},yr=b(gr),hr=a(ir,{l:ir.l.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),mr=a(ir);
|
||||
w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==kt.call(n)});var dr=At?function(n){if(!n||typeof n!="object")return X;var t=n.valueOf,r=typeof t=="function"&&(r=At(t))&&At(r);return r?n==r||At(n)==r&&!y(n):h(n)}:h,_r=F,br=N;Gt&&Z&&typeof setImmediate=="function"&&(V=U(setImmediate,n)),r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=hr,r.at=function(n){var t=-1,r=xt.apply(ut,v(arguments,1)),e=r.length,u=Array(e);for(Zt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];
|
||||
return u},r.bind=U,r.bindAll=function(n){for(var t=xt.apply(ut,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",St.call(e,r)?e[r]++:e[r]=1
|
||||
}),e},r.debounce=function(n,t,r){function e(){f=W,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},r.defaults=mr,r.defer=V,r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=xt.apply(ut,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=N,r.flatten=P,r.forEach=$,r.forIn=lr,r.forOwn=pr,r.functions=_,r.groupBy=function(n,t,r){var e={};
|
||||
return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",(St.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==W||r?1:t||e;return v(n,0,Dt(qt(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=St.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;
|
||||
a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=vr,r.map=F,r.max=q,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return St.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)
|
||||
}}else t=!t&&A(n)?u:f(t,r),cr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=xt.apply(ut,arguments);return lr(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=W,r)}},r.pairs=function(n){for(var t=-1,r=vr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
|
||||
u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),W,ft)},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=xt.apply(ut,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),lr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=_r,r.range=function(n,t,r){n=+n||0,r=+r||1,t==W&&(t=n,n=0);var e=-1;t=qt(0,wt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),N(n,function(n,r,e){return!t(n,r,e)
|
||||
})},r.rest=C,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return $(n,function(n){var r=Ot(Tt()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),$(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=W,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);
|
||||
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=W,f=a,u=n.apply(o,e)),u}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Zt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return L(xt.apply(ut,arguments))},r.uniq=L,r.values=E,r.where=br,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];
|
||||
return Et.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?q(_r(arguments,"length")):0,e=Array(r);++t<r;)e[t]=_r(arguments,t);return e},r.collect=F,r.drop=C,r.each=$,r.extend=hr,r.methods=_,r.select=N,r.tail=C,r.unique=L,H(r),r.clone=d,r.cloneDeep=function(n,t,r){return d(n,Q,t,r)},r.contains=k,r.escape=function(n){return n==W?"":(n+"").replace(_t,l)},r.every=I,r.find=R,r.has=function(n,t){return n?St.call(n,t):X},r.identity=G,r.indexOf=z,r.isArguments=y,r.isArray=sr,r.isBoolean=function(n){return n===Q||n===X||kt.call(n)==Pt
|
||||
},r.isDate=function(n){return n instanceof Date||kt.call(n)==zt},r.isElement=function(n){return n?1===n.nodeType:X},r.isEmpty=function(n){var t=Q;if(!n)return t;var r=kt.call(n),e=n.length;return r==Mt||r==Ut||r==Bt||Yt&&y(n)||r==Kt&&typeof e=="number"&&w(n.splice)?!e:(pr(n,function(){return t=X}),t)},r.isEqual=j,r.isFinite=function(n){return Rt(n)&&!$t(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===W},r.isNumber=O,r.isObject=x,r.isPlainObject=dr,r.isRegExp=function(n){return n instanceof RegExp||kt.call(n)==Lt
|
||||
},r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?qt(0,e+r):Dt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=ct,this},r.random=function(n,t){return n==W&&t==W&&(t=1),n=+n||0,t==W&&(t=n,n=0),n+Ot(Tt()*((+t||0)-n+1))},r.reduce=D,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:vr(n).length
|
||||
},r.some=B,r.sortedIndex=K,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=mr({},u,o);var i,f=mr({},u.imports,o.imports),o=vr(f),f=E(f),a=0,l=u.interpolate||dt,p="__p+='";n.replace(RegExp((u.escape||dt).source+"|"+l.source+"|"+(l===mt?ht:dt).source+"|"+(u.evaluate||dt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(bt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=Q,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(pt,""):p).replace(st,"$1").replace(vt,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+p+"return __p}";
|
||||
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return n==W?"":(n+"").replace(lt,g)},r.uniqueId=function(n){var t=++it;return(n==W?"":n+"")+t},r.all=I,r.any=B,r.detect=R,r.foldl=D,r.foldr=T,r.include=k,r.inject=D,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return Et.apply(t,arguments),n.apply(r,t)})}),r.first=M,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=u;
|
||||
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==W||r)return n[u-1];return v(n,qt(0,u-e))}},r.take=M,r.head=M,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.1",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=J,r.prototype.valueOf=J,cr(["join","pop","shift"],function(n){var t=ut[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),cr(["push","reverse","sort","unshift"],function(n){var t=ut[n];
|
||||
r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),cr(["concat","slice","splice"],function(n){var t=ut[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Qt&&cr(["pop","shift","splice"],function(n){var t=ut[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r
|
||||
})):Y?Z?(Z.exports=r)._=r:Y._=r:n._=r})(this);
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}
|
||||
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function g(e){function v(n){return n&&typeof n=="object"&&!We(n)&&je.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n
|
||||
}function w(n){function t(){if(r){var n=r.slice();Ce.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return Ct(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return Ke(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!Ct(n))return n;var a=ve.call(n);if(!H[a]||!qe.nodeClass&&f(n))return n;var l=Te[a];switch(a){case T:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o
|
||||
}if(a=We(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):nr({},n);return a&&(je.call(n,"index")&&(o.index=n.index),je.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Ze:rr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return Ct(n)?Ae(n):{}}function tt(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(qe.funcNames&&(r=!n.name),r=r||!qe.funcDecomp,!r)){var u=_e.call(n);
|
||||
qe.funcNames||(r=!I.test(u)),r||(r=B.test(u),Ke(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Ht(n,t)}function ot(n){function t(){var n=l?a:this;if(u){var h=u.slice();Ce.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&Ce.apply(h,o),c&&h.length<i)?(r|=16,ot([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),Ct(h)?h:n):e.apply(n,h))
|
||||
}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return Ke(t,n),t}function at(e,r){var u=-1,a=yt(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function it(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(We(a)||bt(a))){t||(a=it(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o
|
||||
}function lt(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=ve.call(n),p=ve.call(t);if(l==$&&(l=G),p==$&&(p=G),l!=p)return false;switch(l){case T:case z:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==le(t)}if(p=l==L,!p){var s=je.call(n,"__wrapped__"),g=je.call(t,"__wrapped__");if(s||g)return lt(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);
|
||||
if(l!=G||!qe.nodeClass&&(f(n)||f(t)))return false;if(l=!qe.argsObject&&bt(n)?ae:n.constructor,s=!qe.argsObject&&bt(t)?ae:t.constructor,l!=s&&!(xt(l)&&l instanceof l&&xt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;var h=0,a=true;if(u.push(n),o.push(t),p){if(l=n.length,h=t.length,a=h==n.length,!a&&!r)return a;for(;h--;)if(p=l,s=t[h],r)for(;p--&&!(a=lt(n[p],s,e,r,u,o)););else if(!(a=lt(n[h],s,e,r,u,o)))break;return a
|
||||
}return er(t,function(t,i,l){return je.call(l,i)?(h++,a=je.call(n,i)&<(n[i],t,e,r,u,o)):void 0}),a&&!r&&er(n,function(n,t,e){return je.call(e,t)?a=-1<--h:void 0}),s&&(c(u),c(o)),a}function ft(n,t,e,r,u){(We(t)?Nt:rr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=We(t))||ur(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?We(f)?f:[]:ur(f)?f:{}),r.push(t),u.push(f),c||ft(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);
|
||||
n[o]=f})}function ct(n,t){return n+be(Le()*(t-n+1))}function pt(e,r,u){var a=-1,l=yt(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;if(g){var v=o(h);v?(l=t,h=v):(g=false,h=u?h:(c(h),s))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function st(n){return function(t,e,r){var u={};if(e=v.createCallback(e,r,3),We(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Ze(t,function(t,r,o){n(u,t,e(t,r,o),o)
|
||||
});return u}}function gt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||xt(n)))throw new fe;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&Ce.apply(c[2]||(c[2]=[]),e),f&&Ce.apply(c[3]||(c[3]=[]),r),c[1]|=t,gt.apply(null,c)):(1==t||17===t?w:ot)([n,t,e,r,u,o])}function ht(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];
|
||||
t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=re,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",qe.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):qe.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),qe.enumPrototypes&&(r+="var G=typeof t=='function';"),qe.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var u=[];if(qe.enumPrototypes&&u.push('!(G&&n=="prototype")'),qe.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";
|
||||
else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",qe.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";r+="}"}return(e.b||qe.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,pe,je,d,bt,We,Et,Q.f,se,X,ze,M,ge,ve)
|
||||
}function vt(n){return Ve[n]}function yt(){var t=(t=v.indexOf)===qt?n:t;return t}function mt(n){var t,e;return!n||ve.call(n)!=G||(t=n.constructor,xt(t)&&!(t instanceof t))||!qe.argsClass&&bt(n)||!qe.nodeClass&&f(n)?false:qe.ownLast?(er(n,function(n,t,r){return e=je.call(r,t),false}),false!==e):(er(n,function(n,t){e=t}),typeof e=="undefined"||je.call(n,e))}function dt(n){return Qe[n]}function bt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||false}function _t(n,t,e){var r=Je(n),u=r.length;
|
||||
for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function wt(n){var t=[];return er(n,function(n,e){xt(n)&&t.push(e)}),t.sort()}function jt(n){for(var t=-1,e=Je(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function xt(n){return typeof n=="function"}function Ct(n){return!(!n||!X[typeof n])}function kt(n){return typeof n=="number"||n&&typeof n=="object"&&ve.call(n)==W||false}function Et(n){return typeof n=="string"||n&&typeof n=="object"&&ve.call(n)==M||false}function Ot(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;)u[t]=n[e[t]];
|
||||
return u}function St(n,t,e){var r=-1,u=yt(),o=n?n.length:0,a=false;return e=(0>e?Re(0,o+e):e)||0,We(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(Et(n)?n.indexOf(t,e):u(n,t,e)):Ze(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function It(n,t,e){var r=true;if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Ze(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];
|
||||
t(o,e,n)&&r.push(o)}}else Ze(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Dt(n,t,e){if(t=v.createCallback(t,e,3),!We(n)){var r;return Ze(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Nt(n,t,e){if(t&&typeof e=="undefined"&&We(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Ze(n,t,e);return n}function Bt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),We(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=Je(n),u=o.length;
|
||||
else qe.unindexedChars&&Et(n)&&(r=n.split(""));Ze(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Pt(n,t,e){var r=-1,u=n?n.length:0,o=ne(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),We(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ze(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Rt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)
|
||||
});return o}function Ft(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),We(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ze(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function $t(n,t,e,r){var u=3>arguments.length;return t=v.createCallback(t,r,4),Bt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Lt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Nt(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function Tt(n,t,e){var r;if(t=v.createCallback(t,e,3),We(n)){e=-1;
|
||||
for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ze(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Fe(Re(0,r),u))}function qt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Re(0,u+r):r||0}else if(r)return r=Wt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
|
||||
for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Re(0,t);return s(n,r)}function Wt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Gt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),pt(n,t,e)}function Jt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Rt(lr(n,"length")):0,r=ne(0>e?0:e);++t<e;)r[t]=lr(n,t);
|
||||
return r}function Mt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Ht(n,t){return 2<arguments.length?gt(n,17,s(arguments,2),null,t):gt(n,1,null,null,t)}function Ut(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!xt(n))throw new fe;if(t=Re(0,t)||0,true===e)var g=true,s=false;else Ct(e)&&(g=e.leading,p="maxWait"in e&&(Re(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(xe()-a);0<e?l=Ee(v,e):(u&&de(u),e=f,u=l=f=h,e&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null)))
|
||||
},y=function(){l&&de(l),u=l=f=h,(s||p!==t)&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=xe(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);var h=p-(a-c),m=0>=h;m?(u&&(u=de(u)),c=a,o=n.apply(i,r)):u||(u=Ee(y,h))}return m&&l?l=de(l):l||t===p||(l=Ee(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Vt(n){if(!xt(n))throw new fe;var t=s(arguments,1);return Ee(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||xt(e);
|
||||
t||(e=y,t=n,n=v),Nt(wt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return Ce.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ae=e.Object,ie=e.RegExp,le=e.String,fe=e.TypeError,ce=[],pe=e.Error.prototype,se=ae.prototype,ge=le.prototype,he=e._,ve=se.toString,ye=ie("^"+le(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),me=ue.ceil,de=e.clearTimeout,be=ue.floor,_e=re.prototype.toString,we=ye.test(we=ae.getPrototypeOf)&&we,je=se.hasOwnProperty,xe=ye.test(xe=ee.now)&&xe||function(){return+new ee
|
||||
},Ce=ce.push,ke=se.propertyIsEnumerable,Ee=e.setTimeout,Oe=ce.splice,Se=typeof(Se=rt&&et&&rt.setImmediate)=="function"&&!ye.test(Se)&&Se,Ie=function(){try{var n={},t=ye.test(t=ae.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ae=ye.test(Ae=ae.create)&&Ae,De=ye.test(De=ne.isArray)&&De,Ne=e.isFinite,Be=e.isNaN,Pe=ye.test(Pe=ae.keys)&&Pe,Re=ue.max,Fe=ue.min,$e=e.parseInt,Le=ue.random,Te={};Te[L]=ne,Te[T]=te,Te[z]=ee,Te[K]=re,Te[G]=ae,Te[W]=oe,Te[J]=ie,Te[M]=le;var ze={};ze[L]=ze[z]=ze[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},ze[T]=ze[M]={constructor:true,toString:true,valueOf:true},ze[q]=ze[K]=ze[J]={constructor:true,toString:true},ze[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
|
||||
for(t in ze)je.call(ze,t)&&!je.call(ze[t],e)&&(ze[t][e]=false)}}(),y.prototype=v.prototype;var qe=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);qe.argsClass=ve.call(arguments)==$,qe.argsObject=arguments.constructor==ae&&!(arguments instanceof ne),qe.enumErrorProps=ke.call(pe,"message")||ke.call(pe,"name"),qe.enumPrototypes=ke.call(n,"prototype"),qe.funcDecomp=!ye.test(e.WinRTError)&&B.test(g),qe.funcNames=typeof re.name=="string",qe.nonEnumArgs=0!=u,qe.nonEnumShadows=!/valueOf/.test(r),qe.ownLast="x"!=r[0],qe.spliceObjects=(ce.splice.call(t,0,1),!t[0]),qe.unindexedChars="xx"!="x"[0]+ae("x")[0];
|
||||
try{qe.nodeClass=!(ve.call(document)==G&&!({toString:0}+""))}catch(o){qe.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:v}},Ae||(nt=function(){function n(){}return function(t){if(Ct(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var Ke=Ie?function(n,t){V.value=t,Ie(n,"__bindData__",V)}:Yt;qe.argsClass||(bt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&je.call(n,"callee")&&!ke.call(n,"callee")||false
|
||||
});var We=De||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==L||false},Ge=ht({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Je=Pe?function(n){return Ct(n)?qe.enumPrototypes&&typeof n=="function"||qe.nonEnumArgs&&n.length&&bt(n)?Ge(n):Pe(n):[]}:Ge,Me={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Je,g:"if(e(t[n],n,g)===false)return E"},He={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:Je,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Ue={i:"if(!B[typeof t])return E;"+Me.i,b:false},Ve={"&":"&","<":"<",">":">",'"':""","'":"'"},Qe=jt(Ve),Xe=ie("("+Je(Qe).join("|")+")","g"),Ye=ie("["+Je(Ve).join("")+"]","g"),Ze=ht(Me),nr=ht(He,{i:He.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),tr=ht(He),er=ht(Me,Ue,{j:false}),rr=ht(Me,Ue);
|
||||
xt(/x/)&&(xt=function(n){return typeof n=="function"&&ve.call(n)==K});var ur=we?function(n){if(!n||ve.call(n)!=G||!qe.argsClass&&bt(n))return false;var t=n.valueOf,e=typeof t=="function"&&(e=we(t))&&we(e);return e?n==e||we(n)==e:mt(n)}:mt,or=st(function(n,t,e){je.call(n,e)?n[e]++:n[e]=1}),ar=st(function(n,t,e){(je.call(n,e)?n[e]:n[e]=[]).push(t)}),ir=st(function(n,t,e){n[e]=t}),lr=Pt;Se&&(Vt=function(n){if(!xt(n))throw new fe;return Se.apply(e,arguments)});var fr=8==$e(j+"08")?$e:function(n,t){return $e(Et(n)?n.replace(D,""):n,t||0)
|
||||
};return v.after=function(n,t){if(!xt(t))throw new fe;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=nr,v.at=function(n){var t=arguments,e=-1,r=it(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);for(qe.unindexedChars&&Et(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Ht,v.bindAll=function(n){for(var t=1<arguments.length?it(arguments,true,false,1):wt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=gt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?gt(t,19,s(arguments,2),null,n):gt(t,3,null,null,n)
|
||||
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!xt(n[t]))throw new fe;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.countBy=or,v.create=function(n,t){var e=nt(n);return t?nr(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);if("object"!=r)return function(t){return t[n]
|
||||
};var u=Je(n),o=u[0],a=n[o];return 1!=u.length||a!==a||Ct(a)?function(t){for(var e=u.length,r=false;e--&&(r=lt(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,gt(n,4,null,null,null,t)},v.debounce=Ut,v.defaults=tr,v.defer=Vt,v.delay=function(n,t){if(!xt(n))throw new fe;var e=s(arguments,2);return Ee(function(){n.apply(h,e)},t)},v.difference=function(n){return at(n,it(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Pt(n,e,r)),it(n,t)
|
||||
},v.forEach=Nt,v.forEachRight=Bt,v.forIn=er,v.forInRight=function(n,t,e){var r=[];er(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=rr,v.forOwnRight=_t,v.functions=wt,v.groupBy=ar,v.indexBy=ir,v.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Fe(Re(0,u-r),u))},v.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,s=yt(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
|
||||
l[a]=s===n&&(y?y.length:0)>=_&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):s(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):s(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&p(m);return c(l),c(v),h},v.invert=jt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=ne(typeof o=="number"?o:0);return Nt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=Je,v.map=Pt,v.max=Rt,v.memoize=function(n,t){if(!xt(n))throw new fe;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];
|
||||
return je.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!Ct(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)ft(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];
|
||||
i<o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];er(n,function(n,t){u.push(t)});for(var u=at(u,it(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!xt(n))throw new fe;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)
|
||||
}},v.pairs=function(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},v.partial=function(n){return gt(n,16,s(arguments,1))},v.partialRight=function(n){return gt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=it(arguments,true,false,1),a=Ct(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=lr,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(Oe.call(n,o--,1),u--);
|
||||
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Re(0,me((t-n)/(e||1)));for(var u=ne(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Oe.call(n,r--,1),u--);return o},v.rest=Kt,v.shuffle=Lt,v.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=ne(typeof o=="number"?o:0);
|
||||
for(t=v.createCallback(t,e,3),Nt(n,function(n,e,u){var o=a[++r]=l();o.m=t(n,e,u),o.n=r,o.o=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.o,p(n);return a},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!xt(n))throw new fe;return false===e?r=false:Ct(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),U.leading=r,U.maxWait=t,U.trailing=u,Ut(n,t,U)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=ne(n);for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?qe.unindexedChars&&Et(n)?n.split(""):s(n):Ot(n)
|
||||
},v.transform=function(n,t,e,r){var u=We(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Ze:rr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return pt(it(arguments,true,true))},v.uniq=Gt,v.values=Ot,v.where=At,v.without=function(n){return at(n,s(arguments,1))},v.wrap=function(n,t){return gt(t,16,[n])},v.zip=Jt,v.zipObject=Mt,v.collect=Pt,v.drop=Kt,v.each=Nt,v.eachRight=Bt,v.extend=nr,v.methods=wt,v.object=Mt,v.select=At,v.tail=Kt,v.unique=Gt,v.unzip=Jt,Xt(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))
|
||||
},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=St,v.escape=function(n){return null==n?"":le(n).replace(Ye,vt)},v.every=It,v.find=Dt,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),rr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Bt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0
|
||||
}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),_t(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?je.call(n,t):false},v.identity=Qt,v.indexOf=qt,v.isArguments=bt,v.isArray=We,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ve.call(n)==T||false},v.isDate=function(n){return n&&typeof n=="object"&&ve.call(n)==z||false
|
||||
},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=ve.call(n),r=n.length;return e==L||e==M||(qe.argsClass?e==$:bt(n))||e==G&&typeof r=="number"&&xt(n.splice)?!r:(rr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return lt(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ne(n)&&!Be(parseFloat(n))},v.isFunction=xt,v.isNaN=function(n){return kt(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=kt,v.isObject=Ct,v.isPlainObject=ur,v.isRegExp=function(n){return n&&X[typeof n]&&ve.call(n)==J||false
|
||||
},v.isString=Et,v.isUndefined=function(n){return typeof n=="undefined"},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Re(0,r+e):Fe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Xt,v.noConflict=function(){return e._=he,this},v.noop=Yt,v.parseInt=fr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Le(),Fe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t)
|
||||
},v.reduce=Ft,v.reduceRight=$t,v.result=function(n,t){if(n){var e=n[t];return xt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Je(n).length},v.some=Tt,v.sortedIndex=Wt,v.template=function(n,t,e){var r=v.templateSettings;n=le(n||""),e=tr({},e,r);var u,o=tr({},e.imports,r.imports),r=Je(o),o=Ot(o),i=0,l=e.interpolate||N,f="__p+='",l=ie((e.escape||N).source+"|"+l.source+"|"+(l===A?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
|
||||
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=re(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":le(n).replace(Xe,dt)},v.uniqueId=function(n){var t=++m;return le(null==n?"":n)+t
|
||||
},v.all=It,v.any=Tt,v.detect=Dt,v.findWhere=Dt,v.foldl=Ft,v.foldr=$t,v.include=St,v.inject=Ft,rr(v,function(n,t){v.prototype[t]||(v.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return Ce.apply(t,arguments),t=n.apply(v,t),e?new y(t,e):t})}),v.first=zt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Re(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Ot(n):qe.unindexedChars&&Et(n)&&(n=n.split("")),null==t||e?n?n[ct(0,n.length-1)]:h:(n=Lt(n),n.length=Fe(Re(0,t),n.length),n)
|
||||
},v.take=zt,v.head=zt,rr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.3.0",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return le(this.__wrapped__)},v.prototype.value=Zt,v.prototype.valueOf=Zt,Ze(["join","pop","shift"],function(n){var t=ce[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
||||
return n?new y(e,n):e}}),Ze(["push","reverse","sort","unshift"],function(n){var t=ce[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(n){var t=ce[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),qe.spliceObjects||Ze(["pop","shift","splice"],function(n){var t=ce[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
|
||||
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,I=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),$="[object Arguments]",L="[object Array]",T="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",H={};
|
||||
H[K]=false,H[$]=H[L]=H[T]=H[z]=H[W]=H[G]=H[J]=H[M]=true;var U={leading:false,maxWait:0,trailing:false},V={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
|
||||
!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);
|
||||
10658
dist/lodash.js
vendored
87
dist/lodash.min.js
vendored
@@ -1,40 +1,55 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.0.1 (Custom Build) lodash.com/license
|
||||
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash modern -o ./dist/lodash.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(n,t){function r(n){if(!n||typeof n!="object")return W;var t=n.valueOf,r=typeof t=="function"&&(r=bt(t))&&bt(r);if(r)n=n==r||bt(n)==r&&!h(n);else{var e=W;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!j(t)||t instanceof t?(Yt(n,function(n,t){e=t}),n=e===W||jt.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||ut);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";
|
||||
(jt.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return jt.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function o(n){return n.charCodeAt(0)}function i(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function f(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=Q,a=n.apply(c,a),w(a)?a:c):n.apply(c,a)
|
||||
}var o=j(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function a(n,t,r){if(n==Q)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=tr(n);return function(t){for(var r=u.length,e=W;r--&&(e=b(t[u[r]],n[u[r]],et)););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function c(){for(var n,t={g:Ut,b:"l(n)",c:"",h:"",l:"",m:L},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];
|
||||
return n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var j,n="+t.d+",u=n;if(!n)return u;"+t.l+";",t.b&&(r+="var o=n.length;j=-1;if("+t.b+"){while(++j<o){"+t.h+"}}else{"),t.g&&t.m?r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];"+t.h+"}":(r+="for(j in n){",t.m&&(r+="if(",t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",t.m&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(a,jt,h,nr,A,Ht,kt)}function l(n){return"\\"+Jt[n]}function p(n){return rr[n]
|
||||
}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return er[n]}function h(n){return xt.call(n)==Ft}function y(n){var t=[];return Zt(n,function(n,r){t.push(r)}),t}function m(n,r,e,u,o,i){var f=n;if(typeof r=="function"&&(u=e,e=r,r=W),typeof e=="function"){e=typeof u=="undefined"?e:a(e,u,1);var f=e(f),c=typeof f!="undefined";c||(f=n)}if(u=w(f)){var l=xt.call(f);if(!Vt[l])return f;var p=nr(f)
|
||||
}if(!u||!r)return u&&!c?p?v(f):ur({},f):f;switch(u=Gt[l],l){case Dt:case It:return c?f:new u(+f);case Tt:case zt:return c?f:new u(f);case Mt:return c?f:u(f.source,lt.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(f=p?u(f.length):{},p&&(jt.call(n,"index")&&(f.index=n.index),jt.call(n,"input")&&(f.input=n.input))),o.push(n),i.push(f),(p?$:Zt)(c?f:n,function(n,u){f[u]=m(n,r,e,t,o,i)}),f}function d(n){var t=[];return Yt(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=tr(n),e=r.length,u={};++t<e;){var o=r[t];
|
||||
u[n[o]]=o}return u}function b(n,t,r,e,u,o){var i=r===et;if(r&&!i){r=typeof e=="undefined"?r:a(r,e,2);var f=r(n,t);if(typeof f!="undefined")return!!f}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return W;if(n==Q||t==Q)return n===t;if(l=xt.call(n),c=xt.call(t),l==Ft&&(l=Bt),c==Ft&&(c=Bt),l!=c)return W;switch(l){case Dt:case It:return+n==+t;case Tt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Mt:case zt:return n==t+""
|
||||
}if(c=l==qt,!c){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Bt)return W;var l=n.constructor,p=t.constructor;if(l!=p&&(!j(l)||!(l instanceof l&&j(p)&&p instanceof p)))return W}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var s=0,f=L;if(u.push(n),o.push(t),c){if(l=n.length,s=t.length,f=s==n.length,!f&&!i)return f;for(;s--;)if(c=l,p=t[s],i)for(;c--&&!(f=b(n[c],p,r,e,u,o)););else if(!(f=b(n[s],p,r,e,u,o)))break;return f}return Yt(t,function(t,i,a){return jt.call(a,i)?(s++,f=jt.call(n,i)&&b(n[i],t,r,e,u,o)):void 0
|
||||
}),f&&!i&&Yt(n,function(n,t,r){return jt.call(r,t)?f=-1<--s:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?Ht[typeof n]:W}function x(n){return typeof n=="number"||xt.call(n)==Tt}function A(n){return typeof n=="string"||xt.call(n)==zt}function O(n,t,e){var u=arguments,o=0,i=2;if(!w(n))return n;if(e===et)var f=u[3],c=u[4],l=u[5];else c=[],l=[],typeof e!="number"&&(i=u.length),3<i&&"function"==typeof u[i-2]?f=a(u[--i-1],u[i--],2):2<i&&"function"==typeof u[i-1]&&(f=u[--i]);for(;++o<i;)(nr(u[o])?$:Zt)(u[o],function(t,e){var u,o,i=t,a=n[e];
|
||||
if(t&&((o=nr(t))||r(t))){for(i=c.length;i--;)if(u=c[i]==t){a=l[i];break}u||(a=o?nr(a)?a:[]:r(a)?a:{},f&&(i=f(a,t),typeof i!="undefined"&&(a=i)),c.push(t),l.push(a),f||(a=O(a,t,et,f,c,l)))}else f&&(i=f(a,t),typeof i=="undefined"&&(i=t)),typeof i!="undefined"&&(a=i);n[e]=a});return n}function E(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,t,r){var e=-1,u=n?n.length:0,o=W;return r=(0>r?Nt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):Xt(n,function(n){return++e<r?void 0:!(o=n===t)
|
||||
}),o}function k(n,t,r){var e=L;if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Xt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function N(n,t,r){var e=[];if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Xt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function R(n,t,r){var e;return t=a(t,r),$(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0}),e}function $(n,t,r){if(t&&typeof r=="undefined"&&nr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==W;);}else Xt(n,t,r);
|
||||
return n}function F(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),nr(n))for(;++e<u;)o[e]=t(n[e],e,n);else Xt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function q(n,t,r){var e=-1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function D(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,4),nr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else Xt(n,function(n,e,o){r=u?(u=W,n):t(r,n,e,o)
|
||||
});return r}function I(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=tr(n),u=i.length;return t=a(t,e,4),$(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=W,n[f]):t(r,n[f],f,a)}),r}function T(n,t,r){var e;if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Xt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function B(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[0];
|
||||
return v(n,0,Rt(Nt(0,e),u))}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];nr(o)?wt.apply(u,t?o:M(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Nt(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t!="number"&&t!=Q){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==Q||r?1:Nt(0,t);return v(n,e)}function C(n,t,r,e){var u=0,o=n?n.length:u;
|
||||
for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function K(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;typeof t=="function"&&(e=r,r=t,t=W);var c=!t&&75<=o;if(c)var l={};for(r&&(f=[],r=a(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=jt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>z(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function U(n,t){return Kt||At&&2<arguments.length?At.call.apply(At,arguments):f(n,t,v(arguments,2))}function V(n){var r=v(arguments,1);
|
||||
return setTimeout(function(){n.apply(t,r)},1)}function G(n){return n}function H(n){$(d(n),function(t){var r=e[t]=n[t];e.prototype[t]=function(){var n=[this.__wrapped__];return wt.apply(n,arguments),new e(r.apply(e,n))}})}function J(){return this.__wrapped__}var L=!0,Q=null,W=!1,X=typeof exports=="object"&&exports,Y=typeof module=="object"&&module&&module.exports==X&&module,Z=typeof global=="object"&&global;Z.global===Z&&(n=Z);var nt=[],tt={},rt=0,et=tt,ut=30,ot=n._,it=/&(?:amp|lt|gt|quot|#39);/g,ft=/\b__p\+='';/g,at=/\b(__p\+=)''\+/g,ct=/(__e\(.*?\)|\b__t\))\+'';/g,lt=/\w*$/,pt=RegExp("^"+(tt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),st=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/<%=([\s\S]+?)%>/g,gt=/($^)/,ht=/[&<>"']/g,yt=/['\n\r\t\u2028\u2029\\]/g,mt=Math.ceil,dt=nt.concat,_t=Math.floor,bt=pt.test(bt=Object.getPrototypeOf)&&bt,jt=tt.hasOwnProperty,wt=nt.push,xt=tt.toString,At=pt.test(At=v.bind)&&At,Ot=pt.test(Ot=Array.isArray)&&Ot,Et=n.isFinite,St=n.isNaN,kt=pt.test(kt=Object.keys)&&kt,Nt=Math.max,Rt=Math.min,$t=Math.random,Ft="[object Arguments]",qt="[object Array]",Dt="[object Boolean]",It="[object Date]",Tt="[object Number]",Bt="[object Object]",Mt="[object RegExp]",zt="[object String]",Pt=!!n.attachEvent,Ct=At&&!/\n|true/.test(At+Pt),Kt=At&&!Ct,Ut=kt&&(Pt||Ct),Vt={"[object Function]":W};
|
||||
Vt[Ft]=Vt[qt]=Vt[Dt]=Vt[It]=Vt[Tt]=Vt[Bt]=Vt[Mt]=Vt[zt]=L;var Gt={};Gt[qt]=Array,Gt[Dt]=Boolean,Gt[It]=Date,Gt[Bt]=Object,Gt[Tt]=Number,Gt[Mt]=RegExp,Gt[zt]=String;var Ht={"boolean":W,"function":L,object:L,number:W,string:W,undefined:W},Jt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:vt,variable:"",imports:{_:e}};var Lt={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},Qt={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},Wt={l:"if(!r[typeof n])return u;"+Qt.l,b:W},Xt=c(Qt),Yt=c(Qt,Wt,{m:W}),Zt=c(Qt,Wt),nr=Ot||function(n){return n instanceof Array||xt.call(n)==qt
|
||||
},tr=kt?function(n){return w(n)?kt(n):[]}:y,rr={"&":"&","<":"<",">":">",'"':""","'":"'"},er=_(rr),ur=c(Lt,{l:Lt.l.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),or=c(Lt);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==xt.call(n)}),Ct&&Y&&typeof setImmediate=="function"&&(V=U(setImmediate,n)),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||
}},e.assign=ur,e.at=function(n){for(var t=-1,r=dt.apply(nt,v(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u},e.bind=U,e.bindAll=function(n){for(var t=dt.apply(nt,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},e.bindKey=function(n,t){return f(n,t,v(arguments,2))},e.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},e.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];
|
||||
return t[0]}},e.countBy=function(n,t,r){var e={};return t=a(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",jt.call(e,r)?e[r]++:e[r]=1}),e},e.debounce=function(n,t,r){function e(){f=Q,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},e.defaults=or,e.defer=V,e.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},e.difference=function(n){for(var t=-1,r=n?n.length:0,e=dt.apply(nt,arguments),e=u(e,r),o=[];++t<r;){var i=n[t];
|
||||
e(i)||o.push(i)}return o},e.filter=N,e.flatten=M,e.forEach=$,e.forIn=Yt,e.forOwn=Zt,e.functions=d,e.groupBy=function(n,t,r){var e={};return t=a(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",(jt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},e.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==Q||r?1:t||e;return v(n,0,Rt(Nt(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;
|
||||
n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=jt.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=tr,e.map=F,e.max=q,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";
|
||||
return jt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});return u},e.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},e.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=a(t,r);else var o=dt.apply(nt,arguments);return Yt(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)
|
||||
}),u},e.once=function(n){var t,r;return function(){return t?r:(t=L,r=n.apply(this,arguments),n=Q,r)}},e.pairs=function(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},e.partial=function(n){return f(n,v(arguments,1))},e.partialRight=function(n){return f(n,v(arguments,1),Q,et)},e.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=dt.apply(nt,arguments),i=w(n)?o.length:0;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),Yt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)
|
||||
});return e},e.pluck=F,e.range=function(n,t,r){n=+n||0,r=+r||1,t==Q&&(t=n,n=0);var e=-1;t=Nt(0,mt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},e.reject=function(n,t,r){return t=a(t,r),N(n,function(n,r,e){return!t(n,r,e)})},e.rest=P,e.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return $(n,function(n){var r=_t($t()*(++t+1));e[t]=e[r],e[r]=n}),e},e.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=a(t,r),$(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}
|
||||
}),u=o.length,o.sort(i);u--;)o[u]=o[u].c;return o},e.tap=function(n,t){return t(n),n},e.throttle=function(n,t){function r(){f=new Date,i=Q,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=Q,f=a,u=n.apply(o,e)),u}},e.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},e.toArray=function(n){return n&&typeof n.length=="number"?v(n):E(n)},e.union=function(){return K(dt.apply(nt,arguments))
|
||||
},e.uniq=K,e.values=E,e.where=N,e.without=function(n){for(var t=-1,r=n?n.length:0,e=u(arguments,1),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.wrap=function(n,t){return function(){var r=[n];return wt.apply(r,arguments),t.apply(this,r)}},e.zip=function(n){for(var t=-1,r=n?q(F(arguments,"length")):0,e=Array(r);++t<r;)e[t]=F(arguments,t);return e},e.collect=F,e.drop=P,e.each=$,e.extend=ur,e.methods=d,e.select=N,e.tail=P,e.unique=K,H(e),e.clone=m,e.cloneDeep=function(n,t,r){return m(n,L,t,r)},e.contains=S,e.escape=function(n){return n==Q?"":(n+"").replace(ht,p)
|
||||
},e.every=k,e.find=R,e.has=function(n,t){return n?jt.call(n,t):W},e.identity=G,e.indexOf=z,e.isArguments=h,e.isArray=nr,e.isBoolean=function(n){return n===L||n===W||xt.call(n)==Dt},e.isDate=function(n){return n instanceof Date||xt.call(n)==It},e.isElement=function(n){return n?1===n.nodeType:W},e.isEmpty=function(n){var t=L;if(!n)return t;var r=xt.call(n),e=n.length;return r==qt||r==zt||r==Ft||r==Bt&&typeof e=="number"&&j(n.splice)?!e:(Zt(n,function(){return t=W}),t)},e.isEqual=b,e.isFinite=function(n){return Et(n)&&!St(parseFloat(n))
|
||||
},e.isFunction=j,e.isNaN=function(n){return x(n)&&n!=+n},e.isNull=function(n){return n===Q},e.isNumber=x,e.isObject=w,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||xt.call(n)==Mt},e.isString=A,e.isUndefined=function(n){return typeof n=="undefined"},e.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Nt(0,e+r):Rt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=H,e.noConflict=function(){return n._=ot,this},e.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+_t($t()*((+t||0)-n+1))
|
||||
},e.reduce=D,e.reduceRight=I,e.result=function(n,r){var e=n?n[r]:t;return j(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:tr(n).length},e.some=T,e.sortedIndex=C,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=or({},u,o);var i,f=or({},u.imports,o.imports),o=tr(f),f=E(f),a=0,c=u.interpolate||gt,p="__p+='";n.replace(RegExp((u.escape||gt).source+"|"+c.source+"|"+(c===vt?st:gt).source+"|"+(u.evaluate||gt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(yt,l),r&&(p+="'+__e("+r+")+'"),o&&(i=L,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t
|
||||
}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ft,""):p).replace(at,"$1").replace(ct,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+p+"return __p}";try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==Q?"":(n+"").replace(it,g)},e.uniqueId=function(n){var t=++rt;return(n==Q?"":n+"")+t
|
||||
},e.all=k,e.any=T,e.detect=R,e.foldl=D,e.foldr=I,e.include=S,e.inject=D,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return wt.apply(t,arguments),n.apply(e,t)})}),e.first=B,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[u-1];return v(n,Nt(0,u-e))}},e.take=B,e.head=B,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r);
|
||||
return t==Q||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.1",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=J,e.prototype.valueOf=J,Xt(["join","pop","shift"],function(n){var t=nt[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Xt(["push","reverse","sort","unshift"],function(n){var t=nt[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xt(["concat","slice","splice"],function(n){var t=nt[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments))
|
||||
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):X?Y?(Y.exports=e)._=e:X._=e:n._=e})(this);
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:m+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:m+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],i=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&i&&typeof i=="object")return false;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=f(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function i(n){return"\\"+V[n]}function a(){return h.pop()||[]}function f(){return g.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}
|
||||
}function l(n){n.length=0,h.length<b&&h.push(n)}function c(n){var t=n.l;t&&c(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,g.length<b&&g.push(n)}function p(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function s(e){function h(n){if(!n||ve.call(n)!=q)return false;var t=n.valueOf,e=typeof t=="function"&&(e=be(t))&&be(e);return e?n==e||be(n)==e:yt(n)}function g(n,t,e){if(!n||!U[typeof n])return n;t=t&&typeof e=="undefined"?t:ut(t,e,3);
|
||||
for(var r=-1,u=U[typeof n]&&ze(n),o=u?u.length:0;++r<o&&(e=u[r],false!==t(n[e],e,n)););return n}function b(n,t,e){var r;if(!n||!U[typeof n])return n;t=t&&typeof e=="undefined"?t:ut(t,e,3);for(r in n)if(false===t(n[r],r,n))break;return n}function V(n,t,e){var r,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f=typeof e=="number"?2:i.length;++a<f;)if((u=i[a])&&U[typeof u])for(var l=-1,c=U[typeof u]&&ze(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof o[r]&&(o[r]=u[r]);return o}function H(n,t,e){var r,u=n,o=u;
|
||||
if(!u)return o;var i=arguments,a=0,f=typeof e=="number"?2:i.length;if(3<f&&"function"==typeof i[f-2])var l=ut(i[--f-1],i[f--],2);else 2<f&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a<f;)if((u=i[a])&&U[typeof u])for(var c=-1,p=U[typeof u]&&ze(u),s=p?p.length:0;++c<s;)r=p[c],o[r]=l?l(o[r],u[r]):u[r];return o}function J(n){var t,e=[];if(!n||!U[typeof n])return e;for(t in n)de.call(n,t)&&e.push(t);return e}function Z(n){return n&&typeof n=="object"&&!qe(n)&&de.call(n,"__wrapped__")?n:new nt(n)}function nt(n,t){this.__chain__=!!t,this.__wrapped__=n
|
||||
}function tt(n){function t(){if(r){var n=r.slice();je.apply(n,arguments)}if(this instanceof t){var o=rt(e.prototype),n=e.apply(o,n||arguments);return kt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return We(t,n),t}function et(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!kt(n))return n;var i=ve.call(n);if(!K[i])return n;var f=Te[i];switch(i){case F:case T:return new f(+n);case W:case P:return new f(n);case z:return o=f(n.source,C.exec(n)),o.lastIndex=n.lastIndex,o
|
||||
}if(i=qe(n),t){var c=!r;r||(r=a()),u||(u=a());for(var s=r.length;s--;)if(r[s]==n)return u[s];o=i?f(n.length):{}}else o=i?p(n):H({},n);return i&&(de.call(n,"index")&&(o.index=n.index),de.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(i?Rt:g)(n,function(n,i){o[i]=et(n,t,e,r,u)}),c&&(l(r),l(u)),o):o}function rt(n){return kt(n)?Ie(n):{}}function ut(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Be.funcNames&&(r=!n.name),r=r||!Be.funcDecomp,!r)){var u=_e.call(n);
|
||||
Be.funcNames||(r=!O.test(u)),r||(r=E.test(u),We(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Gt(n,t)}function ot(n){function t(){var n=f?i:this;if(u){var h=u.slice();je.apply(h,arguments)}return(o||c)&&(h||(h=p(arguments)),o&&je.apply(h,o),c&&h.length<a)?(r|=16,ot([e,s?r:-4&r,h,null,i,a])):(h||(h=arguments),l&&(e=n[v]),this instanceof t?(n=rt(e.prototype),h=e.apply(n,h),kt(h)?h:n):e.apply(n,h))
|
||||
}var e=n[0],r=n[1],u=n[2],o=n[3],i=n[4],a=n[5],f=1&r,l=2&r,c=4&r,s=8&r,v=e;return We(t,n),t}function it(e,r){var u=-1,i=gt(),a=e?e.length:0,f=a>=_&&i===n,l=[];if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++u<a;)p=e[u],0>i(r,p)&&l.push(p);return f&&c(r),l}function at(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var i=n[r];if(i&&typeof i=="object"&&typeof i.length=="number"&&(qe(i)||_t(i))){t||(i=at(i,t,e));var a=-1,f=i.length,l=o.length;for(o.length+=f;++a<f;)o[l++]=i[a]}else e||o.push(i)}return o
|
||||
}function ft(n,t,e,r,u,o){if(e){var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&U[typeof n]||t&&U[typeof t]))return false;if(null==n||null==t)return n===t;var f=ve.call(n),c=ve.call(t);if(f==D&&(f=q),c==D&&(c=q),f!=c)return false;switch(f){case F:case T:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case z:case P:return n==fe(t)}if(c=f==$,!c){var p=de.call(n,"__wrapped__"),s=de.call(t,"__wrapped__");if(p||s)return ft(p?n.__wrapped__:n,s?t.__wrapped__:t,e,r,u,o);
|
||||
if(f!=q)return false;if(f=n.constructor,p=t.constructor,f!=p&&!(jt(f)&&f instanceof f&&jt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in t)return false}for(p=!u,u||(u=a()),o||(o=a()),f=u.length;f--;)if(u[f]==n)return o[f]==t;var v=0,i=true;if(u.push(n),o.push(t),c){if(f=n.length,v=t.length,i=v==n.length,!i&&!r)return i;for(;v--;)if(c=f,p=t[v],r)for(;c--&&!(i=ft(n[c],p,e,r,u,o)););else if(!(i=ft(n[v],p,e,r,u,o)))break;return i}return b(t,function(t,a,f){return de.call(f,a)?(v++,i=de.call(n,a)&&ft(n[a],t,e,r,u,o)):void 0
|
||||
}),i&&!r&&b(n,function(n,t,e){return de.call(e,t)?i=-1<--v:void 0}),p&&(l(u),l(o)),i}function lt(n,t,e,r,u){(qe(t)?Rt:g)(t,function(t,o){var i,a,f=t,l=n[o];if(t&&((a=qe(t))||h(t))){for(f=r.length;f--;)if(i=r[f]==t){l=u[f];break}if(!i){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=a?qe(l)?l:[]:h(l)?l:{}),r.push(t),u.push(l),c||lt(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function ct(n,t){return n+me(Fe()*(t-n+1))}function pt(e,r,u){var i=-1,f=gt(),p=e?e.length:0,s=[],v=!r&&p>=_&&f===n,h=u||v?a():s;
|
||||
if(v){var g=o(h);g?(f=t,h=g):(v=false,h=u?h:(l(h),s))}for(;++i<p;){var g=e[i],y=u?u(g,i,e):g;(r?!i||h[h.length-1]!==y:0>f(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(l(h.k),c(h)):u&&l(h),s}function st(n){return function(t,e,r){var u={};e=Z.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r<o;){var i=t[r];n(u,i,e(i,r,t),t)}else g(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function vt(n,t,e,r,u,o){var i=1&t,a=4&t,f=16&t,l=32&t;if(!(2&t||jt(n)))throw new le;f&&!e.length&&(t&=-17,f=e=false),l&&!r.length&&(t&=-33,l=r=false);
|
||||
var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!i||1&c[1]||(c[4]=u),!i&&1&c[1]&&(t|=8),!a||4&c[1]||(c[5]=o),f&&je.apply(c[2]||(c[2]=[]),e),l&&je.apply(c[3]||(c[3]=[]),r),c[1]|=t,vt.apply(null,c)):(1==t||17===t?tt:ot)([n,t,e,r,u,o])}function ht(n){return Pe[n]}function gt(){var t=(t=Z.indexOf)===Pt?n:t;return t}function yt(n){var t,e;return n&&ve.call(n)==q&&(t=n.constructor,!jt(t)||t instanceof t)?(b(n,function(n,t){e=t}),typeof e=="undefined"||de.call(n,e)):false}function mt(n){return Ke[n]}function _t(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==D||false
|
||||
}function bt(n,t,e){var r=ze(n),u=r.length;for(t=ut(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function dt(n){var t=[];return b(n,function(n,e){jt(n)&&t.push(e)}),t.sort()}function wt(n){for(var t=-1,e=ze(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function jt(n){return typeof n=="function"}function kt(n){return!(!n||!U[typeof n])}function xt(n){return typeof n=="number"||n&&typeof n=="object"&&ve.call(n)==W||false}function Ct(n){return typeof n=="string"||n&&typeof n=="object"&&ve.call(n)==P||false
|
||||
}function Ot(n){for(var t=-1,e=ze(n),r=e.length,u=ne(r);++t<r;)u[t]=n[e[t]];return u}function It(n,t,e){var r=-1,u=gt(),o=n?n.length:0,i=false;return e=(0>e?Ae(0,o+e):e)||0,qe(n)?i=-1<u(n,t,e):typeof o=="number"?i=-1<(Ct(n)?n.indexOf(t,e):u(n,t,e)):g(n,function(n){return++r<e?void 0:!(i=n===t)}),i}function Nt(n,t,e){var r=true;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else g(n,function(n,e,u){return r=!!t(n,e,u)});return r}function St(n,t,e){var r=[];
|
||||
t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else g(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Et(n,t,e){t=Z.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return g(n,function(n,e,r){return t(n,e,r)?(u=n,false):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function Rt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:ut(t,e,3),typeof u=="number")for(;++r<u&&false!==t(n[r],r,n););else g(n,t);
|
||||
return n}function At(n,t,e){var r=n?n.length:0;if(t=t&&typeof e=="undefined"?t:ut(t,e,3),typeof r=="number")for(;r--&&false!==t(n[r],r,n););else{var u=ze(n),r=u.length;g(n,function(n,e,o){return e=u?u[--r]:--r,t(o[e],e,o)})}return n}function Dt(n,t,e){var r=-1,u=n?n.length:0;if(t=Z.createCallback(t,e,3),typeof u=="number")for(var o=ne(u);++r<u;)o[r]=t(n[r],r,n);else o=[],g(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function $t(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;
|
||||
for(var i=n.length;++e<i;){var a=n[e];a>o&&(o=a)}}else t=null==t&&Ct(n)?r:Z.createCallback(t,e,3),Rt(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Ft(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=ne(r);++e<r;)u[e]=n[e][t];return u||Dt(n,t)}function Tt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=Z.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else g(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e
|
||||
}function Bt(n,t,e,r){var u=3>arguments.length;return t=Z.createCallback(t,r,4),At(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Wt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Rt(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function qt(n,t,e){var r;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else g(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;
|
||||
for(t=Z.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:v;return p(n,0,De(Ae(0,r),u))}function Pt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Ae(0,u+r):r||0}else if(r)return r=Lt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Ae(0,t);return p(n,r)}function Lt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?Z.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
|
||||
return u}function Mt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=Z.createCallback(e,r,3)),pt(n,t,e)}function Ut(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?$t(Ft(n,"length")):0,r=ne(0>e?0:e);++t<e;)r[t]=Ft(n,t);return r}function Vt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Gt(n,t){return 2<arguments.length?vt(n,17,p(arguments,2),null,t):vt(n,1,null,null,t)
|
||||
}function Ht(n,t,e){function r(){c&&ye(c),i=c=p=v,(g||h!==t)&&(s=we(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var e=t-(we()-f);0<e?c=ke(u,e):(i&&ye(i),e=p,i=c=p=v,e&&(s=we(),a=n.apply(l,o),c||i||(o=l=null)))}var o,i,a,f,l,c,p,s=0,h=false,g=true;if(!jt(n))throw new le;if(t=Ae(0,t)||0,true===e)var y=true,g=false;else kt(e)&&(y=e.leading,h="maxWait"in e&&(Ae(t,e.maxWait)||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=we(),l=this,p=g&&(c||!y),false===h)var e=y&&!c;else{i||y||(s=f);var v=h-(f-s),m=0>=v;
|
||||
m?(i&&(i=ye(i)),s=f,a=n.apply(l,o)):i||(i=ke(r,v))}return m&&c?c=ye(c):c||t===h||(c=ke(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Jt(n){if(!jt(n))throw new le;var t=p(arguments,1);return ke(function(){n.apply(v,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||jt(e);t||(e=nt,t=n,n=Z),Rt(dt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return je.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)
|
||||
})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ie=e.Object,ae=e.RegExp,fe=e.String,le=e.TypeError,ce=[],pe=ie.prototype,se=e._,ve=pe.toString,he=ae("^"+fe(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ge=ue.ceil,ye=e.clearTimeout,me=ue.floor,_e=re.prototype.toString,be=he.test(be=ie.getPrototypeOf)&&be,de=pe.hasOwnProperty,we=he.test(we=ee.now)&&we||function(){return+new ee
|
||||
},je=ce.push,ke=e.setTimeout,xe=ce.splice,Ce=typeof(Ce=X&&Q&&X.setImmediate)=="function"&&!he.test(Ce)&&Ce,Oe=function(){try{var n={},t=he.test(t=ie.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ie=he.test(Ie=ie.create)&&Ie,Ne=he.test(Ne=ne.isArray)&&Ne,Se=e.isFinite,Ee=e.isNaN,Re=he.test(Re=ie.keys)&&Re,Ae=ue.max,De=ue.min,$e=e.parseInt,Fe=ue.random,Te={};Te[$]=ne,Te[F]=te,Te[T]=ee,Te[B]=re,Te[q]=ie,Te[W]=oe,Te[z]=ae,Te[P]=fe,nt.prototype=Z.prototype;var Be=Z.support={};Be.funcDecomp=!he.test(e.a)&&E.test(s),Be.funcNames=typeof re.name=="string",Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:Z}},Ie||(rt=function(){function n(){}return function(t){if(kt(t)){n.prototype=t;
|
||||
var r=new n;n.prototype=null}return r||e.Object()}}());var We=Oe?function(n,t){M.value=t,Oe(n,"__bindData__",M)}:Yt,qe=Ne||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||false},ze=Re?function(n){return kt(n)?Re(n):[]}:J,Pe={"&":"&","<":"<",">":">",'"':""","'":"'"},Ke=wt(Pe),Le=ae("("+ze(Ke).join("|")+")","g"),Me=ae("["+ze(Pe).join("")+"]","g"),Ue=st(function(n,t,e){de.call(n,e)?n[e]++:n[e]=1}),Ve=st(function(n,t,e){(de.call(n,e)?n[e]:n[e]=[]).push(t)
|
||||
}),Ge=st(function(n,t,e){n[e]=t});Ce&&(Jt=function(n){if(!jt(n))throw new le;return Ce.apply(e,arguments)});var He=8==$e(d+"08")?$e:function(n,t){return $e(Ct(n)?n.replace(N,""):n,t||0)};return Z.after=function(n,t){if(!jt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=H,Z.at=function(n){for(var t=arguments,e=-1,r=at(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);++e<t;)u[e]=n[r[e]];return u},Z.bind=Gt,Z.bindAll=function(n){for(var t=1<arguments.length?at(arguments,true,false,1):dt(n),e=-1,r=t.length;++e<r;){var u=t[e];
|
||||
n[u]=vt(n[u],1,null,null,n)}return n},Z.bindKey=function(n,t){return 2<arguments.length?vt(t,19,p(arguments,2),null,n):vt(t,3,null,null,n)},Z.chain=function(n){return n=new nt(n),n.__chain__=true,n},Z.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},Z.compose=function(){for(var n=arguments,t=n.length;t--;)if(!jt(n[t]))throw new le;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Z.countBy=Ue,Z.create=function(n,t){var e=rt(n);
|
||||
return t?H(e,t):e},Z.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return ut(n,t,e);if("object"!=r)return function(t){return t[n]};var u=ze(n),o=u[0],i=n[o];return 1!=u.length||i!==i||kt(i)?function(t){for(var e=u.length,r=false;e--&&(r=ft(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],i===n&&(0!==i||1/i==1/n)}},Z.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,vt(n,4,null,null,null,t)},Z.debounce=Ht,Z.defaults=V,Z.defer=Jt,Z.delay=function(n,t){if(!jt(n))throw new le;
|
||||
var e=p(arguments,2);return ke(function(){n.apply(v,e)},t)},Z.difference=function(n){return it(n,at(arguments,true,true,1))},Z.filter=St,Z.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Dt(n,e,r)),at(n,t)},Z.forEach=Rt,Z.forEachRight=At,Z.forIn=b,Z.forInRight=function(n,t,e){var r=[];b(n,function(n,t){r.push(t,n)});var u=r.length;for(t=ut(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},Z.forOwn=g,Z.forOwnRight=bt,Z.functions=dt,Z.groupBy=Ve,Z.indexBy=Ge,Z.initial=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=Z.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return p(n,0,De(Ae(0,u-r),u))},Z.intersection=function(e){for(var r=arguments,u=r.length,i=-1,f=a(),p=-1,s=gt(),v=e?e.length:0,h=[],g=a();++i<u;){var y=r[i];f[i]=s===n&&(y?y.length:0)>=_&&o(i?r[i]:g)}n:for(;++p<v;){var m=f[0],y=e[p];if(0>(m?t(m,y):s(g,y))){for(i=u,(m||g).push(y);--i;)if(m=f[i],0>(m?t(m,y):s(r[i],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&c(m);return l(f),l(g),h},Z.invert=wt,Z.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=ne(typeof o=="number"?o:0);
|
||||
return Rt(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},Z.keys=ze,Z.map=Dt,Z.max=$t,Z.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return de.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!jt(n))throw new le;return e.cache={},e},Z.merge=function(n){var t=arguments,e=2;if(!kt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=ut(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=p(arguments,1,e),u=-1,o=a(),i=a();++u<e;)lt(n,t[u],r,o,i);
|
||||
return l(o),l(i),n},Z.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a<o&&(o=a)}}else t=null==t&&Ct(n)?r:Z.createCallback(t,e,3),Rt(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},Z.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];b(n,function(n,t){u.push(t)});for(var u=it(u,at(arguments,true,false,1)),o=-1,i=u.length;++o<i;){var a=u[o];r[a]=n[a]}}else t=Z.createCallback(t,e,3),b(n,function(n,e,u){t(n,e,u)||(r[e]=n)
|
||||
});return r},Z.once=function(n){var t,e;if(!jt(n))throw new le;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},Z.pairs=function(n){for(var t=-1,e=ze(n),r=e.length,u=ne(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},Z.partial=function(n){return vt(n,16,p(arguments,1))},Z.partialRight=function(n){return vt(n,32,null,p(arguments,1))},Z.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=at(arguments,true,false,1),i=kt(n)?o.length:0;++u<i;){var a=o[u];a in n&&(r[a]=n[a])
|
||||
}else t=Z.createCallback(t,e,3),b(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Z.pluck=Ft,Z.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,i=t[e];++o<u;)n[o]===i&&(xe.call(n,o--,1),u--);return n},Z.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Ae(0,ge((t-n)/(e||1)));for(var u=ne(t);++r<t;)u[r]=n,n+=e;return u},Z.reject=function(n,t,e){return t=Z.createCallback(t,e,3),St(n,function(n,e,r){return!t(n,e,r)})},Z.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];
|
||||
for(t=Z.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),xe.call(n,r--,1),u--);return o},Z.rest=Kt,Z.shuffle=Wt,Z.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,i=ne(typeof o=="number"?o:0);for(t=Z.createCallback(t,e,3),Rt(n,function(n,e,u){var o=i[++r]=f();o.m=t(n,e,u),o.n=r,o.o=n}),o=i.length,i.sort(u);o--;)n=i[o],i[o]=n.o,c(n);return i},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,e){var r=true,u=true;if(!jt(n))throw new le;return false===e?r=false:kt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),L.leading=r,L.maxWait=t,L.trailing=u,Ht(n,t,L)
|
||||
},Z.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=ne(n);for(t=ut(t,e,1);++r<n;)u[r]=t(r);return u},Z.toArray=function(n){return n&&typeof n.length=="number"?p(n):Ot(n)},Z.transform=function(n,t,e,r){var u=qe(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=rt(o&&o.prototype)}return t&&(t=Z.createCallback(t,r,4),(u?Rt:g)(n,function(n,r,u){return t(e,n,r,u)})),e},Z.union=function(){return pt(at(arguments,true,true))},Z.uniq=Mt,Z.values=Ot,Z.where=St,Z.without=function(n){return it(n,p(arguments,1))
|
||||
},Z.wrap=function(n,t){return vt(t,16,[n])},Z.zip=Ut,Z.zipObject=Vt,Z.collect=Dt,Z.drop=Kt,Z.each=Rt,Z.eachRight=At,Z.extend=H,Z.methods=dt,Z.object=Vt,Z.select=St,Z.tail=Kt,Z.unique=Mt,Z.unzip=Ut,Xt(Z),Z.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),et(n,t,typeof e=="function"&&ut(e,r,1))},Z.cloneDeep=function(n,t,e){return et(n,true,typeof t=="function"&&ut(t,e,1))},Z.contains=It,Z.escape=function(n){return null==n?"":fe(n).replace(Me,ht)},Z.every=Nt,Z.find=Et,Z.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;
|
||||
for(t=Z.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Z.findKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),g(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},Z.findLast=function(n,t,e){var r;return t=Z.createCallback(t,e,3),At(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},Z.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=Z.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},Z.findLastKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),bt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0
|
||||
}),r},Z.has=function(n,t){return n?de.call(n,t):false},Z.identity=Qt,Z.indexOf=Pt,Z.isArguments=_t,Z.isArray=qe,Z.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ve.call(n)==F||false},Z.isDate=function(n){return n&&typeof n=="object"&&ve.call(n)==T||false},Z.isElement=function(n){return n&&1===n.nodeType||false},Z.isEmpty=function(n){var t=true;if(!n)return t;var e=ve.call(n),r=n.length;return e==$||e==P||e==D||e==q&&typeof r=="number"&&jt(n.splice)?!r:(g(n,function(){return t=false}),t)},Z.isEqual=function(n,t,e,r){return ft(n,t,typeof e=="function"&&ut(e,r,2))
|
||||
},Z.isFinite=function(n){return Se(n)&&!Ee(parseFloat(n))},Z.isFunction=jt,Z.isNaN=function(n){return xt(n)&&n!=+n},Z.isNull=function(n){return null===n},Z.isNumber=xt,Z.isObject=kt,Z.isPlainObject=h,Z.isRegExp=function(n){return n&&typeof n=="object"&&ve.call(n)==z||false},Z.isString=Ct,Z.isUndefined=function(n){return typeof n=="undefined"},Z.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ae(0,r+e):De(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Z.mixin=Xt,Z.noConflict=function(){return e._=se,this
|
||||
},Z.noop=Yt,Z.parseInt=He,Z.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),De(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t)},Z.reduce=Tt,Z.reduceRight=Bt,Z.result=function(n,t){if(n){var e=n[t];return jt(e)?n[t]():e}},Z.runInContext=s,Z.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ze(n).length},Z.some=qt,Z.sortedIndex=Lt,Z.template=function(n,t,e){var r=Z.templateSettings;
|
||||
n=fe(n||""),e=V({},e,r);var u,o=V({},e.imports,r.imports),r=ze(o),o=Ot(o),a=0,f=e.interpolate||S,l="__p+='",f=ae((e.escape||S).source+"|"+f.source+"|"+(f===I?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(R,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";
|
||||
try{var c=re(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Z.unescape=function(n){return null==n?"":fe(n).replace(Le,mt)},Z.uniqueId=function(n){var t=++y;return fe(null==n?"":n)+t},Z.all=Nt,Z.any=qt,Z.detect=Et,Z.findWhere=Et,Z.foldl=Tt,Z.foldr=Bt,Z.include=It,Z.inject=Tt,g(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return je.apply(t,arguments),t=n.apply(Z,t),e?new nt(t,e):t})}),Z.first=zt,Z.last=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=Z.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Ae(0,u-r))},Z.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Ot(n)),null==t||e?n?n[ct(0,n.length-1)]:v:(n=Wt(n),n.length=De(Ae(0,t),n.length),n)},Z.take=zt,Z.head=zt,g(Z,function(n,t){var e="sample"!==t;Z.prototype[t]||(Z.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new nt(o,u):o
|
||||
})}),Z.VERSION="2.3.0",Z.prototype.chain=function(){return this.__chain__=true,this},Z.prototype.toString=function(){return fe(this.__wrapped__)},Z.prototype.value=Zt,Z.prototype.valueOf=Zt,Rt(["join","pop","shift"],function(n){var t=ce[n];Z.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new nt(e,n):e}}),Rt(["push","reverse","sort","unshift"],function(n){var t=ce[n];Z.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Rt(["concat","slice","splice"],function(n){var t=ce[n];
|
||||
Z.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Z}var v,h=[],g=[],y=0,m=+new Date+"",_=75,b=40,d=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,N=RegExp("^["+d+"]*0+(?=.$)"),S=/($^)/,E=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,A="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),D="[object Arguments]",$="[object Array]",F="[object Boolean]",T="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={};
|
||||
K[B]=false,K[D]=K[$]=K[F]=K[T]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},U={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},V={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=U[typeof window]&&window||this,H=U[typeof exports]&&exports&&!exports.nodeType&&exports,J=U[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=U[typeof global]&&global;!X||X.global!==X&&X.window!==X||(G=X);
|
||||
var Y=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(G._=Y, define(function(){return Y})):H&&J?Q?(J.exports=Y)._=Y:H._=Y:G._=Y}).call(this);
|
||||
4000
dist/lodash.underscore.js
vendored
67
dist/lodash.underscore.min.js
vendored
@@ -1,34 +1,39 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 1.0.1 (Custom Build) lodash.com/license
|
||||
* Build: `lodash underscore -o ./dist/lodash.underscore.js`
|
||||
* Underscore.js 1.4.4 underscorejs.org/LICENSE
|
||||
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
*/
|
||||
;(function(n,t){function r(n,t){var r;if(n&&qt[typeof n])for(r in t||(t=G),n)if(t(n[r],r,n)===tt)break}function e(n,t,r){if(n){t=t&&typeof r=="undefined"?t:a(t,r);var e=n.length;if(r=-1,typeof e=="number")for(;++r<e&&t(n[r],r,n)!==tt;);else for(r in n)if(pt.call(n,r)&&t(n[r],r,n)===tt)break}}function u(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof u?(this.__wrapped__=n,void 0):new u(n)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
|
||||
}return r<e?-1:1}function i(n,t,r){function e(){var a=arguments,f=o?this:t;return u||(n=t[i]),r.length&&(a=a.length?(a=p(a),r.concat(a)):r),this instanceof e?(l.prototype=n.prototype,f=new l,l.prototype=K,a=n.apply(f,a),w(a)?a:f):n.apply(f,a)}var u=j(n),o=!r,i=t;return o&&(r=t),u||(t=n),e}function a(n,t,r){if(n==K)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Dt(n);return function(t){for(var r=u.length,e=L;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)
|
||||
}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function f(n){return"\\"+It[n]}function c(n){return Mt[n]}function l(){}function p(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function s(n){return $t[n]}function v(n){return vt.call(n)==wt}function h(n){var t,r=[],e=function(n,t){r.push(t)};if(n&&qt[typeof n])for(t in e||(e=G),n)if(pt.call(n,t)&&e(n[t],t,n)===tt)break;
|
||||
return r}function g(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==K&&(n[u]=e[u])}return n}function m(n){var t=[];return r(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Dt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n){if(!n)return J;if(Bt(n)||x(n))return!n.length;for(var t in n)if(pt.call(n,t))return L;
|
||||
return J}function b(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return L;if(n==K||t==K)return n===t;if(i=vt.call(n),o=vt.call(t),i!=o)return L;switch(i){case xt:case Et:return+n==+t;case Ot:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Nt:case kt:return n==t+""}if(o=i==At,!o){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=St)return L;var i=n.constructor,a=t.constructor;
|
||||
if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return L}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=J,c=0;if(e.push(n),u.push(t),o){if(c=t.length,f=c==n.length)for(;c--&&(f=b(n[c],t[c],e,u)););return f}return r(t,function(t,r,o){return pt.call(o,r)?(c++,!(f=pt.call(n,r)&&b(n[r],t,e,u))&&tt):void 0}),f&&r(n,function(n,t,r){return pt.call(r,t)?!(f=-1<--c)&&tt:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?qt[typeof n]:L}function A(n){return typeof n=="number"||vt.call(n)==Ot
|
||||
}function x(n){return typeof n=="string"||vt.call(n)==kt}function E(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function O(n,t){var r=L;return typeof(n?n.length:0)=="number"?r=-1<z(n,t):e(n,function(n){return(r=n===t)&&tt}),r}function S(n,t,r){var u=J;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&(u=!!t(n[r],r,n)););}else e(n,function(n,r,e){return!(u=!!t(n,r,e))&&tt});return u}function N(n,t,r){var u=[];if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
|
||||
t(i,r,n)&&u.push(i)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)});return u}function k(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,tt):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Bt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==tt;);}else e(n,t,r)}function R(n,t,r){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),Bt(n))for(;++u<o;)i[u]=t(n[u],u,n);else e(n,function(n,r,e){i[++u]=t(n,r,e)});return i}function T(n,t,r){var u=-1/0,o=u;if(!t&&Bt(n)){r=-1;
|
||||
for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function q(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),Bt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else e(n,function(n,e,u){r=o?(o=L,n):t(r,n,e,u)});return r}function I(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Dt(n),u=i.length;return t=a(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)}),r}function B(n,t,r){var u;
|
||||
if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&!(u=t(n[r],r,n)););}else e(n,function(n,r,e){return(u=t(n,r,e))&&tt});return!!u}function D(n,t,r){return r&&d(t)?K:(r?k:N)(n,t)}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[0];return p(n,0,bt(dt(0,e),u))}}function $(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Bt(o)?st.apply(u,t?o:$(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;
|
||||
if(typeof r=="number")e=(0>r?dt(0,u+r):r||0)-1;else if(r)return e=P(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t!="number"&&t!=K){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==K||r?1:dt(0,t);return p(n,e)}function P(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function U(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=L),r&&(f=[],r=a(r,e));++u<o;){e=n[u];
|
||||
var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>z(f,c))&&(r&&f.push(c),i.push(e))}return i}function V(n,t){return Ft||ht&&2<arguments.length?ht.call.apply(ht,arguments):i(n,t,p(arguments,2))}function W(n){var r=p(arguments,1);return setTimeout(function(){n.apply(t,r)},1)}function G(n){return n}function H(n){F(m(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return st.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=J),n}})}var J=!0,K=null,L=!1,Q=typeof exports=="object"&&exports,X=typeof module=="object"&&module&&module.exports==Q&&module,Y=typeof global=="object"&&global;
|
||||
Y.global===Y&&(n=Y);var Z=[],Y={},nt=0,tt=Y,rt=n._,et=/&(?:amp|lt|gt|quot|#39);/g,ut=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ot=/($^)/,it=/[&<>"']/g,at=/['\n\r\t\u2028\u2029\\]/g,ft=Math.ceil,ct=Z.concat,lt=Math.floor,pt=Y.hasOwnProperty,st=Z.push,vt=Y.toString,ht=ut.test(ht=p.bind)&&ht,gt=ut.test(gt=Array.isArray)&>,yt=n.isFinite,mt=n.isNaN,_t=ut.test(_t=Object.keys)&&_t,dt=Math.max,bt=Math.min,jt=Math.random,wt="[object Arguments]",At="[object Array]",xt="[object Boolean]",Et="[object Date]",Ot="[object Number]",St="[object Object]",Nt="[object RegExp]",kt="[object String]",Y=!!n.attachEvent,Y=ht&&!/\n|true/.test(ht+Y),Ft=ht&&!Y,Rt=(Rt={0:1,length:1},Z.splice.call(Rt,0,1),Rt[0]),Tt=arguments.constructor==Object,qt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},It={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
|
||||
u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},v(arguments)||(v=function(n){return n?pt.call(n,"callee"):L});var Bt=gt||function(n){return Tt&&n instanceof Array||vt.call(n)==At},Dt=_t?function(n){return w(n)?_t(n):[]}:h,Mt={"&":"&","<":"<",">":">",'"':""","'":"'"},$t=_(Mt);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==vt.call(n)});var zt=R;Y&&X&&typeof setImmediate=="function"&&(W=V(setImmediate,n)),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
|
||||
}},u.bind=V,u.bindAll=function(n){for(var t=ct.apply(Z,arguments),r=1<t.length?0:(t=m(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=V(n[u],n)}return n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},u.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},u.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",pt.call(e,r)?e[r]++:e[r]=1}),e},u.debounce=function(n,t,r){function e(){a=K,r||(o=n.apply(i,u))
|
||||
}var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,clearTimeout(a),a=setTimeout(e,t),f&&(o=n.apply(i,u)),o}},u.defaults=y,u.defer=W,u.delay=function(n,r){var e=p(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},u.difference=function(n){for(var t=-1,r=n.length,e=ct.apply(Z,arguments),u=[];++t<r;){var o=n[t];0>z(e,o,r)&&u.push(o)}return u},u.filter=N,u.flatten=$,u.forEach=F,u.functions=m,u.groupBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(pt.call(e,r)?e[r]:e[r]=[]).push(n)
|
||||
}),e},u.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==K||r?1:t||e;return p(n,0,bt(dt(0,u-e),u))},u.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>z(o,i)){for(var a=r;--a;)if(0>z(t[a],i))continue n;o.push(i)}}return o},u.invert=_,u.invoke=function(n,t){var r=p(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
|
||||
return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},u.keys=Dt,u.map=R,u.max=T,u.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return pt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},u.min=function(n,t,r){var u=1/0,o=u;if(!t&&Bt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r<u&&(u=r,o=n)});return o},u.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]
|
||||
}return u},u.omit=function(n){var t=ct.apply(Z,arguments),e={};return r(n,function(n,r){0>z(t,r,1)&&(e[r]=n)}),e},u.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=K,r)}},u.pairs=function(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},u.partial=function(n){return i(n,p(arguments,1))},u.pick=function(n){for(var t=0,r=ct.apply(Z,arguments),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},u.pluck=zt,u.range=function(n,t,r){n=+n||0,r=+r||1,t==K&&(t=n,n=0);
|
||||
var e=-1;t=dt(0,ft((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},u.reject=function(n,t,r){return t=a(t,r),N(n,function(n,r,e){return!t(n,r,e)})},u.rest=C,u.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=lt(jt()*(++t+1));e[t]=e[r],e[r]=n}),e},u.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=a(t,r),F(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i
|
||||
},u.tap=function(n,t){return t(n),n},u.throttle=function(n,t){function r(){a=new Date,i=K,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=K,a=f,u=n.apply(o,e)),u}},u.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},u.toArray=function(n){return n&&typeof n.length=="number"?p(n):E(n)},u.union=function(){return U(ct.apply(Z,arguments))},u.uniq=U,u.values=E,u.where=D,u.without=function(n){for(var t=-1,r=n.length,e=[];++t<r;){var u=n[t];
|
||||
0>z(arguments,u,1)&&e.push(u)}return e},u.wrap=function(n,t){return function(){var r=[n];return st.apply(r,arguments),t.apply(this,r)}},u.zip=function(n){for(var t=-1,r=n?T(zt(arguments,"length")):0,e=Array(r);++t<r;)e[t]=zt(arguments,t);return e},u.collect=R,u.drop=C,u.each=F,u.extend=g,u.methods=m,u.select=N,u.tail=C,u.unique=U,u.clone=function(n){return w(n)?Bt(n)?p(n):g({},n):n},u.contains=O,u.escape=function(n){return n==K?"":(n+"").replace(it,c)},u.every=S,u.find=k,u.findWhere=function(n,t){return D(n,t,J)
|
||||
},u.has=function(n,t){return n?pt.call(n,t):L},u.identity=G,u.indexOf=z,u.isArguments=v,u.isArray=Bt,u.isBoolean=function(n){return n===J||n===L||vt.call(n)==xt},u.isDate=function(n){return n instanceof Date||vt.call(n)==Et},u.isElement=function(n){return n?1===n.nodeType:L},u.isEmpty=d,u.isEqual=b,u.isFinite=function(n){return yt(n)&&!mt(parseFloat(n))},u.isFunction=j,u.isNaN=function(n){return A(n)&&n!=+n},u.isNull=function(n){return n===K},u.isNumber=A,u.isObject=w,u.isRegExp=function(n){return n instanceof RegExp||vt.call(n)==Nt
|
||||
},u.isString=x,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?dt(0,e+r):bt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=H,u.noConflict=function(){return n._=rt,this},u.random=function(n,t){return n==K&&t==K&&(t=1),n=+n||0,t==K&&(t=n,n=0),n+lt(jt()*((+t||0)-n+1))},u.reduce=q,u.reduceRight=I,u.result=function(n,t){var r=n?n[t]:K;return j(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Dt(n).length
|
||||
},u.some=B,u.sortedIndex=P,u.template=function(n,t,r){n||(n=""),r=y({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||ot).source+"|"+(r.interpolate||ot).source+"|"+(r.evaluate||ot).source+"|$","g"),function(t,r,u,i,a){return o+=n.slice(e,a).replace(at,f),r&&(o+="'+_['escape']("+r+")+'"),i&&(o+="';"+i+";__p+='"),u&&(o+="'+((__t=("+u+"))==null?'':__t)+'"),e=a+t.length,t}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";
|
||||
try{var a=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},u.unescape=function(n){return n==K?"":(n+"").replace(et,s)},u.uniqueId=function(n){var t=++nt+"";return n?n+t:t},u.all=S,u.any=B,u.detect=k,u.foldl=q,u.foldr=I,u.include=O,u.inject=q,u.first=M,u.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[u-1];return p(n,dt(0,u-e))}},u.take=M,u.head=M,u.chain=function(n){return n=new u(n),n.__chain__=J,n
|
||||
},u.VERSION="1.0.1",H(u),u.prototype.chain=function(){return this.__chain__=J,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=Z[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Rt&&0===n.length&&delete n[0],this}}),e(["concat","join","slice"],function(n){var t=Z[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=J),n
|
||||
}}),Q?X?(X.exports=u)._=u:Q._=u:n._=u})(this);
|
||||
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){var t=n.m,e=r.m;if(t!==e){if(t>e||typeof t=="undefined")return 1;if(t<e||typeof e=="undefined")return-1}return n.n-r.n}function t(n){return"\\"+vr[n]}function e(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n
|
||||
}function i(n){function r(){if(e){var n=e.slice();Rr.apply(n,arguments)}if(this instanceof r){var o=f(t.prototype),n=t.apply(o,n||arguments);return T(n)?n:o}return t.apply(u,n||arguments)}var t=n[0],e=n[2],u=n[4];return r}function f(n){return T(n)?Br(n):{}}function a(n,r,t){if(typeof n!="function")return Y;if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)
|
||||
};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return L(n,r)}function l(n){function r(){var n=p?a:this;if(o){var y=o.slice();Rr.apply(y,arguments)}return(i||g)&&(y||(y=e(arguments)),i&&Rr.apply(y,i),g&&y.length<c)?(u|=16,l([t,h?u:-4&u,y,null,a,c])):(y||(y=arguments),s&&(t=n[v]),this instanceof r?(n=f(t.prototype),y=t.apply(n,y),T(y)?y:n):t.apply(n,y))}var t=n[0],u=n[1],o=n[2],i=n[3],a=n[4],c=n[5],p=1&u,s=2&u,g=4&u,h=8&u,v=t;return r}function c(n,r){for(var t=-1,e=m(),u=n?n.length:0,o=[];++t<u;){var i=n[t];
|
||||
0>e(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];if(i&&typeof i=="object"&&typeof i.length=="number"&&(Cr(i)||d(i))){r||(i=p(i,r,t));var f=-1,a=i.length,l=o.length;for(o.length+=a;++f<a;)o[l++]=i[f]}else t||o.push(i)}return o}function s(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&hr[typeof n]||r&&hr[typeof r]))return false;if(null==n||null==r)return n===r;var o=Ar.call(n),i=Ar.call(r);if(o!=i)return false;switch(o){case ar:case lr:return+n==+r;
|
||||
case cr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case sr:case gr:return n==r+""}if(i=o==fr,!i){var f=n instanceof u,a=r instanceof u;if(f||a)return s(f?n.__wrapped__:n,a?r.__wrapped__:r,t,e);if(o!=pr)return false;if(o=n.constructor,f=r.constructor,o!=f&&!(E(o)&&o instanceof o&&E(f)&&f instanceof f)&&"constructor"in n&&"constructor"in r)return false}for(t||(t=[]),e||(e=[]),o=t.length;o--;)if(t[o]==n)return e[o]==r;var l=true,c=0;if(t.push(n),e.push(r),i){if(c=r.length,l=c==n.length)for(;c--&&(l=s(n[c],r[c],t,e)););return l
|
||||
}return Kr(r,function(r,u,o){return Sr.call(o,u)?(c++,!(l=Sr.call(n,u)&&s(n[u],r,t,e))&&tr):void 0}),l&&Kr(n,function(n,r,t){return Sr.call(t,r)?!(l=-1<--c)&&tr:void 0}),l}function g(n,r,t){for(var e=-1,u=m(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:0>u(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Q(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++e<o;){var i=r[e];n(u,i,t(i,e,r),r)}else Lr(r,function(r,e,o){n(u,r,t(r,e,o),o)
|
||||
});return u}}function v(n,r,t,e,u,o){var f=16&r,a=32&r;if(!(2&r||E(n)))throw new TypeError;return f&&!t.length&&(r&=-17,t=false),a&&!e.length&&(r&=-33,e=false),(1==r||17===r?i:l)([n,r,t,e,u,o])}function y(n){return Vr[n]}function m(){var r=(r=u.indexOf)===G?n:r;return r}function _(n){return Gr[n]}function d(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==ir||false}function b(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n
|
||||
}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function j(n){var r=[];return Kr(n,function(n,t){E(n)&&r.push(t)}),r.sort()}function x(n){for(var r=-1,t=Ur(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function A(n){if(!n)return true;if(Cr(n)||S(n))return!n.length;for(var r in n)if(Sr.call(n,r))return false;return true}function E(n){return typeof n=="function"}function T(n){return!(!n||!hr[typeof n])
|
||||
}function O(n){return typeof n=="number"||n&&typeof n=="object"&&Ar.call(n)==cr||false}function S(n){return typeof n=="string"||n&&typeof n=="object"&&Ar.call(n)==gr||false}function N(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function R(n,r){var t=m(),e=n?n.length:0,u=false;return e&&typeof e=="number"?u=-1<t(n,r):Lr(n,function(n){return(u=n===r)&&tr}),u}function k(n,r,t){var e=true;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Lr(n,function(n,t,u){return!(e=!!r(n,t,u))&&tr
|
||||
});return e}function B(n,r,t){var e=[];r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else Lr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function F(n,r,t){r=Q(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Lr(n,function(n,t,e){return r(n,t,e)?(u=n,tr):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function q(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==tr;);else Lr(n,r)
|
||||
}function D(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=Ur(n),t=e.length;Lr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&tr})}}function I(n,r,t){var e=-1,u=n?n.length:0;if(r=Q(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Lr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function M(n,r,t){var e=-1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t>u&&(u=t);
|
||||
else r=Q(r,t,3),q(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function $(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++t<e;)u[t]=n[t][r];return u||I(n,r)}function W(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=Q(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Lr(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)});return t}function z(n,r,t,e){var u=3>arguments.length;return r=Q(r,e,4),D(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)
|
||||
}),t}function C(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return q(n,function(n){var t;t=++r,t=0+Or(Wr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function P(n,r,t){var e;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Lr(n,function(n,t,u){return(e=r(n,t,u))&&tr});return!!e}function U(n,r,t){return t&&A(r)?nr:(t?F:B)(n,r)}function V(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=-1;for(r=Q(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[0]:nr;
|
||||
return e(n,0,$r(Mr(0,u),o))}function G(r,t,e){if(typeof e=="number"){var u=r?r.length:0;e=0>e?Mr(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1;return n(r,t,e)}function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Q(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:Mr(0,r);return e(n,u)}function J(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?Q(t,e,1):Y,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function K(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=typeof r!="function"&&e&&e[r]===n?null:r,r=false),null!=t&&(t=Q(t,e,3)),g(n,r,t)
|
||||
}function L(n,r){return 2<arguments.length?v(n,17,e(arguments,2),null,r):v(n,1,null,null,r)}function Q(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Ur(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function X(n,r,t){var e,u,o,i,f,a,l,c=0,p=false,s=true;if(!E(n))throw new TypeError;if(r=Mr(0,r)||0,true===t)var g=true,s=false;else T(t)&&(g=t.leading,p="maxWait"in t&&(Mr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);
|
||||
var h=function(){var t=r-(Nr()-i);0<t?a=setTimeout(h,t):(u&&clearTimeout(u),t=l,u=a=l=nr,t&&(c=Nr(),o=n.apply(f,e),a||u||(e=f=null)))},v=function(){a&&clearTimeout(a),u=a=l=nr,(s||p!==r)&&(c=Nr(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=Nr(),f=this,l=s&&(a||!g),false===p)var t=g&&!a;else{u||g||(c=i);var y=p-(i-c),m=0>=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o
|
||||
}}function Y(n){return n}function Z(n){q(j(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}var nr,rr=0,tr={},er=+new Date+"",ur=/($^)/,or=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",fr="[object Array]",ar="[object Boolean]",lr="[object Date]",cr="[object Number]",pr="[object Object]",sr="[object RegExp]",gr="[object String]",hr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yr=hr[typeof window]&&window||this,mr=hr[typeof exports]&&exports&&!exports.nodeType&&exports,_r=hr[typeof module]&&module&&!module.nodeType&&module,dr=_r&&_r.exports===mr&&mr,br=hr[typeof global]&&global;
|
||||
!br||br.global!==br&&br.window!==br||(yr=br);var wr=[],jr=Object.prototype,xr=yr._,Ar=jr.toString,Er=RegExp("^"+(Ar+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Tr=Math.ceil,Or=Math.floor,Sr=jr.hasOwnProperty,Nr=Er.test(Nr=Date.now)&&Nr||function(){return+new Date},Rr=wr.push,kr=jr.propertyIsEnumerable,Br=Er.test(Br=Object.create)&&Br,Fr=Er.test(Fr=Array.isArray)&&Fr,qr=yr.isFinite,Dr=yr.isNaN,Ir=Er.test(Ir=Object.keys)&&Ir,Mr=Math.max,$r=Math.min,Wr=Math.random;
|
||||
o.prototype=u.prototype;var zr={};!function(){var n={0:1,length:1};zr.spliceObjects=(wr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Br||(f=function(){function n(){}return function(r){if(T(r)){n.prototype=r;var t=new n;n.prototype=null}return t||yr.Object()}}()),d(arguments)||(d=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n,"callee")&&!kr.call(n,"callee")||false});var Cr=Fr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==fr||false
|
||||
},Pr=function(n){var r,t=[];if(!n||!hr[typeof n])return t;for(r in n)Sr.call(n,r)&&t.push(r);return t},Ur=Ir?function(n){return T(n)?Ir(n):[]}:Pr,Vr={"&":"&","<":"<",">":">",'"':""","'":"'"},Gr=x(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(r(n[t],t,n)===tr)break;return n},Lr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(Sr.call(n,t)&&r(n[t],t,n)===tr)break;
|
||||
return n};E(/x/)&&(E=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)});var Qr=h(function(n,r,t){Sr.call(n,t)?n[t]++:n[t]=1}),Xr=h(function(n,r,t){(Sr.call(n,t)?n[t]:n[t]=[]).push(r)}),Yr=h(function(n,r,t){n[t]=r});u.after=function(n,r){if(!E(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1<arguments.length?p(arguments,true,false,1):j(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=v(n[u],1,null,null,n)}return n
|
||||
},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!E(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Qr,u.debounce=X,u.defaults=w,u.defer=function(n){if(!E(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(nr,r)},1)},u.delay=function(n,r){if(!E(n))throw new TypeError;
|
||||
var t=e(arguments,2);return setTimeout(function(){n.apply(nr,t)},r)},u.difference=function(n){return c(n,p(arguments,true,true,1))},u.filter=B,u.flatten=function(n,r){return p(n,r)},u.forEach=q,u.functions=j,u.groupBy=Xr,u.indexBy=Yr,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,$r(Mr(0,o-u),o))},u.intersection=function(n){var r=arguments,t=r.length,e=-1,u=m(),o=n?n.length:0,i=[];n:for(;++e<o;){var f=n[e];
|
||||
if(0>u(i,f)){for(var a=t;--a;)if(0>u(r[a],f))continue n;i.push(f)}}return i},u.invert=x,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return q(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Ur,u.map=I,u.max=M,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):er+arguments[0];return Sr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);
|
||||
var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t<u&&(u=t);else r=Q(r,t,3),q(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});return u},u.omit=function(n){var r=[];Kr(n,function(n,t){r.push(t)});for(var r=c(r,p(arguments,true,false,1)),t=-1,e=r.length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!E(n))throw new TypeError;return function(){return r?t:(r=true,t=n.apply(this,arguments),n=null,t)}},u.pairs=function(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;){var o=t[r];
|
||||
u[r]=[o,n[o]]}return u},u.partial=function(n){return v(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,true,false,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=$,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Mr(0,Tr((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=Q(r,t,3),B(n,function(n,t,e){return!r(n,t,e)})},u.rest=H,u.shuffle=C,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);
|
||||
for(t=Q(t,e,3),q(n,function(n,r,e){i[++u]={m:t(n,r,e),n:u,o:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].o;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=true,u=true;if(!E(n))throw new TypeError;return false===t?e=false:T(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,X(n,r,t)},u.times=function(n,r,t){n=-1<(n=+n)?n:0;var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Cr(n)?e(n):n&&typeof n.length=="number"?I(n):N(n)
|
||||
},u.union=function(){return g(p(arguments,true,true))},u.uniq=K,u.values=N,u.where=U,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return v(r,16,[n])},u.zip=function(){for(var n=-1,r=M($(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=$(arguments,n);return t},u.collect=I,u.drop=H,u.each=q,u.extend=b,u.methods=j,u.object=function(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=B,u.tail=H,u.unique=K,u.clone=function(n){return T(n)?Cr(n)?e(n):b({},n):n
|
||||
},u.contains=R,u.escape=function(n){return null==n?"":(n+"").replace(Jr,y)},u.every=k,u.find=F,u.has=function(n,r){return n?Sr.call(n,r):false},u.identity=Y,u.indexOf=G,u.isArguments=d,u.isArray=Cr,u.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Ar.call(n)==ar||false},u.isDate=function(n){return n&&typeof n=="object"&&Ar.call(n)==lr||false},u.isElement=function(n){return n&&1===n.nodeType||false},u.isEmpty=A,u.isEqual=function(n,r){return s(n,r)},u.isFinite=function(n){return qr(n)&&!Dr(parseFloat(n))
|
||||
},u.isFunction=E,u.isNaN=function(n){return O(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=O,u.isObject=T,u.isRegExp=function(n){return n&&hr[typeof n]&&Ar.call(n)==sr||false},u.isString=S,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Mr(0,e+t):$r(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=Z,u.noConflict=function(){return yr._=xr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Or(Wr()*(r-n+1))
|
||||
},u.reduce=W,u.reduceRight=z,u.result=function(n,r){if(n){var t=n[r];return E(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Ur(n).length},u.some=P,u.sortedIndex=J,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=w({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||ur).source+"|"+(e.interpolate||ur).source+"|"+(e.evaluate||ur).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(or,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r
|
||||
}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+"").replace(Hr,_)},u.uniqueId=function(n){var r=++rr+"";return n?n+r:r},u.all=k,u.any=P,u.detect=F,u.findWhere=function(n,r){return U(n,r,true)},u.foldl=W,u.foldr=z,u.include=R,u.inject=W,u.first=V,u.last=function(n,r,t){var u=0,o=n?n.length:0;
|
||||
if(typeof r!="number"&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:nr;return e(n,Mr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=N(n)),null==r||t?n?n[0+Or(Wr()*(n.length-1-0+1))]:nr:(n=C(n),n.length=$r(Mr(0,r),n.length),n)},u.take=V,u.head=V,Z(u),u.VERSION="2.3.0",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},q("pop push reverse shift sort splice unshift".split(" "),function(n){var r=wr[n];
|
||||
u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),zr.spliceObjects||0!==n.length||delete n[0],this}}),q(["concat","join","slice"],function(n){var r=wr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(yr._=u, define(function(){return u})):mr&&_r?dr?(_r.exports=u)._=u:mr._=u:yr._=u}).call(this);
|
||||
2779
doc/README.md
@@ -1,36 +1,38 @@
|
||||
<?php
|
||||
|
||||
// cleanup requested filepath
|
||||
$file = isset($_GET['f']) ? $_GET['f'] : 'lodash';
|
||||
$file = preg_replace('#(\.*[\/])+#', '', $file);
|
||||
$file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.js';
|
||||
// cleanup requested file path
|
||||
$filePath = isset($_GET['f']) ? $_GET['f'] : 'lodash';
|
||||
$filePath = preg_replace('#(\.*[\/])+#', '', $filePath);
|
||||
$filePath .= preg_match('/\.[a-z]+$/', $filePath) ? '' : '.js';
|
||||
|
||||
// output filename
|
||||
if (isset($_GET['o'])) {
|
||||
$output = $_GET['o'];
|
||||
$outputName = $_GET['o'];
|
||||
} else if (isset($_SERVER['argv'][1])) {
|
||||
$output = $_SERVER['argv'][1];
|
||||
$outputName = $_SERVER['argv'][1];
|
||||
} else {
|
||||
$output = basename($file);
|
||||
$outputName = basename($filePath);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
require('../vendor/docdown/docdown.php');
|
||||
|
||||
// get package version
|
||||
$version = json_decode(file_get_contents('../package.json'))->version;
|
||||
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
'path' => '../' . $file,
|
||||
'title' => 'Lo-Dash <sup>v1.0.1</sup>',
|
||||
'path' => '../' . $filePath,
|
||||
'title' => 'Lo-Dash <span>v' . $version . '</span>',
|
||||
'toc' => 'categories',
|
||||
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
|
||||
'url' => 'https://github.com/lodash/lodash/blob/' . $version . '/lodash.js'
|
||||
));
|
||||
|
||||
// save to a .md file
|
||||
file_put_contents($output . '.md', $markdown);
|
||||
// save to a `.md` file
|
||||
file_put_contents($outputName . '.md', $markdown);
|
||||
|
||||
// print
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
echo $markdown . PHP_EOL;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
2
index.js
@@ -1 +1 @@
|
||||
module.exports = require('./lodash');
|
||||
module.exports = require('./dist/lodash.compat.js');
|
||||
98
package.json
@@ -1,52 +1,62 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "1.0.1",
|
||||
"description": "An alternative to Underscore.js, delivering consistency, customization, performance, and extra features.",
|
||||
"homepage": "http://lodash.com",
|
||||
"main": "./dist/lodash",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"client",
|
||||
"functional",
|
||||
"performance",
|
||||
"server",
|
||||
"speed",
|
||||
"util"
|
||||
"version": "2.3.0",
|
||||
"description": "A utility library delivering consistency, customization, performance, & extras.",
|
||||
"homepage": "http://lodash.com/",
|
||||
"license": "MIT",
|
||||
"main": "dist/lodash.js",
|
||||
"keywords": ["amd", "browser", "client", "customize", "functional", "server", "util"],
|
||||
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"contributors": [
|
||||
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://lodash.com/license"
|
||||
}
|
||||
],
|
||||
"author": {
|
||||
"name": "John-David Dalton",
|
||||
"email": "john.david.dalton@gmail.com",
|
||||
"web": "http://allyoucanleet.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/bestiejs/lodash/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bestiejs/lodash.git"
|
||||
},
|
||||
"bin": {
|
||||
"lodash": "./build.js"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "./doc",
|
||||
"test": "./test"
|
||||
},
|
||||
"engines": [
|
||||
"node",
|
||||
"rhino"
|
||||
"bugs": "https://github.com/lodash/lodash/issues",
|
||||
"repository": { "type": "git", "url": "https://github.com/lodash/lodash.git" },
|
||||
"engines": ["node", "rhino"],
|
||||
"files": [
|
||||
"LICENSE.txt",
|
||||
"lodash.js",
|
||||
"dist/lodash.js",
|
||||
"dist/lodash.min.js",
|
||||
"dist/lodash.compat.js",
|
||||
"dist/lodash.compat.min.js",
|
||||
"dist/lodash.underscore.js",
|
||||
"dist/lodash.underscore.min.js"
|
||||
],
|
||||
"jam": {
|
||||
"main": "./lodash.js"
|
||||
"main": "dist/lodash.compat.js",
|
||||
"include": [
|
||||
"LICENSE.txt",
|
||||
"dist/lodash.js",
|
||||
"dist/lodash.min.js",
|
||||
"dist/lodash.compat.js",
|
||||
"dist/lodash.compat.min.js",
|
||||
"dist/lodash.underscore.js",
|
||||
"dist/lodash.underscore.min.js"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node ./build.js",
|
||||
"test": "node ./test/test.js ./dist/lodash.js && node ./test/test.js ./dist/lodash.min.js && node ./test/test-build.js"
|
||||
"volo": {
|
||||
"type": "directory",
|
||||
"ignore": [
|
||||
".*",
|
||||
"*.custom.*",
|
||||
"*.min.*",
|
||||
"*.template.*",
|
||||
"*.map",
|
||||
"*.md",
|
||||
"lodash.js",
|
||||
"index.js",
|
||||
"bower.json",
|
||||
"component.json",
|
||||
"doc",
|
||||
"modularize",
|
||||
"node_modules",
|
||||
"perf",
|
||||
"test",
|
||||
"vendor"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
172
perf/asset/perf-ui.js
Normal file
@@ -0,0 +1,172 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The base path of the builds */
|
||||
var basePath = '../';
|
||||
|
||||
/** The Lo-Dash build to load */
|
||||
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
|
||||
|
||||
/** The other library to load */
|
||||
var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
|
||||
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Registers an event listener on an element.
|
||||
*
|
||||
* @private
|
||||
* @param {Element} element The element.
|
||||
* @param {string} eventName The name of the event.
|
||||
* @param {Function} handler The event handler.
|
||||
* @returns {Element} The element.
|
||||
*/
|
||||
function addListener(element, eventName, handler) {
|
||||
if (typeof element.addEventListener != 'undefined') {
|
||||
element.addEventListener(eventName, handler, false);
|
||||
} else if (typeof element.attachEvent != 'undefined') {
|
||||
element.attachEvent('on' + eventName, handler);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// initialize controls
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
otherIndex = otherList.selectedIndex,
|
||||
search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
|
||||
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
|
||||
'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value);
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.style.cssText = 'float:right';
|
||||
span1.innerHTML =
|
||||
'<label for="perf-build">Build: </label>' +
|
||||
'<select id="perf-build">' +
|
||||
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
|
||||
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="perf-other">Other Library: </label>' +
|
||||
'<select id="perf-other">' +
|
||||
'<option value="underscore-dev">Underscore (development)</option>' +
|
||||
'<option value="underscore">Underscore (production)</option>' +
|
||||
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
|
||||
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
otherList = span2.lastChild,
|
||||
toolbar = document.getElementById('perf-toolbar');
|
||||
|
||||
toolbar.appendChild(span2);
|
||||
toolbar.appendChild(span1);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-compat': return 0;
|
||||
case 'lodash-legacy': return 1;
|
||||
case 'lodash-mobile': return 2;
|
||||
case 'lodash-underscore': return 4;
|
||||
case 'lodash-custom-dev': return 5;
|
||||
case 'lodash-custom': return 6;
|
||||
case 'lodash-modern':
|
||||
case null: return 3;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
otherList.selectedIndex = (function() {
|
||||
switch (other) {
|
||||
case 'underscore-dev': return 0;
|
||||
case 'lodash-compat': return 2;
|
||||
case 'lodash-legacy': return 3;
|
||||
case 'lodash-mobile': return 4;
|
||||
case 'lodash-modern': return 5;
|
||||
case 'lodash-underscore': return 6;
|
||||
case 'lodash-custom-dev': return 7;
|
||||
case 'lodash-custom': return 8;
|
||||
case 'underscore':
|
||||
case null: return 1;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
addListener(otherList, 'change', eventHandler);
|
||||
});
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||
case null: build = 'lodash-modern';
|
||||
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// expose other library file path
|
||||
ui.otherPath = (function() {
|
||||
var result;
|
||||
switch (other) {
|
||||
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
|
||||
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
|
||||
case null: other = 'underscore';
|
||||
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break;
|
||||
default: return other;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// expose `ui.urlParams` properties
|
||||
ui.urlParams = {
|
||||
'build': build,
|
||||
'other': other
|
||||
};
|
||||
|
||||
// expose `ui`
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
@@ -29,17 +29,18 @@
|
||||
<body>
|
||||
<div id="perf-toolbar"></div>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script src="../vendor/benchmark.js/benchmark.js"></script>
|
||||
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
|
||||
<script src="perf-ui.js"></script>
|
||||
<script src="./asset/perf-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
</script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.otherPath + '"><\/script>');
|
||||
document.write('<script src="' + ui.otherPath + '"><\/script>');
|
||||
</script>
|
||||
<script src="perf.js"></script>
|
||||
<script>
|
||||
|
||||
136
perf/perf-ui.js
@@ -1,136 +0,0 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The Lo-Dash build to load */
|
||||
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
|
||||
|
||||
/** The other library to load */
|
||||
var other = (/other=([^&]+)/.exec(location.search) || [])[1];
|
||||
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Registers an event listener on an element.
|
||||
*
|
||||
* @private
|
||||
* @param {Element} element The element.
|
||||
* @param {String} eventName The name of the event.
|
||||
* @param {Function} handler The event handler.
|
||||
* @returns {Element} The element.
|
||||
*/
|
||||
function addListener(element, eventName, handler) {
|
||||
if (typeof element.addEventListener != 'undefined') {
|
||||
element.addEventListener(eventName, handler, false);
|
||||
} else if (typeof element.attachEvent != 'undefined') {
|
||||
element.attachEvent('on' + eventName, handler);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-dev': return 'dist/lodash.compat.js';
|
||||
case 'lodash-modern': return 'dist/lodash.min.js';
|
||||
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
}
|
||||
return 'dist/lodash.compat.min.js';
|
||||
}());
|
||||
|
||||
// expose other library file path
|
||||
ui.otherPath = (function() {
|
||||
switch (other) {
|
||||
case 'lodash-dev': return 'dist/lodash.compat.js';
|
||||
case 'lodash-prod': return 'dist/lodash.compat.min.js';
|
||||
case 'lodash-modern': return 'dist/lodash.min.js';
|
||||
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'underscore-dev': return 'vendor/underscore/underscore.js';
|
||||
}
|
||||
return 'vendor/underscore/underscore-min.js';
|
||||
}());
|
||||
|
||||
// initialize controls
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + buildList[buildList.selectedIndex].value + '&' +
|
||||
'other=' + otherList[otherList.selectedIndex].value;
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.style.cssText = 'float:right';
|
||||
span1.innerHTML =
|
||||
'<label for="perf-build">Build: </label>' +
|
||||
'<select id="perf-build">' +
|
||||
'<option value="lodash-dev">Lo-Dash</option>' +
|
||||
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="perf-other">Other Library: </label>' +
|
||||
'<select id="perf-other">' +
|
||||
'<option value="underscore-dev">Underscore</option>' +
|
||||
'<option value="underscore-prod">Underscore (minified)</option>' +
|
||||
'<option value="lodash-dev">Lo-Dash</option>' +
|
||||
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
otherList = span2.lastChild,
|
||||
toolbar = document.getElementById('perf-toolbar');
|
||||
|
||||
toolbar.appendChild(span2);
|
||||
toolbar.appendChild(span1);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-dev': return 0;
|
||||
case 'lodash-modern': return 2;
|
||||
case 'lodash-underscore': return 3;
|
||||
case 'lodash-custom': return 4;
|
||||
}
|
||||
return 1;
|
||||
}());
|
||||
|
||||
otherList.selectedIndex = (function() {
|
||||
switch (other) {
|
||||
case 'underscore-dev': return 0;
|
||||
case 'lodash-dev': return 2;
|
||||
case 'lodash-prod': return 3;
|
||||
case 'lodash-modern': return 4;
|
||||
case 'lodash-underscore': return 5;
|
||||
case 'lodash-custom': return 6;
|
||||
}
|
||||
return 1;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
addListener(otherList, 'change', eventHandler);
|
||||
});
|
||||
|
||||
// expose `ui`
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
720
perf/perf.js
@@ -3,7 +3,7 @@ cd "$(dirname "$0")"
|
||||
echo "Running performance suite in node..."
|
||||
node perf.js ../dist/lodash.js && node perf.js ../dist/lodash.min.js
|
||||
|
||||
for cmd in rhino narwhal ringo phantomjs; do
|
||||
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||
echo ""
|
||||
echo "Running performance suite in $cmd..."
|
||||
$cmd perf.js ../dist/lodash.compat.js && $cmd perf.js ../dist/lodash.compat.min.js
|
||||
|
||||
174
test/asset/test-ui.js
Normal file
@@ -0,0 +1,174 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** The base path of the builds */
|
||||
var basePath = '../';
|
||||
|
||||
/** The Lo-Dash build to load */
|
||||
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
|
||||
|
||||
/** The module loader to use */
|
||||
var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
|
||||
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Registers an event listener on an element.
|
||||
*
|
||||
* @private
|
||||
* @param {Element} element The element.
|
||||
* @param {string} eventName The name of the event.
|
||||
* @param {Function} handler The event handler.
|
||||
* @returns {Element} The element.
|
||||
*/
|
||||
function addListener(element, eventName, handler) {
|
||||
if (typeof element.addEventListener != 'undefined') {
|
||||
element.addEventListener(eventName, handler, false);
|
||||
} else if (typeof element.attachEvent != 'undefined') {
|
||||
element.attachEvent('on' + eventName, handler);
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// initialize controls
|
||||
addListener(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var buildIndex = buildList.selectedIndex,
|
||||
loaderIndex = loaderList.selectedIndex,
|
||||
search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, '');
|
||||
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
|
||||
'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value);
|
||||
}
|
||||
|
||||
function init() {
|
||||
var toolbar = document.getElementById('qunit-testrunner-toolbar');
|
||||
if (toolbar) {
|
||||
toolbar.appendChild(span1);
|
||||
toolbar.appendChild(span2);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-compat': return 1;
|
||||
case 'lodash-modern-dev': return 2;
|
||||
case 'lodash-modern': return 3;
|
||||
case 'lodash-legacy': return 4;
|
||||
case 'lodash-mobile': return 5;
|
||||
case 'lodash-underscore': return 6;
|
||||
case 'lodash-custom-dev': return 7;
|
||||
case 'lodash-custom': return 8;
|
||||
case 'lodash-compat-dev':
|
||||
case null: return 0;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
loaderList.selectedIndex = (function() {
|
||||
switch (loader) {
|
||||
case 'curl': return 1;
|
||||
case 'dojo': return 2;
|
||||
case 'requirejs': return 3;
|
||||
case 'none':
|
||||
case null: return 0;
|
||||
}
|
||||
return -1;
|
||||
}());
|
||||
|
||||
addListener(buildList, 'change', eventHandler);
|
||||
addListener(loaderList, 'change', eventHandler);
|
||||
}
|
||||
else {
|
||||
setTimeout(init, 15);
|
||||
}
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.style.cssText = 'float:right';
|
||||
span1.innerHTML =
|
||||
'<label for="qunit-build">Build: </label>' +
|
||||
'<select id="qunit-build">' +
|
||||
'<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
|
||||
'<option value="lodash-compat">Lo-Dash (compat production)</option>' +
|
||||
'<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
|
||||
'<option value="lodash-modern">Lo-Dash (modern production)</option>' +
|
||||
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
|
||||
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
|
||||
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
|
||||
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
|
||||
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
|
||||
'</select>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="qunit-loader">Loader: </label>' +
|
||||
'<select id="qunit-loader">' +
|
||||
'<option value="none">None</option>' +
|
||||
'<option value="curl">Curl</option>' +
|
||||
'<option value="dojo">Dojo</option>' +
|
||||
'<option value="requirejs">RequireJS</option>' +
|
||||
'</select>';
|
||||
|
||||
var buildList = span1.lastChild,
|
||||
loaderList = span2.lastChild;
|
||||
|
||||
init();
|
||||
});
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
var result;
|
||||
switch (build) {
|
||||
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
|
||||
case 'lodash-modern-dev': result = 'dist/lodash.js'; break;
|
||||
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
|
||||
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
|
||||
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
|
||||
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
|
||||
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
|
||||
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
|
||||
case null: build = 'lodash-compat-dev';
|
||||
case 'lodash-compat-dev': result = 'lodash.js'; break;
|
||||
default: return build;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// expose module loader file path
|
||||
ui.loaderPath = (function() {
|
||||
var result;
|
||||
switch (loader) {
|
||||
case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break;
|
||||
case 'dojo': result = 'vendor/dojo/dojo.js'; break;
|
||||
case 'requirejs': result = 'vendor/requirejs/require.js'; break;
|
||||
case null: loader = 'none'; return '';
|
||||
default: return loader;
|
||||
}
|
||||
return basePath + result;
|
||||
}());
|
||||
|
||||
// expose `ui.urlParams` properties
|
||||
ui.urlParams = {
|
||||
'build': build,
|
||||
'loader': loader
|
||||
};
|
||||
|
||||
// used to indicate testing a modularized build
|
||||
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]);
|
||||
|
||||
// expose `ui`
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
6
test/asset/worker.js
Normal file
@@ -0,0 +1,6 @@
|
||||
addEventListener('message', function(e) {
|
||||
if (e.data) {
|
||||
importScripts('../' + e.data);
|
||||
postMessage(_.VERSION);
|
||||
}
|
||||
}, false);
|
||||
@@ -18,28 +18,88 @@
|
||||
<h1>Test</h1>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../vendor/json3/lib/json3.js"></script>
|
||||
<script src="../vendor/json-js/json2.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
|
||||
QUnit.config.hidepassed = true;
|
||||
|
||||
// assign results to `global_test_results` for Sauce Labs
|
||||
var global_test_results;
|
||||
QUnit.done(function(results) {
|
||||
global_test_results = results;
|
||||
});
|
||||
|
||||
// skip tests we intentionally fail or those with problems
|
||||
(function() {
|
||||
var skipped = {
|
||||
'Backbone.Collection': {
|
||||
'set with many models does not overflow the stack': true
|
||||
},
|
||||
'Backbone.Router': {
|
||||
'#2656 - No trailing slash on root.': true,
|
||||
'#2765 - Fragment matching sans query/hash.': true
|
||||
}
|
||||
};
|
||||
|
||||
// only skip `Backbone.Router` tests in IE < 8
|
||||
if (!(document.attachEvent && (document.documentMode || 0) < 8)) {
|
||||
delete skipped['Backbone.Router'];
|
||||
}
|
||||
|
||||
QUnit.testStart(function(details) {
|
||||
var test = QUnit.config.current,
|
||||
finish = test.finish,
|
||||
skippedTests = skipped[details.module],
|
||||
skippedAsserts = skippedTests && skippedTests[details.name];
|
||||
|
||||
if (!skippedAsserts) {
|
||||
return;
|
||||
}
|
||||
if (skippedAsserts === true) {
|
||||
test.async = false;
|
||||
test.callback = function() {};
|
||||
test.expected = 0;
|
||||
return;
|
||||
}
|
||||
test.finish = function() {
|
||||
var index = -1,
|
||||
asserts = this.assertions,
|
||||
length = asserts.length;
|
||||
|
||||
while (++index < length) {
|
||||
var assert = asserts[index],
|
||||
message = _.unescape(_.result(/^<span class='test-message'>([\s\S]*?)<\/span>/.exec(assert.message), 1)),
|
||||
died = _.result(/^Died on test #\d+/.exec(message), 0),
|
||||
expected = _.unescape(_.result(/Expected: *<\/th><td><pre>([\s\S]*?)<\/pre>/.exec(assert.message), 1));
|
||||
|
||||
if ((message && _.contains(skippedAsserts, message)) ||
|
||||
(died && _.contains(skippedAsserts, died)) ||
|
||||
(expected && (_.contains(skippedAsserts, expected) ||
|
||||
_.contains(skippedAsserts, expected.replace(/\s+/g, '')))
|
||||
)) {
|
||||
assert.result = true;
|
||||
}
|
||||
}
|
||||
finish.call(this);
|
||||
};
|
||||
});
|
||||
}());
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
_.mixin({
|
||||
'debounce': lodash.debounce,
|
||||
'defer': lodash.defer
|
||||
'debounce': _.debounce || lodash.debounce,
|
||||
'defer': _.defer || lodash.defer,
|
||||
'pluck': _.pluck || lodash.pluck
|
||||
});
|
||||
if (!_.chain) {
|
||||
_.mixin({
|
||||
'chain': function(value) {
|
||||
return new _(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="../vendor/backbone/backbone.js"></script>
|
||||
<script src="../vendor/backbone/test/environment.js"></script>
|
||||
|
||||
173
test/index.html
@@ -4,76 +4,169 @@
|
||||
<meta charset="utf-8">
|
||||
<title>Lo-Dash Test Suite</title>
|
||||
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
|
||||
<style>
|
||||
#exports {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="qunit"></div>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<div id="qunit"></div>
|
||||
<div id="exports"></div>
|
||||
<script>
|
||||
// set a bad shim
|
||||
// set bad shims
|
||||
Array._isArray = Array.isArray;
|
||||
Array.isArray = function() { return false; };
|
||||
|
||||
Function.prototype._bind = Function.prototype.bind;
|
||||
Function.prototype.bind = function() { return function() {}; };
|
||||
|
||||
Object._create = Object.create;
|
||||
Object.create = function() {};
|
||||
|
||||
Object._defineProperty = Object.defineProperty;
|
||||
Object.defineProperty = function() {};
|
||||
|
||||
Object._keys = Object.keys;
|
||||
Object.keys = function() { return []; };
|
||||
|
||||
// load Lo-Dash and expose it to the bad `Object.keys` shim
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
// store Lo-Dash to test for bad shim detection
|
||||
var lodashBadShim = _;
|
||||
var lodashBadShim = window._;
|
||||
|
||||
// restore nativeKeys
|
||||
Object.keys = Object._keys;
|
||||
// restore native methods
|
||||
if (Array._isArray) {
|
||||
Array.isArray = Array._isArray;
|
||||
} else {
|
||||
delete Array.isArray;
|
||||
}
|
||||
if (Function.prototype._bind) {
|
||||
Function.prototype.bind = Function.prototype._bind;
|
||||
} else {
|
||||
delete Function.prototype.bind;
|
||||
}
|
||||
if (Object._create) {
|
||||
Object.create = Object._create;
|
||||
} else {
|
||||
delete Object.create;
|
||||
}
|
||||
if (Object._defineProperty) {
|
||||
Object.defineProperty = Object._defineProperty;
|
||||
} else {
|
||||
delete Object.defineProperty;
|
||||
}
|
||||
if (Object._keys) {
|
||||
Object.keys = Object._keys;
|
||||
} else {
|
||||
delete Object.keys;
|
||||
}
|
||||
delete Array._isArray;
|
||||
delete Function.prototype._bind;
|
||||
delete Object._create;
|
||||
delete Object._defineProperty;
|
||||
delete Object._keys;
|
||||
|
||||
QUnit.config.hidepassed = true;
|
||||
|
||||
// assign results to `global_test_results` for Sauce Labs
|
||||
var global_test_results;
|
||||
QUnit.done(function(results) {
|
||||
global_test_results = results;
|
||||
});
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
|
||||
// load test.js if not using require.js
|
||||
document.write(QUnit.urlParams.norequire
|
||||
document.write(ui.urlParams.loader == 'none'
|
||||
? '<script src="test.js"><\/script>'
|
||||
: '<script src="../vendor/requirejs/require.js"><\/script>'
|
||||
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
// load Lo-Dash as a module
|
||||
var lodashModule,
|
||||
shimmedModule,
|
||||
underscoreModule;
|
||||
|
||||
window.require && require(
|
||||
(function() {
|
||||
var modulePath = ui.buildPath.replace(/\.js$/, '');
|
||||
return {
|
||||
'baseUrl': '../vendor/requirejs/',
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (!window.require) {
|
||||
return;
|
||||
}
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
locationPath = modulePath.replace(reBasename, ''),
|
||||
moduleMain = modulePath.match(reBasename)[0];
|
||||
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
// load Lo-Dash as a module
|
||||
require({
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'paths': {
|
||||
'lodash': '../../' + modulePath,
|
||||
'shimmed': './../../' + modulePath,
|
||||
'underscore': '../underscore/../../' + modulePath
|
||||
},
|
||||
'packages': [
|
||||
{
|
||||
'name': 'lodash',
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'shimmed',
|
||||
'location': './abc/../' + locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'underscore',
|
||||
'location': './xyz/../' + locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'test',
|
||||
'location': basePath + '/test',
|
||||
'main': 'test',
|
||||
'config': {
|
||||
// work around no global being exported
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
}
|
||||
],
|
||||
'shim': {
|
||||
'shimmed': {
|
||||
'exports': '_'
|
||||
'exports': '_'
|
||||
}
|
||||
}
|
||||
};
|
||||
}()),
|
||||
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
|
||||
if (lodash && lodash.noConflict) {
|
||||
lodashModule = lodash.noConflict();
|
||||
lodashModule.moduleName = 'lodash';
|
||||
}
|
||||
if (shimmed.noConflict) {
|
||||
shimmedModule = shimmed.noConflict();
|
||||
shimmedModule.moduleName = 'shimmed';
|
||||
}
|
||||
if (underscore && underscore.noConflict) {
|
||||
underscoreModule = underscore.noConflict();
|
||||
underscoreModule.moduleName = 'underscore';
|
||||
}
|
||||
require(['test.js']);
|
||||
});
|
||||
},
|
||||
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
|
||||
if (shimmed && shimmed.noConflict) {
|
||||
shimmedModule = shimmed.noConflict();
|
||||
shimmedModule.moduleName = 'shimmed';
|
||||
}
|
||||
if (underscore && underscore.noConflict) {
|
||||
underscoreModule = underscore.noConflict();
|
||||
underscoreModule.moduleName = 'underscore';
|
||||
}
|
||||
if (lodash && lodash.noConflict) {
|
||||
lodashModule = lodash.noConflict();
|
||||
lodashModule.moduleName = 'lodash';
|
||||
}
|
||||
if (ui.isModularize) {
|
||||
window._ = lodash;
|
||||
}
|
||||
require(['test'], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
// set a more readable browser name
|
||||
window.onload = function() {
|
||||
@@ -83,7 +176,7 @@
|
||||
ua.innerHTML = platform;
|
||||
clearInterval(timeoutId);
|
||||
}
|
||||
}, 15);
|
||||
}, 16);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
6
test/run-test.sh
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
for cmd in rhino narwhal ringo phantomjs; do
|
||||
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
|
||||
echo "Testing in $cmd..."
|
||||
$cmd test.js ../dist/lodash.compat.js && $cmd test.js ../dist/lodash.compat.min.js
|
||||
echo ""
|
||||
@@ -9,10 +9,6 @@ done
|
||||
echo "Testing in node..."
|
||||
node test.js ../dist/lodash.js && node test.js ../dist/lodash.min.js
|
||||
|
||||
echo ""
|
||||
echo "Testing build..."
|
||||
node test-build.js
|
||||
|
||||
echo ""
|
||||
echo "Testing in a browser..."
|
||||
open index.html
|
||||
|
||||
232
test/saucelabs.js
Normal file
@@ -0,0 +1,232 @@
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
var ecstatic = require('ecstatic'),
|
||||
http = require('http'),
|
||||
path = require('path'),
|
||||
request = require('request'),
|
||||
SauceTunnel = require('sauce-tunnel'),
|
||||
url = require('url');
|
||||
|
||||
var attempts = -1,
|
||||
prevLine = '';
|
||||
|
||||
var port = 8081,
|
||||
username = process.env.SAUCE_USERNAME,
|
||||
accessKey = process.env.SAUCE_ACCESS_KEY,
|
||||
tunnelId = 'lodash_' + process.env.TRAVIS_JOB_NUMBER;
|
||||
|
||||
if (isFinite(process.env.TRAVIS_PULL_REQUEST)) {
|
||||
console.error('Testing skipped for pull requests');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
var runnerPathname = (function() {
|
||||
var args = process.argv;
|
||||
return args.length > 2
|
||||
? '/' + args[args.length - 1].replace(/^\W+/, '')
|
||||
: '/test/index.html';
|
||||
}());
|
||||
|
||||
var runnerQuery = url.parse(runnerPathname, true).query,
|
||||
isBackbone = /\bbackbone\b/i.test(runnerPathname),
|
||||
isMobile = /\bmobile\b/i.test(runnerQuery.build),
|
||||
isModern = /\bmodern\b/i.test(runnerQuery.build);
|
||||
|
||||
var platforms = [
|
||||
['Windows 7', 'chrome', ''],
|
||||
['Windows 7', 'firefox', '25'],
|
||||
['Windows 7', 'firefox', '20'],
|
||||
['Windows 7', 'firefox', '10'],
|
||||
['Windows 7', 'firefox', '6'],
|
||||
['Windows 7', 'firefox', '4'],
|
||||
['Windows 7', 'firefox', '3'],
|
||||
['WIN8.1', 'internet explorer', '11'],
|
||||
['Windows 7', 'internet explorer', '10'],
|
||||
['Windows 7', 'internet explorer', '9'],
|
||||
['Windows 7', 'internet explorer', '8'],
|
||||
['Windows XP', 'internet explorer', '7'],
|
||||
['Windows XP', 'internet explorer', '6'],
|
||||
//['Windows 7', 'opera', '12'],
|
||||
//['Windows 7', 'opera', '11'],
|
||||
['OS X 10.8', 'safari', '6'],
|
||||
['Windows 7', 'safari', '5']
|
||||
];
|
||||
|
||||
// platforms to test IE compat mode
|
||||
if (runnerQuery.compat) {
|
||||
platforms = [
|
||||
['WIN8.1', 'internet explorer', '11'],
|
||||
['Windows 7', 'internet explorer', '10'],
|
||||
['Windows 7', 'internet explorer', '9'],
|
||||
['Windows 7', 'internet explorer', '8']
|
||||
];
|
||||
}
|
||||
// platforms for Backbone tests
|
||||
if (isBackbone) {
|
||||
platforms = platforms.filter(function(platform) {
|
||||
var browser = platform[1],
|
||||
version = +platform[2];
|
||||
|
||||
switch (browser) {
|
||||
case 'firefox': return version >= 4;
|
||||
case 'opera': return version >= 12;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
// platforms for mobile and modern builds
|
||||
if (isMobile || isModern) {
|
||||
platforms = platforms.filter(function(platform) {
|
||||
var browser = platform[1],
|
||||
version = +platform[2];
|
||||
|
||||
switch (browser) {
|
||||
case 'firefox': return version >= 10;
|
||||
case 'internet explorer': return version >= 9;
|
||||
case 'opera': return version >= 12;
|
||||
case 'safari': return version >= (isMobile ? 5 : 6);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// create a web server for the local dir
|
||||
var mount = ecstatic({
|
||||
'root': process.cwd(),
|
||||
'cache': false
|
||||
});
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
var compat = url.parse(req.url, true).query.compat;
|
||||
if (compat) {
|
||||
// see http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx
|
||||
res.setHeader('X-UA-Compatible', 'IE=' + compat);
|
||||
}
|
||||
mount(req, res);
|
||||
}).listen(port);
|
||||
|
||||
// set up Sauce Connect so we can use this server from Sauce Labs
|
||||
var tunnelTimeout = 10000,
|
||||
tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout);
|
||||
|
||||
console.log('Opening Sauce Connect tunnel...');
|
||||
|
||||
tunnel.start(function(success) {
|
||||
if (success) {
|
||||
console.log('Sauce Connect tunnel opened');
|
||||
runTests();
|
||||
} else {
|
||||
console.error('Failed to open Sauce Connect tunnel');
|
||||
process.exit(2);
|
||||
}
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
function logInline(text) {
|
||||
var blankLine = repeat(' ', prevLine.length);
|
||||
if (text.length > 40) {
|
||||
text = text.slice(0, 37) + '...';
|
||||
}
|
||||
prevLine = text;
|
||||
process.stdout.write(text + blankLine.slice(text.length) + '\r');
|
||||
}
|
||||
|
||||
function repeat(text, times) {
|
||||
return Array(times + 1).join(text);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
function runTests() {
|
||||
var testDefinition = {
|
||||
'framework': 'qunit',
|
||||
'platforms': platforms,
|
||||
'tunnel': 'tunnel-identifier:' + tunnelId,
|
||||
'url': 'http://localhost:' + port + runnerPathname
|
||||
};
|
||||
|
||||
console.log('Starting saucelabs tests: ' + JSON.stringify(testDefinition));
|
||||
|
||||
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests', {
|
||||
'auth': { 'user': username, 'pass': accessKey },
|
||||
'json': testDefinition
|
||||
}, function(error, response, body) {
|
||||
var statusCode = response && response.statusCode;
|
||||
if (statusCode == 200) {
|
||||
waitForTestCompletion(body);
|
||||
} else {
|
||||
console.error('Failed to submit test to Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
process.exit(3);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function waitForTestCompletion(testIdentifier) {
|
||||
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests/status', {
|
||||
'auth': { 'user': username, 'pass': accessKey },
|
||||
'json': testIdentifier
|
||||
}, function(error, response, body) {
|
||||
var statusCode = response && response.statusCode;
|
||||
if (statusCode == 200) {
|
||||
if (body.completed) {
|
||||
logInline('');
|
||||
handleTestResults(body['js tests']);
|
||||
}
|
||||
else {
|
||||
logInline('Please wait' + repeat('.', (++attempts % 3) + 1));
|
||||
setTimeout(function() {
|
||||
waitForTestCompletion(testIdentifier);
|
||||
}, 5000);
|
||||
}
|
||||
} else {
|
||||
logInline('');
|
||||
console.error('Failed to check test status on Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
process.exit(4);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleTestResults(results) {
|
||||
var failingTests = results.filter(function(test) {
|
||||
var result = test.result;
|
||||
return !result || result.failed || /\berror\b/i.test(result.message);
|
||||
});
|
||||
|
||||
var failingPlatforms = failingTests.map(function(test) {
|
||||
return test.platform;
|
||||
});
|
||||
|
||||
if (!failingTests.length) {
|
||||
console.log('Tests passed');
|
||||
}
|
||||
else {
|
||||
console.error('Tests failed on platforms: ' + JSON.stringify(failingPlatforms));
|
||||
|
||||
failingTests.forEach(function(test) {
|
||||
var details = 'See ' + test.url + ' for details.',
|
||||
platform = JSON.stringify(test.platform),
|
||||
result = test.result;
|
||||
|
||||
if (result && result.failed) {
|
||||
console.error(result.failed + ' failures on ' + platform + '. ' + details);
|
||||
} else {
|
||||
console.error('Testing on ' + platform + ' failed; no results available. ' + details);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Shutting down Sauce Connect tunnel...');
|
||||
|
||||
tunnel.stop(function() {
|
||||
process.exit(failingTests.length ? 1 : 0);
|
||||
});
|
||||
}
|
||||
}());
|
||||
@@ -1,3 +0,0 @@
|
||||
<ul>
|
||||
<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>
|
||||
</ul>
|
||||
@@ -1 +0,0 @@
|
||||
<% print("Hello " + epithet); %>.
|
||||
@@ -1 +0,0 @@
|
||||
Hello ${ name }!
|
||||
@@ -1 +0,0 @@
|
||||
Hello {{ name }}!
|
||||
1324
test/test-build.js
108
test/test-ui.js
@@ -1,108 +0,0 @@
|
||||
;(function(window) {
|
||||
'use strict';
|
||||
|
||||
/** `QUnit.addEvent` shortcut */
|
||||
var addEvent = QUnit.addEvent;
|
||||
|
||||
/** The Lo-Dash build to load */
|
||||
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
|
||||
|
||||
/** A flag to determine if RequireJS should be loaded */
|
||||
var norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
|
||||
|
||||
/** The `ui` object */
|
||||
var ui = {};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose Lo-Dash build file path
|
||||
ui.buildPath = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-prod': return 'dist/lodash.compat.min.js';
|
||||
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
|
||||
case 'lodash-modern': return 'dist/lodash.min.js';
|
||||
case 'lodash-modern-debug': return 'dist/lodash.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'lodash-custom-debug': return 'lodash.custom.js';
|
||||
}
|
||||
return 'lodash.js';
|
||||
}());
|
||||
|
||||
// assign `QUnit.urlParams` properties
|
||||
QUnit.extend(QUnit.urlParams, {
|
||||
'build': build,
|
||||
'norequire': norequire
|
||||
});
|
||||
|
||||
// initialize controls
|
||||
addEvent(window, 'load', function() {
|
||||
function eventHandler(event) {
|
||||
var search = location.search.replace(/^\?|&?(?:build|norequire)=[^&]*&?/g, '');
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
location.href =
|
||||
location.href.split('?')[0] + '?' +
|
||||
(search ? search + '&' : '') +
|
||||
'build=' + buildList[buildList.selectedIndex].value +
|
||||
(checkbox.checked ? '&norequire=true' : '');
|
||||
}
|
||||
|
||||
function init() {
|
||||
var toolbar = document.getElementById('qunit-testrunner-toolbar');
|
||||
if (toolbar) {
|
||||
toolbar.appendChild(span1);
|
||||
toolbar.appendChild(span2);
|
||||
|
||||
buildList.selectedIndex = (function() {
|
||||
switch (build) {
|
||||
case 'lodash-prod': return 1;
|
||||
case 'lodash-underscore': return 2;
|
||||
case 'lodash-modern': return 3;
|
||||
case 'lodash-modern-debug': return 4;
|
||||
case 'lodash-custom': return 5;
|
||||
case 'lodash-custom-debug': return 6;
|
||||
}
|
||||
return 0;
|
||||
}());
|
||||
|
||||
checkbox.checked = norequire;
|
||||
addEvent(checkbox, 'click', eventHandler);
|
||||
addEvent(buildList, 'change', eventHandler);
|
||||
}
|
||||
else {
|
||||
setTimeout(init, 15);
|
||||
}
|
||||
}
|
||||
|
||||
var span1 = document.createElement('span');
|
||||
span1.innerHTML =
|
||||
'<input id="qunit-norequire" type="checkbox">' +
|
||||
'<label for="qunit-norequire">No RequireJS</label>';
|
||||
|
||||
var span2 = document.createElement('span');
|
||||
span2.style.cssText = 'float:right';
|
||||
span2.innerHTML =
|
||||
'<label for="qunit-build">Build: </label>' +
|
||||
'<select id="qunit-build">' +
|
||||
'<option value="lodash-dev">Developement</option>' +
|
||||
'<option value="lodash-prod">Production</option>' +
|
||||
'<option value="lodash-underscore">Underscore</option>' +
|
||||
'<option value="lodash-modern">Modern</option>' +
|
||||
'<option value="lodash-modern-debug">Modern (debug)</option>' +
|
||||
'<option value="lodash-custom">Custom</option>' +
|
||||
'<option value="lodash-custom-debug">Custom (debug)</option>' +
|
||||
'</select>';
|
||||
|
||||
var checkbox = span1.firstChild,
|
||||
buildList = span2.lastChild;
|
||||
|
||||
init();
|
||||
});
|
||||
|
||||
// expose `ui`
|
||||
window.ui = ui;
|
||||
|
||||
}(this));
|
||||
6826
test/test.js
@@ -19,79 +19,223 @@
|
||||
</div>
|
||||
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
|
||||
</div>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="test-ui.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<script>
|
||||
document.write('<script src="../' + ui.buildPath + '"><\/script>');
|
||||
QUnit.config.hidepassed = true;
|
||||
|
||||
// assign results to `global_test_results` for Sauce Labs
|
||||
var global_test_results;
|
||||
QUnit.done(function(results) {
|
||||
global_test_results = results;
|
||||
});
|
||||
|
||||
// skip tests we intentionally fail or those with problems
|
||||
(function() {
|
||||
var skipped = {
|
||||
'Arrays': {
|
||||
'union': [
|
||||
'[null,1,2,3]'
|
||||
]
|
||||
},
|
||||
'Chaining': {
|
||||
'reverse/concat/unshift/pop/map': [
|
||||
'"34, 10, 8, 6, 4, 2, 10, 10"'
|
||||
]
|
||||
},
|
||||
'Collections': {
|
||||
'reduce': [
|
||||
'handles a null (without initial value) properly',
|
||||
'throws an error for empty arrays with no initial value'
|
||||
],
|
||||
'reduceRight': [
|
||||
'handles a null (without initial value) properly',
|
||||
'throws an error for empty arrays with no initial value'
|
||||
],
|
||||
'where': [
|
||||
'Only get the first object matched.'
|
||||
]
|
||||
},
|
||||
'Functions': {
|
||||
'bind': [
|
||||
'can bind without specifying a context',
|
||||
'Died on test #2'
|
||||
],
|
||||
'bindAll': [
|
||||
'throws an error for bindAll with no functions named'
|
||||
],
|
||||
'throttle': true,
|
||||
'throttle arguments': true,
|
||||
'throttle once': true,
|
||||
'throttle twice': true,
|
||||
'more throttling': true,
|
||||
'throttle repeatedly with results': true,
|
||||
'throttle triggers trailing call when invoked repeatedly': true,
|
||||
'throttle does not trigger leading call when leading is set to false': true,
|
||||
'more throttle does not trigger leading call when leading is set to false': true,
|
||||
'throttle does not trigger trailing call when trailing is set to false': true,
|
||||
'debounce': true,
|
||||
'debounce asap': true,
|
||||
'debounce asap recursively': true
|
||||
},
|
||||
'Objects': {
|
||||
'isEqual': [
|
||||
'Died on test #78'
|
||||
],
|
||||
'keys': [
|
||||
'throws an error for `null` values',
|
||||
'throws an error for `undefined` values',
|
||||
'throws an error for number primitives',
|
||||
'throws an error for string primitives',
|
||||
'throws an error for boolean primitives'
|
||||
]
|
||||
},
|
||||
'Utility': {
|
||||
'_.escape': [
|
||||
'"<a href="http://moe.com">Curly & Moe's</a>"'
|
||||
],
|
||||
'_.unescape': [
|
||||
'"<a href=\\"http://moe.com\\">Curly & Moe's</a>"'
|
||||
],
|
||||
'times': [
|
||||
'Died on test #1'
|
||||
],
|
||||
'uniqueId': [
|
||||
'Died on test #1'
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// only skip in non-Underscore builds
|
||||
if (/\bunderscore\b/i.test(ui.buildPath)) {
|
||||
delete skipped.Chaining;
|
||||
delete skipped.Collections.where;
|
||||
delete skipped.Utility['_.escape'];
|
||||
delete skipped.Utility['_.unescape'];
|
||||
}
|
||||
// only skip in Sauce Labs
|
||||
if (location.port != '8081') {
|
||||
for (var key in skipped.Functions) {
|
||||
if (/\b(debounce|throttl)/.test(key)) {
|
||||
delete skipped.Functions[key];
|
||||
}
|
||||
}
|
||||
delete skipped.Objects.isEqual;
|
||||
delete skipped.Utility.times;
|
||||
delete skipped.Utility.uniqueId;
|
||||
}
|
||||
|
||||
QUnit.testStart(function(details) {
|
||||
var test = QUnit.config.current,
|
||||
finish = test.finish,
|
||||
skippedTests = skipped[details.module],
|
||||
skippedAsserts = skippedTests && skippedTests[details.name];
|
||||
|
||||
if (!skippedAsserts) {
|
||||
return;
|
||||
}
|
||||
if (skippedAsserts === true) {
|
||||
test.async = false;
|
||||
test.callback = function() {};
|
||||
test.expected = 0;
|
||||
return;
|
||||
}
|
||||
test.finish = function() {
|
||||
var index = -1,
|
||||
asserts = this.assertions,
|
||||
length = asserts.length;
|
||||
|
||||
while (++index < length) {
|
||||
var assert = asserts[index],
|
||||
message = _.unescape(_.result(/^<span class='test-message'>([\s\S]*?)<\/span>/.exec(assert.message), 1)),
|
||||
died = _.result(/^Died on test #\d+/.exec(message), 0),
|
||||
expected = _.unescape(_.result(/Expected: *<\/th><td><pre>([\s\S]*?)<\/pre>/.exec(assert.message), 1));
|
||||
|
||||
if ((message && _.contains(skippedAsserts, message)) ||
|
||||
(died && _.contains(skippedAsserts, died)) ||
|
||||
(expected && (_.contains(skippedAsserts, expected) ||
|
||||
_.contains(skippedAsserts, expected.replace(/\s+/g, '')))
|
||||
)) {
|
||||
assert.result = true;
|
||||
}
|
||||
}
|
||||
finish.call(this);
|
||||
};
|
||||
});
|
||||
}());
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
|
||||
// load test.js if not using require.js
|
||||
document.write(ui.urlParams.loader != 'none'
|
||||
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
: ([
|
||||
'<script src="../vendor/underscore/test/collections.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/functions.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/objects.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/utility.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
|
||||
].join('\n'))
|
||||
);
|
||||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
var arrayProto = Array.prototype,
|
||||
concat = arrayProto.concat,
|
||||
pop = arrayProto.pop,
|
||||
push = arrayProto.push,
|
||||
slice = arrayProto.slice;
|
||||
|
||||
if (_.chain) {
|
||||
if (window.curl) {
|
||||
curl.config({ 'apiName': 'require' });
|
||||
}
|
||||
if (!window.require) {
|
||||
return;
|
||||
}
|
||||
_.mixin = function(object) {
|
||||
_.forEach(_.functions(object), function(methodName) {
|
||||
var func = _[methodName] = object[methodName];
|
||||
_.prototype[methodName] = function() {
|
||||
var args = [this.__wrapped__];
|
||||
push.apply(args, arguments);
|
||||
var reBasename = /[\w.-]+$/,
|
||||
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
|
||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||
locationPath = modulePath.replace(reBasename, ''),
|
||||
moduleMain = modulePath.match(reBasename)[0];
|
||||
|
||||
var result = func.apply(_, args);
|
||||
if (this.__chain__) {
|
||||
result = new _(result);
|
||||
result.__chain__ = true;
|
||||
QUnit.config.autostart = false;
|
||||
|
||||
// load Lo-Dash as a module
|
||||
require({
|
||||
'baseUrl': './',
|
||||
'urlArgs': 't=' + (+new Date),
|
||||
'packages': [
|
||||
{
|
||||
'name': 'lodash',
|
||||
'location': locationPath,
|
||||
'main': moduleMain
|
||||
},
|
||||
{
|
||||
'name': 'test',
|
||||
'location': '../vendor/underscore/test',
|
||||
'config': {
|
||||
// work around no global being exported
|
||||
'exports': 'QUnit',
|
||||
'loader': 'curl/loader/legacy'
|
||||
}
|
||||
return result;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
_.mixin(_);
|
||||
|
||||
_.mixin({
|
||||
'findWhere': _.find
|
||||
});
|
||||
|
||||
_.chain = function(value) {
|
||||
value = new _(value);
|
||||
value.__chain__ = true;
|
||||
return value;
|
||||
};
|
||||
|
||||
_.prototype.chain = function() {
|
||||
this.__chain__ = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
_.prototype.concat = function() {
|
||||
var result = concat.apply(this.__wrapped__, arguments);
|
||||
if (this.__chain__) {
|
||||
result = new _(result);
|
||||
result.__chain__ = true;
|
||||
}
|
||||
]
|
||||
},
|
||||
['lodash'], function(lodash) {
|
||||
if (ui.isModularize) {
|
||||
window._ = lodash;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
_.prototype.pop = function() {
|
||||
pop.apply(this.__wrapped__, arguments);
|
||||
return this;
|
||||
};
|
||||
require([
|
||||
'test/collections',
|
||||
'test/arrays',
|
||||
'test/functions',
|
||||
'test/objects',
|
||||
'test/utility',
|
||||
'test/chaining'
|
||||
], function() {
|
||||
QUnit.start();
|
||||
});
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
<script src="../vendor/underscore/test/collections.js"></script>
|
||||
<script src="../vendor/underscore/test/arrays.js"></script>
|
||||
<script src="../vendor/underscore/test/functions.js"></script>
|
||||
<script src="../vendor/underscore/test/objects.js"></script>
|
||||
<script src="../vendor/underscore/test/utility.js"></script>
|
||||
<script src="../vendor/underscore/test/chaining.js"></script>
|
||||
<script type="text/html" id="template">
|
||||
<%
|
||||
// a comment
|
||||
|
||||
4
vendor/backbone/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud
|
||||
Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
26
vendor/backbone/README.md
vendored
@@ -1,26 +0,0 @@
|
||||
____ __ __
|
||||
/\ _`\ /\ \ /\ \ __
|
||||
\ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
|
||||
\ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
|
||||
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
|
||||
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
|
||||
\/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
|
||||
\ \____/
|
||||
\/___/
|
||||
(_'_______________________________________________________________________________'_)
|
||||
(_.———————————————————————————————————————————————————————————————————————————————._)
|
||||
|
||||
|
||||
Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
|
||||
|
||||
For Docs, License, Tests, pre-packed downloads, and everything else, really, see:
|
||||
http://backbonejs.org
|
||||
|
||||
To suggest a feature, report a bug, or general discussion:
|
||||
http://github.com/documentcloud/backbone/issues/
|
||||
|
||||
All contributors are listed here:
|
||||
http://github.com/documentcloud/backbone/contributors
|
||||
|
||||
Special thanks to Robert Kieffer for the original philosophy behind Backbone.
|
||||
http://github.com/broofa
|
||||
1305
vendor/backbone/backbone.js
vendored
407
vendor/backbone/test/collection.js
vendored
@@ -1,12 +1,10 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
var a, b, c, d, e, col, otherCol;
|
||||
|
||||
module("Backbone.Collection", _.extend(new Environment, {
|
||||
module("Backbone.Collection", {
|
||||
|
||||
setup: function() {
|
||||
Environment.prototype.setup.apply(this, arguments);
|
||||
|
||||
a = new Backbone.Model({id: 3, label: 'a'});
|
||||
b = new Backbone.Model({id: 2, label: 'b'});
|
||||
c = new Backbone.Model({id: 1, label: 'c'});
|
||||
@@ -16,7 +14,7 @@ $(document).ready(function() {
|
||||
otherCol = new Backbone.Collection();
|
||||
}
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
test("new and sort", 9, function() {
|
||||
var counter = 0;
|
||||
@@ -62,33 +60,32 @@ $(document).ready(function() {
|
||||
strictEqual(collection.last().get('a'), 4);
|
||||
});
|
||||
|
||||
test("get", 5, function() {
|
||||
test("get", 6, function() {
|
||||
equal(col.get(0), d);
|
||||
equal(col.get(d.clone()), d);
|
||||
equal(col.get(2), b);
|
||||
equal(col.get({id: 1}), c);
|
||||
equal(col.get(c.clone()), c);
|
||||
equal(col.get(col.first().cid), col.first());
|
||||
});
|
||||
|
||||
test("get with non-default ids", 4, function() {
|
||||
test("get with non-default ids", 5, function() {
|
||||
var col = new Backbone.Collection();
|
||||
var MongoModel = Backbone.Model.extend({
|
||||
idAttribute: '_id'
|
||||
});
|
||||
var MongoModel = Backbone.Model.extend({idAttribute: '_id'});
|
||||
var model = new MongoModel({_id: 100});
|
||||
col.push(model);
|
||||
col.add(model);
|
||||
equal(col.get(100), model);
|
||||
model.set({_id: 101});
|
||||
equal(col.get(101), model);
|
||||
equal(col.get(model.cid), model);
|
||||
equal(col.get(model), model);
|
||||
equal(col.get(101), void 0);
|
||||
|
||||
var Col2 = Backbone.Collection.extend({ model: MongoModel });
|
||||
var col2 = new Col2();
|
||||
col2.push(model);
|
||||
equal(col2.get({_id: 101}), model);
|
||||
equal(col2.get(model.clone()), model);
|
||||
var col2 = new Backbone.Collection();
|
||||
col2.model = MongoModel;
|
||||
col2.add(model.attributes);
|
||||
equal(col2.get(model.clone()), col2.first());
|
||||
});
|
||||
|
||||
test("update index when id changes", 3, function() {
|
||||
test("update index when id changes", 4, function() {
|
||||
var col = new Backbone.Collection();
|
||||
col.add([
|
||||
{id : 0, name : 'one'},
|
||||
@@ -96,9 +93,10 @@ $(document).ready(function() {
|
||||
]);
|
||||
var one = col.get(0);
|
||||
equal(one.get('name'), 'one');
|
||||
one.set({id : 101});
|
||||
col.on('change:name', function (model) { ok(this.get(model)); });
|
||||
one.set({name: 'dalmatians', id : 101});
|
||||
equal(col.get(0), null);
|
||||
equal(col.get(101).get('name'), 'one');
|
||||
equal(col.get(101).get('name'), 'dalmatians');
|
||||
});
|
||||
|
||||
test("at", 1, function() {
|
||||
@@ -226,6 +224,19 @@ $(document).ready(function() {
|
||||
equal(col.at(0).get('value'), 2);
|
||||
});
|
||||
|
||||
test("add with parse and merge", function() {
|
||||
var collection = new Backbone.Collection();
|
||||
collection.parse = function(attrs) {
|
||||
return _.map(attrs, function(model) {
|
||||
if (model.model) return model.model;
|
||||
return model;
|
||||
});
|
||||
};
|
||||
collection.add({id: 1});
|
||||
collection.add({model: {id: 1, name: 'Alf'}}, {parse: true, merge: true});
|
||||
equal(collection.first().get('name'), 'Alf');
|
||||
});
|
||||
|
||||
test("add model to collection with sort()-style comparator", 3, function() {
|
||||
var col = new Backbone.Collection;
|
||||
col.comparator = function(a, b) {
|
||||
@@ -276,6 +287,39 @@ $(document).ready(function() {
|
||||
equal(otherRemoved, null);
|
||||
});
|
||||
|
||||
test("add and remove return values", 13, function() {
|
||||
var Even = Backbone.Model.extend({
|
||||
validate: function(attrs) {
|
||||
if (attrs.id % 2 !== 0) return "odd";
|
||||
}
|
||||
});
|
||||
var col = new Backbone.Collection;
|
||||
col.model = Even;
|
||||
|
||||
var list = col.add([{id: 2}, {id: 4}], {validate: true});
|
||||
equal(list.length, 2);
|
||||
ok(list[0] instanceof Backbone.Model);
|
||||
equal(list[1], col.last());
|
||||
equal(list[1].get('id'), 4);
|
||||
|
||||
list = col.add([{id: 3}, {id: 6}], {validate: true});
|
||||
equal(col.length, 3);
|
||||
equal(list[0], false);
|
||||
equal(list[1].get('id'), 6);
|
||||
|
||||
var result = col.add({id: 6});
|
||||
equal(result.cid, list[1].cid);
|
||||
|
||||
result = col.remove({id: 6});
|
||||
equal(col.length, 2);
|
||||
equal(result.id, 6);
|
||||
|
||||
list = col.remove([{id: 2}, {id: 8}]);
|
||||
equal(col.length, 1);
|
||||
equal(list[0].get('id'), 2);
|
||||
equal(list[1], null);
|
||||
});
|
||||
|
||||
test("shift and pop", 2, function() {
|
||||
var col = new Backbone.Collection([{a: 'a'}, {b: 'b'}, {c: 'c'}]);
|
||||
equal(col.shift().get('a'), 'a');
|
||||
@@ -362,9 +406,7 @@ $(document).ready(function() {
|
||||
|
||||
test("model destroy removes from all collections", 3, function() {
|
||||
var e = new Backbone.Model({id: 5, title: 'Othello'});
|
||||
e.sync = function(method, model, options) {
|
||||
options.success(model, [], options);
|
||||
};
|
||||
e.sync = function(method, model, options) { options.success(); };
|
||||
var colE = new Backbone.Collection([e]);
|
||||
var colF = new Backbone.Collection([e]);
|
||||
e.destroy();
|
||||
@@ -396,6 +438,15 @@ $(document).ready(function() {
|
||||
equal(this.syncArgs.options.parse, false);
|
||||
});
|
||||
|
||||
test("fetch with an error response triggers an error event", 1, function () {
|
||||
var collection = new Backbone.Collection();
|
||||
collection.on('error', function () {
|
||||
ok(true);
|
||||
});
|
||||
collection.sync = function (method, model, options) { options.error(); };
|
||||
collection.fetch();
|
||||
});
|
||||
|
||||
test("ensure fetch only parses once", 1, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
var counter = 0;
|
||||
@@ -405,7 +456,7 @@ $(document).ready(function() {
|
||||
};
|
||||
collection.url = '/test';
|
||||
collection.fetch();
|
||||
this.syncArgs.options.success([]);
|
||||
this.syncArgs.options.success();
|
||||
equal(counter, 1);
|
||||
});
|
||||
|
||||
@@ -419,7 +470,7 @@ $(document).ready(function() {
|
||||
equal(model.collection, collection);
|
||||
});
|
||||
|
||||
test("create with validate:true enforces validation", 1, function() {
|
||||
test("create with validate:true enforces validation", 3, function() {
|
||||
var ValidatingModel = Backbone.Model.extend({
|
||||
validate: function(attrs) {
|
||||
return "fail";
|
||||
@@ -429,6 +480,10 @@ $(document).ready(function() {
|
||||
model: ValidatingModel
|
||||
});
|
||||
var col = new ValidatingCollection();
|
||||
col.on('invalid', function (collection, error, options) {
|
||||
equal(error, "fail");
|
||||
equal(options.validationError, 'fail');
|
||||
});
|
||||
equal(col.create({"foo":"bar"}, {validate:true}), false);
|
||||
});
|
||||
|
||||
@@ -461,9 +516,10 @@ $(document).ready(function() {
|
||||
equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]');
|
||||
});
|
||||
|
||||
test("where", 6, function() {
|
||||
test("where and findWhere", 8, function() {
|
||||
var model = new Backbone.Model({a: 1});
|
||||
var coll = new Backbone.Collection([
|
||||
{a: 1},
|
||||
model,
|
||||
{a: 1},
|
||||
{a: 1, b: 2},
|
||||
{a: 2, b: 2},
|
||||
@@ -475,19 +531,21 @@ $(document).ready(function() {
|
||||
equal(coll.where({b: 1}).length, 0);
|
||||
equal(coll.where({b: 2}).length, 2);
|
||||
equal(coll.where({a: 1, b: 2}).length, 1);
|
||||
equal(coll.findWhere({a: 1}), model);
|
||||
equal(coll.findWhere({a: 4}), void 0);
|
||||
});
|
||||
|
||||
test("Underscore methods", 13, function() {
|
||||
test("Underscore methods", 14, function() {
|
||||
equal(col.map(function(model){ return model.get('label'); }).join(' '), 'a b c d');
|
||||
equal(col.any(function(model){ return model.id === 100; }), false);
|
||||
equal(col.any(function(model){ return model.id === 0; }), true);
|
||||
equal(col.indexOf(b), 1);
|
||||
equal(col.size(), 4);
|
||||
equal(col.rest().length, 3);
|
||||
ok(!_.include(col.rest()), a);
|
||||
ok(!_.include(col.rest()), d);
|
||||
ok(!_.include(col.rest(), a));
|
||||
ok(_.include(col.rest(), d));
|
||||
ok(!col.isEmpty());
|
||||
ok(!_.include(col.without(d)), d);
|
||||
ok(!_.include(col.without(d), d));
|
||||
equal(col.max(function(model){ return model.id; }).id, 3);
|
||||
equal(col.min(function(model){ return model.id; }).id, 0);
|
||||
deepEqual(col.chain()
|
||||
@@ -495,23 +553,12 @@ $(document).ready(function() {
|
||||
.map(function(o){ return o.id * 2; })
|
||||
.value(),
|
||||
[4, 0]);
|
||||
deepEqual(col.difference([c, d]), [a, b]);
|
||||
});
|
||||
|
||||
test("sortedIndex", function () {
|
||||
var model = new Backbone.Model({key: 2});
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
comparator: 'key'
|
||||
}))([model, {key: 1}]);
|
||||
equal(collection.sortedIndex(model), 1);
|
||||
equal(collection.sortedIndex(model, 'key'), 1);
|
||||
equal(collection.sortedIndex(model, function (model) {
|
||||
return model.get('key');
|
||||
}), 1);
|
||||
});
|
||||
|
||||
test("reset", 10, function() {
|
||||
test("reset", 12, function() {
|
||||
var resetCount = 0;
|
||||
var models = col.models.slice();
|
||||
var models = col.models;
|
||||
col.on('reset', function() { resetCount += 1; });
|
||||
col.reset([]);
|
||||
equal(resetCount, 1);
|
||||
@@ -526,6 +573,22 @@ $(document).ready(function() {
|
||||
equal(col.length, 4);
|
||||
ok(col.last() !== d);
|
||||
ok(_.isEqual(col.last().attributes, d.attributes));
|
||||
col.reset();
|
||||
equal(col.length, 0);
|
||||
equal(resetCount, 4);
|
||||
});
|
||||
|
||||
test ("reset with different values", function(){
|
||||
var col = new Backbone.Collection({id: 1});
|
||||
col.reset({id: 1, a: 1});
|
||||
equal(col.get(1).get('a'), 1);
|
||||
});
|
||||
|
||||
test("same references in reset", function() {
|
||||
var model = new Backbone.Model({id: 1});
|
||||
var collection = new Backbone.Collection({id: 1});
|
||||
collection.reset(model);
|
||||
equal(collection.get(1), model);
|
||||
});
|
||||
|
||||
test("reset passes caller options", 3, function() {
|
||||
@@ -702,9 +765,7 @@ $(document).ready(function() {
|
||||
test("#1447 - create with wait adds model.", 1, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
var model = new Backbone.Model;
|
||||
model.sync = function(method, model, options){
|
||||
options.success(model, [], options);
|
||||
};
|
||||
model.sync = function(method, model, options){ options.success(); };
|
||||
collection.on('add', function(){ ok(true); });
|
||||
collection.create(model, {wait: true});
|
||||
});
|
||||
@@ -834,7 +895,7 @@ $(document).ready(function() {
|
||||
collection.reset([]);
|
||||
});
|
||||
|
||||
test("update", function() {
|
||||
test("set", function() {
|
||||
var m1 = new Backbone.Model();
|
||||
var m2 = new Backbone.Model({id: 2});
|
||||
var m3 = new Backbone.Model();
|
||||
@@ -852,24 +913,24 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
// remove: false doesn't remove any models
|
||||
c.update([], {remove: false});
|
||||
c.set([], {remove: false});
|
||||
strictEqual(c.length, 2);
|
||||
|
||||
// add: false doesn't add any models
|
||||
c.update([m1, m2, m3], {add: false});
|
||||
c.set([m1, m2, m3], {add: false});
|
||||
strictEqual(c.length, 2);
|
||||
|
||||
// merge: false doesn't change any models
|
||||
c.update([m1, {id: 2, a: 1}], {merge: false});
|
||||
c.set([m1, {id: 2, a: 1}], {merge: false});
|
||||
strictEqual(m2.get('a'), void 0);
|
||||
|
||||
// add: false, remove: false only merges existing models
|
||||
c.update([m1, {id: 2, a: 0}, m3, {id: 4}], {add: false, remove: false});
|
||||
c.set([m1, {id: 2, a: 0}, m3, {id: 4}], {add: false, remove: false});
|
||||
strictEqual(c.length, 2);
|
||||
strictEqual(m2.get('a'), 0);
|
||||
|
||||
// default options add/remove/merge as appropriate
|
||||
c.update([{id: 2, a: 1}, m3]);
|
||||
c.set([{id: 2, a: 1}, m3]);
|
||||
strictEqual(c.length, 2);
|
||||
strictEqual(m2.get('a'), 1);
|
||||
|
||||
@@ -877,23 +938,37 @@ $(document).ready(function() {
|
||||
c.off('remove').on('remove', function(model) {
|
||||
ok(model === m2 || model === m3);
|
||||
});
|
||||
c.update([]);
|
||||
c.set([]);
|
||||
strictEqual(c.length, 0);
|
||||
});
|
||||
|
||||
test("update with only cids", 3, function() {
|
||||
test("set with many models does not overflow the stack", function() {
|
||||
var n = 150000;
|
||||
var collection = new Backbone.Collection();
|
||||
var models = [];
|
||||
for (var i = 0; i < n; i++) {
|
||||
models.push({id: i});
|
||||
}
|
||||
collection.set(models);
|
||||
equal(collection.length, n);
|
||||
collection.reset();
|
||||
collection.set(models, {at: 0});
|
||||
equal(collection.length, n);
|
||||
});
|
||||
|
||||
test("set with only cids", 3, function() {
|
||||
var m1 = new Backbone.Model;
|
||||
var m2 = new Backbone.Model;
|
||||
var c = new Backbone.Collection;
|
||||
c.update([m1, m2]);
|
||||
c.set([m1, m2]);
|
||||
equal(c.length, 2);
|
||||
c.update([m1]);
|
||||
c.set([m1]);
|
||||
equal(c.length, 1);
|
||||
c.update([m1, m1, m1, m2, m2], {remove: false});
|
||||
c.set([m1, m1, m1, m2, m2], {remove: false});
|
||||
equal(c.length, 2);
|
||||
});
|
||||
|
||||
test("update with only idAttribute", 3, function() {
|
||||
test("set with only idAttribute", 3, function() {
|
||||
var m1 = { _id: 1 };
|
||||
var m2 = { _id: 2 };
|
||||
var col = Backbone.Collection.extend({
|
||||
@@ -902,15 +977,15 @@ $(document).ready(function() {
|
||||
})
|
||||
});
|
||||
var c = new col;
|
||||
c.update([m1, m2]);
|
||||
c.set([m1, m2]);
|
||||
equal(c.length, 2);
|
||||
c.update([m1]);
|
||||
c.set([m1]);
|
||||
equal(c.length, 1);
|
||||
c.update([m1, m1, m1, m2, m2], {remove: false});
|
||||
c.set([m1, m1, m1, m2, m2], {remove: false});
|
||||
equal(c.length, 2);
|
||||
});
|
||||
|
||||
test("update + merge with default values defined", function() {
|
||||
test("set + merge with default values defined", function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
defaults: {
|
||||
key: 'value'
|
||||
@@ -920,14 +995,78 @@ $(document).ready(function() {
|
||||
var col = new Backbone.Collection([m], {model: Model});
|
||||
equal(col.first().get('key'), 'value');
|
||||
|
||||
col.update({id: 1, key: 'other'});
|
||||
col.set({id: 1, key: 'other'});
|
||||
equal(col.first().get('key'), 'other');
|
||||
|
||||
col.update({id: 1, other: 'value'});
|
||||
col.set({id: 1, other: 'value'});
|
||||
equal(col.first().get('key'), 'other');
|
||||
equal(col.length, 1);
|
||||
});
|
||||
|
||||
test('merge without mutation', function () {
|
||||
var Model = Backbone.Model.extend({
|
||||
initialize: function (attrs, options) {
|
||||
if (attrs.child) {
|
||||
this.set('child', new Model(attrs.child, options), options);
|
||||
}
|
||||
}
|
||||
});
|
||||
var Collection = Backbone.Collection.extend({model: Model});
|
||||
var data = [{id: 1, child: {id: 2}}];
|
||||
var collection = new Collection(data);
|
||||
equal(collection.first().id, 1);
|
||||
collection.set(data);
|
||||
equal(collection.first().id, 1);
|
||||
collection.set([{id: 2, child: {id: 2}}].concat(data));
|
||||
deepEqual(collection.pluck('id'), [2, 1]);
|
||||
});
|
||||
|
||||
test("`set` and model level `parse`", function() {
|
||||
var Model = Backbone.Model.extend({});
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Model,
|
||||
parse: function (res) { return _.pluck(res.models, 'model'); }
|
||||
});
|
||||
var model = new Model({id: 1});
|
||||
var collection = new Collection(model);
|
||||
collection.set({models: [
|
||||
{model: {id: 1}},
|
||||
{model: {id: 2}}
|
||||
]}, {parse: true});
|
||||
equal(collection.first(), model);
|
||||
});
|
||||
|
||||
test("`set` data is only parsed once", function() {
|
||||
var collection = new Backbone.Collection();
|
||||
collection.model = Backbone.Model.extend({
|
||||
parse: function (data) {
|
||||
equal(data.parsed, void 0);
|
||||
data.parsed = true;
|
||||
return data;
|
||||
}
|
||||
});
|
||||
collection.set({}, {parse: true});
|
||||
});
|
||||
|
||||
test('`set` matches input order in the absence of a comparator', function () {
|
||||
var one = new Backbone.Model({id: 1});
|
||||
var two = new Backbone.Model({id: 2});
|
||||
var three = new Backbone.Model({id: 3});
|
||||
var collection = new Backbone.Collection([one, two, three]);
|
||||
collection.set([{id: 3}, {id: 2}, {id: 1}]);
|
||||
deepEqual(collection.models, [three, two, one]);
|
||||
collection.set([{id: 1}, {id: 2}]);
|
||||
deepEqual(collection.models, [one, two]);
|
||||
collection.set([two, three, one]);
|
||||
deepEqual(collection.models, [two, three, one]);
|
||||
collection.set([{id: 1}, {id: 2}], {remove: false});
|
||||
deepEqual(collection.models, [two, three, one]);
|
||||
collection.set([{id: 1}, {id: 2}, {id: 3}], {merge: false});
|
||||
deepEqual(collection.models, [one, two, three]);
|
||||
collection.set([three, two, one, {id: 4}], {add: false});
|
||||
deepEqual(collection.models, [one, two, three]);
|
||||
});
|
||||
|
||||
test("#1894 - Push should not trigger a sort", 0, function() {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
comparator: 'id',
|
||||
@@ -938,12 +1077,19 @@ $(document).ready(function() {
|
||||
new Collection().push({id: 1});
|
||||
});
|
||||
|
||||
test("`update` with non-normal id", function() {
|
||||
test("#2428 - push duplicate models, return the correct one", 1, function() {
|
||||
var col = new Backbone.Collection;
|
||||
var model1 = col.push({id: 101});
|
||||
var model2 = col.push({id: 101})
|
||||
ok(model2.cid == model1.cid);
|
||||
});
|
||||
|
||||
test("`set` with non-normal id", function() {
|
||||
var Collection = Backbone.Collection.extend({
|
||||
model: Backbone.Model.extend({idAttribute: '_id'})
|
||||
});
|
||||
var collection = new Collection({_id: 1});
|
||||
collection.update([{_id: 1, a: 1}], {add: false});
|
||||
collection.set([{_id: 1, a: 1}], {add: false});
|
||||
equal(collection.first().get('a'), 1);
|
||||
});
|
||||
|
||||
@@ -955,7 +1101,7 @@ $(document).ready(function() {
|
||||
new Collection().add({id: 1}, {sort: false});
|
||||
});
|
||||
|
||||
test("#1915 - `parse` data in the right order in `update`", function() {
|
||||
test("#1915 - `parse` data in the right order in `set`", function() {
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
parse: function (data) {
|
||||
strictEqual(data.status, 'ok');
|
||||
@@ -963,7 +1109,7 @@ $(document).ready(function() {
|
||||
}
|
||||
}));
|
||||
var res = {status: 'ok', data:[{id: 1}]};
|
||||
collection.update(res, {parse: true});
|
||||
collection.set(res, {parse: true});
|
||||
});
|
||||
|
||||
asyncTest("#1939 - `parse` is passed `options`", 1, function () {
|
||||
@@ -1001,7 +1147,7 @@ $(document).ready(function() {
|
||||
test("`add` only `sort`s when necessary with comparator function", 3, function () {
|
||||
var collection = new (Backbone.Collection.extend({
|
||||
comparator: function(a, b) {
|
||||
a.get('a') > b.get('a') ? 1 : (a.get('a') < b.get('a') ? -1 : 0);
|
||||
return a.get('a') > b.get('a') ? 1 : (a.get('a') < b.get('a') ? -1 : 0);
|
||||
}
|
||||
}))([{id: 1}, {id: 2}, {id: 3}]);
|
||||
collection.on('sort', function () { ok(true); });
|
||||
@@ -1013,4 +1159,119 @@ $(document).ready(function() {
|
||||
collection.add(collection.models, {merge: true}); // don't sort
|
||||
});
|
||||
|
||||
});
|
||||
test("Attach options to collection.", 2, function() {
|
||||
var model = new Backbone.Model;
|
||||
var comparator = function(){};
|
||||
|
||||
var collection = new Backbone.Collection([], {
|
||||
model: model,
|
||||
comparator: comparator
|
||||
});
|
||||
|
||||
ok(collection.model === model);
|
||||
ok(collection.comparator === comparator);
|
||||
});
|
||||
|
||||
test("`add` overrides `set` flags", function () {
|
||||
var collection = new Backbone.Collection();
|
||||
collection.once('add', function (model, collection, options) {
|
||||
collection.add({id: 2}, options);
|
||||
});
|
||||
collection.set({id: 1});
|
||||
equal(collection.length, 2);
|
||||
});
|
||||
|
||||
test("#2606 - Collection#create, success arguments", 1, function() {
|
||||
var collection = new Backbone.Collection;
|
||||
collection.url = 'test';
|
||||
collection.create({}, {
|
||||
success: function(model, resp, options) {
|
||||
strictEqual(resp, 'response');
|
||||
}
|
||||
});
|
||||
this.ajaxSettings.success('response');
|
||||
});
|
||||
|
||||
test("#2612 - nested `parse` works with `Collection#set`", function() {
|
||||
|
||||
var Job = Backbone.Model.extend({
|
||||
constructor: function() {
|
||||
this.items = new Items();
|
||||
Backbone.Model.apply(this, arguments);
|
||||
},
|
||||
parse: function(attrs) {
|
||||
this.items.set(attrs.items, {parse: true});
|
||||
return _.omit(attrs, 'items');
|
||||
}
|
||||
});
|
||||
|
||||
var Item = Backbone.Model.extend({
|
||||
constructor: function() {
|
||||
this.subItems = new Backbone.Collection();
|
||||
Backbone.Model.apply(this, arguments);
|
||||
},
|
||||
parse: function(attrs) {
|
||||
this.subItems.set(attrs.subItems, {parse: true});
|
||||
return _.omit(attrs, 'subItems');
|
||||
}
|
||||
});
|
||||
|
||||
var Items = Backbone.Collection.extend({
|
||||
model: Item
|
||||
});
|
||||
|
||||
var data = {
|
||||
name: 'JobName',
|
||||
id: 1,
|
||||
items: [{
|
||||
id: 1,
|
||||
name: 'Sub1',
|
||||
subItems: [
|
||||
{id: 1, subName: 'One'},
|
||||
{id: 2, subName: 'Two'}
|
||||
]
|
||||
}, {
|
||||
id: 2,
|
||||
name: 'Sub2',
|
||||
subItems: [
|
||||
{id: 3, subName: 'Three'},
|
||||
{id: 4, subName: 'Four'}
|
||||
]
|
||||
}]
|
||||
};
|
||||
|
||||
var newData = {
|
||||
name: 'NewJobName',
|
||||
id: 1,
|
||||
items: [{
|
||||
id: 1,
|
||||
name: 'NewSub1',
|
||||
subItems: [
|
||||
{id: 1,subName: 'NewOne'},
|
||||
{id: 2,subName: 'NewTwo'}
|
||||
]
|
||||
}, {
|
||||
id: 2,
|
||||
name: 'NewSub2',
|
||||
subItems: [
|
||||
{id: 3,subName: 'NewThree'},
|
||||
{id: 4,subName: 'NewFour'}
|
||||
]
|
||||
}]
|
||||
};
|
||||
|
||||
var job = new Job(data, {parse: true});
|
||||
equal(job.get('name'), 'JobName');
|
||||
equal(job.items.at(0).get('name'), 'Sub1');
|
||||
equal(job.items.length, 2);
|
||||
equal(job.items.get(1).subItems.get(1).get('subName'), 'One');
|
||||
equal(job.items.get(2).subItems.get(3).get('subName'), 'Three');
|
||||
job.set(job.parse(newData, {parse: true}));
|
||||
equal(job.get('name'), 'NewJobName');
|
||||
equal(job.items.at(0).get('name'), 'NewSub1');
|
||||
equal(job.items.length, 2);
|
||||
equal(job.items.get(1).subItems.get(1).get('subName'), 'NewOne');
|
||||
equal(job.items.get(2).subItems.get(3).get('subName'), 'NewThree');
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
60
vendor/backbone/test/environment.js
vendored
@@ -1,45 +1,35 @@
|
||||
(function() {
|
||||
|
||||
var Environment = this.Environment = function(){};
|
||||
var sync = Backbone.sync;
|
||||
var ajax = Backbone.ajax;
|
||||
var emulateHTTP = Backbone.emulateHTTP;
|
||||
var emulateJSON = Backbone.emulateJSON;
|
||||
|
||||
_.extend(Environment.prototype, {
|
||||
QUnit.testStart(function() {
|
||||
var env = this.config.current.testEnvironment;
|
||||
|
||||
ajax: Backbone.ajax,
|
||||
// Capture ajax settings for comparison.
|
||||
Backbone.ajax = function(settings) {
|
||||
env.ajaxSettings = settings;
|
||||
};
|
||||
|
||||
sync: Backbone.sync,
|
||||
|
||||
emulateHTTP: Backbone.emulateHTTP,
|
||||
|
||||
emulateJSON: Backbone.emulateJSON,
|
||||
|
||||
setup: function() {
|
||||
var env = this;
|
||||
|
||||
// Capture ajax settings for comparison.
|
||||
Backbone.ajax = function(settings) {
|
||||
env.ajaxSettings = settings;
|
||||
// Capture the arguments to Backbone.sync for comparison.
|
||||
Backbone.sync = function(method, model, options) {
|
||||
env.syncArgs = {
|
||||
method: method,
|
||||
model: model,
|
||||
options: options
|
||||
};
|
||||
|
||||
// Capture the arguments to Backbone.sync for comparison.
|
||||
Backbone.sync = function(method, model, options) {
|
||||
env.syncArgs = {
|
||||
method: method,
|
||||
model: model,
|
||||
options: options
|
||||
};
|
||||
env.sync.apply(this, arguments);
|
||||
};
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
this.syncArgs = null;
|
||||
this.ajaxSettings = null;
|
||||
Backbone.sync = this.sync;
|
||||
Backbone.ajax = this.ajax;
|
||||
Backbone.emulateHTTP = this.emulateHTTP;
|
||||
Backbone.emulateJSON = this.emulateJSON;
|
||||
}
|
||||
sync.apply(this, arguments);
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
QUnit.testDone(function() {
|
||||
Backbone.sync = sync;
|
||||
Backbone.ajax = ajax;
|
||||
Backbone.emulateHTTP = emulateHTTP;
|
||||
Backbone.emulateJSON = emulateJSON;
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
102
vendor/backbone/test/events.js
vendored
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
module("Backbone.Events");
|
||||
|
||||
@@ -99,6 +99,43 @@ $(document).ready(function() {
|
||||
a.listenTo(b, 'event2', cb);
|
||||
a.stopListening(null, {event: cb});
|
||||
b.trigger('event event2');
|
||||
b.off();
|
||||
a.listenTo(b, 'event event2', cb);
|
||||
a.stopListening(null, 'event');
|
||||
a.stopListening();
|
||||
b.trigger('event2');
|
||||
});
|
||||
|
||||
test("listenToOnce and stopListening", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, 'all', function() { ok(true); });
|
||||
b.trigger('anything');
|
||||
b.trigger('anything');
|
||||
a.listenToOnce(b, 'all', function() { ok(false); });
|
||||
a.stopListening();
|
||||
b.trigger('anything');
|
||||
});
|
||||
|
||||
test("listenTo, listenToOnce and stopListening", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenToOnce(b, 'all', function() { ok(true); });
|
||||
b.trigger('anything');
|
||||
b.trigger('anything');
|
||||
a.listenTo(b, 'all', function() { ok(false); });
|
||||
a.stopListening();
|
||||
b.trigger('anything');
|
||||
});
|
||||
|
||||
test("listenTo and stopListening with event maps", 1, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenTo(b, {change: function(){ ok(true); }});
|
||||
b.trigger('change');
|
||||
a.listenTo(b, {change: function(){ ok(false); }});
|
||||
a.stopListening();
|
||||
b.trigger('change');
|
||||
});
|
||||
|
||||
test("listenTo yourself", 1, function(){
|
||||
@@ -115,6 +152,31 @@ $(document).ready(function() {
|
||||
e.trigger("foo");
|
||||
});
|
||||
|
||||
test("stopListening cleans up references", 4, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
var fn = function() {};
|
||||
a.listenTo(b, 'all', fn).stopListening();
|
||||
equal(_.size(a._listeningTo), 0);
|
||||
a.listenTo(b, 'all', fn).stopListening(b);
|
||||
equal(_.size(a._listeningTo), 0);
|
||||
a.listenTo(b, 'all', fn).stopListening(null, 'all');
|
||||
equal(_.size(a._listeningTo), 0);
|
||||
a.listenTo(b, 'all', fn).stopListening(null, null, fn);
|
||||
equal(_.size(a._listeningTo), 0);
|
||||
});
|
||||
|
||||
test("listenTo and stopListening cleaning up references", 2, function() {
|
||||
var a = _.extend({}, Backbone.Events);
|
||||
var b = _.extend({}, Backbone.Events);
|
||||
a.listenTo(b, 'all', function(){ ok(true); });
|
||||
b.trigger('anything');
|
||||
a.listenTo(b, 'other', function(){ ok(false); });
|
||||
a.stopListening(b, 'other');
|
||||
a.stopListening(b, 'all');
|
||||
equal(_.keys(a._listeningTo).length, 0);
|
||||
});
|
||||
|
||||
test("listenTo with empty callback doesn't throw an error", 1, function(){
|
||||
var e = _.extend({}, Backbone.Events);
|
||||
e.listenTo(e, "foo", null);
|
||||
@@ -241,6 +303,13 @@ $(document).ready(function() {
|
||||
_.extend({}, Backbone.Events).on('test').trigger('test');
|
||||
});
|
||||
|
||||
test("if callback is truthy but not a function, `on` should throw an error just like jQuery", 1, function() {
|
||||
var view = _.extend({}, Backbone.Events).on('test', 'noop');
|
||||
throws(function() {
|
||||
view.trigger('test');
|
||||
});
|
||||
});
|
||||
|
||||
test("remove all events for a specific context", 4, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.on('x y all', function() { ok(true); });
|
||||
@@ -259,18 +328,6 @@ $(document).ready(function() {
|
||||
obj.trigger('x y');
|
||||
});
|
||||
|
||||
test("off is chainable", 3, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
// With no events
|
||||
ok(obj.off() === obj);
|
||||
// When removing all events
|
||||
obj.on('event', function(){}, obj);
|
||||
ok(obj.off() === obj);
|
||||
// When removing some events
|
||||
obj.on('event', function(){}, obj);
|
||||
ok(obj.off('event') === obj);
|
||||
});
|
||||
|
||||
test("#1310 - off does not skip consecutive events", 0, function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
obj.on('event', function() { ok(false); }, obj);
|
||||
@@ -400,4 +457,21 @@ $(document).ready(function() {
|
||||
_.extend({}, Backbone.Events).once('event').trigger('event');
|
||||
});
|
||||
|
||||
});
|
||||
test("event functions are chainable", function() {
|
||||
var obj = _.extend({}, Backbone.Events);
|
||||
var obj2 = _.extend({}, Backbone.Events);
|
||||
var fn = function() {};
|
||||
equal(obj, obj.trigger('noeventssetyet'));
|
||||
equal(obj, obj.off('noeventssetyet'));
|
||||
equal(obj, obj.stopListening('noeventssetyet'));
|
||||
equal(obj, obj.on('a', fn));
|
||||
equal(obj, obj.once('c', fn));
|
||||
equal(obj, obj.trigger('a'));
|
||||
equal(obj, obj.listenTo(obj2, 'a', fn));
|
||||
equal(obj, obj.listenToOnce(obj2, 'b', fn));
|
||||
equal(obj, obj.off('a c'));
|
||||
equal(obj, obj.stopListening(obj2, 'a'));
|
||||
equal(obj, obj.stopListening());
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
79
vendor/backbone/test/model.js
vendored
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
var proxy = Backbone.Model.extend();
|
||||
var klass = Backbone.Collection.extend({
|
||||
@@ -6,10 +6,9 @@ $(document).ready(function() {
|
||||
});
|
||||
var doc, collection;
|
||||
|
||||
module("Backbone.Model", _.extend(new Environment, {
|
||||
module("Backbone.Model", {
|
||||
|
||||
setup: function() {
|
||||
Environment.prototype.setup.apply(this, arguments);
|
||||
doc = new proxy({
|
||||
id : '1-the-tempest',
|
||||
title : "The Tempest",
|
||||
@@ -20,7 +19,7 @@ $(document).ready(function() {
|
||||
collection.add(doc);
|
||||
}
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
test("initialize", 3, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
@@ -46,9 +45,9 @@ $(document).ready(function() {
|
||||
|
||||
test("initialize with parsed attributes", 1, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function(obj) {
|
||||
obj.value += 1;
|
||||
return obj;
|
||||
parse: function(attrs) {
|
||||
attrs.value += 1;
|
||||
return attrs;
|
||||
}
|
||||
});
|
||||
var model = new Model({value: 1}, {parse: true});
|
||||
@@ -69,8 +68,8 @@ $(document).ready(function() {
|
||||
|
||||
test("parse can return null", 1, function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
parse: function(obj) {
|
||||
obj.value += 1;
|
||||
parse: function(attrs) {
|
||||
attrs.value += 1;
|
||||
return null;
|
||||
}
|
||||
});
|
||||
@@ -111,6 +110,16 @@ $(document).ready(function() {
|
||||
equal(model.url(), '/nested/1/collection/2');
|
||||
});
|
||||
|
||||
test("underscore methods", 5, function() {
|
||||
var model = new Backbone.Model({ 'foo': 'a', 'bar': 'b', 'baz': 'c' });
|
||||
var model2 = model.clone();
|
||||
deepEqual(model.keys(), ['foo', 'bar', 'baz']);
|
||||
deepEqual(model.values(), ['a', 'b', 'c']);
|
||||
deepEqual(model.invert(), { 'a': 'foo', 'b': 'bar', 'c': 'baz' });
|
||||
deepEqual(model.pick('foo', 'baz'), {'foo': 'a', 'baz': 'c'});
|
||||
deepEqual(model.omit('foo', 'bar'), {'baz': 'c'});
|
||||
});
|
||||
|
||||
test("clone", 10, function() {
|
||||
var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
|
||||
var b = a.clone();
|
||||
@@ -324,7 +333,7 @@ $(document).ready(function() {
|
||||
"two": 2
|
||||
}
|
||||
});
|
||||
var model = new Defaulted({two: null});
|
||||
var model = new Defaulted({two: undefined});
|
||||
equal(model.get('one'), 1);
|
||||
equal(model.get('two'), 2);
|
||||
Defaulted = Backbone.Model.extend({
|
||||
@@ -335,7 +344,7 @@ $(document).ready(function() {
|
||||
};
|
||||
}
|
||||
});
|
||||
model = new Defaulted({two: null});
|
||||
model = new Defaulted({two: undefined});
|
||||
equal(model.get('one'), 3);
|
||||
equal(model.get('two'), 4);
|
||||
});
|
||||
@@ -401,7 +410,7 @@ $(document).ready(function() {
|
||||
if (attrs.admin) return "Can't change admin status.";
|
||||
};
|
||||
model.sync = function(method, model, options) {
|
||||
options.success.call(this, this, {admin: true}, options);
|
||||
options.success.call(this, {admin: true});
|
||||
};
|
||||
model.on('invalid', function(model, error) {
|
||||
lastError = error;
|
||||
@@ -418,6 +427,19 @@ $(document).ready(function() {
|
||||
ok(_.isEqual(this.syncArgs.model, doc));
|
||||
});
|
||||
|
||||
test("save, fetch, destroy triggers error event when an error occurs", 3, function () {
|
||||
var model = new Backbone.Model();
|
||||
model.on('error', function () {
|
||||
ok(true);
|
||||
});
|
||||
model.sync = function (method, model, options) {
|
||||
options.error();
|
||||
};
|
||||
model.save({data: 2, id: 1});
|
||||
model.fetch();
|
||||
model.destroy();
|
||||
});
|
||||
|
||||
test("save with PATCH", function() {
|
||||
doc.clear().set({id: 1, a: 1, b: 2, c: 3, d: 4});
|
||||
doc.save();
|
||||
@@ -435,7 +457,7 @@ $(document).ready(function() {
|
||||
test("save in positional style", 1, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.sync = function(method, model, options) {
|
||||
options.success(model, {}, options);
|
||||
options.success();
|
||||
};
|
||||
model.save('title', 'Twelfth Night');
|
||||
equal(model.get('title'), 'Twelfth Night');
|
||||
@@ -444,8 +466,8 @@ $(document).ready(function() {
|
||||
test("save with non-object success response", 2, function () {
|
||||
var model = new Backbone.Model();
|
||||
model.sync = function(method, model, options) {
|
||||
options.success(model, '', options);
|
||||
options.success(model, null, options);
|
||||
options.success('', options);
|
||||
options.success(null, options);
|
||||
};
|
||||
model.save({testing:'empty'}, {
|
||||
success: function (model) {
|
||||
@@ -682,6 +704,22 @@ $(document).ready(function() {
|
||||
ok(this.syncArgs.model === model);
|
||||
});
|
||||
|
||||
test("save without `wait` doesn't set invalid attributes", function () {
|
||||
var model = new Backbone.Model();
|
||||
model.validate = function () { return 1; }
|
||||
model.save({a: 1});
|
||||
equal(model.get('a'), void 0);
|
||||
});
|
||||
|
||||
test("save doesn't validate twice", function () {
|
||||
var model = new Backbone.Model();
|
||||
var times = 0;
|
||||
model.sync = function () {};
|
||||
model.validate = function () { ++times; }
|
||||
model.save({});
|
||||
equal(times, 1);
|
||||
});
|
||||
|
||||
test("`hasChanged` for falsey keys", 2, function() {
|
||||
var model = new Backbone.Model();
|
||||
model.set({x: true}, {silent: true});
|
||||
@@ -720,7 +758,7 @@ $(document).ready(function() {
|
||||
test("#1030 - `save` with `wait` results in correct attributes if success is called during sync", 2, function() {
|
||||
var model = new Backbone.Model({x: 1, y: 2});
|
||||
model.sync = function(method, model, options) {
|
||||
options.success(model, {}, options);
|
||||
options.success();
|
||||
};
|
||||
model.on("change:x", function() { ok(true); });
|
||||
model.save({x: 3}, {wait: true});
|
||||
@@ -893,7 +931,7 @@ $(document).ready(function() {
|
||||
}
|
||||
};
|
||||
model.sync = function(method, model, options) {
|
||||
options.success(model, {}, options);
|
||||
options.success();
|
||||
};
|
||||
model.save({id: 1}, opts);
|
||||
model.fetch(opts);
|
||||
@@ -902,9 +940,8 @@ $(document).ready(function() {
|
||||
|
||||
test("#1412 - Trigger 'sync' event.", 3, function() {
|
||||
var model = new Backbone.Model({id: 1});
|
||||
model.url = '/test';
|
||||
model.sync = function (method, model, options) { options.success(); };
|
||||
model.on('sync', function(){ ok(true); });
|
||||
Backbone.ajax = function(settings){ settings.success(); };
|
||||
model.fetch();
|
||||
model.save();
|
||||
model.destroy();
|
||||
@@ -950,7 +987,7 @@ $(document).ready(function() {
|
||||
var Model = Backbone.Model.extend({
|
||||
sync: function(method, model, options) {
|
||||
setTimeout(function(){
|
||||
options.success(model, {}, options);
|
||||
options.success();
|
||||
start();
|
||||
}, 0);
|
||||
}
|
||||
@@ -1070,4 +1107,4 @@ $(document).ready(function() {
|
||||
model.set({a: true});
|
||||
});
|
||||
|
||||
});
|
||||
})();
|
||||
|
||||
4
vendor/backbone/test/noconflict.js
vendored
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
module("Backbone.noConflict");
|
||||
|
||||
@@ -9,4 +9,4 @@ $(document).ready(function() {
|
||||
equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
|
||||
});
|
||||
|
||||
});
|
||||
})();
|
||||
|
||||
211
vendor/backbone/test/router.js
vendored
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
var router = null;
|
||||
var location = null;
|
||||
@@ -57,6 +57,15 @@ $(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
var ExternalObject = {
|
||||
value: 'unset',
|
||||
|
||||
routingFunction: function(value) {
|
||||
this.value = value;
|
||||
}
|
||||
};
|
||||
_.bindAll(ExternalObject);
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
|
||||
count: 0,
|
||||
@@ -66,6 +75,8 @@ $(document).ready(function() {
|
||||
"counter": "counter",
|
||||
"search/:query": "search",
|
||||
"search/:query/p:page": "search",
|
||||
"charñ": "charUTF",
|
||||
"char%C3%B1": "charEscaped",
|
||||
"contacts": "contacts",
|
||||
"contacts/new": "newContact",
|
||||
"contacts/:id": "loadContact",
|
||||
@@ -73,8 +84,11 @@ $(document).ready(function() {
|
||||
"optional(/:item)": "optionalItem",
|
||||
"named/optional/(y:z)": "namedOptional",
|
||||
"splat/*args/end": "splat",
|
||||
"*first/complex-:part/*rest": "complex",
|
||||
":repo/compare/*from...*to": "github",
|
||||
"decode/:named/*splat": "decode",
|
||||
"*first/complex-*part/*rest": "complex",
|
||||
":entity?*args": "query",
|
||||
"function/:value": ExternalObject.routingFunction,
|
||||
"*anything": "anything"
|
||||
},
|
||||
|
||||
@@ -91,11 +105,19 @@ $(document).ready(function() {
|
||||
this.count++;
|
||||
},
|
||||
|
||||
search : function(query, page) {
|
||||
search: function(query, page) {
|
||||
this.query = query;
|
||||
this.page = page;
|
||||
},
|
||||
|
||||
charUTF: function() {
|
||||
this.charType = 'UTF';
|
||||
},
|
||||
|
||||
charEscaped: function() {
|
||||
this.charType = 'escaped';
|
||||
},
|
||||
|
||||
contacts: function(){
|
||||
this.contact = 'index';
|
||||
},
|
||||
@@ -116,6 +138,12 @@ $(document).ready(function() {
|
||||
this.args = args;
|
||||
},
|
||||
|
||||
github: function(repo, from, to) {
|
||||
this.repo = repo;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
},
|
||||
|
||||
complex: function(first, part, rest) {
|
||||
this.first = first;
|
||||
this.part = part;
|
||||
@@ -135,6 +163,11 @@ $(document).ready(function() {
|
||||
this.z = z;
|
||||
},
|
||||
|
||||
decode: function(named, path) {
|
||||
this.named = named;
|
||||
this.path = path;
|
||||
},
|
||||
|
||||
routeEvent: function(arg) {
|
||||
}
|
||||
|
||||
@@ -153,6 +186,15 @@ $(document).ready(function() {
|
||||
equal(lastArgs[0], 'news');
|
||||
});
|
||||
|
||||
test("routes (simple, but unicode)", 4, function() {
|
||||
location.replace('http://example.com#search/тест');
|
||||
Backbone.history.checkUrl();
|
||||
equal(router.query, "тест");
|
||||
equal(router.page, void 0);
|
||||
equal(lastRoute, 'search');
|
||||
equal(lastArgs[0], "тест");
|
||||
});
|
||||
|
||||
test("routes (two part)", 2, function() {
|
||||
location.replace('http://example.com#search/nyc/p10');
|
||||
Backbone.history.checkUrl();
|
||||
@@ -172,6 +214,10 @@ $(document).ready(function() {
|
||||
equal(router.page, '20');
|
||||
});
|
||||
|
||||
test("reports matched route via nagivate", 1, function() {
|
||||
ok(Backbone.history.navigate('search/manhattan/p20', true));
|
||||
});
|
||||
|
||||
test("route precedence via navigate", 6, function(){
|
||||
// check both 0.9.x and backwards-compatibility options
|
||||
_.each([ { trigger: true }, true ], function( options ){
|
||||
@@ -213,6 +259,14 @@ $(document).ready(function() {
|
||||
equal(router.args, 'long-list/of/splatted_99args');
|
||||
});
|
||||
|
||||
test("routes (github)", 3, function() {
|
||||
location.replace('http://example.com#backbone/compare/1.0...braddunbar:with/slash');
|
||||
Backbone.history.checkUrl();
|
||||
equal(router.repo, 'backbone');
|
||||
equal(router.from, '1.0');
|
||||
equal(router.to, 'braddunbar:with/slash');
|
||||
});
|
||||
|
||||
test("routes (optional)", 2, function() {
|
||||
location.replace('http://example.com#optional');
|
||||
Backbone.history.checkUrl();
|
||||
@@ -246,6 +300,23 @@ $(document).ready(function() {
|
||||
equal(router.anything, 'doesnt-match-a-route');
|
||||
});
|
||||
|
||||
test("routes (function)", 3, function() {
|
||||
router.on('route', function(name) {
|
||||
ok(name === '');
|
||||
});
|
||||
equal(ExternalObject.value, 'unset');
|
||||
location.replace('http://example.com#function/set');
|
||||
Backbone.history.checkUrl();
|
||||
equal(ExternalObject.value, 'set');
|
||||
});
|
||||
|
||||
test("Decode named parameters, not splats.", 2, function() {
|
||||
location.replace('http://example.com#decode/a%2Fb/c%2Fd/e');
|
||||
Backbone.history.checkUrl();
|
||||
strictEqual(router.named, 'a/b');
|
||||
strictEqual(router.path, 'c/d/e');
|
||||
});
|
||||
|
||||
test("fires event when router doesn't have callback on it", 1, function() {
|
||||
router.on("route:noCallback", function(){ ok(true); });
|
||||
location.replace('http://example.com#noCallback');
|
||||
@@ -277,9 +348,9 @@ $(document).ready(function() {
|
||||
test("#967 - Route callback gets passed encoded values.", 3, function() {
|
||||
var route = 'has%2Fslash/complex-has%23hash/has%20space';
|
||||
Backbone.history.navigate(route, {trigger: true});
|
||||
strictEqual(router.first, 'has%2Fslash');
|
||||
strictEqual(router.part, 'has%23hash');
|
||||
strictEqual(router.rest, 'has%20space');
|
||||
strictEqual(router.first, 'has/slash');
|
||||
strictEqual(router.part, 'has#hash');
|
||||
strictEqual(router.rest, 'has space');
|
||||
});
|
||||
|
||||
test("correctly handles URLs with % (#868)", 3, function() {
|
||||
@@ -292,6 +363,13 @@ $(document).ready(function() {
|
||||
equal(lastRoute, 'search');
|
||||
});
|
||||
|
||||
test("#2666 - Hashes with UTF8 in them.", 2, function() {
|
||||
Backbone.history.navigate('charñ', {trigger: true});
|
||||
equal(router.charType, 'UTF');
|
||||
Backbone.history.navigate('char%C3%B1', {trigger: true});
|
||||
equal(router.charType, 'escaped');
|
||||
});
|
||||
|
||||
test("#1185 - Use pathname when hashChange is not wanted.", 1, function() {
|
||||
Backbone.history.stop();
|
||||
location.replace('http://example.com/path/name#hash');
|
||||
@@ -529,4 +607,123 @@ $(document).ready(function() {
|
||||
Backbone.history.checkUrl();
|
||||
});
|
||||
|
||||
});
|
||||
test("#2255 - Extend routes by making routes a function.", 1, function() {
|
||||
var RouterBase = Backbone.Router.extend({
|
||||
routes: function() {
|
||||
return {
|
||||
home: "root",
|
||||
index: "index.html"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var RouterExtended = RouterBase.extend({
|
||||
routes: function() {
|
||||
var _super = RouterExtended.__super__.routes;
|
||||
return _.extend(_super(),
|
||||
{ show: "show",
|
||||
search: "search" });
|
||||
}
|
||||
});
|
||||
|
||||
var router = new RouterExtended();
|
||||
deepEqual({home: "root", index: "index.html", show: "show", search: "search"}, router.routes);
|
||||
});
|
||||
|
||||
test("#2538 - hashChange to pushState only if both requested.", 0, function() {
|
||||
Backbone.history.stop();
|
||||
location.replace('http://example.com/root?a=b#x/y');
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
history: {
|
||||
pushState: function(){},
|
||||
replaceState: function(){ ok(false); }
|
||||
}
|
||||
});
|
||||
Backbone.history.start({
|
||||
root: 'root',
|
||||
pushState: true,
|
||||
hashChange: false
|
||||
});
|
||||
});
|
||||
|
||||
test('No hash fallback.', 0, function() {
|
||||
Backbone.history.stop();
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
history: {
|
||||
pushState: function(){},
|
||||
replaceState: function(){}
|
||||
}
|
||||
});
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
hash: function() { ok(false); }
|
||||
}
|
||||
});
|
||||
var router = new Router;
|
||||
|
||||
location.replace('http://example.com/');
|
||||
Backbone.history.start({
|
||||
pushState: true,
|
||||
hashChange: false
|
||||
});
|
||||
location.replace('http://example.com/nomatch#hash');
|
||||
Backbone.history.checkUrl();
|
||||
});
|
||||
|
||||
test('#2656 - No trailing slash on root.', 1, function() {
|
||||
Backbone.history.stop();
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
history: {
|
||||
pushState: function(state, title, url){
|
||||
strictEqual(url, '/root');
|
||||
}
|
||||
}
|
||||
});
|
||||
location.replace('http://example.com/root/path');
|
||||
Backbone.history.start({pushState: true, root: 'root'});
|
||||
Backbone.history.navigate('');
|
||||
});
|
||||
|
||||
test('#2656 - No trailing slash on root.', 1, function() {
|
||||
Backbone.history.stop();
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
history: {
|
||||
pushState: function(state, title, url) {
|
||||
strictEqual(url, '/');
|
||||
}
|
||||
}
|
||||
});
|
||||
location.replace('http://example.com/path');
|
||||
Backbone.history.start({pushState: true});
|
||||
Backbone.history.navigate('');
|
||||
});
|
||||
|
||||
test('#2765 - Fragment matching sans query/hash.', 2, function() {
|
||||
Backbone.history.stop();
|
||||
Backbone.history = _.extend(new Backbone.History, {
|
||||
location: location,
|
||||
history: {
|
||||
pushState: function(state, title, url) {
|
||||
strictEqual(url, '/path?query#hash');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var Router = Backbone.Router.extend({
|
||||
routes: {
|
||||
path: function() { ok(true); }
|
||||
}
|
||||
});
|
||||
var router = new Router;
|
||||
|
||||
location.replace('http://example.com/');
|
||||
Backbone.history.start({pushState: true});
|
||||
Backbone.history.navigate('path?query#hash', true);
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
10
vendor/backbone/test/sync.js
vendored
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
var Library = Backbone.Collection.extend({
|
||||
url : function() { return '/library'; }
|
||||
@@ -11,20 +11,18 @@ $(document).ready(function() {
|
||||
length : 123
|
||||
};
|
||||
|
||||
module("Backbone.sync", _.extend(new Environment, {
|
||||
module("Backbone.sync", {
|
||||
|
||||
setup : function() {
|
||||
Environment.prototype.setup.apply(this, arguments);
|
||||
library = new Library;
|
||||
library.create(attrs, {wait: false});
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
Environment.prototype.teardown.apply(this, arguments);
|
||||
Backbone.emulateHTTP = false;
|
||||
}
|
||||
|
||||
}));
|
||||
});
|
||||
|
||||
test("read", 4, function() {
|
||||
library.fetch();
|
||||
@@ -209,4 +207,4 @@ $(document).ready(function() {
|
||||
strictEqual(this.ajaxSettings.beforeSend(xhr), false);
|
||||
});
|
||||
|
||||
});
|
||||
})();
|
||||
|
||||
45
vendor/backbone/test/view.js
vendored
@@ -1,4 +1,4 @@
|
||||
$(document).ready(function() {
|
||||
(function() {
|
||||
|
||||
var view;
|
||||
|
||||
@@ -14,13 +14,10 @@ $(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
test("constructor", 6, function() {
|
||||
test("constructor", 3, function() {
|
||||
equal(view.el.id, 'test-view');
|
||||
equal(view.el.className, 'test-view');
|
||||
equal(view.el.other, void 0);
|
||||
equal(view.options.id, 'test-view');
|
||||
equal(view.options.className, 'test-view');
|
||||
equal(view.options.other, 'non-special-option');
|
||||
});
|
||||
|
||||
test("jQuery", 1, function() {
|
||||
@@ -85,6 +82,13 @@ $(document).ready(function() {
|
||||
equal(view.counter, 3);
|
||||
});
|
||||
|
||||
|
||||
test("delegateEvents ignore undefined methods", 0, function() {
|
||||
var view = new Backbone.View({el: '<p></p>'});
|
||||
view.delegateEvents({'click': 'undefinedMethod'});
|
||||
view.$el.trigger('click');
|
||||
});
|
||||
|
||||
test("undelegateEvents", 6, function() {
|
||||
var counter1 = 0, counter2 = 0;
|
||||
|
||||
@@ -149,30 +153,6 @@ $(document).ready(function() {
|
||||
strictEqual(new View().el.id, 'id');
|
||||
});
|
||||
|
||||
test("with options function", 3, function() {
|
||||
var View1 = Backbone.View.extend({
|
||||
options: function() {
|
||||
return {
|
||||
title: 'title1',
|
||||
acceptText: 'confirm'
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
var View2 = View1.extend({
|
||||
options: function() {
|
||||
return _.extend(View1.prototype.options.call(this), {
|
||||
title: 'title2',
|
||||
fixed: true
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
strictEqual(new View2().options.title, 'title2');
|
||||
strictEqual(new View2().options.acceptText, 'confirm');
|
||||
strictEqual(new View2().options.fixed, true);
|
||||
});
|
||||
|
||||
test("with attributes", 2, function() {
|
||||
var View = Backbone.View.extend({
|
||||
attributes: {
|
||||
@@ -312,7 +292,7 @@ $(document).ready(function() {
|
||||
view.collection.trigger('x');
|
||||
});
|
||||
|
||||
test("Provide function for el.", 1, function() {
|
||||
test("Provide function for el.", 2, function() {
|
||||
var View = Backbone.View.extend({
|
||||
el: function() {
|
||||
return "<p><a></a></p>";
|
||||
@@ -320,7 +300,8 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
var view = new View;
|
||||
ok(view.$el.is('p:has(a)'));
|
||||
ok(view.$el.is('p'));
|
||||
ok(view.$el.has('a'));
|
||||
});
|
||||
|
||||
test("events passed in options", 2, function() {
|
||||
@@ -347,4 +328,4 @@ $(document).ready(function() {
|
||||
equal(counter, 4);
|
||||
});
|
||||
|
||||
});
|
||||
})();
|
||||
|
||||
136
vendor/benchmark.js/README.md
vendored
@@ -1,136 +0,0 @@
|
||||
# Benchmark.js <sup>v1.0.0</sup>
|
||||
[](http://travis-ci.org/bestiejs/benchmark.js)
|
||||
|
||||
A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
|
||||
|
||||
## Download
|
||||
|
||||
* [Development source](https://raw.github.com/bestiejs/benchmark.js/v1.0.0/benchmark.js)
|
||||
|
||||
## Dive in
|
||||
|
||||
We’ve got [API docs](http://benchmarkjs.com/docs) and [unit tests](http://benchmarkjs.com/tests).
|
||||
|
||||
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
|
||||
|
||||
## Support
|
||||
|
||||
Benchmark.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1-15, IE 6-9, Opera 9.25-12, Safari 3-6, Node.js 0.8.8, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
|
||||
|
||||
## Installation and usage
|
||||
|
||||
In a browser or Adobe AIR:
|
||||
|
||||
```html
|
||||
<script src="benchmark.js"></script>
|
||||
```
|
||||
|
||||
Optionally, expose Java’s nanosecond timer by adding the `nano` applet to the `<body>`:
|
||||
|
||||
```html
|
||||
<applet code="nano" archive="nano.jar"></applet>
|
||||
```
|
||||
|
||||
Or enable Chrome’s microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
|
||||
|
||||
--enable-benchmarking
|
||||
|
||||
Via [npm](http://npmjs.org/):
|
||||
|
||||
```bash
|
||||
npm install benchmark
|
||||
```
|
||||
|
||||
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var Benchmark = require('benchmark');
|
||||
```
|
||||
|
||||
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
|
||||
|
||||
```bash
|
||||
npm install microtime
|
||||
```
|
||||
|
||||
In [RingoJS v0.7.0-](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var Benchmark = require('benchmark').Benchmark;
|
||||
```
|
||||
|
||||
In [Rhino](http://www.mozilla.org/rhino/):
|
||||
|
||||
```js
|
||||
load('benchmark.js');
|
||||
```
|
||||
|
||||
In an AMD loader like [RequireJS](http://requirejs.org/):
|
||||
|
||||
```js
|
||||
require({
|
||||
'paths': {
|
||||
'benchmark': 'path/to/benchmark'
|
||||
}
|
||||
},
|
||||
['benchmark'], function(Benchmark) {
|
||||
console.log(Benchmark.version);
|
||||
});
|
||||
|
||||
// or with platform.js
|
||||
// https://github.com/bestiejs/platform.js
|
||||
require({
|
||||
'paths': {
|
||||
'benchmark': 'path/to/benchmark',
|
||||
'platform': 'path/to/platform'
|
||||
}
|
||||
},
|
||||
['benchmark', 'platform'], function(Benchmark, platform) {
|
||||
Benchmark.platform = platform;
|
||||
console.log(Benchmark.platform.name);
|
||||
});
|
||||
```
|
||||
|
||||
Usage example:
|
||||
|
||||
```js
|
||||
var suite = new Benchmark.Suite;
|
||||
|
||||
// add tests
|
||||
suite.add('RegExp#test', function() {
|
||||
/o/.test('Hello World!');
|
||||
})
|
||||
.add('String#indexOf', function() {
|
||||
'Hello World!'.indexOf('o') > -1;
|
||||
})
|
||||
// add listeners
|
||||
.on('cycle', function(event) {
|
||||
console.log(String(event.target));
|
||||
})
|
||||
.on('complete', function() {
|
||||
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
|
||||
})
|
||||
// run async
|
||||
.run({ 'async': true });
|
||||
|
||||
// logs:
|
||||
// > RegExp#test x 4,161,532 +-0.99% (59 cycles)
|
||||
// > String#indexOf x 6,139,623 +-1.00% (131 cycles)
|
||||
// > Fastest is String#indexOf
|
||||
```
|
||||
|
||||
## BestieJS
|
||||
|
||||
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
|
||||
|
||||
## Authors
|
||||
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Kit Cambridge](http://kitcambridge.github.com/)
|
||||
[](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
|
||||
6479
vendor/benchmark.js/benchmark.js
vendored
24
vendor/curl/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
Open Source Initiative OSI - The MIT License
|
||||
|
||||
http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
Copyright (c) 2010-2013 Brian Cavalier and John Hann
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
48
vendor/curl/dist/curl-kitchen-sink/curl.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
(function(){/*
|
||||
MIT License (c) copyright 2010-2013 B Cavalier & J Hann MIT (c) copyright 2010-2013 B Cavalier & J Hann */
|
||||
(function(f){function k(){}function g(a,e){return 0==T.call(a).indexOf("[object "+e)}function n(a){return a&&"/"==a.charAt(a.length-1)?a.substr(0,a.length-1):a}function d(a,e){var l,h,D,m;l=1;h=a;"."==h.charAt(0)&&(D=!0,h=h.replace(U,function(a,e,h,D){h&&l++;return D||""}));if(D){D=e.split("/");m=D.length-l;if(0>m)return a;D.splice(m,l);return D.concat(h||[]).join("/")}return h}function s(a){var e=a.indexOf("!");return{g:a.substr(e+1),d:0<=e&&a.substr(0,e)}}function v(){}function q(a,e){v.prototype=
|
||||
a||Q;var l=new v;v.prototype=Q;for(var h in e)l[h]=e[h];return l}function y(){function a(a,e,l){h.push([a,e,l])}function e(a,e){for(var l,D=0;l=h[D++];)(l=l[a])&&l(e)}var l,h,D;l=this;h=[];D=function(l,m){a=l?function(a){a&&a(m)}:function(a,e){e&&e(m)};D=k;e(l?0:1,m);e=k;h=G};this.l=function(e,h,D){a(e,h,D);return l};this.k=function(a){l.H=a;D(!0,a)};this.e=function(a){l.Ba=a;D(!1,a)};this.F=function(a){e(2,a)}}function x(a){return a instanceof y||a instanceof u}function r(a,e,l,h){x(a)?a.l(e,l,h):
|
||||
e(a)}function w(a,e,l){var h;return function(){0<=--a&&e&&(h=e.apply(G,arguments));0==a&&l&&l(h);return h}}function b(){var a,e;p="";a=[].slice.call(arguments);g(a[0],"Object")&&(e=a.shift(),e=c(e));return new u(a[0],a[1],a[2],e)}function c(a,e,l){var h;p="";if(a&&(t.V(a),E=t.b(a),"preloads"in a&&(h=new u(a.preloads,G,l,J,!0),t.n(function(){J=h})),a=a.main))return new u(a,e,l)}function u(a,e,l,h,D){var m;m=t.i(E,G,[].concat(a),D);this.then=this.l=a=function(a,e){r(m,function(e){a&&a.apply(G,e)},function(a){if(e)e(a);
|
||||
else throw a;});return this};this.next=function(a,e,h){return new u(a,e,h,m)};this.config=c;(e||l)&&a(e,l);t.n(function(){r(D||J,function(){r(h,function(){t.A(m)},l)})})}function z(a){var e,l;e=a.id;e==G&&(K!==G?K={L:"Multiple anonymous defines encountered"}:(e=t.ja())||(K=a));if(e!=G){l=F[e];e in F||(l=t.o(e,E),l=t.I(l.b,e),F[e]=l);if(!x(l))throw Error("duplicate define: "+e);l.oa=!1;t.J(l,a)}}function A(){var a=t.ga(arguments);z(a)}var p,E,C,H,B=f.document,L=B&&(B.head||B.getElementsByTagName("head")[0]),
|
||||
N=L&&L.getElementsByTagName("base")[0]||null,M={},I={},m={},V="addEventListener"in f?{}:{loaded:1,complete:1},Q={},T=Q.toString,G,F={},O={},J=!1,K,S=/^\/|^[^:]+:\/\//,U=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,W=/\/\*[\s\S]*?\*\/|\/\/.*?[\n\r]/g,X=/require\s*\(\s*(["'])(.*?[^\\])\1\s*\)|[^\\]?(["'])/g,Y=/\s*,\s*/,R,t;t={t:function(a,e,l){var h;a=d(a,e);if("."==a.charAt(0))return a;h=s(a);a=(e=h.d)||h.g;a in l.c&&(a=l.c[a].Q||a);e&&(0>e.indexOf("/")&&!(e in l.c)&&(a=n(l.T)+"/"+e),a=a+"!"+h.g);return a},i:function(a,
|
||||
e,l,h){function m(e,h){var l,c;l=t.t(e,b.id,a);if(!h)return l;c=s(l);if(!c.d)return l;l=F[c.d];c.g="normalize"in l?l.normalize(c.g,m,b.b)||"":m(c.g);return c.d+"!"+c.g}function c(e,l,d){var s;s=l&&function(a){l.apply(G,a)};if(g(e,"String")){if(s)throw Error("require(id, callback) not allowed");d=m(e,!0);e=F[d];if(!(d in F))throw Error("Module not resolved: "+d);return(d=x(e)&&e.a)||e}r(t.A(t.i(a,b.id,e,h)),s,d)}var b;b=new y;b.id=e||"";b.ka=h;b.K=l;b.b=a;b.s=c;c.toUrl=function(e){return t.o(m(e,!0),
|
||||
a).url};b.t=m;return b},I:function(a,e,l){var h,m,c;h=t.i(a,e,G,l);m=h.k;c=w(1,function(a){h.w=a;try{return t.ba(h)}catch(e){h.e(e)}});h.k=function(a){r(l||J,function(){m(F[h.id]=O[h.url]=c(a))})};h.M=function(a){r(l||J,function(){h.a&&(c(a),h.F(I))})};return h},$:function(a,e,l,h){return t.i(a,l,G,h)},ia:function(a){return a.s},O:function(a){return a.a||(a.a={})},ha:function(a){var e=a.B;e||(e=a.B={id:a.id,uri:t.P(a),exports:t.O(a),config:function(){return a.b}},e.a=e.exports);return e},P:function(a){return a.url||
|
||||
(a.url=t.u(a.s.toUrl(a.id),a.b))},V:function(a){var e,l,h,m,c;e="curl";l="define";h=m=f;if(a&&(c=a.overwriteApi||a.ya,e=a.apiName||a.qa||e,h=a.apiContext||a.pa||h,l=a.defineName||a.ua||l,m=a.defineContext||a.ta||m,C&&g(C,"Function")&&(f.curl=C),C=null,H&&g(H,"Function")&&(f.define=H),H=null,!c)){if(h[e]&&h[e]!=b)throw Error(e+" already exists");if(m[l]&&m[l]!=A)throw Error(l+" already exists");}h[e]=b;m[l]=A},b:function(a){function e(a,e){var l,h,b,p,f;for(f in a){b=a[f];g(b,"String")&&(b={path:a[f]});
|
||||
b.name=b.name||f;p=m;h=s(n(b.name));l=h.g;if(h=h.d)p=c[h],p||(p=c[h]=q(m),p.c=q(m.c),p.f=[]),delete a[f];h=b;var k=e,r=void 0;h.path=n(h.path||h.location||"");k&&(r=h.main||"./main","."==r.charAt(0)||(r="./"+r),h.Q=d(r,h.name+"/"));h.b=h.config;h.b&&(h.b=q(m,h.b));h.W=l.split("/").length;l?(p.c[l]=h,p.f.push(l)):p.p=t.U(b.path,m)}}function l(a){var e=a.c;a.S=RegExp("^("+a.f.sort(function(a,h){return e[h].W-e[a].W}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete a.f}var h,m,c,b;"baseUrl"in
|
||||
a&&(a.p=a.baseUrl);"main"in a&&(a.Q=a.main);"preloads"in a&&(a.za=a.preloads);"pluginPath"in a&&(a.T=a.pluginPath);if("dontAddFileExt"in a||a.j)a.j=RegExp(a.dontAddFileExt||a.j);h=E;m=q(h,a);m.c=q(h.c);c=a.plugins||{};m.plugins=q(h.plugins);m.D=q(h.D,a.D);m.C=q(h.C,a.C);m.f=[];e(a.packages,!0);e(a.paths,!1);for(b in c)a=t.t(b+"!","",m),m.plugins[a.substr(0,a.length-1)]=c[b];c=m.plugins;for(b in c)if(c[b]=q(m,c[b]),a=c[b].f)c[b].f=a.concat(m.f),l(c[b]);for(b in h.c)m.c.hasOwnProperty(b)||m.f.push(b);
|
||||
l(m);return m},o:function(a,e){var m,h,b,c;m=e.c;b=S.test(a)?a:a.replace(e.S,function(a){h=m[a]||{};c=h.b;return h.path||""});return{b:c||E,url:t.U(b,e)}},U:function(a,e){var m=e.p;return m&&!S.test(a)?n(m)+"/"+a:a},u:function(a,e){return a+((e||E).j.test(a)?"":".js")},m:function(a,e,l){var h=B.createElement("script");h.onload=h.onreadystatechange=function(l){l=l||f.event;if("load"==l.type||V[h.readyState])delete m[a.id],h.onload=h.onreadystatechange=h.onerror="",e()};h.onerror=function(){l(Error("Syntax or http error: "+
|
||||
a.url))};h.type=a.r||"text/javascript";h.charset="utf-8";h.async=!a.R;h.src=a.url;m[a.id]=h;L.insertBefore(h,N);return h},N:function(a){var e=[],m;("string"==typeof a?a:a.toSource?a.toSource():a.toString()).replace(W,"").replace(X,function(a,b,c,d){d?m=m==d?G:m:m||e.push(c);return""});return e},ga:function(a){var e,m,h,b,c,d;c=a.length;h=a[c-1];b=g(h,"Function")?h.length:-1;2==c?g(a[0],"Array")?m=a[0]:e=a[0]:3==c&&(e=a[0],m=a[1]);!m&&0<b&&(d=!0,m=["require","exports","module"].slice(0,b).concat(t.N(h)));
|
||||
return{id:e,w:m||[],G:0<=b?h:function(){return h},v:d}},ba:function(a){var e;e=a.G.apply(a.v?a.a:G,a.w);e===G&&a.a&&(e=a.B?a.a=a.B.a:a.a);return e},J:function(a,e){a.G=e.G;a.v=e.v;a.K=e.w;t.A(a)},A:function(a){function e(a,e,m){d[e]=a;m&&s(a,e)}function m(e,h){var b,c,l,d;b=w(1,function(a){c(a);g(a,h)});c=w(1,function(a){s(a,h)});l=t.da(e,a);(d=x(l)&&l.a)&&c(d);r(l,b,a.e,a.a&&function(a){l.a&&(a==M?c(l.a):a==I&&b(l.a))})}function h(){a.k(d)}var b,c,d,p,f,s,g;d=[];c=a.K;p=c.length;0==c.length&&h();
|
||||
s=w(p,e,function(){a.M&&a.M(d)});g=w(p,e,h);for(b=0;b<p;b++)f=c[b],f in R?(g(R[f](a),b,!0),a.a&&a.F(M)):f?m(f,b):g(G,b,!0);return a},ea:function(a){t.P(a);t.m(a,function(){var e=K;K=G;!1!==a.oa&&(!e||e.L?a.e(Error(e&&e.L||"define() missing or duplicated: "+a.url)):t.J(a,e))},a.e);return a},da:function(a,e){var m,h,b,c,d,p,f,g,q,k,n,u;m=e.t;h=e.ka;b=e.b||E;d=m(a);d in F?p=d:(c=s(d),g=c.g,p=c.d||g,q=t.o(p,b));if(!(d in F))if(u=t.o(g,b).b,c.d)f=p;else if(f=u.moduleLoader||u.xa||u.loader||u.wa)g=p,p=
|
||||
f,q=t.o(f,b);p in F?k=F[p]:q.url in O?k=F[p]=O[q.url]:(k=t.I(u,p,h),k.url=t.u(q.url,q.b),F[p]=O[q.url]=k,t.ea(k));p==f&&(c.d&&b.plugins[c.d]&&(u=b.plugins[c.d]),n=new y,r(k,function(a){var e,b,c;c=a.dynamic;g="normalize"in a?a.normalize(g,m,k.b)||"":m(g);b=f+"!"+g;e=F[b];if(!(b in F)){e=t.$(u,b,g,h);c||(F[b]=e);var d=function(a){c||(F[b]=a);e.k(a)};d.resolve=d;d.reject=d.error=e.e;a.load(g,e.s,d,u)}n!=e&&r(e,n.k,n.e,n.F)},n.e));return n||k},ja:function(){var a;if(!g(f.opera,"Opera"))for(var e in m)if("interactive"==
|
||||
m[e].readyState){a=e;break}return a},fa:function(a){var e=0,m,b;for(m=B&&(B.scripts||B.getElementsByTagName("script"));m&&(b=m[e++]);)if(a(b))return b},ca:function(){var a,e="";(a=t.fa(function(a){(a=a.getAttribute("data-curl-run"))&&(e=a);return a}))&&a.setAttribute("data-curl-run","");return e},X:function(){function a(){t.m({url:b.shift()},e,e)}function e(){p&&(b.length?(t.n(m),a()):m("run.js script did not run."))}function m(a){throw Error(a||"Primary run.js failed. Trying fallback.");}var b=p.split(Y);
|
||||
b.length&&a()},n:function(a){setTimeout(a,0)}};R={require:t.ia,exports:t.O,module:t.ha};b.version="0.8.4";b.config=c;A.amd={plugins:!0,jQuery:!0,curl:"0.8.4"};E={p:"",T:"curl/plugin",j:/\?|\.js\b/,D:{},C:{},plugins:{},c:{},S:/$^/};C=f.curl;H=f.define;C&&g(C,"Object")?(f.curl=G,c(C)):t.V();(p=t.ca())&&t.n(t.X);F.curl=b;F["curl/_privileged"]={core:t,cache:F,config:function(){return E},_define:z,_curl:b,Promise:y}})(this.window||"undefined"!=typeof global&&global||this);
|
||||
(function(f,k){function g(){if(!k.body)return!1;A||(A=k.createTextNode(""));try{return k.body.removeChild(k.body.appendChild(A)),A=z,!0}catch(b){return!1}}function n(){var d;d=v[k[s]]&&g();if(!x&&d){x=!0;for(clearTimeout(u);b=c.pop();)b();y&&(k[s]="complete");for(var f;f=q.shift();)f()}return d}function d(){n();x||(u=setTimeout(d,r))}var s="readyState",v={loaded:1,interactive:1,complete:1},q=[],y=k&&"string"!=typeof k[s],x=!1,r=10,w,b,c=[],u,z,A;w="addEventListener"in f?function(b,c){b.addEventListener(c,
|
||||
n,!1);return function(){b.removeEventListener(c,n,!1)}}:function(b,c){b.attachEvent("on"+c,n);return function(){b.detachEvent(c,n)}};k&&!n()&&(c=[w(f,"load"),w(k,"readystatechange"),w(f,"DOMContentLoaded")],u=setTimeout(d,r));define("curl/domReady",function(){function b(c){x?c():q.push(c)}b.then=b;b.amd=!0;return b})})(this,this.document);var P;
|
||||
(function(f,k){define("curl/shim/dojo18",["curl/_privileged"],function(g){function n(c){c.has||(c.has=b);c.on||(c.on=s);c.idle||(c.idle=d);c.async=!0}function d(){for(var b in q)if(q[b]instanceof y)return!1;return!0}function s(){}var v,q,y,x;v=g._curl;q=g.cache;y=g.Promise;x=g.core.i;var r,w,b;r=g.b().va||{};w=k&&k.createElement("div");b=function(b){return"function"==typeof r[b]?r[b]=r[b](f,k,w):r[b]};b.add=function(c,d,f,g){if(void 0===r[c]||g)r[c]=d;if(f)return b(c)};r["dojo-loader"]=!1;q["dojo/_base/loader"]=
|
||||
0;"undefined"==typeof P&&(n(v),P=v);g.core.i=function(){var b=x.apply(this,arguments);n(b.s);return b};return!0})})("object"==typeof global?global:this.window||this.global,"object"==typeof document&&document);
|
||||
(function(f,k,g){define("curl/plugin/js",["curl/_privileged"],function(f){function d(b,c,d){function s(){p||(k<new Date?d():setTimeout(s,10))}var k,p,q;k=(new Date).valueOf()+(b.na||3E5);d&&b.a&&setTimeout(s,10);q=f.core.m(b,function(){p=!0;b.a&&(b.H=g(b.a));!b.a||b.H?c(q):d()},function(b){p=!0;d(b)})}function s(b,c){d(b,function(){var d=q.shift();r=0<q.length;d&&s.apply(null,d);c.k(b.H||!0)},function(b){c.e(b)})}var v={},q=[],y=k&&!0==k.createElement("script").async,x,r,w=/\?|\.js\b/;x=f.Promise;
|
||||
return{dynamic:!0,normalize:function(b,c){var d=b.indexOf("!");return 0<=d?c(b.substr(0,d))+b.substr(d):c(b)},load:function(b,c,f,g){function k(b){(f.error||function(b){throw b;})(b)}var p,n,C,H,B;p=0<b.indexOf("!order");n=b.indexOf("!exports=");C=0<n?b.substr(n+9):g.a;H="prefetch"in g?g.prefetch:!0;b=p||0<n?b.substr(0,b.indexOf("!")):b;n=(n=g.dontAddFileExt||g.j)?RegExp(n):w;B=c.toUrl(b);n.test(B)||(B=B.lastIndexOf(".")<=B.lastIndexOf("/")?B+".js":B);B in v?v[B]instanceof x?v[B].l(f,k):f(v[B]):(b=
|
||||
{name:b,url:B,R:p,a:C,na:g.timeout},v[B]=c=new x,c.l(function(b){v[B]=b;f(b)},k),p&&!y&&r?(q.push([b,c]),H&&(b.r="text/cache",d(b,function(b){b&&b.parentNode.removeChild(b)},function(){}),b.r="")):(r=r||p,s(b,c)))},cramPlugin:"../cram/js"}})})(this,this.document,function(f){try{return eval(f)}catch(k){}});
|
||||
define("curl/plugin/_fetchText",[],function(){var f,k;k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];f=function(){if("undefined"!==typeof XMLHttpRequest)f=function(){return new XMLHttpRequest};else for(var g=f=function(){throw Error("getXhr(): XMLHttpRequest not available");};0<k.length&&f===g;)(function(g){try{new ActiveXObject(g),f=function(){return new ActiveXObject(g)}}catch(d){}})(k.shift());return f()};return function(g,k,d){var s=f();s.open("GET",g,!0);s.onreadystatechange=function(){4===
|
||||
s.readyState&&(400>s.status?k(s.responseText):d(Error("fetchText() failed. status: "+s.statusText)))};s.send(null)}});define("curl/plugin/text",["./_fetchText"],function(f){function k(f){throw f;}return{load:function(g,n,d){f(n.toUrl(g),d,d.error||k)},cramPlugin:"../cram/text"}});
|
||||
define("curl/plugin/async",function(){return{load:function(f,k,g){function n(d){"function"==typeof g.error&&g.error(d)}k([f],function(d){"function"==typeof d.l?d.l(function(f){0==arguments.length&&(f=d);g(f)},n):g(d)},g.error||function(d){throw d;})},analyze:function(f,k,g){g(f)}}});
|
||||
(function(f){function k(){var b;b=p[z]("link");b.rel="stylesheet";b.type="text/css";return b}function g(b,c){b.onload=function(){I.load=I.load||!0;c()}}function n(b,c){b.onerror=function(){I.error=I.error||!0;c()}}function d(b,c,d){B.push({url:b,Y:c,aa:function(){d(Error(M))}});(b=v())&&s(b)}function s(b){var c,d;c=B.shift();d=b.styleSheet;c?(b.onload=function(){c.Y(c.ma);s(b)},b.onerror=function(){c.aa();s(b)},c.ma=d.imports[d.addImport(c.url)]):(b.onload=b.onerror=u,H.push(b))}function v(){var b;
|
||||
b=H.shift();!b&&C.length<L&&(b=p.createElement("style"),C.push(b),E.appendChild(b));return b}function q(b){var c,d,f;if(!b.href||p.readyState&&"complete"!=p.readyState)return!1;c=!1;try{if(d=b.sheet)f=d.cssRules,c=null===f,!c&&f&&(d.insertRule("-curl-css-test {}",0),d.deleteRule(0),c=!0)}catch(g){c="[object Opera]"!=Object.prototype.toString.call(window.opera)&&/security|denied/i.test(g.message)}return c}function y(b,c,d){I.load||(q(b)?d(b.sheet):b.onload==u||!b.onload||A(function(){y(b,c,d)},c))}
|
||||
function x(c,d,f){function k(){c.onload!=u&&c.onload&&(c.onload=c.onerror=u,b(function(){f(c.sheet)}))}g(c,k);y(c,d,k)}function r(b,c){n(b,function(){b.onload!=u&&b.onload&&(b.onload=b.onerror=u,c(Error(M)))})}function w(b,c,d,f){var g;g=k();x(g,f,c);r(g,d);g.href=b;E.appendChild(g)}function b(b){function c(){p.readyState&&"complete"!=p.readyState?A(c,10):b()}c()}function c(b){return b.lastIndexOf(".")<=b.lastIndexOf("/")?b+".css":b}function u(){}var z="createElement",A=f.setTimeout,p=f.document,
|
||||
E;f=p&&p.createStyleSheet&&!(10<=p.documentMode);var C=[],H=[],B=[],L=12,N,M="HTTP or network error.",I={};p&&(E=p.head||p.getElementsByTagName("head")[0],N=f?d:w);define("curl/plugin/css",{normalize:function(b,c){var d,f;if(!b)return b;d=b.split(",");f=[];for(var g=0,k=d.length;g<k;g++)f.push(c(d[g]));return f.join(",")},load:function(b,d,f,g){function p(b){1<n.length&&q.push(b);0==--C&&f(1==n.length?b:q)}function s(b){(f.e||function(b){throw b;})(b)}var q,n,r,C,w;q=[];n=(b||"").split(",");r=g.cssWatchPeriod||
|
||||
50;g=g.cssNoWait;C=n.length;for(w=0;w<n.length;w++){b=n[w];var u;b=c(d.toUrl(b));g?(u=k(),u.href=b,E.appendChild(u),p(u.sheet||u.styleSheet)):N(b,p,s,r)}},cramPlugin:"../cram/css"})})(this);
|
||||
(function(f){var k=f.document,g=/^\/\//,n;k&&(n=k.head||(k.head=k.getElementsByTagName("head")[0]));define("curl/plugin/link",{load:function(d,f,v,q){d=f.toUrl(d);d=d.lastIndexOf(".")<=d.lastIndexOf("/")?d+".css":d;q=d=(q="fixSchemalessUrls"in q?q.fixSchemalessUrls:k.location.protocol)?d.replace(g,q+"//"):d;d=k.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=q;n.appendChild(d);v(d.sheet||d.styleSheet)}})})(this);
|
||||
define("curl/plugin/domReady",["../domReady"],function(f){return{load:function(k,g,n){f(n)}}});(function(f){define("curl/shim/_fetchText",function(){function k(d,f,g){n.Aa(d,function(d,k){d?g(d):f(k.toString())})}function g(f,g,k){var n;f=s.parse(f,!1,!0);n="";d.get(f,function(d){d.h("data",function(b){n+=b}).h("end",function(){g(n)}).h("error",k)}).h("error",k)}var n,d,s;n=f("fs");d=f("http");s=f("url");var v;v=/^https?:/;return function(d,f,n){v.test(d)?g(d,f,n):k(d,f,n)}})})(P);define.amd.Da=!0;
|
||||
(function(f,k){define("curl/shim/ssjs",["curl/_privileged","./_fetchText"],function(g,n){function d(b,c,d){try{k(b.url),c()}catch(f){d(f)}}function s(b,c,d){var g;try{g=b.url.replace(/\.js$/,""),f(g),c()}catch(k){d(k)}}function v(b,c,d){var g;b=f("url").parse(b.url,!1,!0);g="";z.get(b,function(b){b.h("data",function(b){g+=b}).h("end",function(){y(g);c()}).h("error",d)}).h("error",d)}function q(b){throw Error("ssjs: unable to load module in current environment: "+b.url);}function y(b){eval(b)}function x(b){return b&&
|
||||
b.replace(c,function(b,c){return c})}var r,w,b,c,u,z,A,p;if("object"!=typeof window||!window.sa&&!window.navigator){r=g.ra;w=g.b();b=/^\w+:\/\//;c=/(^\w+:)?.*$/;"undefined"==typeof XMLHttpRequest&&(r["curl/plugin/_fetchText"]=n);u=(w.q&&":"!=w.q[w.q.length-1]?w.q+":":w.q)||x(w.p)||"http:";if(k)A=p=d;else if(f){A=s;try{z=f("http"),p=v}catch(E){p=q}}else A=p=q;"object"===typeof process&&process.la&&(g.Z.n=process.la);g.Z.m=function(c,d,f){/^\/\//.test(c.url)&&(c.url=u+c.url);return b.test(c.url)?p(c,
|
||||
d,f):A(c,d,f)}}})})(P,void 0);
|
||||
(function(f,k,g){define("curl/loader/cjsm11",["../plugin/_fetchText","curl/_privileged"],function(f,d){function s(d,b){s="text"in d?function(b,d){b.text=d}:function(b,d){b.appendChild(k.createTextNode(d))};s(d,b)}function v(d,b,c){c=c?"/*\n////@ sourceURL="+c.replace(/\s/g,"%20")+".js\n*/":"";return"define('"+b+"',['require','exports','module'],function(require,exports,module){"+d+"\n});\n"+c+"\n"}var q,y,x,r;y=(q=k&&(k.head||k.getElementsByTagName("head")[0]))&&q.getElementsByTagName("base")[0]||null;
|
||||
x=d.core.N;r=d.core.u;v.load=function(d,b,c,u){var z,A,p;z=c.error||function(b){throw b;};A=r(b.Fa(d),u);p=!1!==u.injectSourceUrl&&A;f(A,function(f){var n;n=x(f);b(n,function(){f=v(f,d,p);if(u.injectScript){var n=f,r=k.createElement("script");s(r,n);r.charset="utf-8";q.insertBefore(r,y)}else g(f);c(b(d))},z)},z)};v.cramPlugin="../cram/cjsm11";return v})})(this,this.document,function(f){eval(f)});
|
||||
define("curl/plugin/locale",function(){function f(f,d){var g;if(f&&(g=f.locale,"function"==typeof g&&(g=g(f,d)),"string"==typeof g))return g;if("undefined"==typeof window)return!1;g=window.clientInformation||window.navigator;return(g&&(g.language||g.userLanguage)||"").toLowerCase()}function k(f,d){return f.replace(g,(d?"/"+d:"")+"$&")}var g;g=/(\.js)?$/;f.toModuleId=k;f.load=function(g,d,s,v){function q(){var b=Error("Unable to find correct locale for "+g);if(s.error)s.error(b);else throw b;}var y,
|
||||
x;y=f(v,g);x=v.localeToModuleId||k;v=y?x(g,y):g;try{s(d(v))}catch(r){x=y?x(g,!1):g;if(x==v)return q();try{s(d(x))}catch(w){if(!0!==y)return q();d(["i18n!"+g],s,q)}}};return f});
|
||||
define("curl/plugin/i18n",["./locale"],function(f){function k(f,k,d,s,v){f([k],function(f){s(f,d)},v)}return{load:function(g,n,d,s){function v(b,c){w[c]=b;q()}function q(){var f;if(++b==c.length)if(0==w.length)y(Error('No i18n bundles found: "'+g+'", locale "'+r+'"'));else{f=w[0]||{};for(z=1;z<w.length;z++){var k=w[z],n={},q=void 0;for(q in f)n[q]=f[q];if(k)for(q in k)n[q]=k[q];f=n}d(f)}}var y,x,r,w,b,c,u,z;y=d.error;g||y(Error("blank i18n bundle id."));x=s.localeToModuleId||f.Ea;r=f(s,g);c=[g];w=
|
||||
[];b=0;if(r&&!1!==s.locale)for(c=c.concat(r.split("-")),u=[],z=1;z<c.length;z++)u[z-1]=c[z],s=x(g,u.join("-")),k(n,s,z,v,q);k(n,g,0,v,q)},cramPlugin:"../cram/i18n"}});
|
||||
(function(f,k,g){define("curl/loader/legacy",["curl/_privileged"],function(n){var d,s,v;d=k&&!0==k.createElement("script").async;s=n.core.m;v=/\?|\.js\b/;return{load:function(k,n,x,r){function w(){E.r="";s(E,b,c)}function b(){var b;if(!(0<--C)){if(z)try{b=z.call(f,k)}catch(d){c(Error("Factory for legacy "+k+" failed: "+d.message))}else try{b=g(u)}catch(n){c(Error("Failed to find exports "+u+" for legacy "+k))}define(k,b);x(b)}}function c(b){(x.error||function(b){throw b;})(b)}var u,z,A,p,E,C;u=r.exports||
|
||||
r.a;z=r.factory||r.factory;if(!u&&!z)throw Error("`exports` or `factory` required for legacy: "+k);A=[].concat(r.requires||r.Ca||[]);r=(r=r.dontAddFileExt||r.j)?RegExp(r):v;p=n.toUrl(k);r.test(p)||(p=p.lastIndexOf(".")<=p.lastIndexOf("/")?p+".js":p);E={url:p,R:!0,r:d||!A.length?"":"text/cache"};A.length?(C=2,n(A,d?b:w,c)):C=1;s(E,b,c)},cramPlugin:"../cram/legacy"}})})(this,this.document,function(f){return(0,eval)(f)});
|
||||
}).call(this);
|
||||
33
vendor/docdown/README.md
vendored
@@ -1,33 +0,0 @@
|
||||
# Docdown <sup>v1.0.0</sup>
|
||||
|
||||
A simple JSDoc to Markdown documentation generator.
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation for Docdown can be viewed here: [/doc/README.md](https://github.com/jdalton/docdown/blob/master/doc/README.md#readme)
|
||||
|
||||
For a list of upcoming features, check out our [roadmap](https://github.com/jdalton/docdown/wiki/Roadmap).
|
||||
|
||||
## Installation and usage
|
||||
|
||||
Usage example:
|
||||
|
||||
```php
|
||||
require("docdown.php");
|
||||
|
||||
// generate Markdown
|
||||
$markdown = docdown(array(
|
||||
"path" => $filepath,
|
||||
"url" => "https://github.com/username/project/blob/master/my.js"
|
||||
));
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
6
vendor/docdown/docdown.php
vendored
@@ -4,13 +4,13 @@
|
||||
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
||||
* Available under MIT license <http://mths.be/mit>
|
||||
*/
|
||||
require(dirname(__FILE__) . '/src/DocDown/Generator.php');
|
||||
require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
|
||||
|
||||
/**
|
||||
* Generates Markdown from JSDoc entries in a given file.
|
||||
*
|
||||
* @param {Array} [$options=array()] The options array.
|
||||
* @returns {String} The generated Markdown.
|
||||
* @returns {string} The generated Markdown.
|
||||
* @example
|
||||
*
|
||||
* // specify a file path
|
||||
@@ -32,7 +32,7 @@ require(dirname(__FILE__) . '/src/DocDown/Generator.php');
|
||||
* ));
|
||||
*/
|
||||
function docdown( $options = array() ) {
|
||||
$gen = new Generator($options);
|
||||
$gen = new MarkdownGenerator($options);
|
||||
return $gen->generate();
|
||||
}
|
||||
?>
|
||||
40
vendor/docdown/src/DocDown/Alias.php
vendored
@@ -19,7 +19,7 @@ class Alias {
|
||||
* The Alias constructor.
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} $name The alias name.
|
||||
* @param {string} $name The alias name.
|
||||
* @param {Object} $owner The alias owner.
|
||||
*/
|
||||
public function __construct( $name, $owner ) {
|
||||
@@ -47,8 +47,8 @@ class Alias {
|
||||
* Extracts the entry's `alias` objects.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @param {Number} $index The index of the array value to return.
|
||||
* @returns {Array|String} The entry's `alias` objects.
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The entry's `alias` objects.
|
||||
*/
|
||||
public function getAliases( $index = null ) {
|
||||
$result = array();
|
||||
@@ -61,7 +61,7 @@ class Alias {
|
||||
* Extracts the function call from the owner entry.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The function call.
|
||||
* @returns {string} The function call.
|
||||
*/
|
||||
public function getCall() {
|
||||
return $this->_call;
|
||||
@@ -71,7 +71,7 @@ class Alias {
|
||||
* Extracts the owner entry's `category` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The owner entry's `category` data.
|
||||
* @returns {string} The owner entry's `category` data.
|
||||
*/
|
||||
public function getCategory() {
|
||||
return $this->_category;
|
||||
@@ -81,7 +81,7 @@ class Alias {
|
||||
* Extracts the owner entry's description.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The owner entry's description.
|
||||
* @returns {string} The owner entry's description.
|
||||
*/
|
||||
public function getDesc() {
|
||||
return $this->_desc;
|
||||
@@ -91,7 +91,7 @@ class Alias {
|
||||
* Extracts the owner entry's `example` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The owner entry's `example` data.
|
||||
* @returns {string} The owner entry's `example` data.
|
||||
*/
|
||||
public function getExample() {
|
||||
return $this->_example;
|
||||
@@ -101,7 +101,7 @@ class Alias {
|
||||
* Checks if the entry is an alias.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Boolean} Returns `true`.
|
||||
* @returns {boolean} Returns `true`.
|
||||
*/
|
||||
public function isAlias() {
|
||||
return true;
|
||||
@@ -111,7 +111,7 @@ class Alias {
|
||||
* Checks if the owner entry is a constructor.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Boolean} Returns `true` if a constructor, else `false`.
|
||||
* @returns {boolean} Returns `true` if a constructor, else `false`.
|
||||
*/
|
||||
public function isCtor() {
|
||||
return $this->_isCtor;
|
||||
@@ -121,7 +121,7 @@ class Alias {
|
||||
* Checks if the owner entry is a license.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Boolean} Returns `true` if a license, else `false`.
|
||||
* @returns {boolean} Returns `true` if a license, else `false`.
|
||||
*/
|
||||
public function isLicense() {
|
||||
return $this->_isLicense;
|
||||
@@ -131,7 +131,7 @@ class Alias {
|
||||
* Checks if the owner entry *is* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isPlugin() {
|
||||
return $this->_isPlugin;
|
||||
@@ -141,7 +141,7 @@ class Alias {
|
||||
* Checks if the owner entry is private.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Boolean} Returns `true` if private, else `false`.
|
||||
* @returns {boolean} Returns `true` if private, else `false`.
|
||||
*/
|
||||
public function isPrivate() {
|
||||
return $this->_isPrivate;
|
||||
@@ -151,7 +151,7 @@ class Alias {
|
||||
* Checks if the owner entry is *not* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isStatic() {
|
||||
return $this->_isStatic;
|
||||
@@ -161,7 +161,7 @@ class Alias {
|
||||
* Resolves the owner entry's line number.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {Number} The owner entry's line number.
|
||||
* @returns {number} The owner entry's line number.
|
||||
*/
|
||||
public function getLineNumber() {
|
||||
return $this->_lineNumber;
|
||||
@@ -171,8 +171,8 @@ class Alias {
|
||||
* Extracts the owner entry's `member` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @param {Number} $index The index of the array value to return.
|
||||
* @returns {Array|String} The owner entry's `member` data.
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The owner entry's `member` data.
|
||||
*/
|
||||
public function getMembers( $index = null ) {
|
||||
return $index !== null
|
||||
@@ -184,7 +184,7 @@ class Alias {
|
||||
* Extracts the owner entry's `name` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The owner entry's `name` data.
|
||||
* @returns {string} The owner entry's `name` data.
|
||||
*/
|
||||
public function getName() {
|
||||
return $this->_name;
|
||||
@@ -194,7 +194,7 @@ class Alias {
|
||||
* Extracts the owner entry's `param` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @param {Number} $index The index of the array value to return.
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array} The owner entry's `param` data.
|
||||
*/
|
||||
public function getParams( $index = null ) {
|
||||
@@ -207,7 +207,7 @@ class Alias {
|
||||
* Extracts the owner entry's `returns` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The owner entry's `returns` data.
|
||||
* @returns {string} The owner entry's `returns` data.
|
||||
*/
|
||||
public function getReturns() {
|
||||
return $this->_returns;
|
||||
@@ -217,7 +217,7 @@ class Alias {
|
||||
* Extracts the owner entry's `type` data.
|
||||
*
|
||||
* @memberOf Alias
|
||||
* @returns {String} The owner entry's `type` data.
|
||||
* @returns {string} The owner entry's `type` data.
|
||||
*/
|
||||
public function getType() {
|
||||
return $this->_type;
|
||||
|
||||
135
vendor/docdown/src/DocDown/Entry.php
vendored
@@ -11,7 +11,7 @@ class Entry {
|
||||
* The documentation entry.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @type String
|
||||
* @type string
|
||||
*/
|
||||
public $entry = '';
|
||||
|
||||
@@ -19,7 +19,7 @@ class Entry {
|
||||
* The language highlighter used for code examples.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @type String
|
||||
* @type string
|
||||
*/
|
||||
public $lang = '';
|
||||
|
||||
@@ -27,7 +27,7 @@ class Entry {
|
||||
* The source code.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @type String
|
||||
* @type string
|
||||
*/
|
||||
public $source = '';
|
||||
|
||||
@@ -37,9 +37,9 @@ class Entry {
|
||||
* The Entry constructor.
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} $entry The documentation entry to analyse.
|
||||
* @param {String} $source The source code.
|
||||
* @param {String} [$lang ='js'] The language highlighter used for code examples.
|
||||
* @param {string} $entry The documentation entry to analyse.
|
||||
* @param {string} $source The source code.
|
||||
* @param {string} [$lang ='js'] The language highlighter used for code examples.
|
||||
*/
|
||||
public function __construct( $entry, $source, $lang = 'js' ) {
|
||||
$this->entry = $entry;
|
||||
@@ -54,11 +54,11 @@ class Entry {
|
||||
*
|
||||
* @static
|
||||
* @memberOf Entry
|
||||
* @param {String} $source The source code.
|
||||
* @param {string} $source The source code.
|
||||
* @returns {Array} The array of entries.
|
||||
*/
|
||||
public static function getEntries( $source ) {
|
||||
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result);
|
||||
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
|
||||
return array_pop($result);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class Entry {
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if the entry is a function reference, else `false`.
|
||||
* @returns {boolean} Returns `true` if the entry is a function reference, else `false`.
|
||||
*/
|
||||
private function isFunction() {
|
||||
if (!isset($this->_isFunction)) {
|
||||
@@ -77,7 +77,7 @@ class Entry {
|
||||
$this->isCtor() ||
|
||||
count($this->getParams()) ||
|
||||
count($this->getReturns()) ||
|
||||
preg_match('/\* *@function\b/', $this->entry)
|
||||
preg_match('/\*[\t ]*@function\b/', $this->entry)
|
||||
);
|
||||
}
|
||||
return $this->_isFunction;
|
||||
@@ -89,15 +89,15 @@ class Entry {
|
||||
* Extracts the entry's `alias` objects.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @param {Number} $index The index of the array value to return.
|
||||
* @returns {Array|String} The entry's `alias` objects.
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The entry's `alias` objects.
|
||||
*/
|
||||
public function getAliases( $index = null ) {
|
||||
if (!isset($this->_aliases)) {
|
||||
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
|
||||
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
$result = preg_split('/,\s*/', $result);
|
||||
natsort($result);
|
||||
|
||||
@@ -116,7 +116,7 @@ class Entry {
|
||||
* Extracts the function call from the entry.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The function call.
|
||||
* @returns {string} The function call.
|
||||
*/
|
||||
public function getCall() {
|
||||
if (isset($this->_call)) {
|
||||
@@ -129,7 +129,7 @@ class Entry {
|
||||
}
|
||||
// resolve name
|
||||
// avoid $this->getName() because it calls $this->getCall()
|
||||
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name);
|
||||
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
|
||||
if (count($name)) {
|
||||
$name = trim($name[1]);
|
||||
} else {
|
||||
@@ -140,12 +140,15 @@ class Entry {
|
||||
// compose parts
|
||||
$result = array($result);
|
||||
$params = $this->getParams();
|
||||
|
||||
foreach ($params as $param) {
|
||||
$result[] = $param[1];
|
||||
// skip params that are properties of other params (e.g. `options.leading`)
|
||||
if (!preg_match('/\w+\.[\w.]+\s*=/', $param[1])) {
|
||||
$result[] = $param[1];
|
||||
}
|
||||
}
|
||||
// format
|
||||
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
|
||||
$result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result));
|
||||
}
|
||||
|
||||
$this->_call = $result ? $result : $name;
|
||||
@@ -156,16 +159,16 @@ class Entry {
|
||||
* Extracts the entry's `category` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The entry's `category` data.
|
||||
* @returns {string} The entry's `category` data.
|
||||
*/
|
||||
public function getCategory() {
|
||||
if (isset($this->_category)) {
|
||||
return $this->_category;
|
||||
}
|
||||
|
||||
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
|
||||
}
|
||||
@@ -177,7 +180,7 @@ class Entry {
|
||||
* Extracts the entry's description.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The entry's description.
|
||||
* @returns {string} The entry's description.
|
||||
*/
|
||||
public function getDesc() {
|
||||
if (isset($this->_desc)) {
|
||||
@@ -187,9 +190,9 @@ class Entry {
|
||||
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$type = $this->getType();
|
||||
$result = preg_replace('/:\n *\* */', ":<br>\n", $result[1]);
|
||||
$result = preg_replace('/(?:^|\n) *\*\n *\* */', "\n\n", $result);
|
||||
$result = preg_replace('/(?:^|\n) *\* ?/', ' ', $result);
|
||||
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
|
||||
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
|
||||
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
|
||||
$result = trim($result);
|
||||
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
|
||||
}
|
||||
@@ -201,16 +204,16 @@ class Entry {
|
||||
* Extracts the entry's `example` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The entry's `example` data.
|
||||
* @returns {string} The entry's `example` data.
|
||||
*/
|
||||
public function getExample() {
|
||||
if (isset($this->_example)) {
|
||||
return $this->_example;
|
||||
}
|
||||
|
||||
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
|
||||
$result = '```' . $this->lang . "\n" . $result . "\n```";
|
||||
}
|
||||
$this->_example = $result;
|
||||
@@ -221,7 +224,7 @@ class Entry {
|
||||
* Checks if the entry is an alias.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `false`.
|
||||
* @returns {boolean} Returns `false`.
|
||||
*/
|
||||
public function isAlias() {
|
||||
return false;
|
||||
@@ -231,11 +234,11 @@ class Entry {
|
||||
* Checks if the entry is a constructor.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if a constructor, else `false`.
|
||||
* @returns {boolean} Returns `true` if a constructor, else `false`.
|
||||
*/
|
||||
public function isCtor() {
|
||||
if (!isset($this->_isCtor)) {
|
||||
$this->_isCtor = !!preg_match('/\* *@constructor\b/', $this->entry);
|
||||
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
|
||||
}
|
||||
return $this->_isCtor;
|
||||
}
|
||||
@@ -244,11 +247,11 @@ class Entry {
|
||||
* Checks if the entry is a license.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if a license, else `false`.
|
||||
* @returns {boolean} Returns `true` if a license, else `false`.
|
||||
*/
|
||||
public function isLicense() {
|
||||
if (!isset($this->_isLicense)) {
|
||||
$this->_isLicense = !!preg_match('/\* *@license\b/', $this->entry);
|
||||
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
|
||||
}
|
||||
return $this->_isLicense;
|
||||
}
|
||||
@@ -257,7 +260,7 @@ class Entry {
|
||||
* Checks if the entry *is* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isPlugin() {
|
||||
if (!isset($this->_isPlugin)) {
|
||||
@@ -270,11 +273,11 @@ class Entry {
|
||||
* Checks if the entry is private.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if private, else `false`.
|
||||
* @returns {boolean} Returns `true` if private, else `false`.
|
||||
*/
|
||||
public function isPrivate() {
|
||||
if (!isset($this->_isPrivate)) {
|
||||
$this->_isPrivate = $this->isLicense() || !!preg_match('/\* *@private\b/', $this->entry) || !preg_match('/\* *@[a-z]+\b/', $this->entry);
|
||||
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
|
||||
}
|
||||
return $this->_isPrivate;
|
||||
}
|
||||
@@ -283,7 +286,7 @@ class Entry {
|
||||
* Checks if the entry is *not* assigned to a prototype.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
|
||||
*/
|
||||
public function isStatic() {
|
||||
if (isset($this->_isStatic)) {
|
||||
@@ -291,7 +294,7 @@ class Entry {
|
||||
}
|
||||
|
||||
$public = !$this->isPrivate();
|
||||
$result = $public && !!preg_match('/\* *@static\b/', $this->entry);
|
||||
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
|
||||
|
||||
// set in cases where it isn't explicitly stated
|
||||
if ($public && !$result) {
|
||||
@@ -315,7 +318,7 @@ class Entry {
|
||||
* Resolves the entry's line number.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {Number} The entry's line number.
|
||||
* @returns {number} The entry's line number.
|
||||
*/
|
||||
public function getLineNumber() {
|
||||
if (!isset($this->_lineNumber)) {
|
||||
@@ -329,14 +332,14 @@ class Entry {
|
||||
* Extracts the entry's `member` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @param {Number} $index The index of the array value to return.
|
||||
* @returns {Array|String} The entry's `member` data.
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array|string} The entry's `member` data.
|
||||
*/
|
||||
public function getMembers( $index = null ) {
|
||||
if (!isset($this->_members)) {
|
||||
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
$result = preg_split('/,\s*/', $result);
|
||||
natsort($result);
|
||||
}
|
||||
@@ -351,16 +354,16 @@ class Entry {
|
||||
* Extracts the entry's `name` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The entry's `name` data.
|
||||
* @returns {string} The entry's `name` data.
|
||||
*/
|
||||
public function getName() {
|
||||
if (isset($this->_name)) {
|
||||
return $this->_name;
|
||||
}
|
||||
|
||||
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
|
||||
} else {
|
||||
$result = array_shift(explode('(', $this->getCall()));
|
||||
}
|
||||
@@ -372,23 +375,26 @@ class Entry {
|
||||
* Extracts the entry's `param` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @param {Number} $index The index of the array value to return.
|
||||
* @param {number} $index The index of the array value to return.
|
||||
* @returns {Array} The entry's `param` data.
|
||||
*/
|
||||
public function getParams( $index = null ) {
|
||||
if (!isset($this->_params)) {
|
||||
preg_match_all('#\* *@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
|
||||
if (count($result = array_filter(array_slice($result, 1)))) {
|
||||
// repurpose array
|
||||
foreach ($result as $param) {
|
||||
foreach ($param as $key => $value) {
|
||||
if (!is_array($result[0][$key])) {
|
||||
$result[0][$key] = array();
|
||||
preg_match_all('#\*[\t ]*@param\s+\{\(?([^})]+)\)?\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $matchTuples);
|
||||
$matchTuples = array_filter(array_slice($matchTuples, 1));
|
||||
$result = array();
|
||||
|
||||
if (count($matchTuples)) {
|
||||
foreach ($matchTuples as $tupleKey => $tuple) {
|
||||
foreach ($tuple as $key => $value) {
|
||||
if (!isset($result[$key])) {
|
||||
$result[$key] = array();
|
||||
}
|
||||
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value));
|
||||
$result[$key][] = $tupleKey
|
||||
? trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value))
|
||||
: trim($value);
|
||||
}
|
||||
}
|
||||
$result = $result[0];
|
||||
}
|
||||
$this->_params = $result;
|
||||
}
|
||||
@@ -401,18 +407,18 @@ class Entry {
|
||||
* Extracts the entry's `returns` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The entry's `returns` data.
|
||||
* @returns {string} The entry's `returns` data.
|
||||
*/
|
||||
public function getReturns() {
|
||||
if (isset($this->_returns)) {
|
||||
return $this->_returns;
|
||||
}
|
||||
|
||||
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = array_map('trim', array_slice($result, 1));
|
||||
$result[0] = str_replace('|', ', ', $result[0]);
|
||||
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]);
|
||||
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
|
||||
}
|
||||
$this->_returns = $result;
|
||||
return $result;
|
||||
@@ -422,18 +428,21 @@ class Entry {
|
||||
* Extracts the entry's `type` data.
|
||||
*
|
||||
* @memberOf Entry
|
||||
* @returns {String} The entry's `type` data.
|
||||
* @returns {string} The entry's `type` data.
|
||||
*/
|
||||
public function getType() {
|
||||
if (isset($this->_type)) {
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result);
|
||||
preg_match('#\*[\t ]*@type\s(?:\{\(?)?([^)}\n]+)#', $this->entry, $result);
|
||||
if (count($result)) {
|
||||
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
|
||||
$result = trim($result[1]);
|
||||
if (preg_match('/^(?:array|function|object|regexp)$/', $result)) {
|
||||
$result = ucfirst($result);
|
||||
}
|
||||
} else {
|
||||
$result = $this->isFunction() ? 'Function' : 'Unknown';
|
||||
$result = $this->isFunction() ? 'Function' : 'unknown';
|
||||
}
|
||||
$this->_type = $result;
|
||||
return $result;
|
||||
|
||||
@@ -5,21 +5,21 @@ require(dirname(__FILE__) . "/Entry.php");
|
||||
/**
|
||||
* Generates Markdown from JSDoc entries.
|
||||
*/
|
||||
class Generator {
|
||||
class MarkdownGenerator {
|
||||
|
||||
/**
|
||||
* The HTML for the close tag.
|
||||
*
|
||||
* @static
|
||||
* @memberOf Generator
|
||||
* @type String
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
public $closeTag = "\n<!-- /div -->\n";
|
||||
|
||||
/**
|
||||
* An array of JSDoc entries.
|
||||
*
|
||||
* @memberOf Generator
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type Array
|
||||
*/
|
||||
public $entries = array();
|
||||
@@ -28,15 +28,15 @@ class Generator {
|
||||
* The HTML for the open tag.
|
||||
*
|
||||
* @static
|
||||
* @memberOf Generator
|
||||
* @type String
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
public $openTag = "\n<!-- div -->\n";
|
||||
|
||||
/**
|
||||
* An options array used to configure the generator.
|
||||
*
|
||||
* @memberOf Generator
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type Array
|
||||
*/
|
||||
public $options = array();
|
||||
@@ -44,18 +44,18 @@ class Generator {
|
||||
/**
|
||||
* The file's source code.
|
||||
*
|
||||
* @memberOf Generator
|
||||
* @type String
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
public $source = '';
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The Generator constructor.
|
||||
* The MarkdownGenerator constructor.
|
||||
*
|
||||
* @constructor
|
||||
* @param {String} $source The source code to parse.
|
||||
* @param {string} $source The source code to parse.
|
||||
* @param {Array} $options The options array.
|
||||
*/
|
||||
public function __construct( $source, $options = array() ) {
|
||||
@@ -103,9 +103,9 @@ class Generator {
|
||||
*
|
||||
* @private
|
||||
* @static
|
||||
* @memberOf Generator
|
||||
* @param {String} $string The string to format.
|
||||
* @returns {String} The formatted string.
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {string} $string The string to format.
|
||||
* @returns {string} The formatted string.
|
||||
*/
|
||||
private static function format( $string ) {
|
||||
$counter = 0;
|
||||
@@ -121,7 +121,7 @@ class Generator {
|
||||
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
|
||||
|
||||
// mark numbers as inline code
|
||||
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
|
||||
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
|
||||
|
||||
// detokenize inline code snippets
|
||||
$counter = 0;
|
||||
@@ -132,28 +132,43 @@ class Generator {
|
||||
return trim($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes special Markdown characters.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @param {string} $string The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
*/
|
||||
private function escape( $string ) {
|
||||
$string = preg_replace('/(?<!\\\)\*/', '*', $string);
|
||||
$string = preg_replace('/(?<!\\\)\[/', '[', $string);
|
||||
$string = preg_replace('/(?<!\\\)\]/', ']', $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify a string by replacing named tokens with matching assoc. array values.
|
||||
*
|
||||
* @private
|
||||
* @static
|
||||
* @memberOf Generator
|
||||
* @param {String} $string The string to modify.
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {string} $string The string to modify.
|
||||
* @param {Array|Object} $object The template object.
|
||||
* @returns {String} The modified string.
|
||||
* @returns {string} The modified string.
|
||||
*/
|
||||
private static function interpolate( $string, $object ) {
|
||||
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
|
||||
$tokens = array_unique(array_pop($tokens));
|
||||
|
||||
foreach ($tokens as $token) {
|
||||
$pattern = '/#\{' . $token . '\}/';
|
||||
$pattern = '/#\{' . preg_replace('/([.*+?^${}()|[\]\\\])/', '\\\$1', $token) . '\}/';
|
||||
$replacement = '';
|
||||
|
||||
if (is_object($object)) {
|
||||
preg_match('/\(([^)]+?)\)$/', $token, $args);
|
||||
$args = preg_split('/,\s*/', array_pop($args));
|
||||
$method = 'get' . ucfirst(str_replace('/\([^)]+?\)$/', '', $token));
|
||||
$method = 'get' . ucfirst(preg_replace('/\([^)]+?\)$/', '', $token));
|
||||
|
||||
if (method_exists($object, $method)) {
|
||||
$replacement = (string) call_user_func_array(array($object, $method), $args);
|
||||
@@ -165,7 +180,7 @@ class Generator {
|
||||
}
|
||||
$string = preg_replace($pattern, trim($replacement), $string);
|
||||
}
|
||||
return Generator::format($string);
|
||||
return MarkdownGenerator::format($string);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -174,7 +189,7 @@ class Generator {
|
||||
* Adds the given `$entries` to the `$result` array.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Generator
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {Array} $result The result array to modify.
|
||||
* @param {Array} $entries The entries to add to the `$result`.
|
||||
*/
|
||||
@@ -188,14 +203,21 @@ class Generator {
|
||||
array_push(
|
||||
$result,
|
||||
$this->openTag,
|
||||
Generator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [Ⓢ](#{href} \"View in source\") [Ⓣ][1]\n\n#{desc}", $entry)
|
||||
MarkdownGenerator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [Ⓢ](#{href} \"View in source\") [Ⓣ][1]\n\n#{desc}", array(
|
||||
'call' => $entry->getCall(),
|
||||
'desc' => $this->escape($entry->getDesc()),
|
||||
'hash' => $entry->hash,
|
||||
'href' => $entry->href,
|
||||
'member' => $entry->member,
|
||||
'separator' => $entry->separator
|
||||
))
|
||||
);
|
||||
|
||||
// @alias
|
||||
if (count($aliases = $entry->getAliases())) {
|
||||
array_push($result, '', '#### Aliases');
|
||||
foreach ($aliases as $index => $alias) {
|
||||
$aliases[$index] = $alias->getName();
|
||||
$aliases[$index] = MarkdownGenerator::interpolate('#{member}#{separator}#{name}', $alias);
|
||||
}
|
||||
$result[] = '*' . implode(', ', $aliases) . '*';
|
||||
}
|
||||
@@ -203,11 +225,11 @@ class Generator {
|
||||
if (count($params = $entry->getParams())) {
|
||||
array_push($result, '', '#### Arguments');
|
||||
foreach ($params as $index => $param) {
|
||||
$result[] = Generator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
|
||||
'desc' => $param[2],
|
||||
$result[] = MarkdownGenerator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
|
||||
'desc' => $this->escape($param[2]),
|
||||
'name' => $param[1],
|
||||
'num' => $index + 1,
|
||||
'type' => $param[0]
|
||||
'type' => $this->escape($param[0])
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -216,7 +238,10 @@ class Generator {
|
||||
array_push(
|
||||
$result, '',
|
||||
'#### Returns',
|
||||
Generator::interpolate('(#{type}): #{desc}', array('desc' => $returns[1], 'type' => $returns[0]))
|
||||
MarkdownGenerator::interpolate('(#{type}): #{desc}', array(
|
||||
'desc' => $this->escape($returns[1]),
|
||||
'type' => $this->escape($returns[0])
|
||||
))
|
||||
);
|
||||
}
|
||||
// @example
|
||||
@@ -231,18 +256,19 @@ class Generator {
|
||||
* Resolves the entry's hash used to navigate the documentation.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Generator
|
||||
* @param {Number|Object} $entry The entry object.
|
||||
* @param {String} $member The name of the member.
|
||||
* @returns {String} The url hash.
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {number|Object} $entry The entry object.
|
||||
* @param {string} $member The name of the member.
|
||||
* @returns {string} The url hash.
|
||||
*/
|
||||
private function getHash( $entry, $member = '' ) {
|
||||
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
|
||||
$member = !$member ? $entry->getMembers(0) : $member;
|
||||
|
||||
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
|
||||
$result = preg_replace('/\(\[|\[\]/', '', $result);
|
||||
$result = preg_replace('/[ =|\'"{}.()\]]/', '', $result);
|
||||
$result = preg_replace('/[[#,]/', '-', $result);
|
||||
$result = preg_replace('/[\t =|\'"{}.()\]]/', '', $result);
|
||||
$result = preg_replace('/[\[#,]+/', '-', $result);
|
||||
return strtolower($result);
|
||||
}
|
||||
|
||||
@@ -250,9 +276,9 @@ class Generator {
|
||||
* Resolves the entry's url for the specific line number.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Generator
|
||||
* @param {Number|Object} $entry The entry object.
|
||||
* @returns {String} The url.
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {number|Object} $entry The entry object.
|
||||
* @returns {string} The url.
|
||||
*/
|
||||
private function getLineUrl( $entry ) {
|
||||
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
|
||||
@@ -263,9 +289,9 @@ class Generator {
|
||||
* Extracts the character used to separate the entry's name from its member.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Generator
|
||||
* @param {Number|Object} $entry The entry object.
|
||||
* @returns {String} The separator.
|
||||
* @memberOf MarkdownGenerator
|
||||
* @param {number|Object} $entry The entry object.
|
||||
* @returns {string} The separator.
|
||||
*/
|
||||
private function getSeparator( $entry ) {
|
||||
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
|
||||
@@ -277,8 +303,8 @@ class Generator {
|
||||
/**
|
||||
* Generates Markdown from JSDoc entries.
|
||||
*
|
||||
* @memberOf Generator
|
||||
* @returns {String} The rendered Markdown.
|
||||
* @memberOf MarkdownGenerator
|
||||
* @returns {string} The rendered Markdown.
|
||||
*/
|
||||
public function generate() {
|
||||
$api = array();
|
||||
@@ -321,9 +347,7 @@ class Generator {
|
||||
|
||||
$api[$member] = $entry;
|
||||
foreach ($entry->getAliases() as $alias) {
|
||||
$api[$member] = $alias;
|
||||
$alias->static = array();
|
||||
$alias->plugin = array();
|
||||
$api[$member]->static[] = $alias;
|
||||
}
|
||||
}
|
||||
else if ($entry->isStatic()) {
|
||||
@@ -345,9 +369,10 @@ class Generator {
|
||||
foreach ($api as $entry) {
|
||||
$entry->hash = $this->getHash($entry);
|
||||
$entry->href = $this->getLineUrl($entry);
|
||||
$entry->separator = '';
|
||||
|
||||
$member = $entry->getMembers(0);
|
||||
$member = ($member ? $member . ($entry->isPlugin() ? '.prototype.' : '.') : '') . $entry->getName();
|
||||
$member = ($member ? $member . $this->getSeparator($entry) : '') . $entry->getName();
|
||||
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
|
||||
|
||||
// add properties to static and plugin sub-entries
|
||||
@@ -446,7 +471,7 @@ class Generator {
|
||||
}
|
||||
// assign TOC hash
|
||||
if (count($result) == 2) {
|
||||
$toc = $category;
|
||||
$toc = strtolower($category);
|
||||
}
|
||||
// add category
|
||||
array_push(
|
||||
@@ -455,7 +480,7 @@ class Generator {
|
||||
);
|
||||
// add entries
|
||||
foreach ($entries as $entry) {
|
||||
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
|
||||
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -477,7 +502,7 @@ class Generator {
|
||||
array_push(
|
||||
$result,
|
||||
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
|
||||
Generator::interpolate('* [`' . $member . '`](##{hash})', $entry)
|
||||
MarkdownGenerator::interpolate('* [`' . $member . '`](##{hash})', $entry)
|
||||
);
|
||||
|
||||
// add static and plugin sub-entries
|
||||
@@ -492,7 +517,7 @@ class Generator {
|
||||
}
|
||||
foreach ($entry->{$kind} as $subentry) {
|
||||
$subentry->member = $member;
|
||||
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
|
||||
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -559,7 +584,7 @@ class Generator {
|
||||
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
|
||||
|
||||
// cleanup whitespace
|
||||
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
|
||||
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
195
vendor/dojo/LICENSE
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
Dojo is available under *either* the terms of the modified BSD license *or* the
|
||||
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
|
||||
license to receive this code under (except as noted in per-module LICENSE
|
||||
files). Some modules may not be the copyright of the Dojo Foundation. These
|
||||
modules contain explicit declarations of copyright in both the LICENSE files in
|
||||
the directories in which they reside and in the code itself. No external
|
||||
contributions are allowed under licenses which are fundamentally incompatible
|
||||
with the AFL or BSD licenses that Dojo is distributed under.
|
||||
|
||||
The text of the AFL and BSD licenses is reproduced below.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The "New" BSD License:
|
||||
**********************
|
||||
|
||||
Copyright (c) 2005-2013, The Dojo Foundation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of the Dojo Foundation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The Academic Free License, v. 2.1:
|
||||
**********************************
|
||||
|
||||
This Academic Free License (the "License") applies to any original work of
|
||||
authorship (the "Original Work") whose owner (the "Licensor") has placed the
|
||||
following notice immediately following the copyright notice for the Original
|
||||
Work:
|
||||
|
||||
Licensed under the Academic Free License version 2.1
|
||||
|
||||
1) Grant of Copyright License. Licensor hereby grants You a world-wide,
|
||||
royalty-free, non-exclusive, perpetual, sublicenseable license to do the
|
||||
following:
|
||||
|
||||
a) to reproduce the Original Work in copies;
|
||||
|
||||
b) to prepare derivative works ("Derivative Works") based upon the Original
|
||||
Work;
|
||||
|
||||
c) to distribute copies of the Original Work and Derivative Works to the
|
||||
public;
|
||||
|
||||
d) to perform the Original Work publicly; and
|
||||
|
||||
e) to display the Original Work publicly.
|
||||
|
||||
2) Grant of Patent License. Licensor hereby grants You a world-wide,
|
||||
royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
|
||||
claims owned or controlled by the Licensor that are embodied in the Original
|
||||
Work as furnished by the Licensor, to make, use, sell and offer for sale the
|
||||
Original Work and Derivative Works.
|
||||
|
||||
3) Grant of Source Code License. The term "Source Code" means the preferred
|
||||
form of the Original Work for making modifications to it and all available
|
||||
documentation describing how to modify the Original Work. Licensor hereby
|
||||
agrees to provide a machine-readable copy of the Source Code of the Original
|
||||
Work along with each copy of the Original Work that Licensor distributes.
|
||||
Licensor reserves the right to satisfy this obligation by placing a
|
||||
machine-readable copy of the Source Code in an information repository
|
||||
reasonably calculated to permit inexpensive and convenient access by You for as
|
||||
long as Licensor continues to distribute the Original Work, and by publishing
|
||||
the address of that information repository in a notice immediately following
|
||||
the copyright notice that applies to the Original Work.
|
||||
|
||||
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
|
||||
of any contributors to the Original Work, nor any of their trademarks or
|
||||
service marks, may be used to endorse or promote products derived from this
|
||||
Original Work without express prior written permission of the Licensor. Nothing
|
||||
in this License shall be deemed to grant any rights to trademarks, copyrights,
|
||||
patents, trade secrets or any other intellectual property of Licensor except as
|
||||
expressly stated herein. No patent license is granted to make, use, sell or
|
||||
offer to sell embodiments of any patent claims other than the licensed claims
|
||||
defined in Section 2. No right is granted to the trademarks of Licensor even if
|
||||
such marks are included in the Original Work. Nothing in this License shall be
|
||||
interpreted to prohibit Licensor from licensing under different terms from this
|
||||
License any Original Work that Licensor otherwise would have a right to
|
||||
license.
|
||||
|
||||
5) This section intentionally omitted.
|
||||
|
||||
6) Attribution Rights. You must retain, in the Source Code of any Derivative
|
||||
Works that You create, all copyright, patent or trademark notices from the
|
||||
Source Code of the Original Work, as well as any notices of licensing and any
|
||||
descriptive text identified therein as an "Attribution Notice." You must cause
|
||||
the Source Code for any Derivative Works that You create to carry a prominent
|
||||
Attribution Notice reasonably calculated to inform recipients that You have
|
||||
modified the Original Work.
|
||||
|
||||
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
|
||||
the copyright in and to the Original Work and the patent rights granted herein
|
||||
by Licensor are owned by the Licensor or are sublicensed to You under the terms
|
||||
of this License with the permission of the contributor(s) of those copyrights
|
||||
and patent rights. Except as expressly stated in the immediately proceeding
|
||||
sentence, the Original Work is provided under this License on an "AS IS" BASIS
|
||||
and WITHOUT WARRANTY, either express or implied, including, without limitation,
|
||||
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
|
||||
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
|
||||
license to Original Work is granted hereunder except under this disclaimer.
|
||||
|
||||
8) Limitation of Liability. Under no circumstances and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise, shall the
|
||||
Licensor be liable to any person for any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License
|
||||
or the use of the Original Work including, without limitation, damages for loss
|
||||
of goodwill, work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses. This limitation of liability shall not
|
||||
apply to liability for death or personal injury resulting from Licensor's
|
||||
negligence to the extent applicable law prohibits such limitation. Some
|
||||
jurisdictions do not allow the exclusion or limitation of incidental or
|
||||
consequential damages, so this exclusion and limitation may not apply to You.
|
||||
|
||||
9) Acceptance and Termination. If You distribute copies of the Original Work or
|
||||
a Derivative Work, You must make a reasonable effort under the circumstances to
|
||||
obtain the express assent of recipients to the terms of this License. Nothing
|
||||
else but this License (or another written agreement between Licensor and You)
|
||||
grants You permission to create Derivative Works based upon the Original Work
|
||||
or to exercise any of the rights granted in Section 1 herein, and any attempt
|
||||
to do so except under the terms of this License (or another written agreement
|
||||
between Licensor and You) is expressly prohibited by U.S. copyright law, the
|
||||
equivalent laws of other countries, and by international treaty. Therefore, by
|
||||
exercising any of the rights granted to You in Section 1 herein, You indicate
|
||||
Your acceptance of this License and all of its terms and conditions.
|
||||
|
||||
10) Termination for Patent Action. This License shall terminate automatically
|
||||
and You may no longer exercise any of the rights granted to You by this License
|
||||
as of the date You commence an action, including a cross-claim or counterclaim,
|
||||
against Licensor or any licensee alleging that the Original Work infringes a
|
||||
patent. This termination provision shall not apply for an action alleging
|
||||
patent infringement by combinations of the Original Work with other software or
|
||||
hardware.
|
||||
|
||||
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
|
||||
License may be brought only in the courts of a jurisdiction wherein the
|
||||
Licensor resides or in which Licensor conducts its primary business, and under
|
||||
the laws of that jurisdiction excluding its conflict-of-law provisions. The
|
||||
application of the United Nations Convention on Contracts for the International
|
||||
Sale of Goods is expressly excluded. Any use of the Original Work outside the
|
||||
scope of this License or after its termination shall be subject to the
|
||||
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
|
||||
seq., the equivalent laws of other countries, and international treaty. This
|
||||
section shall survive the termination of this License.
|
||||
|
||||
12) Attorneys Fees. In any action to enforce the terms of this License or
|
||||
seeking damages relating thereto, the prevailing party shall be entitled to
|
||||
recover its costs and expenses, including, without limitation, reasonable
|
||||
attorneys' fees and costs incurred in connection with such action, including
|
||||
any appeal of such action. This section shall survive the termination of this
|
||||
License.
|
||||
|
||||
13) Miscellaneous. This License represents the complete agreement concerning
|
||||
the subject matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent necessary to
|
||||
make it enforceable.
|
||||
|
||||
14) Definition of "You" in This License. "You" throughout this License, whether
|
||||
in upper or lower case, means an individual or a legal entity exercising rights
|
||||
under, and complying with all of the terms of, this License. For legal
|
||||
entities, "You" includes any entity that controls, is controlled by, or is
|
||||
under common control with you. For purposes of this definition, "control" means
|
||||
(i) the power, direct or indirect, to cause the direction or management of such
|
||||
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
||||
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
|
||||
entity.
|
||||
|
||||
15) Right to Use. You may use the Original Work in all ways not otherwise
|
||||
restricted or conditioned by this License or by law, and Licensor promises not
|
||||
to interfere with or be responsible for such uses by You.
|
||||
|
||||
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
|
||||
Permission is hereby granted to copy and distribute this license without
|
||||
modification. This license may not be modified without the express written
|
||||
permission of its copyright owner.
|
||||
1997
vendor/dojo/dojo.js
vendored
Normal file
0
vendor/firebug-lite/license.txt
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/blank.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/buttonBg.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
0
vendor/firebug-lite/skin/xp/buttonBgHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
0
vendor/firebug-lite/skin/xp/debugger.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/detach.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
vendor/firebug-lite/skin/xp/detachHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 586 B |
0
vendor/firebug-lite/skin/xp/disable.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 340 B |
0
vendor/firebug-lite/skin/xp/disable.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
0
vendor/firebug-lite/skin/xp/disableHover.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 344 B After Width: | Height: | Size: 344 B |
0
vendor/firebug-lite/skin/xp/disableHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
0
vendor/firebug-lite/skin/xp/down.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
0
vendor/firebug-lite/skin/xp/downActive.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
0
vendor/firebug-lite/skin/xp/downHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
0
vendor/firebug-lite/skin/xp/errorIcon-sm.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
0
vendor/firebug-lite/skin/xp/errorIcon.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
0
vendor/firebug-lite/skin/xp/errorIcon.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 457 B After Width: | Height: | Size: 457 B |
0
vendor/firebug-lite/skin/xp/firebug-1.3a2.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/firebug.IE6.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/firebug.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/firebug.html
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/firebug.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
vendor/firebug-lite/skin/xp/group.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
0
vendor/firebug-lite/skin/xp/html.css
vendored
Normal file → Executable file
0
vendor/firebug-lite/skin/xp/infoIcon.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 359 B After Width: | Height: | Size: 359 B |
0
vendor/firebug-lite/skin/xp/infoIcon.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
0
vendor/firebug-lite/skin/xp/loading_16.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
vendor/firebug-lite/skin/xp/min.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
0
vendor/firebug-lite/skin/xp/minHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 485 B |
0
vendor/firebug-lite/skin/xp/off.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 742 B After Width: | Height: | Size: 742 B |
0
vendor/firebug-lite/skin/xp/offHover.png
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 680 B |
0
vendor/firebug-lite/skin/xp/pixel_transparent.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
0
vendor/firebug-lite/skin/xp/roundCorner.svg
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
0
vendor/firebug-lite/skin/xp/search.gif
vendored
Normal file → Executable file
|
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |