Compare commits
644 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2d7a2a3ff7 | ||
|
fa93d678f0 | ||
|
29f0d20be4 | ||
|
19fa70ca0e | ||
|
b1346315c2 | ||
|
5e2be0aa27 | ||
|
316e4ced29 | ||
|
bfa87343a1 | ||
|
c02def2d49 | ||
|
383d376fdc | ||
|
962a4a6f22 | ||
|
39f58e099d | ||
|
debaccfe42 | ||
|
d6aba335bc | ||
|
873d051b15 | ||
|
5b277c84f7 | ||
|
023540854c | ||
|
1a7242b468 | ||
|
e86d1c0dee | ||
|
d0aa7512c2 | ||
|
3327af9808 | ||
|
56d81018d2 | ||
|
08ff1113a6 | ||
|
36cfb436f5 | ||
|
b9810e712c | ||
|
26c67054bb | ||
|
4dbc698687 | ||
|
eecff2c514 | ||
|
db07b366fd | ||
|
ce624c4e4c | ||
|
4af2d4371e | ||
|
09118bbafa | ||
|
2561b99165 | ||
|
b30d88b02c | ||
|
c7d018e576 | ||
|
8e6535a2fe | ||
|
aa6bfd488f | ||
|
c0948070e9 | ||
|
eb757f4a79 | ||
|
f927ba1cd0 | ||
|
635147a629 | ||
|
7033e84c14 | ||
|
f3f2c385e1 | ||
|
ac9e0e8047 | ||
|
5eb0adb008 | ||
|
90886765a7 | ||
|
d8e02a5575 | ||
|
2d43153862 | ||
|
f376c830b5 | ||
|
43f759369a | ||
|
c991bd5bd7 | ||
|
597470eb2c | ||
|
2fcd1d5e9c | ||
|
77d0e34cd2 | ||
|
585c2f244b | ||
|
b646cb2104 | ||
|
8133febe5d | ||
|
d9955dd6d9 | ||
|
1e603083f9 | ||
|
0cffae3677 | ||
|
4a190271c3 | ||
|
b877ccf781 | ||
|
43ae3efccc | ||
|
f0f41fd0b2 | ||
|
964d18c33a | ||
|
5479e66347 | ||
|
b556edf7f9 | ||
|
3468ba61b6 | ||
|
1608ce46d1 | ||
|
6a8d4f1f1f | ||
|
6ad519e567 | ||
|
7f1ce426fd | ||
|
e0f25dc02a | ||
|
e8094b7d2b | ||
|
99fb0135eb | ||
|
9a7d800a15 | ||
|
770d9c6332 | ||
|
4d60c9a376 | ||
|
9dfe68c48d | ||
|
6c17b9994f | ||
|
8ac335a68d | ||
|
e0dc353be4 | ||
|
61f6d0fb42 | ||
|
94a7175886 | ||
|
224382ce9b | ||
|
feb521ec10 | ||
|
a9f572c9f3 | ||
|
2078096ba6 | ||
|
7ee735c547 | ||
|
7fa0406cac | ||
|
916131efe9 | ||
|
b01f542c91 | ||
|
68efa663b0 | ||
|
801036da26 | ||
|
f2b7360bb4 | ||
|
b10d1305a4 | ||
|
42d5fbcc16 | ||
|
0ce325a9d9 | ||
|
518780d0eb | ||
|
7a16a72630 | ||
|
2893ecb6ff | ||
|
0a06b55472 | ||
|
f0afcbdbd2 | ||
|
a5c33ce8b8 | ||
|
40fba56c6e | ||
|
25df5771df | ||
|
ba561ed556 | ||
|
b756956821 | ||
|
88d672e103 | ||
|
82cd91e761 | ||
|
55d73cd12c | ||
|
a38454a075 | ||
|
f66b2165f1 | ||
|
8e301d9b2e | ||
|
b51fc86847 | ||
|
657cee2598 | ||
|
275d7fd4e8 | ||
|
4c2d59078d | ||
|
81a426477f | ||
|
5391cd9c3f | ||
|
09db94df12 | ||
|
06eee652c4 | ||
|
2f39e54ba0 | ||
|
57a520ef68 | ||
|
b2100fb11b | ||
|
982a4fb92e | ||
|
794b8877ae | ||
|
c302592eff | ||
|
7bf580df4e | ||
|
d0c34fe288 | ||
|
7a02d9c8fb | ||
|
f4269d8f75 | ||
|
ae8be46f96 | ||
|
a0807d5dbb | ||
|
3707082d04 | ||
|
3d0c98ec87 | ||
|
0bcee11a4b | ||
|
e836c3f6a8 | ||
|
2e2d48200e | ||
|
cd14edff98 | ||
|
429a0ed252 | ||
|
c7e6443e3c | ||
|
efbc5d8e05 | ||
|
9024398522 | ||
|
cc0a85a6e9 | ||
|
442deb47b4 | ||
|
5a58dab6c0 | ||
|
c037b40961 | ||
|
9a27f70393 | ||
|
21e5ccd5a2 | ||
|
012ba8385b | ||
|
c9f1b4099f | ||
|
52f9f72e97 | ||
|
1abf4ef027 | ||
|
1819f4f63e | ||
|
ff0c890f0b | ||
|
8b9a6eb9f6 | ||
|
7a23294e7f | ||
|
dcd1d29da7 | ||
|
98137a767c | ||
|
2074f52740 | ||
|
1fdb2c61f9 | ||
|
a92d3ece6b | ||
|
71c1ffb899 | ||
|
50a7b092ff | ||
|
542108def2 | ||
|
fab6654aca | ||
|
99ca13202b | ||
|
7e3cfe6180 | ||
|
e8bf7b241d | ||
|
eeb99fe4c0 | ||
|
c930cd4e91 | ||
|
117817a0ff | ||
|
177f70cba6 | ||
|
b7a90faf76 | ||
|
0722e70a47 | ||
|
f8c0cb985c | ||
|
a4840c3c69 | ||
|
97e56818c5 | ||
|
c97f172014 | ||
|
5ce8351bbe | ||
|
2754047a32 | ||
|
eb4f6b3f6e | ||
|
d325c13610 | ||
|
3f1e03fc31 | ||
|
7de5341887 | ||
|
b7603e7b29 | ||
|
2d78d74d73 | ||
|
017da88af4 | ||
|
b0b805fd16 | ||
|
31918d786c | ||
|
ca7423ad0a | ||
|
9d4c1dcc26 | ||
|
0be27d6563 | ||
|
15b68e2225 | ||
|
2f9be22ffb | ||
|
d3fa52936c | ||
|
d56df75be2 | ||
|
f833a2c3ce | ||
|
5e0fcf9214 | ||
|
53fa65a933 | ||
|
8f12a121e4 | ||
|
0c4836128b | ||
|
99c2830d16 | ||
|
07b1a16b4e | ||
|
bc7bb42b7b | ||
|
a84835ca5b | ||
|
5994be5fe1 | ||
|
04b7e7a96c | ||
|
f6659b9e36 | ||
|
f95dea0a46 | ||
|
feea6fb6ac | ||
|
edc7253736 | ||
|
4efc689d6e | ||
|
4d559d56e9 | ||
|
7ad26ad4d8 | ||
|
d4c15b66a5 | ||
|
de4859eab9 | ||
|
adb9db12f4 | ||
|
3b35b5e9bf | ||
|
7a77aa64e1 | ||
|
be8824b889 | ||
|
7abea7cc9b | ||
|
fdcb6b4f14 | ||
|
f8e3b4bfe1 | ||
|
967a60b4c3 | ||
|
e6a2214bc9 | ||
|
c9d929e0a7 | ||
|
3b3105bc4f | ||
|
df05002bc7 | ||
|
e55ce1660d | ||
|
7ff55a4721 | ||
|
b7d929f425 | ||
|
1e7efa8e9e | ||
|
fb838e69b3 | ||
|
332baa9283 | ||
|
fac161ed78 | ||
|
fc594a52c4 | ||
|
8c289e09de | ||
|
722eddb847 | ||
|
dc06bd8f88 | ||
|
8676d7094d | ||
|
cfcf2f8c57 | ||
|
9fb88ff7e6 | ||
|
4f16ae603e | ||
|
f090079eed | ||
|
95749f6d20 | ||
|
d87259366f | ||
|
81de9d6906 | ||
|
eb383cbee9 | ||
|
712274b52e | ||
|
8cc33a1ca0 | ||
|
6152b22596 | ||
|
3efb879496 | ||
|
4b01d11016 | ||
|
5e48961a52 | ||
|
39d46e2aeb | ||
|
8fc3a63d51 | ||
|
3a3a62b24f | ||
|
c8deb8df6e | ||
|
13ba8b7620 | ||
|
2455493396 | ||
|
374483982c | ||
|
9244fa41f4 | ||
|
a5a6068dbe | ||
|
ea9f308d9b | ||
|
11a0adb623 | ||
|
27a7e8d0a9 | ||
|
693148cd03 | ||
|
5137c97e13 | ||
|
b1d529f407 | ||
|
38537d1a79 | ||
|
fff23e11ae | ||
|
0e99d33f9e | ||
|
5b72503296 | ||
|
fb7a77d23c | ||
|
40aa908f2e | ||
|
ecdfafe612 | ||
|
38235b1a60 | ||
|
e2999f37ad | ||
|
f034644459 | ||
|
267872b396 | ||
|
615ba409e5 | ||
|
42a3c1ea61 | ||
|
5bbb1292c8 | ||
|
a7a15af70a | ||
|
80c4c2e3c2 | ||
|
364bd12be6 | ||
|
78b5c0f915 | ||
|
b5f67d59f2 | ||
|
ffdb597b1e | ||
|
7da623e334 | ||
|
b387333ee8 | ||
|
89c2561b95 | ||
|
4e60b5779f | ||
|
3dfaedc317 | ||
|
aa4281d293 | ||
|
d67cbb2f26 | ||
|
445b3474ce | ||
|
f54711b161 | ||
|
2600b743d1 | ||
|
76d4a9ad1c | ||
|
ca1c15adac | ||
|
44d7736e67 | ||
|
9b3d3808bf | ||
|
3786ef6b05 | ||
|
a51a2bb9c7 | ||
|
afea0734e9 | ||
|
6505571221 | ||
|
be56e61ff6 | ||
|
b8f3a77372 | ||
|
22fb30a587 | ||
|
580e4415e2 | ||
|
6868c1fa85 | ||
|
abad21c131 | ||
|
e6b5440e16 | ||
|
71b178947e | ||
|
e0508145dd | ||
|
33e5f5926d | ||
|
bac897df2c | ||
|
ea47adbbbe | ||
|
0583f25b88 | ||
|
9ac0e367d6 | ||
|
6e86c48486 | ||
|
d29e2b1f7f | ||
|
7103ce8b46 | ||
|
5719ba8d54 | ||
|
c3ef3e36fc | ||
|
21e01a3b6b | ||
|
1319300dfd | ||
|
ec48f21da5 | ||
|
acefc81832 | ||
|
be2afc3de2 | ||
|
2f6d036cd5 | ||
|
b8395f37d3 | ||
|
7ff96e1665 | ||
|
ab0fb6a1cf | ||
|
14fefaeedd | ||
|
6566f73a51 | ||
|
9c2b852cec | ||
|
8f19ae3a16 | ||
|
1c7ba7cced | ||
|
d4e60ba755 | ||
|
03e026d239 | ||
|
224aa5e7cd | ||
|
e26aa4397b | ||
|
70e9368ee0 | ||
|
ccc164db5a | ||
|
8a0580e7c4 | ||
|
0bac525826 | ||
|
2b8e2ceb41 | ||
|
25eb211440 | ||
|
80d025d023 | ||
|
b860267599 | ||
|
c33d871bf0 | ||
|
005f761d9e | ||
|
de56a3e776 | ||
|
4d2cadc29f | ||
|
dd480b5cb6 | ||
|
cdb1e76404 | ||
|
b7d47872bf | ||
|
7d6e81f0ff | ||
|
0c23a10e80 | ||
|
25da2cabd3 | ||
|
e7d36de35d | ||
|
2c2f090f13 | ||
|
409f92f344 | ||
|
177cb69b10 | ||
|
2b6e52205e | ||
|
8f017bc20a | ||
|
6e21e47bf2 | ||
|
cc14f86893 | ||
|
0c54bfbf06 | ||
|
fd0f221d64 | ||
|
167643c8df | ||
|
e0a7ad5a3b | ||
|
20b77148c7 | ||
|
4f01b5c467 | ||
|
c345b8ae64 | ||
|
9a6d6907cf | ||
|
7dd75ea74a | ||
|
3fcb2579fc | ||
|
b69e548ad5 | ||
|
7fc602ba28 | ||
|
288eef68e2 | ||
|
bd562eae67 | ||
|
f21f3b5939 | ||
|
26fa383bfe | ||
|
2b99d7c31f | ||
|
93bcf99bb3 | ||
|
8635d9ec05 | ||
|
2cfecf234e | ||
|
49d34f61f9 | ||
|
07edbefd2a | ||
|
f7da068505 | ||
|
fa2685f865 | ||
|
26b7dd28fa | ||
|
ca6ad6d071 | ||
|
f70fc2c080 | ||
|
71eac57907 | ||
|
8edf747917 | ||
|
9734855e5d | ||
|
2b8a10bc00 | ||
|
9bab1ad07d | ||
|
45da679de2 | ||
|
0aab95605b | ||
|
d5b7abc50d | ||
|
6c7154f881 | ||
|
b22912ca29 | ||
|
c0c48d76fd | ||
|
7c1e980dc8 | ||
|
8c75605ee8 | ||
|
10a4a56723 | ||
|
65e914b52c | ||
|
5a653a0ac4 | ||
|
db70056825 | ||
|
16064af6d5 | ||
|
886e851fee | ||
|
b2109c2c75 | ||
|
53ba41d885 | ||
|
7fed47172a | ||
|
9e9171d470 | ||
|
8203a58836 | ||
|
973f727206 | ||
|
fb95a1c6a0 | ||
|
33a93c370c | ||
|
6ebc72de2d | ||
|
a8ccf569ce | ||
|
8755d64de7 | ||
|
6e0b2d6fe6 | ||
|
d6c090e8c8 | ||
|
5fd545ae30 | ||
|
90f66a8b22 | ||
|
ebb222ed33 | ||
|
249c07480c | ||
|
ac4ed80d5d | ||
|
73a3e61e88 | ||
|
096bfe275e | ||
|
5793c0ca40 | ||
|
78ef009e61 | ||
|
37103d1869 | ||
|
faff17987f | ||
|
cebfc2b556 | ||
|
b4358062fb | ||
|
aeea3c8a17 | ||
|
5e46c0d8ab | ||
|
77f5379ad3 | ||
|
5b6aeb3d67 | ||
|
d35619dfe3 | ||
|
059cc022b6 | ||
|
8192c65e49 | ||
|
9d8702d3bb | ||
|
8296cdca78 | ||
|
3a669de201 | ||
|
57de2f4e03 | ||
|
71f5069537 | ||
|
0d26ac6a01 | ||
|
c204dc9fcb | ||
|
292bd8b814 | ||
|
82d72907da | ||
|
6527fe2d90 | ||
|
4606fd1d39 | ||
|
588cecafa9 | ||
|
9fb4b6e340 | ||
|
54f2c185fe | ||
|
07dafcd2aa | ||
|
f8762809f3 | ||
|
32bc2c5d9b | ||
|
5c18451d72 | ||
|
9a08cfb5b5 | ||
|
28fd2f91ee | ||
|
f86f0fabdf | ||
|
218a3e61d4 | ||
|
6eb1a1dc89 | ||
|
9db19c98be | ||
|
ac35531b87 | ||
|
5bcfeb17c3 | ||
|
065ab9bdee | ||
|
467565d41b | ||
|
7fda438397 | ||
|
8d335d449e | ||
|
875519d603 | ||
|
8ecf360462 | ||
|
26df3a53a4 | ||
|
42dbd2c3bf | ||
|
fda6f1a68c | ||
|
5a737b609e | ||
|
38072d3766 | ||
|
a54bd58eee | ||
|
cdfae91598 | ||
|
336996220c | ||
|
8569ba96c4 | ||
|
7ca7154a1e | ||
|
010acd7adc | ||
|
745d7092ad | ||
|
4a8562642b | ||
|
a05db79889 | ||
|
a512ee4957 | ||
|
852c0835fa | ||
|
eea860d919 | ||
|
b84ff1088f | ||
|
631640c5bb | ||
|
debf173673 | ||
|
781fc74c1a | ||
|
3b4d6f696f | ||
|
82e1a053dc | ||
|
e5ce17a16d | ||
|
6c906d498f | ||
|
48bf3f5a3e | ||
|
60bd54a12a | ||
|
7b92499941 | ||
|
49cc81db8c | ||
|
b9fba16893 | ||
|
6c37d0ccfe | ||
|
ce967126d0 | ||
|
949885abbd | ||
|
828320eb9d | ||
|
fb952e00ef | ||
|
78eae0600c | ||
|
55ca445ff7 | ||
|
2413f072ed | ||
|
db067f945a | ||
|
6fbf9f690c | ||
|
5ac76af636 | ||
|
4fce4cfbbc | ||
|
45ece5e7d4 | ||
|
917d6dfc00 | ||
|
573e38683f | ||
|
74bbb03993 | ||
|
09480e4856 | ||
|
1137168e1f | ||
|
0ddc2a8b45 | ||
|
64939e31d7 | ||
|
6d1c3bcb32 | ||
|
bcc062ecb8 | ||
|
f4ea1cc882 | ||
|
1a1c2e5136 | ||
|
74c365f1f7 | ||
|
7a4f37f585 | ||
|
cbb02de464 | ||
|
42272c9164 | ||
|
ad110a9837 | ||
|
6be679f478 | ||
|
a5d0869dd7 | ||
|
06f8f37237 | ||
|
729b48a846 | ||
|
4fc1a91a39 | ||
|
f05d5562b8 | ||
|
339f76cf01 | ||
|
1b2a171b89 | ||
|
d6818be568 | ||
|
facbe2a7d7 | ||
|
daef57f01a | ||
|
6b68ccc2ac | ||
|
46a5578b19 | ||
|
7fafcf01b4 | ||
|
ac0b247eea | ||
|
e11e0db662 | ||
|
098fee36ff | ||
|
cc9fd069db | ||
|
27097b1de4 | ||
|
faa3ec5575 | ||
|
5d8f98e558 | ||
|
fa0803f5ff | ||
|
add00a94fd | ||
|
3d71229767 | ||
|
74b59e3365 | ||
|
f951ec4218 | ||
|
0b3cc39e87 | ||
|
2990a5cbad | ||
|
74928c8e64 | ||
|
4827856fe2 | ||
|
ccb13d3c31 | ||
|
7fed10a26c | ||
|
a4ae53b19f | ||
|
4a2ad1ffa9 | ||
|
3586799367 | ||
|
5052eeb233 | ||
|
5733d73466 | ||
|
b6de8200db | ||
|
d777e4313a | ||
|
86c71338dd | ||
|
13d5e9ff26 | ||
|
1263af850b | ||
|
d075e7f58a | ||
|
fed6cb864a | ||
|
9c064f9052 | ||
|
3402bd9836 | ||
|
29a7f9e972 | ||
|
1f72ebf40f | ||
|
90144ea042 | ||
|
b04677851a | ||
|
68b2f319c3 | ||
|
d8ecc06314 | ||
|
d8a776bea9 | ||
|
76b0ae3912 | ||
|
4852fa3675 | ||
|
b67802a646 | ||
|
cbe70ac13b | ||
|
55f9e4136b | ||
|
3105eeb776 | ||
|
a83c494d47 | ||
|
e183c9f478 | ||
|
54dbdc1011 | ||
|
3998f82331 | ||
|
357e17dfbc | ||
|
68114429c0 | ||
|
8680ce6d38 | ||
|
a620277d86 | ||
|
c4a78bf584 | ||
|
3ee08967e8 | ||
|
8fa85a5243 | ||
|
0e41221703 | ||
|
ab5792e39f | ||
|
47a6a86a95 | ||
|
1bd067323b | ||
|
74da399d03 | ||
|
66b25374ae | ||
|
0fcaad6d31 | ||
|
152fbaef0f | ||
|
49b6442362 | ||
|
a9dbc5d44c | ||
|
040185cc21 | ||
|
9fbeddfa9b | ||
|
98933860e8 | ||
|
ff3c3e58ef | ||
|
9b2699b0b7 | ||
|
7e96630c72 | ||
|
d2f72b2821 | ||
|
97c7684b51 | ||
|
05ccdeb650 | ||
|
77a9e9cccf | ||
|
3774653643 | ||
|
5755ab800f | ||
|
75e3e409ac | ||
|
2552ce3c1b | ||
|
822f969afc | ||
|
a3accd7a77 | ||
|
16134e0709 | ||
|
eeb2f57901 | ||
|
44b47fb045 | ||
|
6176aceded | ||
|
2b0701ccc7 | ||
|
0e9e1fd503 |
46
.ci/release_app.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#! /bin/bash
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
if [ -z ${1} ]; then
|
||||
echo "Release version (arg1) not set !"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
SRC_DIR=`dirname $0`"/.."
|
||||
RELEASE_VERSION=${1}
|
||||
echo "Release version set to ${RELEASE_VERSION}"
|
||||
|
||||
#which npm > /dev/null
|
||||
#which gulp > /dev/null
|
||||
#which wget > /dev/null
|
||||
|
||||
sed -ri 's/(.*)<version>(.+)<\/version>/\1<version>'${RELEASE_VERSION}'<\/version>/g' ${SRC_DIR}/appinfo/info.xml
|
||||
npm install
|
||||
node_modules/gulp/bin/gulp.js uglify
|
||||
git commit -am "Release "${RELEASE_VERSION}
|
||||
git tag ${RELEASE_VERSION}
|
||||
git push
|
||||
git push --tags
|
||||
# Wait a second for Github to ingest our data
|
||||
sleep 1
|
||||
cd /tmp
|
||||
rm -Rf ocsms-packaging && mkdir ocsms-packaging && cd ocsms-packaging
|
||||
|
||||
# Download the git file from github
|
||||
wget https://github.com/nextcloud/ocsms/archive/${RELEASE_VERSION}.tar.gz
|
||||
tar xzf ${RELEASE_VERSION}.tar.gz
|
||||
mv ocsms-${RELEASE_VERSION} ocsms
|
||||
|
||||
# Drop unneeded files
|
||||
rm -Rf \
|
||||
ocsms/js/devel \
|
||||
ocsms/gulpfile.js \
|
||||
ocsms/package.json \
|
||||
ocsms/.ci \
|
||||
ocsms/.tx \
|
||||
ocsms/doc
|
||||
|
||||
tar cfz ocsms-${RELEASE_VERSION}.tar.gz ocsms
|
||||
echo "Release version "${RELEASE_VERSION}" is now ready."
|
70
.github/workflows/codeql-analysis.yml
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
schedule:
|
||||
- cron: '20 1 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.idea/*
|
||||
package-lock.json
|
||||
node_modules/*
|
11
.l10nignore
Normal file
@ -0,0 +1,11 @@
|
||||
doc/swagger-ui-bundle.js
|
||||
doc/swagger-ui-bundle.js.map
|
||||
doc/swagger-ui.css
|
||||
doc/swagger-ui.css.map
|
||||
doc/swagger-ui.js
|
||||
doc/swagger-ui.js.map
|
||||
doc/swagger-ui-standalone-preset.js
|
||||
doc/swagger-ui-standalone-preset.js.map
|
||||
doc/swagger.yml
|
||||
doc/index.html
|
||||
doc/oauth2-redirect.html
|
17
.travis.yml
@ -1,17 +0,0 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
|
||||
before_install:
|
||||
- cd ..
|
||||
- git clone https://github.com/owncloud/core.git
|
||||
- mv ocsms core/apps/
|
||||
- cd core
|
||||
- git submodule init
|
||||
- git submodule update
|
||||
- cd apps/ocsms
|
||||
|
||||
script:
|
||||
- phpunit tests
|
10
.tx/config
Normal file
@ -0,0 +1,10 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = sk_SK: sk, th_TH: th, ja_JP: ja, bg_BG: bg, cs_CZ: cs, fi_FI: fi, hu_HU: hu, nb_NO: nb
|
||||
|
||||
[o:nextcloud:p:nextcloud:r:ocsms]
|
||||
file_filter = translationfiles/<lang>/ocsms.po
|
||||
source_file = translationfiles/templates/ocsms.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
53
CHANGELOG.md
@ -1,2 +1,51 @@
|
||||
owncloud-ocsms (0.0.1)
|
||||
* First release
|
||||
1.7.0 (-CURRENT)
|
||||
* Enhance the contact list using nicer list like in contact app
|
||||
* PHP code cleanup (thanks to PHPStorm)
|
||||
* Angular app code cleanup & enhancements
|
||||
* Start to implement API calls for restoring messages to phones (using ownCloud SMS app)
|
||||
* Show the contact avatar in the conversation
|
||||
|
||||
1.6.0
|
||||
* You can now limit messages shown when loading a conversation
|
||||
* Update AngularJS to 1.4.9
|
||||
* You can now disable desktop notifications
|
||||
* New application icon (thanks to @skjnldsv)
|
||||
* Add singapore country code
|
||||
|
||||
1.5.0
|
||||
* You can now delete conversation or single messages (only in owncloud, not on your phone via the app)
|
||||
* Fix a scrolling issue (thanks @animalillo)
|
||||
* Fix duplicate numbers in conversation in some cases
|
||||
* Update AngularJS to 1.3
|
||||
* Rewrite all JS code to use AngularJS
|
||||
|
||||
1.4.5
|
||||
* Fix a MySQL issue with some key length
|
||||
* Fix a mischecked variable in sync process which could block the sync process
|
||||
|
||||
1.4.4
|
||||
* Add more european country codes
|
||||
* Code refactoring to respect owncloud app style
|
||||
* Minor performance improvements
|
||||
|
||||
1.4.3
|
||||
* Add south Africa country code
|
||||
|
||||
1.4.2
|
||||
* Fix appframework check issue
|
||||
* Fix angular.js library
|
||||
|
||||
1.4.0
|
||||
* Use contact avatars into the conversation list
|
||||
* Add a user setting to set your country. It permit to deduplicate local/international prefixes and prevent splitted conversations. (Tell us if your country doesn't appear, we will map it, we refer to Google Play Store stats for generate the basic mapping)
|
||||
* Add angular.js support into template
|
||||
* Re-organize JS sources
|
||||
|
||||
1.3.3
|
||||
* Fix JS code for HTML5 notifications on browsers which doesn't support it (like IE)
|
||||
|
||||
1.3.2
|
||||
* Fix an integer overflow on 32bits systems which block the sync process
|
||||
|
||||
1.3.1
|
||||
* Fix a CSRF issue when phone push datas
|
||||
|
3
Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM nextcloud:15.0.0-rc-apache
|
||||
|
||||
COPY . /usr/src/nextcloud/apps/ocsms
|
661
LICENSE.md
Normal file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
98
README.md
@ -1,58 +1,64 @@
|
||||
## ownCloud SMS
|
||||
# Phone Sync (for Nextcloud & ownCloud)
|
||||
|
||||
Phone Sync provides a webinterface to display your SMS conversations. SMS conversations are pushed by your Android devices using the [Android client](https://github.com/nerzhul/ownCloud-SMS-App), available on [F-Droid](https://f-droid.org/repository/browse/?fdid=fr.unix_experience.owncloud_sms).
|
||||
|
||||
### Introduction
|
||||
ownCloud SMS provides a webinterface to display your SMS conversations.
|
||||
## :arrow_forward: Access
|
||||
|
||||
SMS conversations are pushed by your Android devices using ownCloud SMS app, available on Google Play Store.
|
||||
The app is available on the [Nextcloud App Store](https://apps.nextcloud.com/apps/ocsms), so installing is as easy as:
|
||||
|
||||
Android download link: https://play.google.com/store/apps/details?id=fr.unix_experience.owncloud_sms
|
||||
1. Navigate in your Nextcloud instance to the "Apps"
|
||||
2. Select the category "Multimedia"
|
||||
3. Click "activate"
|
||||
|
||||
ownCloud SMS Android App sources are partially available here: https://github.com/nerzhul/ownCloud-SMS-App
|
||||
## :question: Solve encoding errors on MySQL
|
||||
If you are on MySQL or MariaDB and have the following issue with the database:
|
||||
|
||||
|
||||
### Licence
|
||||
ownCloud SMS (OcSMS) web application is currently under AGPL licence but this free licence can be modificated to a better free licence.
|
||||
|
||||
|
||||
### Requirements
|
||||
- An ownCloud instance
|
||||
- An Andoid phone
|
||||
|
||||
|
||||
### Installation
|
||||
1. Download the [latest release](https://github.com/nerzhul/ocsms/releases)
|
||||
2. Place this app in **owncloud/apps/** and unpack it
|
||||
3. Activate the app in https://your-owncloud/index.php/settings/apps?installed
|
||||
4. Download the Android client from [Google Play](https://play.google.com/store/apps/details?id=fr.unix_experience.owncloud_sms)
|
||||
5. Activate the Android client by adding an account in your phone settings
|
||||
|
||||
|
||||
### Owncloud SMS core issues
|
||||
*Please create your core issues here:*
|
||||
https://github.com/nerzhul/ocsms/issues
|
||||
|
||||
|
||||
### Issue template
|
||||
**Server**
|
||||
- ownCloud version: X.X.X
|
||||
- PHP version: X.X
|
||||
- HTTPd server: <apache|nginx...>
|
||||
- HTTPS: <yes|no>
|
||||
|
||||
**Client**
|
||||
- Android version: X.X.X
|
||||
- Phone: <phone-model>
|
||||
- ownCloud SMS app version: X.X.X
|
||||
|
||||
**Content of /owncloud/data/owncloud.log**
|
||||
```
|
||||
Place content of your owncloud.log here
|
||||
Incorrect string value: '\xF0\x9F\x98\x89' for column 'sms_msg' at row 1
|
||||
```
|
||||
|
||||
The cause may be that you have to enable 4-byte support.
|
||||
|
||||
### Android client issues
|
||||
*Please create your issues for the Android client here:*
|
||||
https://github.com/nerzhul/ownCloud-SMS-App/issues
|
||||
Here is a guide: https://docs.nextcloud.com/server/11/admin_manual/maintenance/mysql_4byte_support.html
|
||||
|
||||
## :question: Solve InnoDB 'Index column size too large' error on MySQL
|
||||
|
||||
If you are on MySQL or MariaDB and have the following issue with the database:
|
||||
|
||||
```
|
||||
Index column size too large. The maximum column size is 767 bytes.
|
||||
```
|
||||
|
||||
You should reconfigure your MySQL server to support a such column size.
|
||||
|
||||
Here are some informations: https://stackoverflow.com/questions/30761867/mysql-error-the-maximum-column-size-is-767-bytes/30767600
|
||||
|
||||
## :question: Solve the synchronisation issues
|
||||
If you are using FastCGI you must enable buffering in FastCGI but commenting the following line:
|
||||
|
||||
```
|
||||
fastcgi_request_buffering off;
|
||||
```
|
||||
|
||||
## :question: Using the Android App With 2FA Enabled
|
||||
If you've enabled 2FA (Two Factor Authentication) logins you may be hit with an incorrect password error. The android client doesn't support logging in with 2FA credentials. Here is a guide to do so, although it says Managing Devices it is the same process for App Passwords: https://docs.nextcloud.com/server/11/user_manual/session_management.html#managing-devices
|
||||
|
||||
## :eyes: Screenshot
|
||||
|
||||

|
||||
|
||||
## :link: Requirements
|
||||
- A [Nextcloud](https://nextcloud.com) or [ownCloud](https://owncloud.com) instance
|
||||
- An Android phone
|
||||
|
||||
## :exclamation: Reporting issues
|
||||
|
||||
- **Server:** https://github.com/nextcloud/ocsms/issues
|
||||
- **Client:** https://github.com/nerzhul/ownCloud-SMS-App/issues
|
||||
|
||||
## :notebook: License
|
||||
Phone Sync web application is currently licensed under [AGPL license](https://github.com/nextcloud/ocsms/blob/master/LICENSE.md).
|
||||
|
||||
## :notebook: External Libraries
|
||||
[Twemoji](https://github.com/twitter/twemoji) Code licensed under the [MIT License](http://opensource.org/licenses/MIT), Graphics licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
||||
[libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) Code licensed under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\AppInfo;
|
||||
|
||||
if (class_exists('\OCP\AppFramework\App')) {
|
||||
\OCP\App::addNavigationEntry(array(
|
||||
// the string under which your app will be referenced in owncloud
|
||||
'id' => 'ocsms',
|
||||
|
||||
// sorting weight for the navigation. The higher the number, the higher
|
||||
// will it be listed in the navigation
|
||||
'order' => 10,
|
||||
|
||||
// the route that will be shown on startup
|
||||
'href' => \OCP\Util::linkToRoute('ocsms.sms.index'),
|
||||
|
||||
// the icon that will be shown in the navigation
|
||||
// this file needs to exist in img/
|
||||
'icon' => \OCP\Util::imagePath('ocsms', 'app.svg'),
|
||||
|
||||
// the title of your application. This will be used in the
|
||||
// navigation or on the settings page of your app
|
||||
'name' => \OCP\Util::getL10N('ocsms')->t('SMS')
|
||||
));
|
||||
} else {
|
||||
$msg = 'Can not enable the OcSms app because the App Framework App is disabled';
|
||||
\OCP\Util::writeLog('ocsms', $msg, \OCP\Util::ERROR);
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<database>
|
||||
<name>*dbname*</name>
|
||||
<create>true</create>
|
||||
<overwrite>false</overwrite>
|
||||
<charset>utf8</charset>
|
||||
|
||||
<table>
|
||||
<name>*dbprefix*ocsms_user_datas</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>user_id</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>64</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>datakey</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>64</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>datavalue</name>
|
||||
<type>text</type>
|
||||
<length>64</length>
|
||||
<notnull>true</notnull>
|
||||
</field>
|
||||
</declaration>
|
||||
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*ocsms_smsdatas</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>integer</type>
|
||||
<default>0</default>
|
||||
<notnull>true</notnull>
|
||||
<autoincrement>1</autoincrement>
|
||||
<length>10</length>
|
||||
<primary>true</primary>
|
||||
</field>
|
||||
<field>
|
||||
<name>user_id</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>64</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>added</name>
|
||||
<type>timestamp</type>
|
||||
<notnull>true</notnull>
|
||||
<default>1970-01-01 00:00:00</default>
|
||||
</field>
|
||||
<field>
|
||||
<name>lastmodified</name>
|
||||
<type>timestamp</type>
|
||||
<notnull>true</notnull>
|
||||
<default>1970-01-01 00:00:00</default>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_id</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<length>5</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_address</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>64</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_msg</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>2048</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_date</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<length>10</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_flags</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<default>00</default>
|
||||
<length>2</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_mailbox</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<length>1</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>sms_type</name>
|
||||
<type>integer</type>
|
||||
<notnull>true</notnull>
|
||||
<length>1</length>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
<table>
|
||||
<name>*dbprefix*ocsms_config</name>
|
||||
<declaration>
|
||||
<field>
|
||||
<name>user</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>255</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>key</name>
|
||||
<type>text</type>
|
||||
<notnull>true</notnull>
|
||||
<length>25555</length>
|
||||
</field>
|
||||
<field>
|
||||
<name>value</name>
|
||||
<type>text</type>
|
||||
<notnull>false</notnull>
|
||||
<length>25555</length>
|
||||
</field>
|
||||
</declaration>
|
||||
</table>
|
||||
</database>
|
@ -1,10 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
|
||||
<id>ocsms</id>
|
||||
<name>ownCloud SMS</name>
|
||||
<description>A app to sync SMS with your ownCloud</description>
|
||||
<licence>AGPL</licence>
|
||||
<name>Phone Sync</name>
|
||||
<summary>An app to sync SMS with your cloud</summary>
|
||||
<description>An app to sync SMS with your cloud</description>
|
||||
<author>Loic Blot</author>
|
||||
<version>1.4.1</version>
|
||||
<requiremin>7</requiremin>
|
||||
<author>e-alfred</author>
|
||||
<version>2.2.0</version>
|
||||
<licence>agpl</licence>
|
||||
<category>multimedia</category>
|
||||
<category>tools</category>
|
||||
<dependencies>
|
||||
<nextcloud min-version="18" max-version="20" />
|
||||
</dependencies>
|
||||
|
||||
<website>https://github.com/nextcloud/ocsms</website>
|
||||
<bugs>https://github.com/nextcloud/ocsms/issues</bugs>
|
||||
<repository type="git">https://github.com/nextcloud/ocsms</repository>
|
||||
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/ocsms/master/appinfo/screenshots/1-small.png">https://raw.githubusercontent.com/nextcloud/ocsms/master/appinfo/screenshots/1.png</screenshot>
|
||||
|
||||
<fulltextsearch>
|
||||
<provider>OCA\OcSms\Provider\FullTextSearchProvider</provider>
|
||||
</fulltextsearch>
|
||||
<repair-steps>
|
||||
<post-migration>
|
||||
<step>OCA\OcSms\Migration\FixConversationReadStates</step>
|
||||
</post-migration>
|
||||
</repair-steps>
|
||||
<navigations>
|
||||
<navigation>
|
||||
<id>ocsms</id>
|
||||
<name>Phone Sync</name>
|
||||
<route>ocsms.sms.index</route>
|
||||
<icon>app.svg</icon>
|
||||
</navigation>
|
||||
</navigations>
|
||||
</info>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
* @copyright Loic Blot 2014-2016
|
||||
*/
|
||||
|
||||
|
||||
@ -14,155 +14,114 @@ namespace OCA\OcSms\AppInfo;
|
||||
|
||||
|
||||
use \OCP\AppFramework\App;
|
||||
use \OCP\IContainer;
|
||||
|
||||
use \OCA\OcSms\Controller\ApiController;
|
||||
use \OCA\OcSms\Controller\SettingsController;
|
||||
use \OCA\OcSms\Controller\SmsController;
|
||||
|
||||
use \OCA\OcSms\Db\Sms;
|
||||
use \OCA\OcSms\Db\SmsMapper;
|
||||
use \OCA\OcSms\Db\ConversationStateMapper;
|
||||
|
||||
use \OCA\OcSms\Db\ConfigMapper;
|
||||
|
||||
use \OCA\OcSms\Lib\PhoneNumberFormatter;
|
||||
use \OCA\OcSms\Migration\FixConversationReadStates;
|
||||
|
||||
class OcSmsApp extends App {
|
||||
|
||||
/**
|
||||
* @var array used to cache the parsed contacts for every request
|
||||
*/
|
||||
private static $contacts;
|
||||
private static $contactPhotos;
|
||||
|
||||
private static $contactsInverted;
|
||||
|
||||
private $c;
|
||||
|
||||
* OcSmsApp constructor.
|
||||
* @param array $urlParams
|
||||
*/
|
||||
public function __construct (array $urlParams=array()) {
|
||||
parent::__construct('ocsms', $urlParams);
|
||||
|
||||
$container = $this->getContainer();
|
||||
$this->c = $container;
|
||||
$app = $this;
|
||||
$server = $container->query('ServerContainer');
|
||||
|
||||
/**
|
||||
* Core
|
||||
*/
|
||||
$container->registerService('UserId', function($c) {
|
||||
return \OCP\User::getUser();
|
||||
$container->registerService('UserId', function($c) use ($server) {
|
||||
if ($server->getUserSession()->getUser()) {
|
||||
return $server->getUserSession()->getUser()->getUID();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Database Layer
|
||||
* Database Layer
|
||||
*/
|
||||
$container->registerService('ConfigMapper', function ($c) use ($app) {
|
||||
return new ConfigMapper(
|
||||
$c->query('ServerContainer')->getDb(),
|
||||
$container->registerService('ConfigMapper', function (IContainer $c) use ($server) {
|
||||
return new ConfigMapper(
|
||||
$server->getDatabaseConnection(),
|
||||
$c->query('UserId'),
|
||||
$c->query('ServerContainer')->getCrypto()
|
||||
);
|
||||
});
|
||||
$server->getCrypto()
|
||||
);
|
||||
});
|
||||
|
||||
$container->registerService('Sms', function($c) {
|
||||
return new Sms($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
$container->registerService('Sms', function(IContainer $c) use ($server) {
|
||||
return new Sms($server->getDb());
|
||||
});
|
||||
|
||||
$container->registerService('SmsMapper', function($c) {
|
||||
return new SmsMapper($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
$container->registerService('ConversationStateMapper', function(IContainer $c) use ($server) {
|
||||
return new ConversationStateMapper($server->getDatabaseConnection());
|
||||
});
|
||||
|
||||
/**
|
||||
* Controllers
|
||||
*/
|
||||
$container->registerService('SmsController', function($c) use($app) {
|
||||
return new SmsController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId'),
|
||||
$c->query('SmsMapper'),
|
||||
$c->query('ConfigMapper'),
|
||||
$app
|
||||
$container->registerService('SmsMapper', function(IContainer $c) use ($server) {
|
||||
return new SmsMapper(
|
||||
$server->getDatabaseConnection(),
|
||||
$c->query('ConversationStateMapper')
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Managers
|
||||
*/
|
||||
$container->registerService('ContactsManager', function($c){
|
||||
return $c->getServer()->getContactsManager();
|
||||
$container->registerService('ContactsManager', function(IContainer $c) use ($server) {
|
||||
return $server->getContactsManager();
|
||||
});
|
||||
|
||||
/**
|
||||
* Controllers
|
||||
*/
|
||||
$container->registerService('SettingsController', function(IContainer $c) {
|
||||
return new SettingsController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('ConfigMapper')
|
||||
);
|
||||
});
|
||||
|
||||
$container->registerService('SmsController', function(IContainer $c) use($server) {
|
||||
return new SmsController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId'),
|
||||
$c->query('SmsMapper'),
|
||||
$c->query('ConversationStateMapper'),
|
||||
$c->query('ConfigMapper'),
|
||||
$server->getContactsManager(),
|
||||
$server->getURLGenerator()
|
||||
);
|
||||
});
|
||||
|
||||
$container->registerService('ApiController', function(IContainer $c) {
|
||||
return new ApiController(
|
||||
$c->query('AppName'),
|
||||
$c->query('Request'),
|
||||
$c->query('UserId'),
|
||||
$c->query('SmsMapper')
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Migration services
|
||||
*/
|
||||
$container->registerService('OCA\OcSms\Migration\FixConversationReadStates', function ($c) {
|
||||
return new FixConversationReadStates(
|
||||
$c->query('ConversationStateMapper'),
|
||||
$c->getServer()->getUserManager()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public function getContacts() {
|
||||
// Only load contacts if they aren't in the buffer
|
||||
if(count(self::$contacts) == 0) {
|
||||
$this->loadContacts();
|
||||
}
|
||||
return self::$contacts;
|
||||
}
|
||||
|
||||
public function getInvertedContacts() {
|
||||
// Only load contacts if they aren't in the buffer
|
||||
if(count(self::$contactsInverted) == 0) {
|
||||
$this->loadContacts();
|
||||
}
|
||||
return self::$contactsInverted;
|
||||
}
|
||||
|
||||
public function getContactPhotos() {
|
||||
// Only load contacts if they aren't in the buffer
|
||||
if(count(self::$contactPhotos) == 0) {
|
||||
$this->loadContacts();
|
||||
}
|
||||
return self::$contactPhotos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Partially importe this function from owncloud Chat app
|
||||
* https://github.com/owncloud/chat/blob/master/app/chat.php
|
||||
*/
|
||||
private function loadContacts() {
|
||||
self::$contacts = array();
|
||||
self::$contactsInverted = array();
|
||||
|
||||
// Cache country because of loops
|
||||
$configuredCountry = $this->c->query('ConfigMapper')->getCountry();
|
||||
|
||||
$cm = $this->c['ContactsManager'];
|
||||
if ($cm == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$result = $cm->search('',array('FN'));
|
||||
|
||||
foreach ($result as $r) {
|
||||
if (isset ($r["TEL"])) {
|
||||
$phoneIds = $r["TEL"];
|
||||
if (is_array($phoneIds)) {
|
||||
$countPhone = count($phoneIds);
|
||||
for ($i=0; $i < $countPhone; $i++) {
|
||||
$this->pushPhoneNumberToCache($phoneIds[$i], $r["FN"], $configuredCountry);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->pushPhoneNumberToCache($phoneIds, $r["FN"], $configuredCountry);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset ($r["PHOTO"])) {
|
||||
// Remove useless prefix
|
||||
$photoURL = preg_replace("#VALUE=uri:#","",$r["PHOTO"]);
|
||||
self::$contactPhotos[$r["FN"]] = $photoURL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function pushPhoneNumberToCache($rawPhone, $contactName, $country) {
|
||||
|
||||
$phoneNb = PhoneNumberFormatter::format($country, $rawPhone);
|
||||
self::$contacts[$phoneNb] = $contactName;
|
||||
// Inverted contacts
|
||||
if (!isset(self::$contactsInverted[$contactName])) {
|
||||
self::$contactsInverted[$contactName] = array();
|
||||
}
|
||||
array_push(self::$contactsInverted[$contactName], $phoneNb);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\AppInfo;
|
||||
@ -15,14 +15,37 @@ $application = new OcSmsApp();
|
||||
|
||||
$application->registerRoutes($this, array('routes' => array(
|
||||
array('name' => 'sms#index', 'url' => '/', 'verb' => 'GET'),
|
||||
array('name' => 'sms#push', 'url' => '/push', 'verb' => 'POST'),
|
||||
array('name' => 'sms#replace', 'url' => '/replace', 'verb' => 'POST'),
|
||||
array('name' => 'sms#retrieve_all_ids', 'url' => '/get/smsidlist', 'verb' => 'GET'),
|
||||
array('name' => 'sms#retrieve_all_ids_with_status', 'url' => '/get/smsidstate', 'verb' => 'GET'),
|
||||
array('name' => 'sms#retrieve_last_timestamp', 'url' => '/get/lastmsgtime', 'verb' => 'GET'),
|
||||
array('name' => 'sms#retrieve_all_peers', 'url' => '/get/peerlist', 'verb' => 'GET'),
|
||||
array('name' => 'sms#get_conversation', 'url' => '/get/conversation', 'verb' => 'GET'),
|
||||
array('name' => 'sms#check_new_messages', 'url' => '/get/new_messages', 'verb' => 'GET'),
|
||||
array('name' => 'sms#get_api_version', 'url' => '/get/apiversion', 'verb' => 'GET'),
|
||||
array('name' => 'sms#set_country', 'url'=> '/set/country', 'verb' => 'POST'),
|
||||
array('name' => 'sms#delete_conversation', 'url' => '/delete/conversation', 'verb' => 'POST'),
|
||||
array('name' => 'sms#delete_message', 'url' => '/delete/message', 'verb' => 'POST'),
|
||||
|
||||
array('name' => 'settings#set_country', 'url'=> '/set/country', 'verb' => 'POST'),
|
||||
array('name' => 'settings#set_messagelimit', 'url'=> '/set/msglimit', 'verb' => 'POST'),
|
||||
array('name' => 'settings#set_notification_state', 'url'=> '/set/notification_state', 'verb' => 'POST'),
|
||||
array('name' => 'settings#set_contact_order', 'url' => '/set/contact_order', 'verb' => 'POST'),
|
||||
|
||||
// Front API
|
||||
array('name' => 'sms#retrieve_all_peers', 'url' => '/front-api/v1/peerlist', 'verb' => 'GET'),
|
||||
array('name' => 'sms#get_conversation', 'url' => '/front-api/v1/conversation', 'verb' => 'GET'),
|
||||
array('name' => 'sms#check_new_messages', 'url' => '/front-api/v1/new_messages', 'verb' => 'GET'),
|
||||
array('name' => 'sms#wipe_all_user_messages', 'url' => '/front-api/v1/delete/all', 'verb' => 'POST'),
|
||||
array('name' => 'settings#get_settings', 'url'=> '/front-api/v1/settings', 'verb' => 'GET'),
|
||||
|
||||
// Android API v1 doesn't have a version in the URL, be careful
|
||||
array('name' => 'api#get_api_version', 'url' => '/get/apiversion', 'verb' => 'GET'), // Android APIv1
|
||||
array('name' => 'api#push', 'url' => '/push', 'verb' => 'POST'), // Android API
|
||||
array('name' => 'api#replace', 'url' => '/replace', 'verb' => 'POST'), // Android API
|
||||
array('name' => 'api#retrieve_all_ids', 'url' => '/get/smsidlist', 'verb' => 'GET'), // Android APIv1
|
||||
array('name' => 'api#retrieve_last_timestamp', 'url' => '/get/lastmsgtime', 'verb' => 'GET'), // Android APIv1
|
||||
|
||||
// Android API v2
|
||||
array('name' => 'api#get_all_stored_phone_numbers', 'url' => '/api/v2/phones/list', 'verb' => 'GET'), // Android APIv2
|
||||
array('name' => 'api#fetch_messages', 'url' => '/api/v2/messages/{start}/{limit}', 'verb' => 'GET'), // Android APIv2
|
||||
array('name' => 'api#fetch_messages_count', 'url' => '/api/v2/messages/count', 'verb' => 'GET'), // Android APIv2
|
||||
|
||||
// Android API v3
|
||||
array('name' => 'api#generate_sms_test_data', 'url' => '/api/v3/test/generate_sms_data', 'verb' => 'POST'), // Android APIv3
|
||||
|
||||
// Android API v4
|
||||
// @TODO future calls to sending calls recorded on the phone
|
||||
array('name' => 'api#fetch_messages_to_send', 'url' => '/api/v4/messages/sendqueue', 'verb' => 'GET'), // Android APIv3
|
||||
)));
|
||||
|
BIN
appinfo/screenshots/1-small.png
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
appinfo/screenshots/1.png
Normal file
After Width: | Height: | Size: 99 KiB |
253
controller/apicontroller.php
Normal file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Controller;
|
||||
|
||||
|
||||
use \OCP\IRequest;
|
||||
use \OCP\AppFramework\Http;
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
use \OCA\OcSms\Db\SmsMapper;
|
||||
|
||||
class ApiController extends Controller {
|
||||
|
||||
private $userId;
|
||||
private $smsMapper;
|
||||
private $errorMsg;
|
||||
|
||||
public function __construct ($appName, IRequest $request, $userId, SmsMapper $mapper) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->smsMapper = $mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function getApiVersion () {
|
||||
return new JSONResponse(array("version" => 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* This function is used by API v1
|
||||
* Phone will compare its own message list with this
|
||||
* message list and send the missing messages
|
||||
* This call will remain as secure slow sync mode (1 per hour)
|
||||
*/
|
||||
public function retrieveAllIds () {
|
||||
$smsList = $this->smsMapper->getAllIds($this->userId);
|
||||
return new JSONResponse(array("smslist" => $smsList));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* This function is used by API v2
|
||||
* Phone will get this ID to push recent messages
|
||||
* This call will be used combined with retrieveAllIds
|
||||
* but will be used more times
|
||||
*/
|
||||
public function retrieveLastTimestamp () {
|
||||
$ts = $this->smsMapper->getLastTimestamp($this->userId);
|
||||
return new JSONResponse(array("timestamp" => $ts));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param $smsCount
|
||||
* @param $smsDatas
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function push ($smsCount, $smsDatas) {
|
||||
if ($this->checkPushStructure($smsCount, $smsDatas) === false) {
|
||||
return new JSONResponse(
|
||||
array("status" => false, "msg" => $this->errorMsg),
|
||||
Http::STATUS_BAD_REQUEST
|
||||
);
|
||||
}
|
||||
|
||||
$this->smsMapper->writeToDB($this->userId, $smsDatas);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $smsCount
|
||||
* @param $smsDatas
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function replace($smsCount, $smsDatas) {
|
||||
if ($this->checkPushStructure($smsCount, $smsDatas) === false) {
|
||||
return new JSONResponse(
|
||||
array("status" => false, "msg" => $this->errorMsg),
|
||||
Http::STATUS_BAD_REQUEST
|
||||
);
|
||||
}
|
||||
|
||||
$this->smsMapper->writeToDB($this->userId, $smsDatas, true);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $smsCount
|
||||
* @param $smsDatas
|
||||
* @return bool
|
||||
*/
|
||||
private function checkPushStructure (&$smsCount, &$smsDatas) {
|
||||
if ($smsCount === NULL) {
|
||||
$this->errorMsg = "Error: smsCount field is NULL";
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($smsDatas === NULL) {
|
||||
$this->errorMsg = "Error: smsDatas field is NULL";
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($smsCount != count($smsDatas)) {
|
||||
$this->errorMsg = "Error: sms count invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($smsDatas as &$sms) {
|
||||
if (!array_key_exists("_id", $sms) || !array_key_exists("read", $sms) ||
|
||||
!array_key_exists("date", $sms) || !array_key_exists("seen", $sms) ||
|
||||
!array_key_exists("mbox", $sms) || !array_key_exists("type", $sms) ||
|
||||
!array_key_exists("body", $sms) || !array_key_exists("address", $sms)) {
|
||||
$this->errorMsg = "Error: bad SMS entry";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["_id"])) {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS ID '%s'", $sms["_id"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["type"])) {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS type '%s'", $sms["type"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["mbox"]) && $sms["mbox"] != 0 && $sms["mbox"] != 1 &&
|
||||
$sms["mbox"] != 2) {
|
||||
$this->errorMsg = sprintf("Error: Invalid Mailbox ID '%s'", $sms["mbox"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($sms["read"] !== "true" && $sms["read"] !== "false") {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS Read state '%s'", $sms["read"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($sms["seen"] !== "true" && $sms["seen"] !== "false") {
|
||||
$this->errorMsg = "Error: Invalid SMS Seen state";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["date"]) && $sms["date"] != 0 && $sms["date"] != 1) {
|
||||
$this->errorMsg = "Error: Invalid SMS date";
|
||||
return false;
|
||||
}
|
||||
|
||||
// @ TODO: test address and body ?
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* API v2
|
||||
*/
|
||||
public function getAllStoredPhoneNumbers () {
|
||||
$phoneList = $this->smsMapper->getAllPhoneNumbers($this->userId);
|
||||
return new JSONResponse(array("phoneList" => $phoneList));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* APIv2
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function fetchMessagesCount() {
|
||||
return new JSONResponse(array("count" => $this->smsMapper->getMessageCount($this->userId)));
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* APIv2
|
||||
* @param $start
|
||||
* @param $limit
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function fetchMessages($start, $limit) {
|
||||
if (!is_numeric($start) || !is_numeric($limit) || $start < 0 || $limit <= 0) {
|
||||
return new JSONResponse(array("msg" => "Invalid request"), Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
// Limit messages per fetch to prevent phone garbage collecting due to too many datas
|
||||
if ($limit > 500) {
|
||||
return new JSONResponse(array("msg" => "Too many messages requested"), 413);
|
||||
}
|
||||
|
||||
$messages = $this->smsMapper->getMessages($this->userId, $start, $limit);
|
||||
$last_id = $start;
|
||||
if (count($messages) > 0) {
|
||||
$last_id = max(array_keys($messages));
|
||||
}
|
||||
|
||||
return new JSONResponse(array("messages" => $messages, "last_id" => $last_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* APIv3
|
||||
*/
|
||||
public function fetchMessagesToSend() {
|
||||
// @TODO
|
||||
return new JSONResponse(array("messages" => array()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* @param $smsCount
|
||||
* @param $smsDatas
|
||||
* @return JSONResponse
|
||||
*
|
||||
* produce a bunch of data to test application
|
||||
*/
|
||||
public function generateSmsTestData () {
|
||||
return $this->push(2, array(
|
||||
array("_id" => 702, "type" => 1, "mbox" => 2, "read" => "true",
|
||||
"seen" => "true", "date" => 1654777747, "address" => "+33123456789",
|
||||
"body" => "hello dude"),
|
||||
array("_id" => 685, "type" => 1, "mbox" => 1, "read" => "true",
|
||||
"seen" => "true", "date" => 1654777777, "address" => "+33123456789",
|
||||
"body" => "😀🌍⭐🌎🌔🌒🐕🍖🥂🍻🎮🤸♂️🚇🈲❕📘📚📈🇸🇨🇮🇲"),
|
||||
));
|
||||
}
|
||||
}
|
101
controller/settingscontroller.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Controller;
|
||||
|
||||
|
||||
use \OCP\IRequest;
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
use \OCP\AppFramework\Http;
|
||||
|
||||
use \OCA\OcSms\Db\ConfigMapper;
|
||||
|
||||
use \OCA\OcSms\Lib\CountryCodes;
|
||||
|
||||
class SettingsController extends Controller {
|
||||
|
||||
private $configMapper;
|
||||
|
||||
public function __construct ($appName, IRequest $request, ConfigMapper $cfgMapper){
|
||||
parent::__construct($appName, $request);
|
||||
$this->configMapper = $cfgMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
function getSettings() {
|
||||
$country = $this->configMapper->getKey("country");
|
||||
if ($country === false) {
|
||||
return new JSONResponse(array("status" => false));
|
||||
}
|
||||
|
||||
return new JSONResponse(array("status" => true,
|
||||
"country" => $country,
|
||||
"message_limit" => $this->configMapper->getMessageLimit(),
|
||||
"notification_state" => $this->configMapper->getNotificationState(),
|
||||
"contact_order" => $this->configMapper->getContactOrder(),
|
||||
"contact_order_reverse" => $this->configMapper->getContactOrderReverse(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $country
|
||||
* @return JSONResponse
|
||||
*/
|
||||
function setCountry($country) {
|
||||
if (!array_key_exists($country, CountryCodes::$codes)) {
|
||||
return new JSONResponse(array("status" => false, "msg" => "Invalid country"), Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
$this->configMapper->set("country", $country);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $limit
|
||||
* @return JSONResponse
|
||||
*/
|
||||
function setMessageLimit($limit) {
|
||||
$this->configMapper->set("message_limit", $limit);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $notification
|
||||
* @return JSONResponse
|
||||
*/
|
||||
function setNotificationState($notification) {
|
||||
if (!is_numeric($notification) || $notification < 0 || $notification > 2) {
|
||||
return new JSONResponse(array("status" => false, "msg" => "Invalid notification state"), Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
$this->configMapper->set("notification_state", $notification);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @param $attribute
|
||||
* @param $reverse
|
||||
* @return JSONResponse
|
||||
*/
|
||||
function setContactOrder($attribute, $reverse) {
|
||||
if (!in_array($reverse, ['true','false']) || !in_array($attribute, ['lastmsg','label'])) {
|
||||
return new JSONResponse(array("status" => false, "msg" => "Invalid contact ordering"), Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
$this->configMapper->set("contact_order", $attribute);
|
||||
$this->configMapper->set("contact_order_reverse", $reverse);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
}
|
@ -1,44 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Controller;
|
||||
|
||||
|
||||
use \OCP\IRequest;
|
||||
use \OCP\IURLGenerator;
|
||||
use \OCP\Contacts\IManager as IContactsManager;
|
||||
use \OCP\AppFramework\Http\TemplateResponse;
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
|
||||
use \OCA\OcSms\AppInfo\OcSmsApp;
|
||||
use \OCP\AppFramework\Http;
|
||||
|
||||
use \OCA\OcSms\Db\ConfigMapper;
|
||||
use \OCA\OcSms\Db\SmsMapper;
|
||||
use \OCA\OcSms\Db\ConversationStateMapper;
|
||||
|
||||
use \OCA\OcSms\Lib\CountryCodes;
|
||||
use \OCA\OcSms\Lib\ContactCache;
|
||||
use \OCA\OcSms\Lib\PhoneNumberFormatter;
|
||||
|
||||
class SmsController extends Controller {
|
||||
|
||||
private $app;
|
||||
private $userId;
|
||||
private $configMapper;
|
||||
private $smsMapper;
|
||||
private $errorMsg;
|
||||
private $convStateMapper;
|
||||
private $urlGenerator;
|
||||
private $contactCache;
|
||||
|
||||
public function __construct ($appName, IRequest $request, $userId, SmsMapper $mapper, ConfigMapper $cfgMapper, OcSmsApp $app){
|
||||
/**
|
||||
* SmsController constructor.
|
||||
* @param string $appName
|
||||
* @param IRequest $request
|
||||
* @param $userId
|
||||
* @param SmsMapper $mapper
|
||||
* @param ConfigMapper $cfgMapper
|
||||
* @param IContactsManager $contactsManager
|
||||
* @param $urlGenerator
|
||||
*/
|
||||
public function __construct ($appName, IRequest $request, $userId,
|
||||
SmsMapper $mapper, ConversationStateMapper $cmapper,
|
||||
ConfigMapper $cfgMapper,
|
||||
IContactsManager $contactsManager, IURLGenerator $urlGenerator) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->app = $app;
|
||||
$this->userId = $userId;
|
||||
$this->smsMapper = $mapper;
|
||||
$this->convStateMapper = $cmapper;
|
||||
$this->configMapper = $cfgMapper;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
$this->contactCache = new ContactCache($cfgMapper, $contactsManager);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,65 +67,34 @@ class SmsController extends Controller {
|
||||
$mboxes = array(
|
||||
'PNLConversations' => array(
|
||||
'label' => 'Conversations',
|
||||
'phoneNumbers' => $this->smsMapper->getAllPeersPhoneNumbers($this->userId),
|
||||
'url' => \OCP\Util::linkToAbsolute('index.php', 'apps/ocsms/', array('feed' => 'conversations'))
|
||||
'phoneNumbers' => $this->smsMapper->getAllPhoneNumbers($this->userId),
|
||||
'url' => $this->urlGenerator->linkToRoute('ocsms.sms.index', ['feed' => 'conversations'])
|
||||
),
|
||||
'PNLDrafts' => array(
|
||||
'label' => 'Drafts',
|
||||
'phoneNumbers' => array(),
|
||||
'url' => \OCP\Util::linkToAbsolute('index.php', 'apps/ocsms/', array('feed' => 'drafts'))
|
||||
'url' => $this->urlGenerator->linkToRoute('ocsms.sms.index', ['feed' => 'drafts'])
|
||||
)
|
||||
);
|
||||
|
||||
$params = array('user' => $this->userId,
|
||||
'mailboxes' => $mboxes
|
||||
);
|
||||
return new TemplateResponse($this->appName, 'main', $params);
|
||||
$response = new TemplateResponse($this->appName, 'main', $params);
|
||||
$this->addContentSecurityToResponse($response);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function getApiVersion () {
|
||||
return new JSONResponse(array("version" => 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* Adds the domain "data:" to the allowed image domains
|
||||
* this function is called by reference
|
||||
*
|
||||
* This function is used by API v1
|
||||
* Phone will compare its own message list with this
|
||||
* message list and send the missing messages
|
||||
* This call will remain as secure slow sync mode (1 per hour)
|
||||
* @param TemplateResponse $response
|
||||
*/
|
||||
public function retrieveAllIds () {
|
||||
$smsList = $this->smsMapper->getAllIds($this->userId);
|
||||
return new JSONResponse(array("smslist" => $smsList));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* This function is used by API v2
|
||||
* Phone will get this ID to push recent messages
|
||||
* This call will be used combined with retrieveAllIds
|
||||
* but will be used more times
|
||||
*/
|
||||
public function retrieveLastTimestamp () {
|
||||
$ts = $this->smsMapper->getLastTimestamp($this->userId);
|
||||
return new JSONResponse(array("timestamp" => $ts));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function retrieveAllIdsWithStatus () {
|
||||
$smsList = $this->smsMapper->getAllIdsWithStatus($this->userId);
|
||||
return new JSONResponse(array("smslist" => $smsList));
|
||||
private function addContentSecurityToResponse($response) {
|
||||
$csp = new Http\ContentSecurityPolicy();
|
||||
$csp->allowEvalScript(true);
|
||||
$response->setContentSecurityPolicy($csp);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,14 +103,14 @@ class SmsController extends Controller {
|
||||
*/
|
||||
public function retrieveAllPeers () {
|
||||
$phoneList = $this->smsMapper->getLastMessageTimestampForAllPhonesNumbers($this->userId);
|
||||
$contactsSrc = $this->app->getContacts();
|
||||
$contactsSrc = $this->contactCache->getContacts();
|
||||
$contacts = array();
|
||||
$photos = $this->app->getContactPhotos();
|
||||
$photos = $this->contactCache->getContactPhotos();
|
||||
$uids = $this->contactCache->getContactUids();
|
||||
|
||||
// Cache country because of loops
|
||||
$configuredCountry = $this->configMapper->getCountry();
|
||||
|
||||
$countPhone = count($phoneList);
|
||||
foreach ($phoneList as $number => $ts) {
|
||||
$fmtPN = PhoneNumberFormatter::format($configuredCountry, $number);
|
||||
if (isset($contactsSrc[$number])) {
|
||||
@ -136,17 +123,27 @@ class SmsController extends Controller {
|
||||
$contacts[$number] = $fmtPN;
|
||||
}
|
||||
}
|
||||
$lastRead = $this->smsMapper->getLastReadDate($this->userId);
|
||||
return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "lastRead" => $lastRead, "photos" => $photos));
|
||||
$lastRead = $this->convStateMapper->getLast($this->userId);
|
||||
$lastMessage = $this->smsMapper->getLastTimestamp($this->userId);
|
||||
$ocversion = \OCP\Util::getVersion();
|
||||
$photoversion = 1;
|
||||
if (version_compare($ocversion[0].".".$ocversion[1].".".$ocversion[2], "9.0.0", ">=")) {
|
||||
$photoversion = 2;
|
||||
}
|
||||
|
||||
return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "lastRead" => $lastRead, "lastMessage" => $lastMessage, "photos" => $photos, "uids" => $uids, "photo_version" => $photoversion));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param $phoneNumber
|
||||
* @param int $lastDate
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function getConversation ($phoneNumber, $lastDate = 0) {
|
||||
$contacts = $this->app->getContacts();
|
||||
$iContacts = $this->app->getInvertedContacts();
|
||||
$contacts = $this->contactCache->getContacts();
|
||||
$iContacts = $this->contactCache->getInvertedContacts();
|
||||
$contactName = "";
|
||||
|
||||
// Cache country because of loops
|
||||
@ -163,7 +160,7 @@ class SmsController extends Controller {
|
||||
// Contact resolved
|
||||
if ($contactName != "" && isset($iContacts[$contactName])) {
|
||||
// forall numbers in iContacts
|
||||
foreach($iContacts[$contactName] as $cnumber) {
|
||||
foreach ($iContacts[$contactName] as $cnumber) {
|
||||
$messages = $messages + $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $cnumber, $configuredCountry, $lastDate);
|
||||
$msgCount += $this->smsMapper->countMessagesForPhoneNumber($this->userId, $cnumber, $configuredCountry);
|
||||
$phoneNumbers[] = PhoneNumberFormatter::format($configuredCountry, $cnumber);
|
||||
@ -172,22 +169,19 @@ class SmsController extends Controller {
|
||||
else {
|
||||
$messages = $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $phoneNumber, $configuredCountry, $lastDate);
|
||||
$msgCount = $this->smsMapper->countMessagesForPhoneNumber($this->userId, $phoneNumber, $configuredCountry);
|
||||
if(isset($peerNumber[$fmtPN])) {
|
||||
foreach($peerNumber[$fmtPN] as $cnumber) {
|
||||
$messages = $messages + $this->smsMapper->getAllMessagesForPhoneNumber($this->userId, $cnumber, $configuredCountry, $lastDate);
|
||||
$msgCount += $this->smsMapper->countMessagesForPhoneNumber($this->userId, $cnumber, $configuredCountry);
|
||||
}
|
||||
}
|
||||
$phoneNumbers[] = PhoneNumberFormatter::format($configuredCountry, $phoneNumber);
|
||||
}
|
||||
// Order by id (date)
|
||||
ksort($messages);
|
||||
$msgLimit = $this->configMapper->getMessageLimit();
|
||||
// Only load the last 500 messages
|
||||
$messages = array_slice($messages, -$msgLimit, $msgLimit, true);
|
||||
|
||||
// Set the last read message for the conversation (all phone numbers)
|
||||
if (count($messages) > 0) {
|
||||
$maxDate = max(array_keys($messages));
|
||||
for ($i=0;$i<count($phoneNumbers);$i++) {
|
||||
$this->smsMapper->setLastReadDate($this->userId, $phoneNumbers[$i], $maxDate);
|
||||
$this->convStateMapper->setLast($this->userId, $phoneNumbers[$i], $maxDate);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,119 +193,100 @@ class SmsController extends Controller {
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param $contact
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function checkNewMessages($lastDate) {
|
||||
$phoneList = $this->smsMapper->getNewMessagesCountForAllPhonesNumbers($this->userId, $lastDate);
|
||||
$contactsSrc = $this->app->getContacts();
|
||||
$photosSrc = $this->app->getContactPhotos();
|
||||
$contacts = array();
|
||||
$photos = array();
|
||||
public function deleteConversation ($contact) {
|
||||
$contacts = $this->contactCache->getContacts();
|
||||
$iContacts = $this->contactCache->getInvertedContacts();
|
||||
$contactName = "";
|
||||
|
||||
$countPhone = count($phoneList);
|
||||
foreach ($phoneList as $number => $ts) {
|
||||
$fmtPN = preg_replace("#[ ]#","/", $number);
|
||||
if (isset($contactsSrc[$fmtPN])) {
|
||||
$fmtPN2 = preg_replace("#\/#","", $fmtPN);
|
||||
$contacts[$fmtPN] = $contactsSrc[$fmtPN];
|
||||
$contacts[$fmtPN2] = $contactsSrc[$fmtPN];
|
||||
// Cache country because of loops
|
||||
$configuredCountry = $this->configMapper->getCountry();
|
||||
|
||||
if (isset($photosSrc[$contacts[$fmtPN]])) {
|
||||
$photos[$contacts[$fmtPN]] = $photosSrc[$contacts[$fmtPN]];
|
||||
}
|
||||
|
||||
if (isset($photosSrc[$contacts[$fmtPN2]])) {
|
||||
$photos[$contacts[$fmtPN2]] = $photosSrc[$contacts[$fmtPN2]];
|
||||
}
|
||||
}
|
||||
$fmtPN = PhoneNumberFormatter::format($configuredCountry, $contact);
|
||||
if (isset($contacts[$fmtPN])) {
|
||||
$contactName = $contacts[$fmtPN];
|
||||
}
|
||||
|
||||
return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "photos" => $photos));
|
||||
// Contact resolved
|
||||
if ($contactName != "" && isset($iContacts[$contactName])) {
|
||||
// forall numbers in iContacts
|
||||
foreach ($iContacts[$contactName] as $cnumber) {
|
||||
$this->smsMapper->removeMessagesForPhoneNumber($this->userId, $cnumber);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If we didn't match a contact we need to lookup the raw sms phone numbers associated with the formatted phone number that was passed in as $contact.
|
||||
$phlist = $this->smsMapper->getAllPhoneNumbersForFPN($this->userId, $contact, $configuredCountry);
|
||||
|
||||
// Loop through the returned list of phone numbers and delete them.
|
||||
foreach ($phlist as $phnumber => $value) {
|
||||
$this->smsMapper->removeMessagesForPhoneNumber($this->userId, $phnumber);
|
||||
}
|
||||
}
|
||||
return new JSONResponse(array("status" => "ok"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param $lastDate
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function push ($smsCount, $smsDatas) {
|
||||
if ($this->checkPushStructure($smsCount, $smsDatas, true) === false) {
|
||||
return new JSONResponse(array("status" => false, "msg" => $this->errorMsg));
|
||||
public function checkNewMessages($lastDate) {
|
||||
$phoneList = $this->smsMapper->getNewMessagesCountForAllPhonesNumbers($this->userId, $lastDate);
|
||||
$formatedPhoneList = array();
|
||||
$contactsSrc = $this->contactCache->getContacts();
|
||||
$photosSrc = $this->contactCache->getContactPhotos();
|
||||
$uidsSrc = $this->contactCache->getContactUids();
|
||||
$contacts = array();
|
||||
$photos = array();
|
||||
$uids = array();
|
||||
|
||||
// Cache country because of loops
|
||||
$configuredCountry = $this->configMapper->getCountry();
|
||||
|
||||
foreach ($phoneList as $number => $ts) {
|
||||
$fmtPN = PhoneNumberFormatter::format($configuredCountry, $number);
|
||||
$formatedPhoneList[$number] = $ts;
|
||||
if (isset($contactsSrc[$fmtPN])) {
|
||||
$contacts[$fmtPN] = $contactsSrc[$fmtPN];
|
||||
if (isset($uidsSrc[$fmtPN])) {
|
||||
$uids[$fmtPN] = $uidsSrc[$fmtPN];
|
||||
}
|
||||
|
||||
if (isset($photosSrc[$contacts[$fmtPN]])) {
|
||||
$photos[$contacts[$fmtPN]] = $photosSrc[$contacts[$fmtPN]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->smsMapper->writeToDB($this->userId, $smsDatas);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
return new JSONResponse(array("phonelist" => $phoneList, "contacts" => $contacts, "photos" => $photos, "uids" => $uids));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param $messageId
|
||||
* @param $phoneNumber
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function replace($smsCount, $smsDatas) {
|
||||
if ($this->checkPushStructure($smsCount, $smsDatas, true) === false) {
|
||||
return new JSONResponse(array("status" => false, "msg" => $this->errorMsg));
|
||||
public function deleteMessage ($messageId, $phoneNumber) {
|
||||
if (!preg_match('#^[0-9]+$#',$messageId)) {
|
||||
return new JSONResponse(array(), Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
$this->smsMapper->writeToDB($this->userId, $smsDatas, true);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
}
|
||||
|
||||
private function checkPushStructure ($smsCount, $smsDatas) {
|
||||
if ($smsCount != count($smsDatas)) {
|
||||
$this->errorMsg = "Error: sms count invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($smsDatas as &$sms) {
|
||||
if (!array_key_exists("_id", $sms) || !array_key_exists("read", $sms) ||
|
||||
!array_key_exists("date", $sms) || !array_key_exists("seen", $sms) ||
|
||||
!array_key_exists("mbox", $sms) || !array_key_exists("type", $sms) ||
|
||||
!array_key_exists("body", $sms) || !array_key_exists("address", $sms)) {
|
||||
$this->errorMsg = "Error: bad SMS entry";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["_id"])) {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS ID '%s'", $sms["_id"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["type"])) {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS type '%s'", $sms["type"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["mbox"]) && $sms["mbox"] != 0 && $sms["mbox"] != 1 &&
|
||||
$sms["mbox"] != 2) {
|
||||
$this->errorMsg = sprintf("Error: Invalid Mailbox ID '%s'", $sms["mbox"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($sms["read"] !== "true" && $sms["read"] !== "false") {
|
||||
$this->errorMsg = sprintf("Error: Invalid SMS Read state '%s'", $sms["read"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($sms["seen"] !== "true" && $sms["seen"] !== "false") {
|
||||
$this->errorMsg = "Error: Invalid SMS Seen state";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_numeric($sms["date"]) && $sms["date"] != 0 && $sms["date"] != 1) {
|
||||
$this->errorMsg = "Error: Invalid SMS date";
|
||||
return false;
|
||||
}
|
||||
|
||||
// @ TODO: test address and body ?
|
||||
}
|
||||
return true;
|
||||
$this->smsMapper->removeMessage($this->userId, $phoneNumber, $messageId);
|
||||
return new JSONResponse(array("status" => "ok"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @return JSONResponse
|
||||
*/
|
||||
function setCountry($country) {
|
||||
if (!array_key_exists($country, CountryCodes::$codes)) {
|
||||
return new JSONResponse(array("status" => false, "msg" => "Invalid country"));
|
||||
}
|
||||
$this->configMapper->set("country", $country);
|
||||
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||
public function wipeAllUserMessages () {
|
||||
$this->smsMapper->removeAllMessagesForUser($this->userId);
|
||||
return new JSONResponse(array("status" => "ok"));
|
||||
}
|
||||
}
|
||||
|
323
css/style.css
@ -1,36 +1,50 @@
|
||||
/* Navigation: folder like structure */
|
||||
#app-mailbox-peers {
|
||||
width: 250px;
|
||||
height: 100%;
|
||||
float: left;
|
||||
-moz-box-sizing: border-box; box-sizing: border-box;
|
||||
background-color: #f5f5f5;
|
||||
padding-bottom: 44px;
|
||||
#app {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body.dark #app {
|
||||
color: var(--color-background-dark);
|
||||
}
|
||||
|
||||
#app-navigation {
|
||||
box-sizing: border-box;
|
||||
border-left: 1px solid #ddd;
|
||||
border-right: 1px solid #ddd;
|
||||
overflow-x: auto;
|
||||
flex: 1;
|
||||
}
|
||||
/* Navigation: folder like structure */
|
||||
#app-mailbox-peers {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
overflow-x: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
#app-mailbox-peers > ul {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
-moz-box-sizing: border-box; box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#app-mailbox-peers li {
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
-moz-box-sizing: border-box; box-sizing: border-box;
|
||||
border-top: 1px solid #eee;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#app-mailbox-peers li:hover > a,
|
||||
#app-mailbox-peers li:hover,
|
||||
#app-mailbox-peers .selected,
|
||||
#app-mailbox-peers .selected a {
|
||||
background-color: #ccc;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
#app-mailbox-peers li > a, #ocsms-empty-peers {
|
||||
@ -38,12 +52,9 @@
|
||||
padding: 0 12px;
|
||||
}
|
||||
#app-mailbox-peers li > a {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
-moz-box-sizing: border-box; box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
#ocsms-empty-peers {
|
||||
@ -53,32 +64,78 @@
|
||||
|
||||
#app-content-wrapper {
|
||||
padding: 15px;
|
||||
margin-top: 80px;
|
||||
min-width: auto !important;
|
||||
min-height: auto !important;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#app-content-header {
|
||||
background-color: #E6E6E6;
|
||||
min-height: 30px;
|
||||
width: 100%;
|
||||
float: left;
|
||||
position: fixed;
|
||||
top: 45px;
|
||||
padding: 15px;
|
||||
min-height: 100px;
|
||||
width: auto;
|
||||
top: 0px;
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
padding: 12px;
|
||||
box-shadow: 0 1px 0 0 #CCC;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@media screen and (max-width : 770px) {
|
||||
#app-content-header {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#ocsms-contact-avatar {
|
||||
background-color: transparent;
|
||||
height: 75px;
|
||||
width: 75px;
|
||||
font-size: 2.5em;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
#ocsms-contact-details {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
#ocsms-phone-label {
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
font-weight: normal;
|
||||
color: #fff;
|
||||
float: left;
|
||||
font-size: 20px;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
#ocsms-phone-opt-number {
|
||||
color: #999;
|
||||
padding-left: 15px;
|
||||
color: #fff;
|
||||
float: left;
|
||||
width: 100%;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
|
||||
#ocsms-phone-msg-nb {
|
||||
color: #555;
|
||||
color: #fff;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#ocsms-conversation-removal {
|
||||
float: left;
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
#ocsms-conversation-removal:hover,
|
||||
#ocsms-message-removal:hover,
|
||||
#app-mailbox-peers li:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#ocsms-message-removal {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#ocsms-empty-conversation {
|
||||
@ -89,55 +146,231 @@
|
||||
padding: 20px;
|
||||
color: #666;
|
||||
font-size: 32px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.msg-sent, .msg-recv {
|
||||
border-radius: 12px;
|
||||
border: 1px solid #ccc;
|
||||
border-left-width: 4px;
|
||||
border-radius: 2px;
|
||||
margin: 4px;
|
||||
max-width: 50%;
|
||||
padding: 8px;
|
||||
box-shadow: 1px 1px 1px #CCC;
|
||||
-moz-box-shadow: 1px 1px 1px #CCC;
|
||||
-webkit-box-shadow: 1px 1px 1px #CCC;
|
||||
-ms-box-shadow: 1px 1px 1px #CCC;
|
||||
-o-box-shadow: 1px 1px 1px #CCC;
|
||||
box-shadow: 0px 1px 2px 0px #0000004d;
|
||||
}
|
||||
|
||||
.msg-sent {
|
||||
border: 1px solid #bbb;
|
||||
background: #a5fb7a;
|
||||
border-color: #a0ce89;
|
||||
background: #e0ffd1;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.msg-recv {
|
||||
border: 1px solid #bbb;
|
||||
background: #e8e8e8;
|
||||
background: #f5f5f5;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.msg-sent a:link, .msg-sent a:visited, .msg-recv a:link, .msg-recv a:visited {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.msg-date {
|
||||
color: #666;
|
||||
font-style: italic;
|
||||
font-size: 90%;
|
||||
float: right;
|
||||
line-height: 16px;
|
||||
margin-top: .5rem;
|
||||
font-size: smaller;
|
||||
transition: color .3s ease;
|
||||
}
|
||||
|
||||
.msg-recv:hover .msg-date,
|
||||
.msg-sent:hover .msg-date{
|
||||
color: #333;
|
||||
}
|
||||
|
||||
#app-content-wrapper .icon-delete {
|
||||
opacity: .2;
|
||||
margin-top: .5rem;
|
||||
}
|
||||
|
||||
#app-content-wrapper .icon-delete:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.ocsms-messages-container {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.msg-spacer {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.ocsms-plavatar {
|
||||
margin-top: 2px;
|
||||
width: 40px;
|
||||
.ocsms-plavatar, .ocsms-plavatar-big {
|
||||
display: inline-block;
|
||||
height: 40px;
|
||||
float: left;
|
||||
background-size: 40px;
|
||||
min-height: 40px;
|
||||
width: 40px;
|
||||
min-width: 40px;
|
||||
line-height: 40px;
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
/*! margin-right: 10px; */
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-size: 1.5em;
|
||||
text-transform: capitalize;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.ocsms-plavatar-big {
|
||||
height: 75px;
|
||||
min-height: 75px;
|
||||
width: 75px;
|
||||
min-width: 75px;
|
||||
line-height: 55px;
|
||||
}
|
||||
|
||||
.ocsms-plname {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#app-settings {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#app-settings-header, #app-settings-content {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#app-settings-content .new-button, #app-settings-content .crit-button {
|
||||
height: 34px;
|
||||
vertical-align: middle;
|
||||
background-size: 16px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#app-settings-content .new-button {
|
||||
width: 32px;
|
||||
background-size: 16px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
#app-settings-content .crit-button {
|
||||
width: 200px;
|
||||
background-color: #822C19;
|
||||
padding: 0 2em;
|
||||
}
|
||||
|
||||
|
||||
#app-settings-content input[type="checkbox"] {
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.label-invalid-input {
|
||||
color: red;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.icon-loading {
|
||||
margin: 88px auto;
|
||||
}
|
||||
|
||||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contact-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
img.emoji {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin: 0 .05em 0 .1em;
|
||||
vertical-align: -0.1em;
|
||||
}
|
||||
|
||||
.contact-list-no-contact {
|
||||
padding: 1em;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/**
|
||||
Modal
|
||||
*/
|
||||
|
||||
.modal-mask {
|
||||
position: fixed;
|
||||
z-index: 9998;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, .5);
|
||||
display: table;
|
||||
transition: opacity .3s ease;
|
||||
}
|
||||
|
||||
.modal-wrapper {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.modal-container {
|
||||
width: 300px;
|
||||
margin: 0px auto;
|
||||
padding: 20px 30px;
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
|
||||
transition: all .3s ease;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.modal-default-button {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.modal-crit-button {
|
||||
background: #822C19;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.modal-crit-button:active {
|
||||
color: #822C19;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following styles are auto-applied to elements with
|
||||
* transition="modal" when their visibility is toggled
|
||||
* by Vue.js.
|
||||
*
|
||||
* You can easily play with the modal transition by editing
|
||||
* these styles.
|
||||
*/
|
||||
|
||||
.modal-enter {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.modal-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.modal-enter .modal-container,
|
||||
.modal-leave-active .modal-container {
|
||||
-webkit-transform: scale(1.1);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
@ -1,18 +1,18 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Db;
|
||||
|
||||
use \OCP\IDb;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use \OCP\IDBConnection;
|
||||
|
||||
use \OCP\AppFramework\Db\Mapper;
|
||||
use \OCP\AppFramework\Db\DoesNotExistException;
|
||||
@ -29,12 +29,16 @@ class ConfigMapper extends Mapper {
|
||||
*/
|
||||
private $crypto;
|
||||
|
||||
public function __construct (IDb $api, $user, $crypto){
|
||||
parent::__construct($api, 'ocsms_config');
|
||||
public function __construct (IDBConnection $db, $user, $crypto){
|
||||
parent::__construct($db, 'ocsms_config');
|
||||
$this->user = $user;
|
||||
$this->crypto = $crypto;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @param $value
|
||||
*/
|
||||
public function set ($key, $value){
|
||||
$value = $this->crypto->encrypt($value);
|
||||
if($this->hasKey($key, $value)){
|
||||
@ -54,19 +58,31 @@ class ConfigMapper extends Mapper {
|
||||
return true;
|
||||
} catch (DoesNotExistException $e){
|
||||
return false;
|
||||
} catch (MultipleObjectsReturnedException $e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKey ($key) {
|
||||
try {
|
||||
$query = \OCP\DB::prepare("SELECT `value` FROM `*PREFIX*ocsms_config` WHERE `key` = ? AND `user` = ?");
|
||||
$result = $query->execute(array($key, $this->user));
|
||||
while($row = $result->fetchRow()) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('value')
|
||||
->from('ocsms_config')
|
||||
->where(
|
||||
$qb->expr()->andX(
|
||||
$qb->expr()->eq('key', $qb->createNamedParameter($key)),
|
||||
$qb->expr()->eq('user', $qb->createNamedParameter($this->user))
|
||||
)
|
||||
);
|
||||
$result = $qb->execute();
|
||||
if ($row = $result->fetch()) {
|
||||
return $this->crypto->decrypt($row["value"]);
|
||||
}
|
||||
return false;
|
||||
} catch (DoesNotExistException $e){
|
||||
return false;
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +90,39 @@ class ConfigMapper extends Mapper {
|
||||
* Helpers for different config options
|
||||
*/
|
||||
public function getCountry () { return $this->getKey("country"); }
|
||||
public function getMessageLimit () {
|
||||
$limit = $this->getKey("message_limit");
|
||||
// Default limit is 500 messages
|
||||
if ($limit === false) {
|
||||
$limit = 500;
|
||||
}
|
||||
return $limit;
|
||||
}
|
||||
|
||||
public function getNotificationState () {
|
||||
$st = $this->getKey("notification_state");
|
||||
// Default state is 1/enabled
|
||||
if ($st === false) {
|
||||
$st = 1;
|
||||
}
|
||||
return $st;
|
||||
}
|
||||
|
||||
public function getContactOrder() {
|
||||
$order = $this->getKey("contact_order");
|
||||
if ($order === false) {
|
||||
$order = "lastmsg";
|
||||
}
|
||||
return $order;
|
||||
}
|
||||
|
||||
public function getContactOrderReverse() {
|
||||
$rev = $this->getKey("contact_order_reverse");
|
||||
if ($rev === false) {
|
||||
$rev = "true";
|
||||
}
|
||||
return $rev;
|
||||
}
|
||||
};
|
||||
|
||||
?>
|
||||
|
102
db/conversationstatemapper.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Db;
|
||||
|
||||
use \OCP\IDBConnection;
|
||||
|
||||
use \OCP\AppFramework\Db\Mapper;
|
||||
|
||||
use \OCA\OcSms\AppInfo\OcSmsApp;
|
||||
use \OCA\OcSms\Lib\PhoneNumberFormatter;
|
||||
|
||||
class ConversationStateMapper extends Mapper {
|
||||
public function __construct (IDBConnection $db) {
|
||||
parent::__construct($db, 'ocsms_smsdatas');
|
||||
}
|
||||
|
||||
public function getLast ($userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->selectAlias($qb->createFunction('MAX(int_date)'), 'mx')
|
||||
->from('ocsms_conv_r_states')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId))
|
||||
));
|
||||
$result = $qb->execute();
|
||||
|
||||
if ($row = $result->fetch()) {
|
||||
return $row["mx"];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getLastForPhoneNumber ($userId, $phoneNumber) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->selectAlias($qb->createFunction('MAX(int_date)'), 'mx')
|
||||
->from('ocsms_conv_r_states')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('phone_number', $qb->createNamedParameter($phoneNumber))
|
||||
));
|
||||
$result = $qb->execute();
|
||||
|
||||
if ($row = $result->fetch()) {
|
||||
return $row["mx"];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function setLast ($userId, $phoneNumber, $lastDate) {
|
||||
$this->db->beginTransaction();
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete('ocsms_conv_r_states')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('phone_number', $qb->createNamedParameter($phoneNumber))
|
||||
));
|
||||
$qb->execute();
|
||||
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->insert('ocsms_conv_r_states')
|
||||
->values(array(
|
||||
'user_id' => $qb->createNamedParameter($userId),
|
||||
'phone_number' => $qb->createNamedParameter($phoneNumber),
|
||||
'int_date' => $qb->createNamedParameter($lastDate)
|
||||
));
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
/*
|
||||
* Migration steps
|
||||
*/
|
||||
|
||||
public function migrate () {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('user_id', 'datakey', 'datavalue')
|
||||
->from('ocsms_user_datas')
|
||||
->where($qb->expr()->like('datakey', $qb->createNamedParameter('lastReadDate-%')));
|
||||
|
||||
$result = $qb->execute();
|
||||
while($row = $result->fetch()) {
|
||||
$pn = preg_replace("#lastReadDate[-]#", "", $row["datakey"]);
|
||||
$this->setLast($row["user_id"], $pn, $row["datavalue"]);
|
||||
};
|
||||
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete('ocsms_user_datas')
|
||||
->where($qb->expr()->like('datakey', $qb->createNamedParameter('lastReadDate-%')));
|
||||
$qb->execute();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Db;
|
||||
|
365
db/smsmapper.php
@ -1,22 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
* @copyright Loic Blot 2014-2017
|
||||
*/
|
||||
|
||||
namespace OCA\OcSms\Db;
|
||||
|
||||
use \OCP\IDb;
|
||||
use \OCP\IDBConnection;
|
||||
|
||||
use \OCP\AppFramework\Db\Mapper;
|
||||
|
||||
use \OCA\OcSms\AppInfo\OcSmsApp;
|
||||
use \OCA\OcSms\Lib\PhoneNumberFormatter;
|
||||
use \OCA\OcSms\Db\ConversationStateMapper;
|
||||
|
||||
class SmsMapper extends Mapper {
|
||||
/*
|
||||
@ -30,18 +31,26 @@ class SmsMapper extends Mapper {
|
||||
4 => "outbox", 5 => "failed",
|
||||
6 => "queued"
|
||||
);
|
||||
private $convStateMapper;
|
||||
|
||||
public function __construct (IDb $db) {
|
||||
public function __construct (IDBConnection $db, ConversationStateMapper $cmapper) {
|
||||
parent::__construct($db, 'ocsms_smsdatas');
|
||||
$this->convStateMapper = $cmapper;
|
||||
}
|
||||
|
||||
public function getAllIds ($userId) {
|
||||
$query = \OCP\DB::prepare('SELECT sms_id, sms_mailbox FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ?');
|
||||
$result = $query->execute(array($userId));
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('sms_id', 'sms_mailbox')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
$result = $qb->execute();
|
||||
|
||||
$smsList = array();
|
||||
while($row = $result->fetchRow()) {
|
||||
while($row = $result->fetch()) {
|
||||
// This case may not arrive, but we test if the DB is consistent
|
||||
if (!in_array((int) $row["sms_mailbox"], SmsMapper::$mailboxNames)) {
|
||||
continue;
|
||||
}
|
||||
$mbox = SmsMapper::$mailboxNames[$row["sms_mailbox"]];
|
||||
if (!isset($smsList[$mbox])) {
|
||||
$smsList[$mbox] = array();
|
||||
@ -51,64 +60,68 @@ class SmsMapper extends Mapper {
|
||||
array_push($smsList[$mbox], $row["sms_id"]);
|
||||
}
|
||||
}
|
||||
return $smsList;
|
||||
}
|
||||
|
||||
public function getAllIdsWithStatus ($userId) {
|
||||
$query = \OCP\DB::prepare('SELECT sms_id, sms_type, sms_mailbox FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ?');
|
||||
$result = $query->execute(array($userId));
|
||||
|
||||
$smsList = array();
|
||||
while($row = $result->fetchRow()) {
|
||||
$mbox = SmsMapper::$mailboxNames[$row["sms_mailbox"]];
|
||||
if (!isset($smsList[$mbox])) {
|
||||
$smsList[$mbox] = array();
|
||||
}
|
||||
|
||||
if (!isset($smsList[$mbox][$row["sms_id"]])) {
|
||||
$smsList[$mbox][$row["sms_id"]] = $row["sms_type"];
|
||||
}
|
||||
}
|
||||
$result->closeCursor();
|
||||
return $smsList;
|
||||
}
|
||||
|
||||
public function getLastTimestamp ($userId) {
|
||||
$query = \OCP\DB::prepare('SELECT max(sms_date) as mx FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ?');
|
||||
$result = $query->execute(array($userId));
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
if ($row = $result->fetchRow()) {
|
||||
$qb->selectAlias($qb->createFunction('MAX(sms_date)'), 'mx')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
$result = $qb->execute();
|
||||
|
||||
if ($row = $result->fetch()) {
|
||||
return $row["mx"];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getAllPeersPhoneNumbers ($userId) {
|
||||
$query = \OCP\DB::prepare('SELECT sms_address FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_mailbox IN (?,?)');
|
||||
$result = $query->execute(array($userId, 0, 1));
|
||||
public function getAllPhoneNumbers ($userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('sms_address')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
|
||||
return $qb->createNamedParameter($mbid);
|
||||
}, array(0, 1, 3)))
|
||||
)
|
||||
);
|
||||
|
||||
$result = $qb->execute();
|
||||
|
||||
$phoneList = array();
|
||||
while($row = $result->fetchRow()) {
|
||||
while($row = $result->fetch()) {
|
||||
$pn = $row["sms_address"];
|
||||
if (!in_array($pn, $phoneList)) {
|
||||
array_push($phoneList, $pn);
|
||||
}
|
||||
}
|
||||
$result->closeCursor();
|
||||
return $phoneList;
|
||||
}
|
||||
|
||||
/*
|
||||
get all possible SMS_adresses for a given formated phonenumber
|
||||
*/
|
||||
* get all possible SMS_adresses for a given formated phonenumber
|
||||
*/
|
||||
public function getAllPhoneNumbersForFPN ($userId, $phoneNumber, $country) {
|
||||
$query = \OCP\DB::prepare('SELECT sms_address FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_mailbox IN (?,?)');
|
||||
$result = $query->execute(array($userId, 0, 1));
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('sms_address')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
|
||||
return $qb->createNamedParameter($mbid);
|
||||
}, array(0, 1, 3)))
|
||||
)
|
||||
);
|
||||
$result = $qb->execute();
|
||||
|
||||
$phoneList = array();
|
||||
while($row = $result->fetchRow()) {
|
||||
while($row = $result->fetch()) {
|
||||
$pn = $row["sms_address"];
|
||||
$fmtPN = PhoneNumberFormatter::format($country, $pn);
|
||||
if (!isset($phoneList[$fmtPN])) {
|
||||
@ -119,27 +132,40 @@ class SmsMapper extends Mapper {
|
||||
}
|
||||
$phoneList[$fmtPN][$pn] += 1;
|
||||
}
|
||||
$fpn = PhoneNumberFormatter::format($country, $phoneNumber);
|
||||
if(isset($phoneList[$fpn])){
|
||||
$fpn = $phoneNumber;
|
||||
if(isset($phoneList[$fpn])) {
|
||||
return $phoneList[$fpn];
|
||||
}
|
||||
else {
|
||||
return array();
|
||||
|
||||
$fpn = PhoneNumberFormatter::format($country, $fpn);
|
||||
if (isset($phoneList[$fpn])) {
|
||||
return $phoneList[$fpn];
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getAllMessagesForPhoneNumber ($userId, $phoneNumber, $country, $minDate = 0) {
|
||||
|
||||
$phlst = $this->getAllPhoneNumbersForFPN($userId, $phoneNumber, $country);
|
||||
$messageList = array();
|
||||
$query = \OCP\DB::prepare('SELECT sms_date, sms_msg, sms_type FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_address = ? ' .
|
||||
'AND sms_mailbox IN (?,?) AND sms_date > ?');
|
||||
|
||||
foreach ($phlst as $pn => $val) {
|
||||
$result = $query->execute(array($userId, $pn, 0, 1, $minDate));
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('sms_date', 'sms_msg', 'sms_type')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('sms_address', $qb->createNamedParameter($pn)),
|
||||
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
|
||||
return $qb->createNamedParameter($mbid);
|
||||
}, array(0, 1, 3))),
|
||||
$qb->expr()->gt('sms_date', $qb->createNamedParameter($minDate))
|
||||
)
|
||||
);
|
||||
$result = $qb->execute();
|
||||
|
||||
while ($row = $result->fetchRow()) {
|
||||
while ($row = $result->fetch()) {
|
||||
$messageList[$row["sms_date"]] = array(
|
||||
"msg" => $row["sms_msg"],
|
||||
"type" => $row["sms_type"]
|
||||
@ -149,38 +175,137 @@ class SmsMapper extends Mapper {
|
||||
return $messageList;
|
||||
}
|
||||
|
||||
public function getMessageCount ($userId) {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->selectAlias($qb->createFunction('COUNT(*)'), 'count')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))
|
||||
);
|
||||
$result = $qb->execute();
|
||||
|
||||
if ($row = $result->fetch()) {
|
||||
return $row["count"];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function getMessages ($userId, $start, $limit) {
|
||||
$messageList = array();
|
||||
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->select('sms_address', 'sms_date', 'sms_msg', 'sms_type', 'sms_mailbox')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->gt('sms_date', $qb->createNamedParameter($start))
|
||||
)
|
||||
)
|
||||
->orderBy('sms_date')
|
||||
->setMaxResults((int) $limit);
|
||||
$result = $qb->execute();
|
||||
|
||||
while ($row = $result->fetch()) {
|
||||
$messageList[$row["sms_date"]] = array(
|
||||
"address" => $row["sms_address"],
|
||||
"mailbox" => intval($row["sms_mailbox"]),
|
||||
"msg" => $row["sms_msg"],
|
||||
"type" => intval($row["sms_type"])
|
||||
);
|
||||
}
|
||||
return $messageList;
|
||||
}
|
||||
|
||||
public function countMessagesForPhoneNumber ($userId, $phoneNumber, $country) {
|
||||
$cnt = 0;
|
||||
$phlst = $this->getAllPhoneNumbersForFPN ($userId, $phoneNumber, $country);
|
||||
|
||||
$query = \OCP\DB::prepare('SELECT count(sms_date) as ct FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_address = ? ' .
|
||||
'AND sms_mailbox IN (?,?)');
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
foreach($phlst as $pn => $val) {
|
||||
$result = $query->execute(array($userId, $pn, 0, 1));
|
||||
if ($row = $result->fetchRow())
|
||||
$qb->selectAlias($qb->createFunction('COUNT(*)'), 'ct')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('sms_address', $qb->createNamedParameter($pn)),
|
||||
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
|
||||
return $qb->createNamedParameter($mbid);
|
||||
}, array(0, 1, 3)))
|
||||
)
|
||||
);
|
||||
$result = $qb->execute();
|
||||
|
||||
if ($row = $result->fetch())
|
||||
$cnt += $row["ct"];
|
||||
}
|
||||
return $cnt;
|
||||
}
|
||||
|
||||
public function removeAllMessagesForUser ($userId) {
|
||||
$this->db->beginTransaction();
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete('ocsms_smsdatas')
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
|
||||
$qb->execute();
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
public function removeMessagesForPhoneNumber ($userId, $phoneNumber) {
|
||||
$this->db->beginTransaction();
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('sms_address', $qb->createNamedParameter($phoneNumber))
|
||||
)
|
||||
);
|
||||
$qb->execute();
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
/*
|
||||
* WARN: messageId is sms_date here
|
||||
*/
|
||||
public function removeMessage ($userId, $phoneNumber, $messageId) {
|
||||
$this->db->beginTransaction();
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('sms_address', $qb->createNamedParameter($phoneNumber)),
|
||||
$qb->expr()->eq('sms_date', $qb->createNamedParameter($messageId))
|
||||
)
|
||||
);
|
||||
$qb->execute();
|
||||
$this->db->commit();
|
||||
}
|
||||
|
||||
public function getLastMessageTimestampForAllPhonesNumbers ($userId, $order = true) {
|
||||
$sql = 'SELECT sms_address,MAX(sms_date) as mx FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_mailbox IN (?,?) ' .
|
||||
'GROUP BY sms_address';
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->selectAlias($qb->createFunction('MAX(sms_date)'), 'mx')
|
||||
->addSelect('sms_address')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
|
||||
return $qb->createNamedParameter($mbid);
|
||||
}, array(0, 1, 3)))
|
||||
))
|
||||
->groupBy('sms_address');
|
||||
|
||||
if ($order === true) {
|
||||
$sql .= ' ORDER BY mx DESC';
|
||||
$qb->orderBy('mx', 'DESC');
|
||||
}
|
||||
|
||||
$query = \OCP\DB::prepare($sql);
|
||||
$result = $query->execute(array($userId, 0, 1));
|
||||
$result = $qb->execute();
|
||||
|
||||
$phoneList = array();
|
||||
while ($row = $result->fetchRow()) {
|
||||
$phoneNumber = $row["sms_address"];
|
||||
if (!in_array($phoneNumber, $phoneList)) {
|
||||
while ($row = $result->fetch()) {
|
||||
$phoneNumber = preg_replace("#[ ]#", "", $row["sms_address"]);
|
||||
if (!array_key_exists($phoneNumber, $phoneList)) {
|
||||
$phoneList[$phoneNumber] = $row["mx"];
|
||||
}
|
||||
// Maybe duplicate due to spaces in database
|
||||
else if ($phoneList[$phoneNumber] < $row["mx"]) {
|
||||
$phoneList[$phoneNumber] = $row["mx"];
|
||||
}
|
||||
}
|
||||
@ -188,55 +313,45 @@ class SmsMapper extends Mapper {
|
||||
}
|
||||
|
||||
public function getNewMessagesCountForAllPhonesNumbers($userId, $lastDate) {
|
||||
$sql = 'SELECT sms_address,count(sms_date) as ct FROM ' .
|
||||
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_mailbox IN (?,?) ' .
|
||||
'AND sms_date > ? GROUP BY sms_address';
|
||||
$ld = ($lastDate == '') ? 0 : $lastDate;
|
||||
|
||||
$query = \OCP\DB::prepare($sql);
|
||||
$result = $query->execute(array($userId, 0, 1, $lastDate));
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->selectAlias($qb->createFunction('COUNT(sms_date)'), 'ct')
|
||||
->addSelect('sms_address')
|
||||
->from('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->in('sms_mailbox', array_map(function($mbid) use ($qb) {
|
||||
return $qb->createNamedParameter($mbid);
|
||||
}, array(0, 1, 3))),
|
||||
$qb->expr()->gt('sms_date', $qb->createNamedParameter($ld))))
|
||||
->groupBy('sms_address');
|
||||
$result = $qb->execute();
|
||||
|
||||
$phoneList = array();
|
||||
while ($row = $result->fetchRow()) {
|
||||
$phoneNumber = preg_replace("#[ ]#", "/", $row["sms_address"]);
|
||||
if (!in_array($phoneNumber, $phoneList)) {
|
||||
$phoneList[$phoneNumber] = $row["ct"];
|
||||
while ($row = $result->fetch()) {
|
||||
$phoneNumber = preg_replace("#[ ]#", "", $row["sms_address"]);
|
||||
if ($this->convStateMapper->getLastForPhoneNumber($userId, $phoneNumber) < $lastDate) {
|
||||
if (!array_key_exists($phoneNumber, $phoneList)) {
|
||||
$phoneList[$phoneNumber] = $row["ct"];
|
||||
}
|
||||
else {
|
||||
$phoneList[$phoneNumber] += $row["ct"];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $phoneList;
|
||||
}
|
||||
|
||||
public function getLastReadDate ($userId) {
|
||||
$sql = 'SELECT MAX(datavalue) as mx FROM ' .
|
||||
'*PREFIX*ocsms_user_datas WHERE user_id = ?';
|
||||
|
||||
$query = \OCP\DB::prepare($sql);
|
||||
$result = $query->execute(array($userId));
|
||||
|
||||
if ($row = $result->fetchRow()) {
|
||||
return $row["mx"];
|
||||
}
|
||||
}
|
||||
|
||||
public function setLastReadDate ($userId, $phoneNumber, $lastDate) {
|
||||
\OCP\DB::beginTransaction();
|
||||
$query = \OCP\DB::prepare('DELETE FROM *PREFIX*ocsms_user_datas ' .
|
||||
'WHERE user_id = ? AND datakey = ?');
|
||||
$query->execute(array($userId, 'lastReadDate-' . $phoneNumber));
|
||||
|
||||
$query = \OCP\DB::prepare('INSERT INTO *PREFIX*ocsms_user_datas' .
|
||||
'(user_id, datakey, datavalue) VALUES ' .
|
||||
'(?,?,?)');
|
||||
$query->execute(array($userId, 'lastReadDate-' . $phoneNumber, $lastDate));
|
||||
\OCP\DB::commit();
|
||||
}
|
||||
|
||||
public function writeToDB ($userId, $smsList, $purgeAllSmsBeforeInsert = false) {
|
||||
\OCP\DB::beginTransaction();
|
||||
$this->db->beginTransaction();
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
if ($purgeAllSmsBeforeInsert === true) {
|
||||
$query = \OCP\DB::prepare('DELETE FROM *PREFIX*ocsms_smsdatas ' .
|
||||
'WHERE user_id = ?');
|
||||
$result = $query->execute(array($userId));
|
||||
$qb->delete('ocsms_smsdatas')
|
||||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))
|
||||
);
|
||||
$qb->execute();
|
||||
}
|
||||
|
||||
foreach ($smsList as $sms) {
|
||||
@ -248,28 +363,32 @@ class SmsMapper extends Mapper {
|
||||
// Only delete if we haven't purged the DB
|
||||
if ($purgeAllSmsBeforeInsert === false) {
|
||||
// Remove previous record
|
||||
// @ TODO: only update the required fields, getAllIds can be useful
|
||||
$query = \OCP\DB::prepare('DELETE FROM *PREFIX*ocsms_smsdatas ' .
|
||||
'WHERE user_id = ? AND sms_id = ?');
|
||||
$result = $query->execute(array(
|
||||
$userId, (int) $sms["_id"]
|
||||
));
|
||||
$qb->delete('ocsms_smsdatas')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)),
|
||||
$qb->expr()->eq('sms_id', $qb->createNamedParameter((int) $sms["_id"]))
|
||||
)
|
||||
);
|
||||
$qb->execute();
|
||||
}
|
||||
$query = \OCP\DB::prepare('INSERT INTO *PREFIX*ocsms_smsdatas ' .
|
||||
'(user_id, added, lastmodified, sms_flags, sms_date, sms_id,' .
|
||||
'sms_address, sms_msg, sms_mailbox, sms_type) VALUES ' .
|
||||
'(?,?,?,?,?,?,?,?,?,?)');
|
||||
$result = $query->execute(array(
|
||||
$userId, "NOW()", "NOW()", $smsFlags,
|
||||
$sms["date"], (int) $sms["_id"],
|
||||
$sms["address"], $sms["body"], (int) $sms["mbox"],
|
||||
(int) $sms["type"]
|
||||
));
|
||||
|
||||
|
||||
$now = date("Y-m-d H:i:s");
|
||||
$qb->insert('ocsms_smsdatas')
|
||||
->values(array(
|
||||
'user_id' => $qb->createNamedParameter($userId),
|
||||
'added' => $qb->createNamedParameter($now),
|
||||
'lastmodified' => $qb->createNamedParameter($now),
|
||||
'sms_flags' => $qb->createNamedParameter($smsFlags),
|
||||
'sms_date' => $qb->createNamedParameter($sms["date"]),
|
||||
'sms_id' => $qb->createNamedParameter((int) $sms["_id"]),
|
||||
'sms_address' => $qb->createNamedParameter($sms["address"]),
|
||||
'sms_msg' => $qb->createNamedParameter($sms["body"]),
|
||||
'sms_mailbox' => $qb->createNamedParameter((int) $sms["mbox"]),
|
||||
'sms_type' => $qb->createNamedParameter((int) $sms["type"])
|
||||
));
|
||||
$qb->execute();
|
||||
}
|
||||
|
||||
\OCP\DB::commit();
|
||||
$this->db->commit();
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
doc/favicon-16x16.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
doc/favicon-32x32.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
60
doc/index.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!-- HTML for static distribution bundle build -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Swagger UI</title>
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
|
||||
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
|
||||
<style>
|
||||
html
|
||||
{
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
*,
|
||||
*:before,
|
||||
*:after
|
||||
{
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
margin:0;
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script src="./swagger-ui-bundle.js"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js"> </script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
// Begin Swagger UI call region
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "https://raw.githubusercontent.com/nextcloud/ocsms/master/doc/swagger.yml",
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
})
|
||||
// End Swagger UI call region
|
||||
|
||||
window.ui = ui
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
67
doc/oauth2-redirect.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!doctype html>
|
||||
<html lang="en-US">
|
||||
<body onload="run()">
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
'use strict';
|
||||
function run () {
|
||||
var oauth2 = window.opener.swaggerUIRedirectOauth2;
|
||||
var sentState = oauth2.state;
|
||||
var redirectUrl = oauth2.redirectUrl;
|
||||
var isValid, qp, arr;
|
||||
|
||||
if (/code|token|error/.test(window.location.hash)) {
|
||||
qp = window.location.hash.substring(1);
|
||||
} else {
|
||||
qp = location.search.substring(1);
|
||||
}
|
||||
|
||||
arr = qp.split("&")
|
||||
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
|
||||
qp = qp ? JSON.parse('{' + arr.join() + '}',
|
||||
function (key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value)
|
||||
}
|
||||
) : {}
|
||||
|
||||
isValid = qp.state === sentState
|
||||
|
||||
if ((
|
||||
oauth2.auth.schema.get("flow") === "accessCode"||
|
||||
oauth2.auth.schema.get("flow") === "authorizationCode"
|
||||
) && !oauth2.auth.code) {
|
||||
if (!isValid) {
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "warning",
|
||||
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
|
||||
});
|
||||
}
|
||||
|
||||
if (qp.code) {
|
||||
delete oauth2.state;
|
||||
oauth2.auth.code = qp.code;
|
||||
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
|
||||
} else {
|
||||
let oauthErrorMsg
|
||||
if (qp.error) {
|
||||
oauthErrorMsg = "["+qp.error+"]: " +
|
||||
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
|
||||
(qp.error_uri ? "More info: "+qp.error_uri : "");
|
||||
}
|
||||
|
||||
oauth2.errCb({
|
||||
authId: oauth2.auth.name,
|
||||
source: "auth",
|
||||
level: "error",
|
||||
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
|
||||
});
|
||||
}
|
||||
} else {
|
||||
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
</script>
|
93
doc/swagger-ui-bundle.js
Normal file
1
doc/swagger-ui-bundle.js.map
Normal file
14
doc/swagger-ui-standalone-preset.js
Normal file
1
doc/swagger-ui-standalone-preset.js.map
Normal file
3
doc/swagger-ui.css
Normal file
1
doc/swagger-ui.css.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","file":"swagger-ui.css","sourceRoot":""}
|
9
doc/swagger-ui.js
Normal file
1
doc/swagger-ui.js.map
Normal file
58
doc/swagger.yml
Normal file
@ -0,0 +1,58 @@
|
||||
swagger: "2.0"
|
||||
|
||||
info:
|
||||
version: 2.0.0
|
||||
title: OcSMS API
|
||||
description: OcSMS API specification
|
||||
|
||||
schemes:
|
||||
- https
|
||||
host: nextcloud.example.org
|
||||
basePath: /apps/ocsms
|
||||
|
||||
paths:
|
||||
/get/apiversion:
|
||||
get:
|
||||
summary: Retrieve API version
|
||||
description: Returns the current API version.
|
||||
responses:
|
||||
200:
|
||||
description: OcSMS API version
|
||||
schema:
|
||||
required:
|
||||
- version
|
||||
properties:
|
||||
version:
|
||||
type: integer
|
||||
# TODO: complete this
|
||||
/push:
|
||||
post:
|
||||
summary: Push messages to server
|
||||
description: Push a list of messages to the server
|
||||
responses:
|
||||
200:
|
||||
# TODO: complete this
|
||||
/replace:
|
||||
post:
|
||||
summary: Replace messages to server
|
||||
description: Push a list of messages to replace on the server
|
||||
responses:
|
||||
200:
|
||||
# TODO: complete this
|
||||
/get/smsidlist:
|
||||
get:
|
||||
# TODO: complete this
|
||||
/get/lastmsgtime:
|
||||
get:
|
||||
# TODO: complete this
|
||||
/api/v2/phones/list:
|
||||
get:
|
||||
# TODO: complete this
|
||||
/api/v2/messages/{start}/{limit}:
|
||||
get:
|
||||
# TODO: complete this
|
||||
/api/v2/messages/count:
|
||||
get:
|
||||
# Not implemented
|
||||
/api/v4/messages/sendqueue:
|
||||
get:
|
20
gulpfile.js
Normal file
@ -0,0 +1,20 @@
|
||||
let gulp = require("gulp");
|
||||
let concat = require('gulp-concat');
|
||||
let rename = require("gulp-rename");
|
||||
let uglify = require('gulp-uglify-es').default;
|
||||
|
||||
js_files = [
|
||||
'js/devel/app.js',
|
||||
'js/devel/settings.js',
|
||||
'js/devel/contactlist.js',
|
||||
'js/devel/conversation.js',
|
||||
'js/devel/helpers.js',
|
||||
'js/devel/notifications.js'
|
||||
];
|
||||
|
||||
gulp.task("uglify", function () {
|
||||
return gulp.src(js_files)
|
||||
.pipe(concat("app.min.js"))
|
||||
.pipe(uglify(/* options */))
|
||||
.pipe(gulp.dest("js/"));
|
||||
});
|
72
img/app.svg
@ -1,7 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="32" width="32" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<g transform="translate(573.14 110.3)" fill-rule="evenodd">
|
||||
<path d="m-570.22-108.3c-0.50115 0-0.92082 0.41966-0.92082 0.92081v24.158c0 0.51739 0.40324 0.92073 0.92082 0.92073h26.158c0.51756 0 0.92081-0.40316 0.92081-0.92073l0.00069-14.154c0-0.5011-0.41966-0.92524-0.92081-0.92524h-21.079l-0.0007 11.005c0 0.48012-0.52409 0.97706-1.0042 0.97706-0.48012 0-0.99573-0.49694-0.99573-0.97706l0.0007-12.143c0-0.48012 0.40484-0.86215 0.88497-0.86215h4.5944l14.521 0.00052-0.0007-2.9516c0-0.56713-0.42551-1.0481-0.99245-1.0481h-13.007v-3.0791c0-0.50118-0.40586-0.92081-0.90701-0.92081z"/>
|
||||
<path d="m-570.22-107.3c-0.50115 0-0.92082 0.41966-0.92082 0.92081v24.158c0 0.51739 0.40324 0.92073 0.92082 0.92073h26.158c0.51756 0 0.92081-0.40316 0.92081-0.92073l0.00069-14.154c0-0.5011-0.41966-0.92524-0.92081-0.92524h-21.079l-0.0007 11.005c0 0.48012-0.52409 0.97706-1.0042 0.97706-0.48012 0-0.99573-0.49694-0.99573-0.97706l0.0007-12.143c0-0.48012 0.40484-0.86214 0.88497-0.86214h4.5944l14.521 0.00052-0.0007-2.9516c0-0.56713-0.42551-1.0481-0.99245-1.0481h-13.007v-3.0791c0-0.50118-0.40586-0.92081-0.90701-0.92081z" fill="#fff"/>
|
||||
</g>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
viewBox="0 0 512 512"
|
||||
height="512"
|
||||
width="512"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="server.svg">
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1148"
|
||||
id="namedview11"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.4609375"
|
||||
inkscape:cx="256"
|
||||
inkscape:cy="256"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient5">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop4205" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
transform="translate(0,-540.36219)"
|
||||
style="fill:#ffffff;fill-opacity:1">
|
||||
<path
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.38337606;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0"
|
||||
d="m 51.26741,540.4888 c -28.296248,0 -51.07572198,21.64049 -51.07572198,48.52099 l 0,220.37577 c 0,26.88054 22.77947398,48.521 51.07572198,48.521 l 58.63304,0 233.81605,193.84304 -75.71646,-193.84304 192.73255,0 c 28.29626,0 51.07572,-21.64046 51.07572,-48.521 l 0,-220.37577 c 0,-26.8805 -22.77946,-48.52099 -51.07572,-48.52099 z m 13.880268,41.7133 381.704642,0 c 13.93233,0 25.14853,8.97537 25.14853,20.12354 l 0,13.0919 c 0,11.14817 -11.2162,20.12093 -25.14853,20.12093 l -381.704642,0 c -13.932322,0 -25.14854,-8.97276 -25.14854,-20.12093 l 0,-13.0919 c 0,-11.14817 11.216218,-20.12354 25.14854,-20.12354 z m 0,92.7683 381.704642,0 c 13.93233,0 25.14853,8.97536 25.14853,20.12353 l 0,13.08927 c 0,11.14819 -11.2162,20.12356 -25.14853,20.12356 l -381.704642,0 c -13.932322,0 -25.14854,-8.97537 -25.14854,-20.12356 l 0,-13.08927 c 0,-11.14817 11.216218,-20.12353 25.14854,-20.12353 z m 0,92.00522 137.894142,0 c 13.93234,0 25.14855,12.24637 25.14855,23.39454 l 0,9.81826 c 0,11.14819 -11.21621,20.12355 -25.14855,20.12355 l -137.894142,0 c -13.932322,0 -25.14854,-8.97536 -25.14854,-20.12355 l 0,-9.81826 c 0,-11.14817 11.216218,-23.39454 25.14854,-23.39454 z"
|
||||
id="rect3350" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
img/favicon.ico
Normal file
After Width: | Height: | Size: 4.2 KiB |
40
issue_template.md
Normal file
@ -0,0 +1,40 @@
|
||||
<!--
|
||||
Thanks for reporting issues back to us!
|
||||
|
||||
To make it possible for us to help you please fill out below information carefully.
|
||||
-->
|
||||
|
||||
### Steps to reproduce
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
### Expected behaviour
|
||||
Tell us what should happen
|
||||
|
||||
### Actual behaviour
|
||||
Tell us what happens instead
|
||||
|
||||
### Server configuration
|
||||
|
||||
**Nextcloud/ownCloud version:**
|
||||
|
||||
**PHP version:**
|
||||
|
||||
**HTTPd server:**
|
||||
|
||||
**Database engine & version:** <!-- MySQL 5.6.14 / PostgreSQL 9.6.1 ... -->
|
||||
|
||||
### Client configuration
|
||||
|
||||
**Android version:**
|
||||
|
||||
**Phone:**
|
||||
|
||||
**Nextcloud SMS app version:**
|
||||
|
||||
### Logs
|
||||
|
||||
```
|
||||
Insert your log here
|
||||
```
|
1
js/anchorme.min.js
vendored
Normal file
178
js/angular/angular.min.js
vendored
@ -1,178 +0,0 @@
|
||||
/*
|
||||
AngularJS v1.1.5
|
||||
(c) 2010-2012 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(M,T,p){'use strict';function lc(){var b=M.angular;M.angular=mc;return b}function Xa(b){return!b||typeof b.length!=="number"?!1:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"?!0:b instanceof R||ga&&b instanceof ga||Ea.call(b)!=="[object Object]"||typeof b.callee==="function"}function n(b,a,c){var d;if(b)if(H(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==n)b.forEach(a,c);else if(Xa(b))for(d=
|
||||
0;d<b.length;d++)a.call(c,b[d],d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function qb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function nc(b,a,c){for(var d=qb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function rb(b){return function(a,c){b(c,a)}}function Fa(){for(var b=ba.length,a;b;){b--;a=ba[b].charCodeAt(0);if(a==57)return ba[b]="A",ba.join("");if(a==90)ba[b]="0";else return ba[b]=String.fromCharCode(a+1),ba.join("")}ba.unshift("0");
|
||||
return ba.join("")}function sb(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function t(b){var a=b.$$hashKey;n(arguments,function(a){a!==b&&n(a,function(a,c){b[c]=a})});sb(b,a);return b}function N(b){return parseInt(b,10)}function tb(b,a){return t(new (t(function(){},{prototype:b})),a)}function q(){}function qa(b){return b}function S(b){return function(){return b}}function C(b){return typeof b=="undefined"}function B(b){return typeof b!="undefined"}function L(b){return b!=null&&typeof b=="object"}function E(b){return typeof b==
|
||||
"string"}function Ya(b){return typeof b=="number"}function ra(b){return Ea.apply(b)=="[object Date]"}function F(b){return Ea.apply(b)=="[object Array]"}function H(b){return typeof b=="function"}function sa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function U(b){return E(b)?b.replace(/^\s*/,"").replace(/\s*$/,""):b}function oc(b){return b&&(b.nodeName||b.bind&&b.find)}function Za(b,a,c){var d=[];n(b,function(b,g,i){d.push(a.call(c,b,g,i))});return d}function Ga(b,a){if(b.indexOf)return b.indexOf(a);
|
||||
for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function ta(b,a){var c=Ga(b,a);c>=0&&b.splice(c,1);return a}function V(b,a){if(sa(b)||b&&b.$evalAsync&&b.$watch)throw Error("Can't copy Window or Scope");if(a){if(b===a)throw Error("Can't copy equivalent objects or arrays");if(F(b))for(var c=a.length=0;c<b.length;c++)a.push(V(b[c]));else{c=a.$$hashKey;n(a,function(b,c){delete a[c]});for(var d in b)a[d]=V(b[d]);sb(a,c)}}else(a=b)&&(F(b)?a=V(b,[]):ra(b)?a=new Date(b.getTime()):L(b)&&(a=V(b,{})));
|
||||
return a}function pc(b,a){var a=a||{},c;for(c in b)b.hasOwnProperty(c)&&c.substr(0,2)!=="$$"&&(a[c]=b[c]);return a}function ia(b,a){if(b===a)return!0;if(b===null||a===null)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&c=="object")if(F(b)){if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ia(b[d],a[d]))return!1;return!0}}else if(ra(b))return ra(a)&&b.getTime()==a.getTime();else{if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||sa(b)||sa(a))return!1;c={};for(d in b)if(!(d.charAt(0)===
|
||||
"$"||H(b[d]))){if(!ia(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c[d]&&d.charAt(0)!=="$"&&a[d]!==p&&!H(a[d]))return!1;return!0}return!1}function $a(b,a){var c=arguments.length>2?ka.call(arguments,2):[];return H(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ka.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function qc(b,a){var c=a;/^\$+/.test(b)?c=p:sa(a)?c="$WINDOW":a&&T===a?c="$DOCUMENT":a&&a.$evalAsync&&
|
||||
a.$watch&&(c="$SCOPE");return c}function ha(b,a){return JSON.stringify(b,qc,a?" ":null)}function ub(b){return E(b)?JSON.parse(b):b}function ua(b){b&&b.length!==0?(b=I(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function va(b){b=w(b).clone();try{b.html("")}catch(a){}var c=w("<div>").append(b).html();try{return b[0].nodeType===3?I(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+I(b)})}catch(d){return I(c)}}function vb(b){var a={},c,d;n((b||
|
||||
"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=B(c[1])?decodeURIComponent(c[1]):!0)});return a}function wb(b){var a=[];n(b,function(b,d){a.push(wa(d,!0)+(b===!0?"":"="+wa(b,!0)))});return a.length?a.join("&"):""}function ab(b){return wa(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function wa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function rc(b,
|
||||
a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;n(i,function(a){i[a]=!0;c(T.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(n(b.querySelectorAll("."+a),c),n(b.querySelectorAll("."+a+"\\:"),c),n(b.querySelectorAll("["+a+"]"),c))});n(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):n(a.attributes,function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}
|
||||
function xb(b,a){var c=function(){b=w(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=yb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animator",function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)});e.enabled(!0)}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(M&&!d.test(M.name))return c();M.name=M.name.replace(d,"");Ha.resumeBootstrap=function(b){n(b,function(b){a.push(b)});c()}}function bb(b,a){a=a||"_";return b.replace(sc,
|
||||
function(b,d){return(d?a:"")+b.toLowerCase()})}function cb(b,a,c){if(!b)throw Error("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function xa(b,a,c){c&&F(b)&&(b=b[b.length-1]);cb(H(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function tc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,
|
||||
d,e){return function(){b[e||"push"]([c,d,arguments]);return m}}if(!e)throw Error("No module: "+d);var b=[],c=[],j=a("$injector","invoke"),m={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),animation:a("$animationProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider",
|
||||
"directive"),config:j,run:function(a){c.push(a);return this}};g&&j(g);return m})}})}function Ia(b){return b.replace(uc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(vc,"Moz$1")}function db(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,j,m,k;b.length;){i=b.shift();f=0;for(h=i.length;f<h;f++){j=w(i[f]);c?j.triggerHandler("$destroy"):c=!c;m=0;for(e=(k=j.children()).length,j=e;m<j;m++)b.push(ga(k[m]))}}return d.apply(this,arguments)}var d=ga.fn[b],d=d.$original||d;c.$original=d;ga.fn[b]=
|
||||
c}function R(b){if(b instanceof R)return b;if(!(this instanceof R)){if(E(b)&&b.charAt(0)!="<")throw Error("selectors not implemented");return new R(b)}if(E(b)){var a=T.createElement("div");a.innerHTML="<div> </div>"+b;a.removeChild(a.firstChild);eb(this,a.childNodes);this.remove()}else eb(this,b)}function fb(b){return b.cloneNode(!0)}function ya(b){zb(b);for(var a=0,b=b.childNodes||[];a<b.length;a++)ya(b[a])}function Ab(b,a,c){var d=ca(b,"events");ca(b,"handle")&&(C(a)?n(d,function(a,c){gb(b,
|
||||
c,a);delete d[c]}):C(c)?(gb(b,a,d[a]),delete d[a]):ta(d[a],c))}function zb(b){var a=b[Ja],c=Ka[a];c&&(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),Ab(b)),delete Ka[a],b[Ja]=p)}function ca(b,a,c){var d=b[Ja],d=Ka[d||-1];if(B(c))d||(b[Ja]=d=++wc,d=Ka[d]={}),d[a]=c;else return d&&d[a]}function Bb(b,a,c){var d=ca(b,"data"),e=B(c),g=!e&&B(a),i=g&&!L(a);!d&&!i&&ca(b,"data",d={});if(e)d[a]=c;else if(g)if(i)return d&&d[a];else t(d,a);else return d}function La(b,a){return(" "+b.className+" ").replace(/[\n\t]/g,
|
||||
" ").indexOf(" "+a+" ")>-1}function Cb(b,a){a&&n(a.split(" "),function(a){b.className=U((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+U(a)+" "," "))})}function Db(b,a){a&&n(a.split(" "),function(a){if(!La(b,a))b.className=U(b.className+" "+U(a))})}function eb(b,a){if(a)for(var a=!a.nodeName&&B(a.length)&&!sa(a)?a:[a],c=0;c<a.length;c++)b.push(a[c])}function Eb(b,a){return Ma(b,"$"+(a||"ngController")+"Controller")}function Ma(b,a,c){b=w(b);for(b[0].nodeType==9&&(b=b.find("html"));b.length;){if(c=
|
||||
b.data(a))return c;b=b.parent()}}function Fb(b,a){var c=Na[a.toLowerCase()];return c&&Gb[b.nodeName]&&c}function xc(b,a){var c=function(c,e){if(!c.preventDefault)c.preventDefault=function(){c.returnValue=!1};if(!c.stopPropagation)c.stopPropagation=function(){c.cancelBubble=!0};if(!c.target)c.target=c.srcElement||T;if(C(c.defaultPrevented)){var g=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;g.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented||
|
||||
c.returnValue==!1};n(a[e||c.type],function(a){a.call(b,c)});Z<=8?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function la(b){var a=typeof b,c;if(a=="object"&&b!==null)if(typeof(c=b.$$hashKey)=="function")c=b.$$hashKey();else{if(c===p)c=b.$$hashKey=Fa()}else c=b;return a+":"+c}function za(b){n(b,this.put,this)}function Hb(b){var a,c;if(typeof b=="function"){if(!(a=b.$inject))a=
|
||||
[],c=b.toString().replace(yc,""),c=c.match(zc),n(c[1].split(Ac),function(b){b.replace(Bc,function(b,c,d){a.push(d)})}),b.$inject=a}else F(b)?(c=b.length-1,xa(b[c],"fn"),a=b.slice(0,c)):xa(b,"fn",!0);return a}function yb(b){function a(a){return function(b,c){if(L(b))n(b,rb(a));else return a(b,c)}}function c(a,b){if(H(b)||F(b))b=k.instantiate(b);if(!b.$get)throw Error("Provider "+a+" must define $get factory method.");return m[a+f]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[];n(a,function(a){if(!j.get(a))if(j.put(a,
|
||||
!0),E(a)){var c=Aa(a);b=b.concat(e(c.requires)).concat(c._runBlocks);try{for(var d=c._invokeQueue,c=0,f=d.length;c<f;c++){var g=d[c],o=k.get(g[0]);o[g[1]].apply(o,g[2])}}catch(h){throw h.message&&(h.message+=" from "+a),h;}}else if(H(a))try{b.push(k.invoke(a))}catch(l){throw l.message&&(l.message+=" from "+a),l;}else if(F(a))try{b.push(k.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+String(a[a.length-1])),i;}else xa(a,"module")});return b}function g(a,b){function c(d){if(typeof d!=="string")throw Error("Service name expected");
|
||||
if(a.hasOwnProperty(d)){if(a[d]===i)throw Error("Circular dependency: "+h.join(" <- "));return a[d]}else try{return h.unshift(d),a[d]=i,a[d]=b(d)}finally{h.shift()}}function d(a,b,e){var f=[],j=Hb(a),g,o,h;o=0;for(g=j.length;o<g;o++)h=j[o],f.push(e&&e.hasOwnProperty(h)?e[h]:c(h));a.$inject||(a=a[g]);switch(b?-1:f.length){case 0:return a();case 1:return a(f[0]);case 2:return a(f[0],f[1]);case 3:return a(f[0],f[1],f[2]);case 4:return a(f[0],f[1],f[2],f[3]);case 5:return a(f[0],f[1],f[2],f[3],f[4]);
|
||||
case 6:return a(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6]);case 8:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7]);case 9:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8]);case 10:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9]);default:return a.apply(b,f)}}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(F(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return L(e)?e:c},get:c,annotate:Hb,has:function(b){return m.hasOwnProperty(b+
|
||||
f)||a.hasOwnProperty(b)}}}var i={},f="Provider",h=[],j=new za,m={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,S(b))}),constant:a(function(a,b){m[a]=b;l[a]=b}),decorator:function(a,b){var c=k.get(a+f),d=c.$get;c.$get=function(){var a=u.invoke(d,c);return u.invoke(b,null,{$delegate:a})}}}},k=m.$injector=g(m,function(){throw Error("Unknown provider: "+h.join(" <- "));}),l={},u=l.$injector=
|
||||
g(l,function(a){a=k.get(a+f);return u.invoke(a.$get,a)});n(e(b),function(a){u.invoke(a||q)});return u}function Cc(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;n(a,function(a){!b&&I(a.nodeName)==="a"&&(b=a)});return b}function g(){var b=c.hash(),d;b?(d=i.getElementById(b))?d.scrollIntoView():(d=e(i.getElementsByName(b)))?d.scrollIntoView():b==="top"&&a.scrollTo(0,0):a.scrollTo(0,0)}var i=a.document;b&&d.$watch(function(){return c.hash()},
|
||||
function(){d.$evalAsync(g)});return g}]}function Ib(b){this.register=function(a,c){b.factory(Ia(a)+"Animation",c)};this.$get=["$injector",function(a){return function(b){if(b&&(b=Ia(b)+"Animation",a.has(b)))return a.get(b)}}]}function Dc(b,a,c,d){function e(a){try{a.apply(null,ka.call(arguments,1))}finally{if(o--,o===0)for(;z.length;)try{z.pop()()}catch(b){c.error(b)}}}function g(a,b){(function s(){n(r,function(a){a()});y=b(s,a)})()}function i(){x!=f.url()&&(x=f.url(),n(v,function(a){a(f.url())}))}
|
||||
var f=this,h=a[0],j=b.location,m=b.history,k=b.setTimeout,l=b.clearTimeout,u={};f.isMock=!1;var o=0,z=[];f.$$completeOutstandingRequest=e;f.$$incOutstandingRequestCount=function(){o++};f.notifyWhenNoOutstandingRequests=function(a){n(r,function(a){a()});o===0?a():z.push(a)};var r=[],y;f.addPollFn=function(a){C(y)&&g(100,k);r.push(a);return a};var x=j.href,W=a.find("base");f.url=function(a,b){if(a){if(x!=a)return x=a,d.history?b?m.replaceState(null,"",a):(m.pushState(null,"",a),W.attr("href",W.attr("href"))):
|
||||
b?j.replace(a):j.href=a,f}else return j.href.replace(/%27/g,"'")};var v=[],A=!1;f.onUrlChange=function(a){A||(d.history&&w(b).bind("popstate",i),d.hashchange?w(b).bind("hashchange",i):f.addPollFn(i),A=!0);v.push(a);return a};f.baseHref=function(){var a=W.attr("href");return a?a.replace(/^https?\:\/\/[^\/]*/,""):""};var G={},D="",$=f.baseHref();f.cookies=function(a,b){var d,e,f,j;if(a)if(b===p)h.cookie=escape(a)+"=;path="+$+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(E(b))d=(h.cookie=escape(a)+
|
||||
"="+escape(b)+";path="+$).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(h.cookie!==D){D=h.cookie;d=D.split("; ");G={};for(f=0;f<d.length;f++)e=d[f],j=e.indexOf("="),j>0&&(a=unescape(e.substring(0,j)),G[a]===p&&(G[a]=unescape(e.substring(j+1))))}return G}};f.defer=function(a,b){var c;o++;c=k(function(){delete u[c];e(a)},b||0);u[c]=!0;return c};f.defer.cancel=function(a){return u[a]?(delete u[a],l(a),e(q),!0):!1}}function Ec(){this.$get=
|
||||
["$window","$log","$sniffer","$document",function(b,a,c,d){return new Dc(b,d,a,c)}]}function Fc(){this.$get=function(){function b(b,d){function e(a){if(a!=k){if(l){if(l==a)l=a.n}else l=a;g(a.n,a.p);g(a,k);k=a;k.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw Error("cacheId "+b+" taken");var i=0,f=t({},d,{id:b}),h={},j=d&&d.capacity||Number.MAX_VALUE,m={},k=null,l=null;return a[b]={put:function(a,b){var c=m[a]||(m[a]={key:a});e(c);if(!C(b))return a in h||i++,h[a]=b,i>j&&this.remove(l.key),
|
||||
b},get:function(a){var b=m[a];if(b)return e(b),h[a]},remove:function(a){var b=m[a];if(b){if(b==k)k=b.p;if(b==l)l=b.n;g(b.n,b.p);delete m[a];delete h[a];i--}},removeAll:function(){h={};i=0;m={};k=l=null},destroy:function(){m=f=h=null;delete a[b]},info:function(){return t({},f,{size:i})}}}var a={};b.info=function(){var b={};n(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function Gc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Jb(b){var a=
|
||||
{},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ",i=/^\s*(https?|ftp|mailto|file):/;this.directive=function h(d,e){E(d)?(cb(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];n(a[d],function(a){try{var g=b.invoke(a);if(H(g))g={compile:S(g)};else if(!g.compile&&g.link)g.compile=S(g.link);g.priority=g.priority||0;g.name=g.name||d;g.require=
|
||||
g.require||g.controller&&g.name;g.restrict=g.restrict||"A";e.push(g)}catch(h){c(h)}});return e}])),a[d].push(e)):n(d,rb(h));return this};this.urlSanitizationWhitelist=function(a){return B(a)?(i=a,this):i};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(b,j,m,k,l,u,o,z,r){function y(a,b,c){a instanceof w||(a=w(a));n(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=w(b).wrap("<span></span>").parent()[0])});
|
||||
var d=W(a,b,a,c);return function(b,c){cb(b,"scope");for(var e=c?Ba.clone.call(a):a,j=0,g=e.length;j<g;j++){var h=e[j];(h.nodeType==1||h.nodeType==9)&&e.eq(j).data("$scope",b)}x(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function x(a,b){try{a.addClass(b)}catch(c){}}function W(a,b,c,d){function e(a,c,d,g){var h,i,k,l,o,m,u,z=[];o=0;for(m=c.length;o<m;o++)z.push(c[o]);u=o=0;for(m=j.length;o<m;u++)i=z[u],c=j[o++],h=j[o++],c?(c.scope?(k=a.$new(L(c.scope)),w(i).data("$scope",k)):k=a,(l=c.transclude)||
|
||||
!g&&b?c(h,k,i,d,function(b){return function(c){var d=a.$new();d.$$transcluded=!0;return b(d,c).bind("$destroy",$a(d,d.$destroy))}}(l||b)):c(h,k,i,p,g)):h&&h(a,i.childNodes,p,g)}for(var j=[],g,h,k,i=0;i<a.length;i++)h=new ma,g=v(a[i],[],h,d),h=(g=g.length?A(g,a[i],h,b,c):null)&&g.terminal||!a[i].childNodes||!a[i].childNodes.length?null:W(a[i].childNodes,g?g.transclude:b),j.push(g),j.push(h),k=k||g||h;return k?e:null}function v(a,b,c,j){var g=c.$attr,h;switch(a.nodeType){case 1:G(b,da(hb(a).toLowerCase()),
|
||||
"E",j);var i,k,l;h=a.attributes;for(var o=0,m=h&&h.length;o<m;o++)if(i=h[o],i.specified)k=i.name,l=da(k),Y.test(l)&&(k=l.substr(6).toLowerCase()),l=da(k.toLowerCase()),g[l]=k,c[l]=i=U(Z&&k=="href"?decodeURIComponent(a.getAttribute(k,2)):i.value),Fb(a,l)&&(c[l]=!0),s(a,b,i,l),G(b,l,"A",j);a=a.className;if(E(a)&&a!=="")for(;h=e.exec(a);)l=da(h[2]),G(b,l,"C",j)&&(c[l]=U(h[3])),a=a.substr(h.index+h[0].length);break;case 3:P(b,a.nodeValue);break;case 8:try{if(h=d.exec(a.nodeValue))l=da(h[1]),G(b,l,"M",
|
||||
j)&&(c[l]=U(h[2]))}catch(u){}}b.sort(K);return b}function A(a,b,c,d,e){function h(a,b){if(a)a.require=s.require,z.push(a);if(b)b.require=s.require,ea.push(b)}function i(a,b){var c,d="data",e=!1;if(E(a)){for(;(c=a.charAt(0))=="^"||c=="?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("$"+a+"Controller");if(!c&&!e)throw Error("No controller: "+a);}else F(a)&&(c=[],n(a,function(a){c.push(i(a,b))}));return c}function k(a,d,e,g,h){var l,v,r,D,x;l=b===e?c:pc(c,new ma(w(e),c.$attr));v=l.$$element;
|
||||
if(K){var y=/^\s*([@=&])(\??)\s*(\w*)\s*$/,s=d.$parent||d;n(K.scope,function(a,b){var c=a.match(y)||[],e=c[3]||b,g=c[2]=="?",c=c[1],h,k,i;d.$$isolateBindings[b]=c+e;switch(c){case "@":l.$observe(e,function(a){d[b]=a});l.$$observers[e].$$scope=s;l[e]&&(d[b]=j(l[e])(s));break;case "=":if(g&&!l[e])break;k=u(l[e]);i=k.assign||function(){h=d[b]=k(s);throw Error(Kb+l[e]+" (directive: "+K.name+")");};h=d[b]=k(s);d.$watch(function(){var a=k(s);a!==d[b]&&(a!==h?h=d[b]=a:i(s,a=h=d[b]));return a});break;case "&":k=
|
||||
u(l[e]);d[b]=function(a){return k(s,a)};break;default:throw Error("Invalid isolate scope definition for directive "+K.name+": "+a);}})}q&&n(q,function(a){var b={$scope:d,$element:v,$attrs:l,$transclude:h};x=a.controller;x=="@"&&(x=l[a.name]);v.data("$"+a.name+"Controller",o(x,b))});g=0;for(r=z.length;g<r;g++)try{D=z[g],D(d,v,l,D.require&&i(D.require,v))}catch(Hc){m(Hc,va(v))}a&&a(d,e.childNodes,p,h);g=0;for(r=ea.length;g<r;g++)try{D=ea[g],D(d,v,l,D.require&&i(D.require,v))}catch(J){m(J,va(v))}}for(var l=
|
||||
-Number.MAX_VALUE,z=[],ea=[],r=null,K=null,W=null,J=c.$$element=w(b),s,A,Y,G,P=d,q,na,t,B=0,C=a.length;B<C;B++){s=a[B];Y=p;if(l>s.priority)break;if(t=s.scope)O("isolated scope",K,s,J),L(t)&&(x(J,"ng-isolate-scope"),K=s),x(J,"ng-scope"),r=r||s;A=s.name;if(t=s.controller)q=q||{},O("'"+A+"' controller",q[A],s,J),q[A]=s;if(t=s.transclude)O("transclusion",G,s,J),G=s,l=s.priority,t=="element"?(Y=w(b),J=c.$$element=w(T.createComment(" "+A+": "+c[A]+" ")),b=J[0],ja(e,w(Y[0]),b),P=y(Y,d,l)):(Y=w(fb(b)).contents(),
|
||||
J.html(""),P=y(Y,d));if(s.template)if(O("template",W,s,J),W=s,t=H(s.template)?s.template(J,c):s.template,t=Lb(t),s.replace){Y=w("<div>"+U(t)+"</div>").contents();b=Y[0];if(Y.length!=1||b.nodeType!==1)throw Error(g+t);ja(e,J,b);A={$attr:{}};a=a.concat(v(b,a.splice(B+1,a.length-(B+1)),A));D(c,A);C=a.length}else J.html(t);if(s.templateUrl)O("template",W,s,J),W=s,k=$(a.splice(B,a.length-B),k,J,c,e,s.replace,P),C=a.length;else if(s.compile)try{na=s.compile(J,c,P),H(na)?h(null,na):na&&h(na.pre,na.post)}catch(I){m(I,
|
||||
va(J))}if(s.terminal)k.terminal=!0,l=Math.max(l,s.priority)}k.scope=r&&r.scope;k.transclude=G&&P;return k}function G(d,e,j,g){var l=!1;if(a.hasOwnProperty(e))for(var k,e=b.get(e+c),i=0,o=e.length;i<o;i++)try{if(k=e[i],(g===p||g>k.priority)&&k.restrict.indexOf(j)!=-1)d.push(k),l=!0}catch(u){m(u)}return l}function D(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;n(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});n(b,function(b,j){j=="class"?(x(e,b),a["class"]=
|
||||
(a["class"]?a["class"]+" ":"")+b):j=="style"?e.attr("style",e.attr("style")+";"+b):j.charAt(0)!="$"&&!a.hasOwnProperty(j)&&(a[j]=b,d[j]=c[j])})}function $(a,b,c,d,e,j,h){var i=[],o,m,u=c[0],z=a.shift(),r=t({},z,{controller:null,templateUrl:null,transclude:null,scope:null}),z=H(z.templateUrl)?z.templateUrl(c,d):z.templateUrl;c.html("");k.get(z,{cache:l}).success(function(l){var k,z,l=Lb(l);if(j){z=w("<div>"+U(l)+"</div>").contents();k=z[0];if(z.length!=1||k.nodeType!==1)throw Error(g+l);l={$attr:{}};
|
||||
ja(e,c,k);v(k,a,l);D(d,l)}else k=u,c.html(l);a.unshift(r);o=A(a,k,d,h);for(m=W(c[0].childNodes,h);i.length;){var ea=i.shift(),l=i.shift();z=i.shift();var x=i.shift(),y=k;l!==u&&(y=fb(k),ja(z,w(l),y));o(function(){b(m,ea,y,e,x)},ea,y,e,x)}i=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url);});return function(a,c,d,e,j){i?(i.push(c),i.push(d),i.push(e),i.push(j)):o(function(){b(m,c,d,e,j)},c,d,e,j)}}function K(a,b){return b.priority-a.priority}function O(a,b,c,d){if(b)throw Error("Multiple directives ["+
|
||||
b.name+", "+c.name+"] asking for "+a+" on: "+va(d));}function P(a,b){var c=j(b,!0);c&&a.push({priority:0,compile:S(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);x(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function s(a,b,c,d){var e=j(c,!0);e&&b.push({priority:100,compile:S(function(a,b,c){b=c.$$observers||(c.$$observers={});if(e=j(c[d],!0))c[d]=e(a),(b[d]||(b[d]=[])).$$inter=!0,(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,
|
||||
a)})})})}function ja(a,b,c){var d=b[0],e=d.parentNode,j,g;if(a){j=0;for(g=a.length;j<g;j++)if(a[j]==d){a[j]=c;break}}e&&e.replaceChild(c,d);c[w.expando]=d[w.expando];b[0]=c}var ma=function(a,b){this.$$element=a;this.$attr=b||{}};ma.prototype={$normalize:da,$set:function(a,b,c,d){var e=Fb(this.$$element[0],a),j=this.$$observers;e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=bb(a,"-"));if(hb(this.$$element[0])==="A"&&a==="href")q.setAttribute("href",
|
||||
b),e=q.href,e.match(i)||(this[a]=b="unsafe:"+e);c!==!1&&(b===null||b===p?this.$$element.removeAttr(d):this.$$element.attr(d,b));j&&n(j[a],function(a){try{a(b)}catch(c){m(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);z.$evalAsync(function(){e.$$inter||b(c[a])});return b}};var q=r[0].createElement("a"),ea=j.startSymbol(),J=j.endSymbol(),Lb=ea=="{{"||J=="}}"?qa:function(a){return a.replace(/\{\{/g,ea).replace(/}}/g,J)},Y=/^ngAttr[A-Z]/;return y}]}
|
||||
function da(b){return Ia(b.replace(Ic,""))}function Jc(){var b={},a=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,d){L(a)?t(b,a):b[a]=d};this.$get=["$injector","$window",function(c,d){return function(e,g){var i,f;E(e)&&(f=e.match(a),i=f[1],f=f[3],e=b.hasOwnProperty(i)?b[i]:ib(g.$scope,i,!0)||ib(d,i,!0),xa(e,i,!0));i=c.instantiate(e,g);if(f){if(typeof g.$scope!=="object")throw Error('Can not export controller as "'+f+'". No scope object provided!');g.$scope[f]=i}return i}}]}function Kc(){this.$get=
|
||||
["$window",function(b){return w(b.document)}]}function Lc(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Mc(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler",function(c,d){function e(e,h){for(var j,m,k=0,l=[],u=e.length,o=!1,z=[];k<u;)(j=e.indexOf(b,k))!=-1&&(m=e.indexOf(a,j+g))!=-1?(k!=j&&l.push(e.substring(k,j)),l.push(k=c(o=e.substring(j+g,
|
||||
m))),k.exp=o,k=m+i,o=!0):(k!=u&&l.push(e.substring(k)),k=u);if(!(u=l.length))l.push(""),u=1;if(!h||o)return z.length=u,k=function(a){try{for(var b=0,c=u,j;b<c;b++){if(typeof(j=l[b])=="function")j=j(a),j==null||j==p?j="":typeof j!="string"&&(j=ha(j));z[b]=j}return z.join("")}catch(g){d(Error("Error while interpolating: "+e+"\n"+g.toString()))}},k.exp=e,k.parts=l,k}var g=b.length,i=a.length;e.startSymbol=function(){return b};e.endSymbol=function(){return a};return e}]}function Mb(b){for(var b=b.split("/"),
|
||||
a=b.length;a--;)b[a]=ab(b[a]);return b.join("/")}function Nb(b,a){var c=jb.exec(b);a.$$protocol=c[1];a.$$host=c[3];a.$$port=N(c[5])||Oa[c[1]]||null}function Ob(b,a){var c=Pb.exec(b);a.$$path=decodeURIComponent(c[1]);a.$$search=vb(c[3]);a.$$hash=decodeURIComponent(c[5]||"");if(a.$$path&&a.$$path.charAt(0)!="/")a.$$path="/"+a.$$path}function fa(b,a,c){return a.indexOf(b)==0?a.substr(b.length):c}function Ca(b){var a=b.indexOf("#");return a==-1?b:b.substr(0,a)}function kb(b){return b.substr(0,Ca(b).lastIndexOf("/")+
|
||||
1)}function Qb(b,a){var a=a||"",c=kb(b);this.$$parse=function(a){var b={};Nb(a,b);var g=fa(c,a);if(!E(g))throw Error('Invalid url "'+a+'", missing path prefix "'+c+'".');Ob(g,b);t(this,b);if(!this.$$path)this.$$path="/";this.$$compose()};this.$$compose=function(){var a=wb(this.$$search),b=this.$$hash?"#"+ab(this.$$hash):"";this.$$url=Mb(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;if((e=fa(b,d))!==p)return d=e,(e=fa(a,e))!==p?c+(fa("/",e)||e):
|
||||
b+d;else if((e=fa(c,d))!==p)return c+e;else if(c==d+"/")return c}}function lb(b,a){var c=kb(b);this.$$parse=function(d){Nb(d,this);var e=fa(b,d)||fa(c,d);if(!E(e))throw Error('Invalid url "'+d+'", does not start with "'+b+'".');e=e.charAt(0)=="#"?fa(a,e):e;if(!E(e))throw Error('Invalid url "'+d+'", missing hash prefix "'+a+'".');Ob(e,this);this.$$compose()};this.$$compose=function(){var c=wb(this.$$search),e=this.$$hash?"#"+ab(this.$$hash):"";this.$$url=Mb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=
|
||||
b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(Ca(b)==Ca(a))return a}}function Rb(b,a){lb.apply(this,arguments);var c=kb(b);this.$$rewrite=function(d){var e;if(b==Ca(d))return d;else if(e=fa(c,d))return b+a+e;else if(c===d+"/")return c}}function Pa(b){return function(){return this[b]}}function Sb(b,a){return function(c){if(C(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Nc(){var b="",a=!1;this.hashPrefix=function(a){return B(a)?(b=a,this):b};this.html5Mode=function(b){return B(b)?
|
||||
(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function i(a){c.$broadcast("$locationChangeSuccess",f.absUrl(),a)}var f,h=d.baseHref(),j=d.url();a?(h=h?j.substring(0,j.indexOf("/",j.indexOf("//")+2))+h:j,e=e.history?Qb:Rb):(h=Ca(j),e=lb);f=new e(h,"#"+b);f.$$parse(f.$$rewrite(j));g.bind("click",function(a){if(!a.ctrlKey&&!(a.metaKey||a.which==2)){for(var b=w(a.target);I(b[0].nodeName)!=="a";)if(b[0]===g[0]||!(b=b.parent())[0])return;var e=b.prop("href"),
|
||||
j=f.$$rewrite(e);e&&!b.attr("target")&&j&&!a.isDefaultPrevented()&&(a.preventDefault(),j!=d.url()&&(f.$$parse(j),c.$apply(),M.angular["ff-684208-preventDefault"]=!0))}});f.absUrl()!=j&&d.url(f.absUrl(),!0);d.onUrlChange(function(a){f.absUrl()!=a&&(c.$broadcast("$locationChangeStart",a,f.absUrl()).defaultPrevented?d.url(f.absUrl()):(c.$evalAsync(function(){var b=f.absUrl();f.$$parse(a);i(b)}),c.$$phase||c.$digest()))});var m=0;c.$watch(function(){var a=d.url(),b=f.$$replace;if(!m||a!=f.absUrl())m++,
|
||||
c.$evalAsync(function(){c.$broadcast("$locationChangeStart",f.absUrl(),a).defaultPrevented?f.$$parse(a):(d.url(f.absUrl(),b),i(a))});f.$$replace=!1;return m});return f}]}function Oc(){var b=!0,a=this;this.debugEnabled=function(a){return B(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&a.stack.indexOf(a.message)===-1?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=
|
||||
c.console||{},e=b[a]||b.log||q;return e.apply?function(){var a=[];n(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,b)}}return{log:e("log"),warn:e("warn"),info:e("info"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Pc(b,a){function c(a){return a.indexOf(r)!=-1}function d(a){a=a||1;return o+a<b.length?b.charAt(o+a):!1}function e(a){return"0"<=a&&a<="9"}function g(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||
|
||||
a=="\u000b"||a=="\u00a0"}function i(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"}function f(a){return a=="-"||a=="+"||e(a)}function h(a,c,d){d=d||o;throw Error("Lexer Error: "+a+" at column"+(B(c)?"s "+c+"-"+o+" ["+b.substring(c,d)+"]":" "+d)+" in expression ["+b+"].");}function j(){for(var a="",c=o;o<b.length;){var j=I(b.charAt(o));if(j=="."||e(j))a+=j;else{var g=d();if(j=="e"&&f(g))a+=j;else if(f(j)&&g&&e(g)&&a.charAt(a.length-1)=="e")a+=j;else if(f(j)&&(!g||!e(g))&&a.charAt(a.length-
|
||||
1)=="e")h("Invalid exponent");else break}o++}a*=1;l.push({index:c,text:a,json:!0,fn:function(){return a}})}function m(){for(var c="",d=o,f,j,h,k;o<b.length;){k=b.charAt(o);if(k=="."||i(k)||e(k))k=="."&&(f=o),c+=k;else break;o++}if(f)for(j=o;j<b.length;){k=b.charAt(j);if(k=="("){h=c.substr(f-d+1);c=c.substr(0,f-d);o=j;break}if(g(k))j++;else break}d={index:d,text:c};if(Da.hasOwnProperty(c))d.fn=d.json=Da[c];else{var m=Tb(c,a);d.fn=t(function(a,b){return m(a,b)},{assign:function(a,b){return Ub(a,c,b)}})}l.push(d);
|
||||
h&&(l.push({index:f,text:".",json:!1}),l.push({index:f+1,text:h,json:!1}))}function k(a){var c=o;o++;for(var d="",e=a,f=!1;o<b.length;){var j=b.charAt(o);e+=j;if(f)j=="u"?(j=b.substring(o+1,o+5),j.match(/[\da-f]{4}/i)||h("Invalid unicode escape [\\u"+j+"]"),o+=4,d+=String.fromCharCode(parseInt(j,16))):(f=Qc[j],d+=f?f:j),f=!1;else if(j=="\\")f=!0;else if(j==a){o++;l.push({index:c,text:e,string:d,json:!0,fn:function(){return d}});return}else d+=j;o++}h("Unterminated quote",c)}for(var l=[],u,o=0,z=[],
|
||||
r,y=":";o<b.length;){r=b.charAt(o);if(c("\"'"))k(r);else if(e(r)||c(".")&&e(d()))j();else if(i(r)){if(m(),"{,".indexOf(y)!=-1&&z[0]=="{"&&(u=l[l.length-1]))u.json=u.text.indexOf(".")==-1}else if(c("(){}[].,;:?"))l.push({index:o,text:r,json:":[,".indexOf(y)!=-1&&c("{[")||c("}]:,")}),c("{[")&&z.unshift(r),c("}]")&&z.shift(),o++;else if(g(r)){o++;continue}else{var x=r+d(),n=x+d(2),v=Da[r],A=Da[x],G=Da[n];G?(l.push({index:o,text:n,fn:G}),o+=3):A?(l.push({index:o,text:x,fn:A}),o+=2):v?(l.push({index:o,
|
||||
text:r,fn:v,json:"[,:".indexOf(y)!=-1&&c("+-")}),o+=1):h("Unexpected next character ",o,o+1)}y=r}return l}function Rc(b,a,c,d){function e(a,c){throw Error("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}function g(){if(O.length===0)throw Error("Unexpected end of expression: "+b);return O[0]}function i(a,b,c,d){if(O.length>0){var e=O[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,
|
||||
c,d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),O.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function j(a,b){return t(function(c,d){return a(c,d,b)},{constant:b.constant})}function m(a,b,c){return t(function(d,e){return a(d,e)?b(d,e):c(d,e)},{constant:a.constant&&b.constant&&c.constant})}function k(a,b,c){return t(function(d,e){return b(d,e,a,c)},{constant:a.constant&&c.constant})}function l(){for(var a=[];;)if(O.length>0&&!i("}",")",";","]")&&a.push(w()),
|
||||
!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e<a.length;e++){var f=a[e];f&&(d=f(b,c))}return d}}function u(){for(var a=f(),b=c(a.text),d=[];;)if(a=f(":"))d.push(P());else{var e=function(a,c,e){for(var e=[e],f=0;f<d.length;f++)e.push(d[f](a,c));return b.apply(a,e)};return function(){return e}}}function o(){var a=z(),b,c;if(f("?"))if(b=o(),c=f(":"))return m(a,b,o());else e("expected :",c);else return a}function z(){for(var a=r(),b;;)if(b=f("||"))a=k(a,b.fn,r());else return a}function r(){var a=
|
||||
y(),b;if(b=f("&&"))a=k(a,b.fn,r());return a}function y(){var a=x(),b;if(b=f("==","!=","===","!=="))a=k(a,b.fn,y());return a}function x(){var a;a=n();for(var b;b=f("+","-");)a=k(a,b.fn,n());if(b=f("<",">","<=",">="))a=k(a,b.fn,x());return a}function n(){for(var a=v(),b;b=f("*","/","%");)a=k(a,b.fn,v());return a}function v(){var a;return f("+")?A():(a=f("-"))?k($,a.fn,v()):(a=f("!"))?j(a.fn,v()):A()}function A(){var a;if(f("("))a=w(),h(")");else if(f("["))a=G();else if(f("{"))a=D();else{var b=f();(a=
|
||||
b.fn)||e("not a primary expression",b);if(b.json)a.constant=a.literal=!0}for(var c;b=f("(","[",".");)b.text==="("?(a=s(a,c),c=null):b.text==="["?(c=a,a=ma(a)):b.text==="."?(c=a,a=ja(a)):e("IMPOSSIBLE");return a}function G(){var a=[],b=!0;if(g().text!="]"){do{var c=P();a.push(c);c.constant||(b=!1)}while(f(","))}h("]");return t(function(b,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e](b,c));return d},{literal:!0,constant:b})}function D(){var a=[],b=!0;if(g().text!="}"){do{var c=f(),c=c.string||c.text;
|
||||
h(":");var d=P();a.push({key:c,value:d});d.constant||(b=!1)}while(f(","))}h("}");return t(function(b,c){for(var d={},e=0;e<a.length;e++){var f=a[e];d[f.key]=f.value(b,c)}return d},{literal:!0,constant:b})}var $=S(0),K,O=Pc(b,d),P=function(){var a=o(),c,d;return(d=f("="))?(a.assign||e("implies assignment but ["+b.substring(0,d.index)+"] can not be assigned to",d),c=o(),function(b,d){return a.assign(b,c(b,d),d)}):a},s=function(a,b){var c=[];if(g().text!=")"){do c.push(P());while(f(","))}h(")");return function(d,
|
||||
e){for(var f=[],j=b?b(d,e):d,g=0;g<c.length;g++)f.push(c[g](d,e));g=a(d,e,j)||q;return g.apply?g.apply(j,f):g(f[0],f[1],f[2],f[3],f[4])}},ja=function(a){var b=f().text,c=Tb(b,d);return t(function(b,d,e){return c(e||a(b,d),d)},{assign:function(c,d,e){return Ub(a(c,e),b,d)}})},ma=function(a){var b=P();h("]");return t(function(c,d){var e=a(c,d),f=b(c,d),j;if(!e)return p;if((e=e[f])&&e.then){j=e;if(!("$$v"in e))j.$$v=p,j.then(function(a){j.$$v=a});e=e.$$v}return e},{assign:function(c,d,e){return a(c,
|
||||
e)[b(c,e)]=d}})},w=function(){for(var a=P(),b;;)if(b=f("|"))a=k(a,b.fn,u());else return a};a?(P=z,s=ja=ma=w=function(){e("is not valid json",{text:b,index:0})},K=A()):K=l();O.length!==0&&e("is an unexpected token",O[0]);K.literal=!!K.literal;K.constant=!!K.constant;return K}function Ub(b,a,c){for(var a=a.split("."),d=0;a.length>1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function ib(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i<g;i++)d=a[i],b&&(b=
|
||||
(e=b)[d]);return!c&&H(b)?$a(e,b):b}function Vb(b,a,c,d,e){return function(g,i){var f=i&&i.hasOwnProperty(b)?i:g,h;if(f===null||f===p)return f;if((f=f[b])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!a||f===null||f===p)return f;if((f=f[a])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!c||f===null||f===p)return f;if((f=f[c])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!d||f===null||f===p)return f;if((f=
|
||||
f[d])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!e||f===null||f===p)return f;if((f=f[e])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}return f}}function Tb(b,a){if(mb.hasOwnProperty(b))return mb[b];var c=b.split("."),d=c.length,e;if(a)e=d<6?Vb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,j;do j=Vb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=p,a=j;while(e<d);return j};else{var g="var l, fn, p;\n";n(c,function(a,b){g+="if(s === null || s === undefined) return s;\nl=s;\ns="+
|
||||
(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'});g+="return s;";e=Function("s","k",g);e.toString=function(){return g}}return mb[b]=e}function Sc(){var b={};this.$get=["$filter","$sniffer",function(a,c){return function(d){switch(typeof d){case "string":return b.hasOwnProperty(d)?b[d]:b[d]=Rc(d,!1,a,c.csp);case "function":return d;default:return q}}}]}function Tc(){this.$get=
|
||||
["$rootScope","$exceptionHandler",function(b,a){return Uc(function(a){b.$evalAsync(a)},a)}]}function Uc(b,a){function c(a){return a}function d(a){return i(a)}var e=function(){var f=[],h,j;return j={resolve:function(a){if(f){var c=f;f=p;h=g(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],h.then(a[0],a[1])})}},reject:function(a){j.resolve(i(a))},promise:{then:function(b,j){var g=e(),i=function(d){try{g.resolve((b||c)(d))}catch(e){a(e),g.reject(e)}},o=function(b){try{g.resolve((j||
|
||||
d)(b))}catch(c){a(c),g.reject(c)}};f?f.push([i,o]):h.then(i,o);return g.promise},always:function(a){function b(a,c){var d=e();c?d.resolve(a):d.reject(a);return d.promise}function d(e,f){var j=null;try{j=(a||c)()}catch(g){return b(g,!1)}return j&&j.then?j.then(function(){return b(e,f)},function(a){return b(a,!1)}):b(e,f)}return this.then(function(a){return d(a,!0)},function(a){return d(a,!1)})}}}},g=function(a){return a&&a.then?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},
|
||||
i=function(a){return{then:function(c,j){var g=e();b(function(){g.resolve((j||d)(a))});return g.promise}}};return{defer:e,reject:i,when:function(f,h,j){var m=e(),k,l=function(b){try{return(h||c)(b)}catch(d){return a(d),i(d)}},u=function(b){try{return(j||d)(b)}catch(c){return a(c),i(c)}};b(function(){g(f).then(function(a){k||(k=!0,m.resolve(g(a).then(l,u)))},function(a){k||(k=!0,m.resolve(u(a)))})});return m.promise},all:function(a){var b=e(),c=0,d=F(a)?[]:{};n(a,function(a,e){c++;g(a).then(function(a){d.hasOwnProperty(e)||
|
||||
(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});c===0&&b.resolve(d);return b.promise}}}function Vc(){var b={};this.when=function(a,c){b[a]=t({reloadOnSearch:!0,caseInsensitiveMatch:!1},c);if(a){var d=a[a.length-1]=="/"?a.substr(0,a.length-1):a+"/";b[d]={redirectTo:a}}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(a,c,d,e,g,i,f){function h(a,b,c){for(var b=
|
||||
"^"+b.replace(/[-\/\\^$:*+?.()|[\]{}]/g,"\\$&")+"$",d="",e=[],f={},j=/\\([:*])(\w+)/g,g,i=0;(g=j.exec(b))!==null;){d+=b.slice(i,g.index);switch(g[1]){case ":":d+="([^\\/]*)";break;case "*":d+="(.*)"}e.push(g[2]);i=j.lastIndex}d+=b.substr(i);var h=a.match(RegExp(d,c.caseInsensitiveMatch?"i":""));h&&n(e,function(a,b){f[a]=h[b+1]});return h?f:null}function j(){var b=m(),j=u.current;if(b&&j&&b.$$route===j.$$route&&ia(b.pathParams,j.pathParams)&&!b.reloadOnSearch&&!l)j.params=b.params,V(j.params,d),a.$broadcast("$routeUpdate",
|
||||
j);else if(b||j)l=!1,a.$broadcast("$routeChangeStart",b,j),(u.current=b)&&b.redirectTo&&(E(b.redirectTo)?c.path(k(b.redirectTo,b.params)).search(b.params).replace():c.url(b.redirectTo(b.pathParams,c.path(),c.search())).replace()),e.when(b).then(function(){if(b){var a=t({},b.resolve),c;n(a,function(b,c){a[c]=E(b)?g.get(b):g.invoke(b)});if(B(c=b.template))H(c)&&(c=c(b.params));else if(B(c=b.templateUrl))if(H(c)&&(c=c(b.params)),B(c))b.loadedTemplateUrl=c,c=i.get(c,{cache:f}).then(function(a){return a.data});
|
||||
B(c)&&(a.$template=c);return e.all(a)}}).then(function(c){if(b==u.current){if(b)b.locals=c,V(b.params,d);a.$broadcast("$routeChangeSuccess",b,j)}},function(c){b==u.current&&a.$broadcast("$routeChangeError",b,j,c)})}function m(){var a,d;n(b,function(b,e){if(!d&&(a=h(c.path(),e,b)))d=tb(b,{params:t({},c.search(),a),pathParams:a}),d.$$route=b});return d||b[null]&&tb(b[null],{params:{},pathParams:{}})}function k(a,b){var c=[];n((a||"").split(":"),function(a,d){if(d==0)c.push(a);else{var e=a.match(/(\w+)(.*)/),
|
||||
f=e[1];c.push(b[f]);c.push(e[2]||"");delete b[f]}});return c.join("")}var l=!1,u={routes:b,reload:function(){l=!0;a.$evalAsync(j)}};a.$on("$locationChangeSuccess",j);return u}]}function Wc(){this.$get=S({})}function Xc(){var b=10;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){function e(){this.$id=Fa();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;
|
||||
this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$listeners={};this.$$isolateBindings={}}function g(a){if(h.$$phase)throw Error(h.$$phase+" already in progress");h.$$phase=a}function i(a,b){var c=d(a);xa(c,b);return c}function f(){}e.prototype={$new:function(a){if(H(a))throw Error("API-CHANGE: Use $controller to instantiate controllers.");a?(a=new e,a.$root=this.$root):(a=function(){},a.prototype=this,a=new a,a.$id=Fa());a["this"]=a;a.$$listeners={};a.$parent=this;a.$$watchers=
|
||||
a.$$nextSibling=a.$$childHead=a.$$childTail=null;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,c){var d=i(a,"watch"),e=this.$$watchers,g={fn:b,last:f,get:d,exp:a,eq:!!c};if(!H(b)){var h=i(b||q,"listener");g.fn=function(a,b,c){h(c)}}if(typeof a=="string"&&d.constant){var r=g.fn;g.fn=function(a,b,c){r.call(this,a,b,c);ta(e,g)}}if(!e)e=this.$$watchers=[];e.unshift(g);return function(){ta(e,
|
||||
g)}},$watchCollection:function(a,b){var c=this,e,f,g=0,i=d(a),h=[],n={},x=0;return this.$watch(function(){f=i(c);var a,b;if(L(f))if(Xa(f)){if(e!==h)e=h,x=e.length=0,g++;a=f.length;if(x!==a)g++,e.length=x=a;for(b=0;b<a;b++)e[b]!==f[b]&&(g++,e[b]=f[b])}else{e!==n&&(e=n={},x=0,g++);a=0;for(b in f)f.hasOwnProperty(b)&&(a++,e.hasOwnProperty(b)?e[b]!==f[b]&&(g++,e[b]=f[b]):(x++,e[b]=f[b],g++));if(x>a)for(b in g++,e)e.hasOwnProperty(b)&&!f.hasOwnProperty(b)&&(x--,delete e[b])}else e!==f&&(e=f,g++);return g},
|
||||
function(){b(f,e,c)})},$digest:function(){var a,d,e,i,u=this.$$asyncQueue,o,z,r=b,n,x=[],p,v;g("$digest");do{z=!1;for(n=this;u.length;)try{n.$eval(u.shift())}catch(A){c(A)}do{if(i=n.$$watchers)for(o=i.length;o--;)try{if(a=i[o],(d=a.get(n))!==(e=a.last)&&!(a.eq?ia(d,e):typeof d=="number"&&typeof e=="number"&&isNaN(d)&&isNaN(e)))z=!0,a.last=a.eq?V(d):d,a.fn(d,e===f?d:e,n),r<5&&(p=4-r,x[p]||(x[p]=[]),v=H(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,v+="; newVal: "+ha(d)+"; oldVal: "+ha(e),x[p].push(v))}catch(G){c(G)}if(!(i=
|
||||
n.$$childHead||n!==this&&n.$$nextSibling))for(;n!==this&&!(i=n.$$nextSibling);)n=n.$parent}while(n=i);if(z&&!r--)throw h.$$phase=null,Error(b+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+ha(x));}while(z||u.length);h.$$phase=null},$destroy:function(){if(!(h==this||this.$$destroyed)){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;if(a.$$childHead==this)a.$$childHead=this.$$nextSibling;if(a.$$childTail==this)a.$$childTail=this.$$prevSibling;
|
||||
if(this.$$prevSibling)this.$$prevSibling.$$nextSibling=this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling=this.$$prevSibling;this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$$asyncQueue.push(a)},$apply:function(a){try{return g("$apply"),this.$eval(a)}catch(b){c(b)}finally{h.$$phase=null;try{h.$digest()}catch(d){throw c(d),d;}}},$on:function(a,b){var c=this.$$listeners[a];
|
||||
c||(this.$$listeners[a]=c=[]);c.push(b);return function(){c[Ga(c,b)]=null}},$emit:function(a,b){var d=[],e,f=this,g=!1,i={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1},h=[i].concat(ka.call(arguments,1)),n,x;do{e=f.$$listeners[a]||d;i.currentScope=f;n=0;for(x=e.length;n<x;n++)if(e[n])try{if(e[n].apply(null,h),g)return i}catch(p){c(p)}else e.splice(n,1),n--,x--;f=f.$parent}while(f);return i},$broadcast:function(a,b){var d=
|
||||
this,e=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},g=[f].concat(ka.call(arguments,1)),i,h;do{d=e;f.currentScope=d;e=d.$$listeners[a]||[];i=0;for(h=e.length;i<h;i++)if(e[i])try{e[i].apply(null,g)}catch(n){c(n)}else e.splice(i,1),i--,h--;if(!(e=d.$$childHead||d!==this&&d.$$nextSibling))for(;d!==this&&!(e=d.$$nextSibling);)d=d.$parent}while(d=e);return f}};var h=new e;return h}]}function Yc(){this.$get=["$window","$document",function(b,a){var c=
|
||||
{},d=N((/android (\d+)/.exec(I((b.navigator||{}).userAgent))||[])[1]),e=a[0]||{},g,i=/^(Moz|webkit|O|ms)(?=[A-Z])/,f=e.body&&e.body.style,h=!1,j=!1;if(f){for(var m in f)if(h=i.exec(m)){g=h[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}h=!!("transition"in f||g+"Transition"in f);j=!!("animation"in f||g+"Animation"in f)}return{history:!(!b.history||!b.history.pushState||d<4),hashchange:"onhashchange"in b&&(!e.documentMode||e.documentMode>7),hasEvent:function(a){if(a=="input"&&Z==9)return!1;if(C(c[a])){var b=
|
||||
e.createElement("div");c[a]="on"+a in b}return c[a]},csp:e.securityPolicy?e.securityPolicy.isActive:!1,vendorPrefix:g,transitions:h,animations:j}}]}function Zc(){this.$get=S(M)}function Wb(b){var a={},c,d,e;if(!b)return a;n(b.split("\n"),function(b){e=b.indexOf(":");c=I(U(b.substr(0,e)));d=U(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function $c(b,a){var c=ad.exec(b);if(c==null)return!0;var d={protocol:c[2],host:c[4],port:N(c[6])||Oa[c[2]]||null,relativeProtocol:c[2]===p||c[2]===""},
|
||||
c=jb.exec(a),c={protocol:c[1],host:c[3],port:N(c[5])||Oa[c[1]]||null};return(d.protocol==c.protocol||d.relativeProtocol)&&d.host==c.host&&(d.port==c.port||d.relativeProtocol&&c.port==Oa[c.protocol])}function Xb(b){var a=L(b)?b:p;return function(c){a||(a=Wb(b));return c?a[I(c)]||null:a}}function Yb(b,a,c){if(H(c))return c(b,a);n(c,function(c){b=c(b,a)});return b}function bd(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d={"Content-Type":"application/json;charset=utf-8"},e=this.defaults=
|
||||
{transformResponse:[function(d){E(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=ub(d,!0)));return d}],transformRequest:[function(a){return L(a)&&Ea.apply(a)!=="[object File]"?ha(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:d,put:d,patch:d},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},g=this.interceptors=[],i=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,d,k,l){function u(a){function c(a){var b=
|
||||
t({},a,{data:Yb(a.data,a.headers,d.transformResponse)});return 200<=a.status&&a.status<300?b:k.reject(b)}var d={transformRequest:e.transformRequest,transformResponse:e.transformResponse},f={};t(d,a);d.headers=f;d.method=oa(d.method);t(f,e.headers.common,e.headers[I(d.method)],a.headers);(a=$c(d.url,b.url())?b.cookies()[d.xsrfCookieName||e.xsrfCookieName]:p)&&(f[d.xsrfHeaderName||e.xsrfHeaderName]=a);var g=[function(a){var b=Yb(a.data,Xb(f),a.transformRequest);C(a.data)&&delete f["Content-Type"];if(C(a.withCredentials)&&
|
||||
!C(e.withCredentials))a.withCredentials=e.withCredentials;return o(a,b,f).then(c,c)},p],j=k.when(d);for(n(y,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;)var a=g.shift(),i=g.shift(),j=j.then(a,i);j.success=function(a){j.then(function(b){a(b.data,b.status,b.headers,d)});return j};j.error=function(a){j.then(null,function(b){a(b.data,b.status,b.headers,d)});return j};return j}function o(b,c,g){function j(a,
|
||||
b,c){n&&(200<=a&&a<300?n.put(s,[a,b,Wb(c)]):n.remove(s));i(b,a,c);d.$$phase||d.$apply()}function i(a,c,d){c=Math.max(c,0);(200<=c&&c<300?l.resolve:l.reject)({data:a,status:c,headers:Xb(d),config:b})}function h(){var a=Ga(u.pendingRequests,b);a!==-1&&u.pendingRequests.splice(a,1)}var l=k.defer(),o=l.promise,n,p,s=z(b.url,b.params);u.pendingRequests.push(b);o.then(h,h);if((b.cache||e.cache)&&b.cache!==!1&&b.method=="GET")n=L(b.cache)?b.cache:L(e.cache)?e.cache:r;if(n)if(p=n.get(s))if(p.then)return p.then(h,
|
||||
h),p;else F(p)?i(p[1],p[0],V(p[2])):i(p,200,{});else n.put(s,o);p||a(b.method,s,c,j,g,b.timeout,b.withCredentials,b.responseType);return o}function z(a,b){if(!b)return a;var c=[];nc(b,function(a,b){a==null||a==p||(F(a)||(a=[a]),n(a,function(a){L(a)&&(a=ha(a));c.push(wa(b)+"="+wa(a))}))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var r=c("$http"),y=[];n(g,function(a){y.unshift(E(a)?l.get(a):l.invoke(a))});n(i,function(a,b){var c=E(a)?l.get(a):l.invoke(a);y.splice(b,0,{response:function(a){return c(k.when(a))},
|
||||
responseError:function(a){return c(k.reject(a))}})});u.pendingRequests=[];(function(a){n(arguments,function(a){u[a]=function(b,c){return u(t(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){n(arguments,function(a){u[a]=function(b,c,d){return u(t(d||{},{method:a,url:b,data:c}))}})})("post","put");u.defaults=e;return u}]}function cd(){this.$get=["$browser","$window","$document",function(b,a,c){return dd(b,ed,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}
|
||||
function dd(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;Z?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c);return d}return function(e,h,j,m,k,l,u,o){function z(){p=-1;t&&t();v&&v.abort()}function r(a,d,e,f){var j=(h.match(jb)||["",g])[1];A&&c.cancel(A);t=v=null;d=j=="file"?e?200:404:d;a(d==1223?204:d,e,f);b.$$completeOutstandingRequest(q)}
|
||||
var p;b.$$incOutstandingRequestCount();h=h||b.url();if(I(e)=="jsonp"){var x="_"+(d.counter++).toString(36);d[x]=function(a){d[x].data=a};var t=i(h.replace("JSON_CALLBACK","angular.callbacks."+x),function(){d[x].data?r(m,200,d[x].data):r(m,p||-2);delete d[x]})}else{var v=new a;v.open(e,h,!0);n(k,function(a,b){a&&v.setRequestHeader(b,a)});v.onreadystatechange=function(){if(v.readyState==4){var a=v.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified",
|
||||
"Pragma"];a||(a="",n(b,function(b){var c=v.getResponseHeader(b);c&&(a+=b+": "+c+"\n")}));r(m,p||v.status,v.responseType?v.response:v.responseText,a)}};if(u)v.withCredentials=!0;if(o)v.responseType=o;v.send(j||"")}if(l>0)var A=c(z,l);else l&&l.then&&l.then(z)}}function fd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",
|
||||
posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",
|
||||
mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function gd(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var j=c.defer(),m=j.promise,k=B(h)&&!h,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}k||b.$apply()},f),h=function(){delete g[m.$$timeoutId]};m.$$timeoutId=f;g[f]=j;m.then(h,h);return m}var g={};e.cancel=function(b){return b&&b.$$timeoutId in
|
||||
g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Zb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",$b);a("date",ac);a("filter",hd);a("json",id);a("limitTo",jd);a("lowercase",kd);a("number",bc);a("orderBy",cc);a("uppercase",ld)}function hd(){return function(b,a,c){if(!F(b))return b;var d=[];d.check=function(a){for(var b=0;b<d.length;b++)if(!d[b](a))return!1;
|
||||
return!0};switch(typeof c){case "function":break;case "boolean":if(c==!0){c=function(a,b){return Ha.equals(a,b)};break}default:c=function(a,b){b=(""+b).toLowerCase();return(""+a).toLowerCase().indexOf(b)>-1}}var e=function(a,b){if(typeof b=="string"&&b.charAt(0)==="!")return!e(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if(d.charAt(0)!=="$"&&e(a[d],b))return!0}return!1;case "array":for(d=
|
||||
0;d<a.length;d++)if(e(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var g in a)g=="$"?function(){if(a[g]){var b=g;d.push(function(c){return e(c,a[b])})}}():function(){if(a[g]){var b=g;d.push(function(c){return e(ib(c,b),a[b])})}}();break;case "function":d.push(a);break;default:return b}for(var i=[],f=0;f<b.length;f++){var h=b[f];d.check(h)&&i.push(h)}return i}}function $b(b){var a=b.NUMBER_FORMATS;return function(b,
|
||||
d){if(C(d))d=a.CURRENCY_SYM;return dc(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function bc(b){var a=b.NUMBER_FORMATS;return function(b,d){return dc(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function dc(b,a,c,d,e){if(isNaN(b)||!isFinite(b))return"";var g=b<0,b=Math.abs(b),i=b+"",f="",h=[],j=!1;if(i.indexOf("e")!==-1){var m=i.match(/([\d\.]+)e(-?)(\d+)/);m&&m[2]=="-"&&m[3]>e+1?i="0":(f=i,j=!0)}if(!j){i=(i.split(ec)[1]||"").length;C(e)&&(e=Math.min(Math.max(a.minFrac,i),
|
||||
a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(ec),i=b[0],b=b[1]||"",j=0,m=a.lgSize,k=a.gSize;if(i.length>=m+k)for(var j=i.length-m,l=0;l<j;l++)(j-l)%k===0&&l!==0&&(f+=c),f+=i.charAt(l);for(l=j;l<i.length;l++)(i.length-l)%m===0&&l!==0&&(f+=c),f+=i.charAt(l);for(;b.length<e;)b+="0";e&&e!=="0"&&(f+=d+b.substr(0,e))}h.push(g?a.negPre:a.posPre);h.push(f);h.push(g?a.negSuf:a.posSuf);return h.join("")}function nb(b,a,c){var d="";b<0&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=
|
||||
b.substr(b.length-a));return d+b}function Q(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(c>0||e>-c)e+=c;e===0&&c==-12&&(e=12);return nb(e,a,d)}}function Qa(b,a){return function(c,d){var e=c["get"+b](),g=oa(a?"SHORT"+b:b);return d[g][e]}}function ac(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,i=0,f=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours;b[9]&&(g=N(b[9]+b[10]),i=N(b[9]+b[11]));f.call(a,N(b[1]),N(b[2])-1,N(b[3]));g=N(b[4]||0)-g;i=N(b[5]||0)-i;f=
|
||||
N(b[6]||0);b=Math.round(parseFloat("0."+(b[7]||0))*1E3);h.call(a,g,i,f,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;E(c)&&(c=md.test(c)?N(c):a(c));Ya(c)&&(c=new Date(c));if(!ra(c))return c;for(;e;)(h=nd.exec(e))?(i=i.concat(ka.call(h,1)),e=i.pop()):(i.push(e),e=null);n(i,function(a){f=od[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,
|
||||
"").replace(/''/g,"'")});return g}}function id(){return function(b){return ha(b,!0)}}function jd(){return function(b,a){if(!F(b)&&!E(b))return b;a=N(a);if(E(b))return a?a>=0?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function cc(b){return function(a,c,d){function e(a,b){return ua(b)?function(b,c){return a(c,b)}:a}if(!F(a))return a;if(!c)return a;for(var c=F(c)?c:[c],c=
|
||||
Za(c,function(a){var c=!1,d=a||qa;if(E(a)){if(a.charAt(0)=="+"||a.charAt(0)=="-")c=a.charAt(0)=="-",a=a.substring(1);d=b(a)}return e(function(a,b){var c;c=d(a);var e=d(b),f=typeof c,g=typeof e;f==g?(f=="string"&&(c=c.toLowerCase()),f=="string"&&(e=e.toLowerCase()),c=c===e?0:c<e?-1:1):c=f<g?-1:1;return c},c)}),g=[],i=0;i<a.length;i++)g.push(a[i]);return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(e!==0)return e}return 0},d))}}function aa(b){H(b)&&(b={link:b});b.restrict=b.restrict||
|
||||
"AC";return S(b)}function fc(b,a){function c(a,c){c=c?"-"+bb(c,"-"):"";b.removeClass((a?Ra:Sa)+c).addClass((a?Sa:Ra)+c)}var d=this,e=b.parent().controller("form")||Ta,g=0,i=d.$error={},f=[];d.$name=a.name;d.$dirty=!1;d.$pristine=!0;d.$valid=!0;d.$invalid=!1;e.$addControl(d);b.addClass(pa);c(!0);d.$addControl=function(a){f.push(a);a.$name&&!d.hasOwnProperty(a.$name)&&(d[a.$name]=a)};d.$removeControl=function(a){a.$name&&d[a.$name]===a&&delete d[a.$name];n(i,function(b,c){d.$setValidity(c,!0,a)});ta(f,
|
||||
a)};d.$setValidity=function(a,b,f){var k=i[a];if(b){if(k&&(ta(k,f),!k.length)){g--;if(!g)c(b),d.$valid=!0,d.$invalid=!1;i[a]=!1;c(!0,a);e.$setValidity(a,!0,d)}}else{g||c(b);if(k){if(Ga(k,f)!=-1)return}else i[a]=k=[],g++,c(!1,a),e.$setValidity(a,!1,d);k.push(f);d.$valid=!1;d.$invalid=!0}};d.$setDirty=function(){b.removeClass(pa).addClass(Ua);d.$dirty=!0;d.$pristine=!1;e.$setDirty()};d.$setPristine=function(){b.removeClass(Ua).addClass(pa);d.$dirty=!1;d.$pristine=!0;n(f,function(a){a.$setPristine()})}}
|
||||
function X(b){return C(b)||b===""||b===null||b!==b}function Va(b,a,c,d,e,g){var i=function(){var e=a.val();if(ua(c.ngTrim||"T"))e=U(e);d.$viewValue!==e&&b.$apply(function(){d.$setViewValue(e)})};if(e.hasEvent("input"))a.bind("input",i);else{var f,h=function(){f||(f=g.defer(function(){i();f=null}))};a.bind("keydown",function(a){a=a.keyCode;a===91||15<a&&a<19||37<=a&&a<=40||h()});a.bind("change",i);e.hasEvent("paste")&&a.bind("paste cut",h)}d.$render=function(){a.val(X(d.$viewValue)?"":d.$viewValue)};
|
||||
var j=c.ngPattern,m=function(a,b){return X(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),p)};j&&((e=j.match(/^\/(.*)\/([gim]*)$/))?(j=RegExp(e[1],e[2]),e=function(a){return m(j,a)}):e=function(a){var c=b.$eval(j);if(!c||!c.test)throw Error("Expected "+j+" to be a RegExp but was "+c);return m(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var k=N(c.ngMinlength),e=function(a){return!X(a)&&a.length<k?(d.$setValidity("minlength",!1),p):(d.$setValidity("minlength",
|
||||
!0),a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var l=N(c.ngMaxlength),e=function(a){return!X(a)&&a.length>l?(d.$setValidity("maxlength",!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}}function ob(b,a){b="ngClass"+b;return aa(function(c,d,e){function g(b){if(a===!0||c.$index%2===a)h&&!ia(b,h)&&i(h),f(b);h=V(b)}function i(a){L(a)&&!F(a)&&(a=Za(a,function(a,b){if(a)return b}));d.removeClass(F(a)?a.join(" "):a)}function f(a){L(a)&&!F(a)&&(a=Za(a,
|
||||
function(a,b){if(a)return b}));a&&d.addClass(F(a)?a.join(" "):a)}var h=p;c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var h=d&1;h!==g&1&&(h===a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var I=function(b){return E(b)?b.toLowerCase():b},oa=function(b){return E(b)?b.toUpperCase():b},Z=N((/msie (\d+)/.exec(I(navigator.userAgent))||[])[1]),w,ga,ka=[].slice,Wa=[].push,Ea=Object.prototype.toString,mc=M.angular,Ha=M.angular||(M.angular=
|
||||
{}),Aa,hb,ba=["0","0","0"];q.$inject=[];qa.$inject=[];hb=Z<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?oa(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var sc=/[A-Z]/g,pd={full:"1.1.5",major:1,minor:1,dot:5,codeName:"triangle-squarification"},Ka=R.cache={},Ja=R.expando="ng-"+(new Date).getTime(),wc=1,gc=M.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},gb=
|
||||
M.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},uc=/([\:\-\_]+(.))/g,vc=/^moz([A-Z])/,Ba=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;T.readyState==="complete"?setTimeout(a):(this.bind("DOMContentLoaded",a),R(M).bind("load",a))},toString:function(){var b=[];n(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?w(this[b]):w(this[this.length+b])},length:0,push:Wa,sort:[].sort,
|
||||
splice:[].splice},Na={};n("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(b){Na[I(b)]=b});var Gb={};n("input,select,option,textarea,button,form,details".split(","),function(b){Gb[oa(b)]=!0});n({data:Bb,inheritedData:Ma,scope:function(b){return Ma(b,"$scope")},controller:Eb,injector:function(b){return Ma(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:La,css:function(b,a,c){a=Ia(a);if(B(c))b.style[a]=c;else{var d;Z<=8&&(d=b.currentStyle&&b.currentStyle[a],
|
||||
d===""&&(d="auto"));d=d||b.style[a];Z<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=I(a);if(Na[d])if(B(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||q).specified?d:p;else if(B(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(B(c))b[a]=c;else return b[a]},text:t(Z<9?function(b,a){if(b.nodeType==1){if(C(a))return b.innerText;b.innerText=a}else{if(C(a))return b.nodeValue;
|
||||
b.nodeValue=a}}:function(b,a){if(C(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(C(a))return b.value;b.value=a},html:function(b,a){if(C(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)ya(d[c]);b.innerHTML=a}},function(b,a){R.prototype[a]=function(a,d){var e,g;if((b.length==2&&b!==La&&b!==Eb?a:d)===p)if(L(a)){for(e=0;e<this.length;e++)if(b===Bb)b(this[e],a);else for(g in a)b(this[e],g,a[g]);return this}else{if(this.length)return b(this[0],a,d)}else{for(e=0;e<
|
||||
this.length;e++)b(this[e],a,d);return this}return b.$dv}});n({removeData:zb,dealoc:ya,bind:function a(c,d,e){var g=ca(c,"events"),i=ca(c,"handle");g||ca(c,"events",g={});i||ca(c,"handle",i=xc(c,g));n(d.split(" "),function(d){var h=g[d];if(!h){if(d=="mouseenter"||d=="mouseleave"){var j=T.body.contains||T.body.compareDocumentPosition?function(a,c){var d=a.nodeType===9?a.documentElement:a,e=c&&c.parentNode;return a===e||!(!e||!(e.nodeType===1&&(d.contains?d.contains(e):a.compareDocumentPosition&&a.compareDocumentPosition(e)&
|
||||
16)))}:function(a,c){if(c)for(;c=c.parentNode;)if(c===a)return!0;return!1};g[d]=[];a(c,{mouseleave:"mouseout",mouseenter:"mouseover"}[d],function(a){var c=a.relatedTarget;(!c||c!==this&&!j(this,c))&&i(a,d)})}else gc(c,d,i),g[d]=[];h=g[d]}h.push(e)})},unbind:Ab,replaceWith:function(a,c){var d,e=a.parentNode;ya(a);n(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];n(a.childNodes,function(a){a.nodeType===1&&c.push(a)});return c},contents:function(a){return a.childNodes||
|
||||
[]},append:function(a,c){n(new R(c),function(c){(a.nodeType===1||a.nodeType===11)&&a.appendChild(c)})},prepend:function(a,c){if(a.nodeType===1){var d=a.firstChild;n(new R(c),function(c){d?a.insertBefore(c,d):(a.appendChild(c),d=c)})}},wrap:function(a,c){var c=w(c)[0],d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){ya(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;n(new R(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:Db,
|
||||
removeClass:Cb,toggleClass:function(a,c,d){C(d)&&(d=!La(a,c));(d?Db:Cb)(a,c)},parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;for(a=a.nextSibling;a!=null&&a.nodeType!==1;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName(c)},clone:fb,triggerHandler:function(a,c){var d=(ca(a,"events")||{})[c];n(d,function(c){c.call(a,{preventDefault:q})})}},function(a,c){R.prototype[c]=function(c,e){for(var g,
|
||||
i=0;i<this.length;i++)g==p?(g=a(this[i],c,e),g!==p&&(g=w(g))):eb(g,a(this[i],c,e));return g==p?this:g}});za.prototype={put:function(a,c){this[la(a)]=c},get:function(a){return this[la(a)]},remove:function(a){var c=this[a=la(a)];delete this[a];return c}};var zc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,Ac=/,/,Bc=/^\s*(_?)(\S+?)\1\s*$/,yc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;Ib.$inject=["$provide"];var qd=function(){var a="$ngAnimateController",c={running:!0};this.$get=["$animation","$window","$sniffer","$rootElement",
|
||||
"$rootScope",function(d,e,g,i){i.data(a,c);i=function(c,i){function j(j,k,o){return function(m,r,p){function x(a){var c=0,a=E(a)?a.split(/\s*,\s*/):[];n(a,function(a){c=Math.max(parseFloat(a)||0,c)});return c}function t(){m.addClass(K);if($)$(m,v,P);else if(H(e.getComputedStyle)){var a=g.vendorPrefix+"Animation",c=g.vendorPrefix+"Transition",d=0;n(m,function(f){if(f.nodeType==1){var g="transition",i=c,j=1,h=e.getComputedStyle(f)||{};if(parseFloat(h.animationDuration)>0||parseFloat(h[a+"Duration"])>
|
||||
0)g="animation",i=a,j=Math.max(parseInt(h[g+"IterationCount"])||0,parseInt(h[i+"IterationCount"])||0,j);f=Math.max(x(h[g+"Delay"]),x(h[i+"Delay"]));g=Math.max(x(h[g+"Duration"]),x(h[i+"Duration"]));d=Math.max(f+j*g,d)}});e.setTimeout(v,d*1E3)}else v()}function v(){if(!v.run)v.run=!0,o(m,r,p),m.removeClass(w),m.removeClass(K),m.removeData(a)}var A=c.$eval(i.ngAnimate),w=A?L(A)?A[j]:A+"-"+j:"",D=d(w),A=D&&D.setup,$=D&&D.start,D=D&&D.cancel;if(w){var K=w+"-active";r||(r=p?p.parent():m.parent());if(!g.transitions&&
|
||||
!A&&!$||(r.inheritedData(a)||q).running)k(m,r,p),o(m,r,p);else{var O=m.data(a)||{};O.running&&((D||q)(m),O.done());m.data(a,{running:!0,done:v});m.addClass(w);k(m,r,p);if(m.length==0)return v();var P=(A||q)(m);e.setTimeout(t,1)}}else k(m,r,p),o(m,r,p)}}function m(a,c,d){d?d.after(a):c.append(a)}var k={};k.enter=j("enter",m,q);k.leave=j("leave",q,function(a){a.remove()});k.move=j("move",function(a,c,d){m(a,c,d)},q);k.show=j("show",function(a){a.css("display","")},q);k.hide=j("hide",q,function(a){a.css("display",
|
||||
"none")});k.animate=function(a,c){j(a,q,q)(c)};return k};i.enabled=function(a){if(arguments.length)c.running=!a;return!c.running};return i}]},Kb="Non-assignable model expression: ";Jb.$inject=["$provide"];var Ic=/^(x[\:\-_]|data[\:\-_])/i,jb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?(\{?[\w\.-]*\}?)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,Pb=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Oa={http:80,https:443,ftp:21};Rb.prototype=lb.prototype=Qb.prototype={$$replace:!1,absUrl:Pa("$$absUrl"),url:function(a,c){if(C(a))return this.$$url;
|
||||
var d=Pb.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));if(d[2]||d[1])this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:Pa("$$protocol"),host:Pa("$$host"),port:Pa("$$port"),path:Sb("$$path",function(a){return a.charAt(0)=="/"?a:"/"+a}),search:function(a,c){if(C(a))return this.$$search;B(c)?c===null?delete this.$$search[a]:this.$$search[a]=c:this.$$search=E(a)?vb(a):a;this.$$compose();return this},hash:Sb("$$hash",qa),replace:function(){this.$$replace=!0;return this}};var Da={"null":function(){return null},
|
||||
"true":function(){return!0},"false":function(){return!1},undefined:q,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return B(d)?B(e)?d+e:d:B(e)?e:p},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(B(d)?d:0)-(B(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":q,"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,
|
||||
c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Qc={n:"\n",f:"\u000c",r:"\r",
|
||||
t:"\t",v:"\u000b","'":"'",'"':'"'},mb={},ad=/^(([^:]+):)?\/\/(\w+:{0,1}\w*@)?([\w\.-]*)?(:([0-9]+))?(.*)$/,ed=M.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");};Zb.$inject=["$provide"];$b.$inject=["$locale"];bc.$inject=["$locale"];var ec=".",od={yyyy:Q("FullYear",4),yy:Q("FullYear",
|
||||
2,0,!0),y:Q("FullYear",1),MMMM:Qa("Month"),MMM:Qa("Month",!0),MM:Q("Month",2,1),M:Q("Month",1,1),dd:Q("Date",2),d:Q("Date",1),HH:Q("Hours",2),H:Q("Hours",1),hh:Q("Hours",2,-12),h:Q("Hours",1,-12),mm:Q("Minutes",2),m:Q("Minutes",1),ss:Q("Seconds",2),s:Q("Seconds",1),sss:Q("Milliseconds",3),EEEE:Qa("Day"),EEE:Qa("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){var a=-1*a.getTimezoneOffset(),c=a>=0?"+":"";c+=nb(Math[a>0?"floor":"ceil"](a/60),2)+nb(Math.abs(a%60),
|
||||
2);return c}},nd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,md=/^\d+$/;ac.$inject=["$locale"];var kd=S(I),ld=S(oa);cc.$inject=["$parse"];var rd=S({restrict:"E",compile:function(a,c){Z<=8&&(!c.href&&!c.name&&c.$set("href",""),a.append(T.createComment("IE fix")));return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),pb={};n(Na,function(a,c){var d=da("ng-"+c);pb[d]=function(){return{priority:100,compile:function(){return function(a,
|
||||
g,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}});n(["src","srcset","href"],function(a){var c=da("ng-"+a);pb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),Z&&e.prop(a,g[a]))})}}}});var Ta={$addControl:q,$removeControl:q,$setValidity:q,$setDirty:q,$setPristine:q};fc.$inject=["$element","$attrs","$scope"];var Wa=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:fc,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=
|
||||
function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};gc(d[0],"submit",h);d.bind("$destroy",function(){c(function(){gb(d[0],"submit",h)},0,!1)})}var j=d.parent().controller("form"),m=i.name||i.ngForm;m&&(a[m]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);m&&(a[m]=p);t(f,Ta)})}}}};return a?t(V(d),{restrict:"EAC"}):d}]},sd=Wa(),td=Wa(!0),ud=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,vd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,
|
||||
wd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,hc={text:Va,number:function(a,c,d,e,g,i){Va(a,c,d,e,g,i);e.$parsers.push(function(a){var c=X(a);return c||wd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return X(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!X(a)&&a<f?(e.$setValidity("min",!1),p):(e.$setValidity("min",!0),a)};e.$parsers.push(a);e.$formatters.push(a)}if(d.max){var h=parseFloat(d.max),
|
||||
d=function(a){return!X(a)&&a>h?(e.$setValidity("max",!1),p):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return X(a)||Ya(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Va(a,c,d,e,g,i);a=function(a){return X(a)||ud.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Va(a,c,d,e,g,i);a=function(a){return X(a)||vd.test(a)?
|
||||
(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){C(d.name)&&c.attr("name",Fa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;E(g)||(g=!0);E(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});
|
||||
e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===g});e.$parsers.push(function(a){return a?g:i})},hidden:q,button:q,submit:q,reset:q},ic=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(hc[I(g.type)]||hc.text)(d,e,g,i,c,a)}}}],Sa="ng-valid",Ra="ng-invalid",pa="ng-pristine",Ua="ng-dirty",xd=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+bb(c,"-"):"";
|
||||
e.removeClass((a?Ra:Sa)+c).addClass((a?Sa:Ra)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw Error(Kb+d.ngModel+" ("+va(e)+")");this.$render=q;var j=e.inheritedData("$formController")||Ta,m=0,k=this.$error={};e.addClass(pa);i(!0);this.$setValidity=function(a,c){if(k[a]!==!c){if(c){if(k[a]&&m--,!m)i(!0),this.$valid=
|
||||
!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,m++;k[a]=!c;i(c,a);j.$setValidity(a,c,this)}};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;e.removeClass(Ua).addClass(pa)};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(pa).addClass(Ua),j.$setDirty();n(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),n(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};
|
||||
var l=this;a.$watch(function(){var c=f(a);if(l.$modelValue!==c){var d=l.$formatters,e=d.length;for(l.$modelValue=c;e--;)c=d[e](c);if(l.$viewValue!==c)l.$viewValue=c,l.$render()}})}],yd=function(){return{require:["ngModel","^?form"],controller:xd,link:function(a,c,d,e){var g=e[0],i=e[1]||Ta;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},zd=S({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),jc=function(){return{require:"?ngModel",
|
||||
link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(X(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},Ad=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&n(a.split(g),function(a){a&&c.push(U(a))});return c});e.$formatters.push(function(a){return F(a)?
|
||||
a.join(", "):p})}}},Bd=/^(true|false|\d+)$/,Cd=function(){return{priority:100,compile:function(a,c){return Bd.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},Dd=aa(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),Ed=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",
|
||||
c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],Fd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,function(a){c.html(a||"")})}}],Gd=ob("",!0),Hd=ob("Odd",0),Id=ob("Even",1),Jd=aa({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Kd=[function(){return{scope:!0,controller:"@"}}],Ld=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],kc={};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress".split(" "),
|
||||
function(a){var c=da("ng-"+a);kc[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(I(a),function(a){e.$apply(function(){f(e,{$event:a})})})}}]});var Md=aa(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Nd=["$animator",function(a){return{transclude:"element",priority:1E3,terminal:!0,restrict:"A",compile:function(c,d,e){return function(c,d,f){var h=a(c,f),j,m;c.$watch(f.ngIf,function(a){j&&(h.leave(j),j=p);m&&(m.$destroy(),m=p);ua(a)&&(m=c.$new(),e(m,function(a){j=
|
||||
a;h.enter(a,d.parent(),d)}))})}}}}],Od=["$http","$templateCache","$anchorScroll","$compile","$animator",function(a,c,d,e,g){return{restrict:"ECA",terminal:!0,compile:function(i,f){var h=f.ngInclude||f.src,j=f.onload||"",m=f.autoscroll;return function(f,i,n){var o=g(f,n),p=0,r,t=function(){r&&(r.$destroy(),r=null);o.leave(i.contents(),i)};f.$watch(h,function(g){var h=++p;g?(a.get(g,{cache:c}).success(function(a){h===p&&(r&&r.$destroy(),r=f.$new(),o.leave(i.contents(),i),a=w("<div/>").html(a).contents(),
|
||||
o.enter(a,i),e(a)(r),B(m)&&(!m||f.$eval(m))&&d(),r.$emit("$includeContentLoaded"),f.$eval(j))}).error(function(){h===p&&t()}),f.$emit("$includeContentRequested")):t()})}}}}],Pd=aa({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Qd=aa({terminal:!0,priority:1E3}),Rd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),j=i.offset||0,m=e.$eval(h),k={},l=c.startSymbol(),p=c.endSymbol();n(m,function(a,e){k[e]=
|
||||
c(a.replace(d,l+f+"-"+j+p))});e.$watch(function(){var c=parseFloat(e.$eval(f));return isNaN(c)?"":(c in m||(c=a.pluralCat(c-j)),k[c](e,g,!0))},function(a){g.text(a)})}}}],Sd=["$parse","$animator",function(a,c){return{transclude:"element",priority:1E3,terminal:!0,compile:function(d,e,g){return function(d,e,h){var j=c(d,h),m=h.ngRepeat,k=m.match(/^\s*(.+)\s+in\s+(.*?)\s*(\s+track\s+by\s+(.+)\s*)?$/),l,p,o,z,r,t={$id:la};if(!k)throw Error("Expected ngRepeat in form of '_item_ in _collection_[ track by _id_]' but got '"+
|
||||
m+"'.");h=k[1];o=k[2];(k=k[4])?(l=a(k),p=function(a,c,e){r&&(t[r]=a);t[z]=c;t.$index=e;return l(d,t)}):p=function(a,c){return la(c)};k=h.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!k)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+h+"'.");z=k[3]||k[1];r=k[2];var x={};d.$watchCollection(o,function(a){var c,h,k=e,l,o={},t,q,w,s,B,y,C=[];if(Xa(a))B=a;else{B=[];for(w in a)a.hasOwnProperty(w)&&w.charAt(0)!="$"&&B.push(w);B.sort()}t=B.length;h=
|
||||
C.length=B.length;for(c=0;c<h;c++)if(w=a===B?c:B[c],s=a[w],l=p(w,s,c),x.hasOwnProperty(l))y=x[l],delete x[l],o[l]=y,C[c]=y;else if(o.hasOwnProperty(l))throw n(C,function(a){a&&a.element&&(x[a.id]=a)}),Error("Duplicates in a repeater are not allowed. Repeater: "+m+" key: "+l);else C[c]={id:l},o[l]=!1;for(w in x)if(x.hasOwnProperty(w))y=x[w],j.leave(y.element),y.element[0].$$NG_REMOVED=!0,y.scope.$destroy();c=0;for(h=B.length;c<h;c++){w=a===B?c:B[c];s=a[w];y=C[c];if(y.element){q=y.scope;l=k[0];do l=
|
||||
l.nextSibling;while(l&&l.$$NG_REMOVED);y.element[0]!=l&&j.move(y.element,null,k);k=y.element}else q=d.$new();q[z]=s;r&&(q[r]=w);q.$index=c;q.$first=c===0;q.$last=c===t-1;q.$middle=!(q.$first||q.$last);y.element||g(q,function(a){j.enter(a,null,k);k=a;y.scope=q;y.element=a;o[y.id]=y})}x=o})}}}}],Td=["$animator",function(a){return function(c,d,e){var g=a(c,e);c.$watch(e.ngShow,function(a){g[ua(a)?"show":"hide"](d)})}}],Ud=["$animator",function(a){return function(c,d,e){var g=a(c,e);c.$watch(e.ngHide,
|
||||
function(a){g[ua(a)?"hide":"show"](d)})}}],Vd=aa(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&n(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Wd=["$animator",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,g){var i=a(c,e),f,h,j=[];c.$watch(e.ngSwitch||e.on,function(a){for(var d=0,l=j.length;d<l;d++)j[d].$destroy(),i.leave(h[d]);h=[];j=[];if(f=g.cases["!"+a]||g.cases["?"])c.$eval(e.change),n(f,function(a){var d=
|
||||
c.$new();j.push(d);a.transclude(d,function(c){var d=a.element;h.push(c);i.enter(c,d.parent(),d)})})})}}}],Xd=aa({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,g,i,f){f.cases["!"+c.ngSwitchWhen]=f.cases["!"+c.ngSwitchWhen]||[];f.cases["!"+c.ngSwitchWhen].push({transclude:d,element:g})}}}),Yd=aa({transclude:"element",priority:500,require:"^ngSwitch",compile:function(a,c,d){return function(a,c,i,f){f.cases["?"]=f.cases["?"]||[];f.cases["?"].push({transclude:d,
|
||||
element:c})}}}),Zd=aa({controller:["$transclude","$element",function(a,c){a(function(a){c.append(a)})}]}),$d=["$http","$templateCache","$route","$anchorScroll","$compile","$controller","$animator",function(a,c,d,e,g,i,f){return{restrict:"ECA",terminal:!0,link:function(a,c,m){function k(){var f=d.current&&d.current.locals,k=f&&f.$template;if(k){o.leave(c.contents(),c);l&&(l.$destroy(),l=null);k=w("<div></div>").html(k).contents();o.enter(k,c);var k=g(k),m=d.current;l=m.scope=a.$new();if(m.controller)f.$scope=
|
||||
l,f=i(m.controller,f),m.controllerAs&&(l[m.controllerAs]=f),c.children().data("$ngControllerController",f);k(l);l.$emit("$viewContentLoaded");l.$eval(n);e()}else o.leave(c.contents(),c),l&&(l.$destroy(),l=null)}var l,n=m.onload||"",o=f(a,m);a.$on("$routeChangeSuccess",k);k()}}}],ae=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){d.type=="text/ng-template"&&a.put(d.id,c[0].text)}}}],be=S({terminal:!0}),ce=["$compile","$parse",function(a,c){var d=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/,
|
||||
e={$setViewValue:q};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var h=this,j={},m=e,k;h.databound=d.ngModel;h.init=function(a,c,d){m=a;k=d};h.addOption=function(c){j[c]=!0;m.$viewValue==c&&(a.val(c),k.parent()&&k.remove())};h.removeOption=function(a){this.hasOption(a)&&(delete j[a],m.$viewValue==a&&this.renderUnknownOption(a))};h.renderUnknownOption=function(c){c="? "+la(c)+" ?";k.val(c);a.prepend(k);a.val(c);k.prop("selected",!0)};h.hasOption=
|
||||
function(a){return j.hasOwnProperty(a)};c.$on("$destroy",function(){h.renderUnknownOption=q})}],link:function(e,i,f,h){function j(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(v.parent()&&v.remove(),c.val(a),a===""&&t.prop("selected",!0)):C(a)&&t?c.val(""):e.renderUnknownOption(a)};c.bind("change",function(){a.$apply(function(){v.parent()&&v.remove();d.$setViewValue(c.val())})})}function m(a,c,d){var e;d.$render=function(){var a=new za(d.$viewValue);n(c.find("option"),function(c){c.selected=
|
||||
B(a.get(c.value))})};a.$watch(function(){ia(e,d.$viewValue)||(e=V(d.$viewValue),d.$render())});c.bind("change",function(){a.$apply(function(){var a=[];n(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function k(e,f,g){function i(){var a={"":[]},c=[""],d,h,q,v,s;q=g.$modelValue;v=u(e)||[];var z=l?qb(v):v,B,y,A;y={};s=!1;var C,D;if(o)if(t&&F(q)){s=new za([]);for(h=0;h<q.length;h++)y[k]=q[h],s.put(t(e,y),q[h])}else s=new za(q);for(A=0;B=z.length,A<B;A++){y[k]=v[l?y[l]=
|
||||
z[A]:A];d=m(e,y)||"";if(!(h=a[d]))h=a[d]=[],c.push(d);o?d=s.remove(t?t(e,y):n(e,y))!=p:(t?(d={},d[k]=q,d=t(e,d)===t(e,y)):d=q===n(e,y),s=s||d);C=j(e,y);C=C===p?"":C;h.push({id:t?t(e,y):l?z[A]:A,label:C,selected:d})}o||(r||q===null?a[""].unshift({id:"",label:"",selected:!s}):s||a[""].unshift({id:"?",label:"",selected:!0}));y=0;for(z=c.length;y<z;y++){d=c[y];h=a[d];if(w.length<=y)q={element:E.clone().attr("label",d),label:h.label},v=[q],w.push(v),f.append(q.element);else if(v=w[y],q=v[0],q.label!=d)q.element.attr("label",
|
||||
q.label=d);C=null;A=0;for(B=h.length;A<B;A++)if(d=h[A],s=v[A+1]){C=s.element;if(s.label!==d.label)C.text(s.label=d.label);if(s.id!==d.id)C.val(s.id=d.id);if(C[0].selected!==d.selected)C.prop("selected",s.selected=d.selected)}else d.id===""&&r?D=r:(D=x.clone()).val(d.id).attr("selected",d.selected).text(d.label),v.push({element:D,label:d.label,id:d.id,selected:d.selected}),C?C.after(D):q.element.append(D),C=D;for(A++;v.length>A;)v.pop().element.remove()}for(;w.length>y;)w.pop()[0].element.remove()}
|
||||
var h;if(!(h=q.match(d)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_ (track by _expr_)?' but got '"+q+"'.");var j=c(h[2]||h[1]),k=h[4]||h[6],l=h[5],m=c(h[3]||""),n=c(h[2]?h[1]:k),u=c(h[7]),t=h[8]?c(h[8]):null,w=[[{element:f,label:""}]];r&&(a(r)(e),r.removeClass("ng-scope"),r.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=u(e)||[],d={},h,i,j,m,q,r;if(o){i=[];m=0;for(r=w.length;m<r;m++){a=w[m];j=1;for(q=a.length;j<
|
||||
q;j++)if((h=a[j].element)[0].selected){h=h.val();l&&(d[l]=h);if(t)for(var s=0;s<c.length;s++){if(d[k]=c[s],t(e,d)==h)break}else d[k]=c[h];i.push(n(e,d))}}}else if(h=f.val(),h=="?")i=p;else if(h=="")i=null;else if(t)for(s=0;s<c.length;s++){if(d[k]=c[s],t(e,d)==h){i=n(e,d);break}}else d[k]=c[h],l&&(d[l]=h),i=n(e,d);g.$setViewValue(i)})});g.$render=i;e.$watch(i)}if(h[1]){for(var l=h[0],u=h[1],o=f.multiple,q=f.ngOptions,r=!1,t,x=w(T.createElement("option")),E=w(T.createElement("optgroup")),v=x.clone(),
|
||||
h=0,A=i.children(),G=A.length;h<G;h++)if(A[h].value==""){t=r=A.eq(h);break}l.init(u,r,v);if(o&&(f.required||f.ngRequired)){var D=function(a){u.$setValidity("required",!f.required||a&&a.length);return a};u.$parsers.push(D);u.$formatters.unshift(D);f.$observe("required",function(){D(u.$viewValue)})}q?k(e,i,u):o?m(e,i,u):j(e,i,u,l)}}}}],de=["$interpolate",function(a){var c={addOption:q,removeOption:q};return{restrict:"E",priority:100,compile:function(d,e){if(C(e.value)){var g=a(d.text(),!0);g||e.$set("value",
|
||||
d.text())}return function(a,d,e){var j=d.parent(),m=j.data("$selectController")||j.parent().data("$selectController");m&&m.databound?d.prop("selected",!1):m=c;g?a.$watch(g,function(a,c){e.$set("value",a);a!==c&&m.removeOption(c);m.addOption(a)}):m.addOption(e.value);d.bind("$destroy",function(){m.removeOption(e.value)})}}}}],ee=S({restrict:"E",terminal:!0});(ga=M.jQuery)?(w=ga,t(ga.fn,{scope:Ba.scope,controller:Ba.controller,injector:Ba.injector,inheritedData:Ba.inheritedData}),db("remove",!0),db("empty"),
|
||||
db("html")):w=R;Ha.element=w;(function(a){t(a,{bootstrap:xb,copy:V,extend:t,equals:ia,element:w,forEach:n,injector:yb,noop:q,bind:$a,toJson:ha,fromJson:ub,identity:qa,isUndefined:C,isDefined:B,isString:E,isFunction:H,isObject:L,isNumber:Ya,isElement:oc,isArray:F,version:pd,isDate:ra,lowercase:I,uppercase:oa,callbacks:{counter:0},noConflict:lc});Aa=tc(M);try{Aa("ngLocale")}catch(c){Aa("ngLocale",[]).provider("$locale",fd)}Aa("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Jb).directive({a:rd,
|
||||
input:ic,textarea:ic,form:sd,script:ae,select:ce,style:ee,option:de,ngBind:Dd,ngBindHtmlUnsafe:Fd,ngBindTemplate:Ed,ngClass:Gd,ngClassEven:Id,ngClassOdd:Hd,ngCsp:Ld,ngCloak:Jd,ngController:Kd,ngForm:td,ngHide:Ud,ngIf:Nd,ngInclude:Od,ngInit:Pd,ngNonBindable:Qd,ngPluralize:Rd,ngRepeat:Sd,ngShow:Td,ngSubmit:Md,ngStyle:Vd,ngSwitch:Wd,ngSwitchWhen:Xd,ngSwitchDefault:Yd,ngOptions:be,ngView:$d,ngTransclude:Zd,ngModel:yd,ngList:Ad,ngChange:zd,required:jc,ngRequired:jc,ngValue:Cd}).directive(pb).directive(kc);
|
||||
a.provider({$anchorScroll:Cc,$animation:Ib,$animator:qd,$browser:Ec,$cacheFactory:Fc,$controller:Jc,$document:Kc,$exceptionHandler:Lc,$filter:Zb,$interpolate:Mc,$http:bd,$httpBackend:cd,$location:Nc,$log:Oc,$parse:Sc,$route:Vc,$routeParams:Wc,$rootScope:Xc,$q:Tc,$sniffer:Yc,$templateCache:Gc,$timeout:gd,$window:Zc})}])})(Ha);w(T).ready(function(){rc(T,xb)})})(window,document);angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
|
1
js/app.min.js
vendored
Normal file
7
js/devel/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Generate bundle
|
||||
|
||||
Use uglifyjs to generate app.min.js bundle
|
||||
|
||||
```
|
||||
uglifyjs devel/*.js > app.min.js
|
||||
```
|
117
js/devel/app.js
Normal file
@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2018
|
||||
*/
|
||||
|
||||
var Sms = {
|
||||
// Attributes
|
||||
selectedConversation: null,
|
||||
unreadCountCurrentConv: 0,
|
||||
unreadCountNotifStep: 12,
|
||||
lastContactListMsgDate: 0,
|
||||
originalTitle: document.title,
|
||||
photoVersion: 1,
|
||||
|
||||
_winRegexp: /(.*)\/ocsms.*/,
|
||||
|
||||
// Functions
|
||||
generateURL: function (endpoint) {
|
||||
var match = this._winRegexp.exec(window.location.href);
|
||||
if (match.length !== 2) {
|
||||
console.log("A very bad error happened when parsing window location");
|
||||
}
|
||||
return match[1] + '/ocsms' + endpoint;
|
||||
},
|
||||
selectConversation: function (item) {
|
||||
if (item === 'undefined' || item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.selectedConversation != null) {
|
||||
this.selectedConversation.parent().removeClass('selected');
|
||||
}
|
||||
this.selectedConversation = item;
|
||||
this.selectedConversation.parent().addClass('selected');
|
||||
this.selectedConversation.css("font-weight", "normal");
|
||||
this.selectedConversation.html(this.selectedConversation.attr("mailbox-label"));
|
||||
}
|
||||
};
|
||||
|
||||
var ContactRenderer = {
|
||||
generateColor: function (input) {
|
||||
if (typeof input === 'undefined') {
|
||||
return '';
|
||||
}
|
||||
// Check if core has the new color generator
|
||||
if (typeof input.toHsl === 'function') {
|
||||
var hsl = input.toHsl();
|
||||
return 'hsl(' + hsl[0] + ', ' + hsl[1] + '%, ' + hsl[2] + '%)';
|
||||
} else {
|
||||
// If not, we use the old one
|
||||
/* global md5 */
|
||||
var hash = md5(input).substring(0, 4),
|
||||
maxRange = parseInt('ffff', 16),
|
||||
hue = parseInt(hash, 16) / maxRange * 256;
|
||||
return 'hsl(' + hue + ', 90%, 65%)';
|
||||
}
|
||||
},
|
||||
generateFirstCharacter: function (input) {
|
||||
if (typeof input !== 'string') {
|
||||
return '?';
|
||||
}
|
||||
|
||||
if (input.charAt(0) === '+') {
|
||||
return '#';
|
||||
}
|
||||
|
||||
return input.charAt(0);
|
||||
}
|
||||
};
|
||||
|
||||
$.urlParam = function (name) {
|
||||
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
|
||||
if (results == null) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return results[1] || 0;
|
||||
}
|
||||
};
|
||||
|
||||
Vue.filter('firstCharacter', ContactRenderer.generateFirstCharacter);
|
||||
const Dialog = Vue.extend({
|
||||
template: '#modal-template'
|
||||
});
|
||||
|
||||
Vue.directive('confirm', {
|
||||
bind(el, binding, vnode) {
|
||||
const yesMethod = binding.value[1];
|
||||
const bodyMessage = binding.value[0];
|
||||
el.handleClick = (e) => {
|
||||
const data = {
|
||||
doYes: function () { yesMethod(); data.show = false; },
|
||||
show: true,
|
||||
bodyMessage: bodyMessage
|
||||
};
|
||||
let dialog = new Dialog({ data: data }).$mount();
|
||||
document.getElementById('app').appendChild(dialog.$el);
|
||||
};
|
||||
el.addEventListener('click', el.handleClick);
|
||||
},
|
||||
unbind(el) {
|
||||
el.removeEventListener('click', el.handleClick);
|
||||
}
|
||||
});
|
||||
|
||||
(function ($, OC) {
|
||||
// reset count and title
|
||||
window.onfocus = function () {
|
||||
Sms.unreadCountCurrentConv = 0;
|
||||
document.title = Sms.originalTitle;
|
||||
};
|
||||
})(jQuery, OC);
|
218
js/devel/contactlist.js
Normal file
@ -0,0 +1,218 @@
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2018
|
||||
*/
|
||||
|
||||
var ContactList = new Vue({
|
||||
el: '#app-mailbox-peers',
|
||||
data: {
|
||||
isContactsLoading: true,
|
||||
contacts: [],
|
||||
lastRetrievedMessageDate: 0,
|
||||
totalUnreadMessages: 0,
|
||||
lastTotalUnreadCount: 0
|
||||
},
|
||||
created: function () {
|
||||
this.reset();
|
||||
this.fetch();
|
||||
this.checkNewMessages();
|
||||
setInterval(this.checkNewMessages, 10000);
|
||||
},
|
||||
methods: {
|
||||
reset: function () {
|
||||
this.contacts = [];
|
||||
this.lastRetrievedMessageDate = 0;
|
||||
this.totalUnreadMessages = 0;
|
||||
this.lastTotalUnreadCount = 0;
|
||||
},
|
||||
fetch: function () {
|
||||
let self = this;
|
||||
// Now bind the events when we click on the phone number
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/peerlist'), function (jsondata, status) {
|
||||
// Use a buffer for better jQuery performance
|
||||
let bufferedContacts = [];
|
||||
|
||||
Sms.photoVersion = jsondata["photo_version"];
|
||||
|
||||
$.each(jsondata['phonelist'], function (id, val) {
|
||||
var peerLabel;
|
||||
if (typeof jsondata['contacts'][id] === 'undefined') {
|
||||
peerLabel = id;
|
||||
}
|
||||
else {
|
||||
peerLabel = jsondata['contacts'][id];
|
||||
}
|
||||
if (!inArray(peerLabel, bufferedContacts)) {
|
||||
var contactObj = {
|
||||
'label': peerLabel,
|
||||
'nav': id,
|
||||
'unread': 0,
|
||||
'lastmsg': parseInt(val)
|
||||
};
|
||||
|
||||
if (typeof(jsondata['photos'][peerLabel]) !== 'undefined') {
|
||||
contactObj['avatar'] = jsondata['photos'][peerLabel];
|
||||
}
|
||||
|
||||
if (typeof jsondata['uids'][peerLabel] !== 'undefined') {
|
||||
contactObj.uid = jsondata['uids'][peerLabel];
|
||||
} else {
|
||||
contactObj.uid = peerLabel;
|
||||
}
|
||||
|
||||
self.addContact(contactObj);
|
||||
bufferedContacts.push(peerLabel);
|
||||
}
|
||||
});
|
||||
|
||||
self.isContactsLoading = false;
|
||||
Sms.lastContactListMsgDate = jsondata["lastRead"];
|
||||
self.lastRetrievedMessageDate = jsondata["lastMessage"];
|
||||
|
||||
var pnParam = $.urlParam('phonenumber');
|
||||
if (pnParam != null) {
|
||||
var urlPhoneNumber = decodeURIComponent(pnParam);
|
||||
if (urlPhoneNumber != null) {
|
||||
// If no contact when loading, creating a new contact from urlPhoneNumber
|
||||
if (Conversation.selectedContact.nav === undefined) {
|
||||
Conversation.selectedContact.label = urlPhoneNumber;
|
||||
Conversation.selectedContact.nav = urlPhoneNumber;
|
||||
Conversation.selectedContact.avatar = undefined;
|
||||
|
||||
// Now let's loop through the contact list and see if we can find the rest of the details
|
||||
for (var i = 0; i < self.contacts.length; i++) {
|
||||
if (self.contacts[i].nav === urlPhoneNumber) {
|
||||
Conversation.selectedContact = self.contacts[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Conversation.fetch(Conversation.selectedContact);
|
||||
Sms.selectConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']"));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getContactColor: function(contact_id) {
|
||||
return ContactRenderer.generateColor(contact_id);
|
||||
},
|
||||
// Conversations
|
||||
loadConversation: function (contact) {
|
||||
OC.Util.History.pushState('phonenumber=' + contact.nav);
|
||||
|
||||
// phoneNumber must exist
|
||||
if (contact.nav !== null) {
|
||||
Conversation.fetch(contact);
|
||||
Sms.selectConversation($("a[mailbox-navigation='" + contact.nav + "']"));
|
||||
}
|
||||
},
|
||||
/*
|
||||
* Contact list management
|
||||
*/
|
||||
addContact: function (ct) {
|
||||
this.contacts.push(ct);
|
||||
},
|
||||
removeContact: function (ct) {
|
||||
var len = this.contacts.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var curCt = this.contacts[i];
|
||||
if (curCt['nav'] === ct['nav']) {
|
||||
this.contacts.splice(i, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
modifyContact: function (ct) {
|
||||
var len = this.contacts.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (this.contacts[i]['nav'] === ct['nav']) {
|
||||
this.contacts[i].unread = parseInt(ct.unread);
|
||||
if (typeof(ct.avatar) !== 'undefined') {
|
||||
this.contacts[i].avatar = ct.avatar;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
checkNewMessages: function () {
|
||||
this.totalUnreadMessages = 0;
|
||||
var self = this;
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/new_messages'),
|
||||
{'lastDate': this.lastRetrievedMessageDate},
|
||||
function (jsondata, status) {
|
||||
let bufferedContacts = [];
|
||||
|
||||
$.each(jsondata['phonelist'], function (id, val) {
|
||||
let fn, peerLabel;
|
||||
if (typeof jsondata['contacts'][id] === 'undefined') {
|
||||
peerLabel = id;
|
||||
}
|
||||
else {
|
||||
fn = jsondata['contacts'][id];
|
||||
peerLabel = fn;
|
||||
}
|
||||
|
||||
if (!inArray(peerLabel, bufferedContacts)) {
|
||||
let contactObj = {
|
||||
'label': peerLabel,
|
||||
'nav': id,
|
||||
'unread': parseInt(val)
|
||||
};
|
||||
|
||||
if (typeof jsondata['photos'][peerLabel] !== 'undefined') {
|
||||
contactObj.avatar = jsondata['photos'][peerLabel];
|
||||
}
|
||||
|
||||
if (typeof jsondata['uids'][peerLabel] !== 'undefined') {
|
||||
contactObj.uid = jsondata['uids'][peerLabel];
|
||||
} else {
|
||||
contactObj.uid = peerLabel;
|
||||
}
|
||||
|
||||
ContactList.modifyContact(contactObj);
|
||||
bufferedContacts.push(peerLabel);
|
||||
|
||||
// Re-set conversation because we reload the element
|
||||
if (id === Conversation.selectedContact.nav) {
|
||||
Sms.selectConversation($("a[mailbox-navigation='" + id + "']"));
|
||||
}
|
||||
|
||||
self.totalUnreadMessages += parseInt(val);
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Decrement notification step counter, but stop it a zero
|
||||
* Stop at zero permit to notify instanly the user when
|
||||
* there is new messages in all conversations
|
||||
*/
|
||||
|
||||
if (Sms.unreadCountNotifStep > 0) {
|
||||
Sms.unreadCountNotifStep--;
|
||||
}
|
||||
|
||||
if (self.totalUnreadMessages > 0) {
|
||||
/*
|
||||
* We notify user every two minutes for all messages
|
||||
* or if unreadCount changes
|
||||
*/
|
||||
if (Sms.unreadCountNotifStep === 0 || self.lastTotalUnreadCount !== self.totalUnreadMessages) {
|
||||
SmsNotifications.notify(self.totalUnreadMessages + " unread message(s) for all conversations");
|
||||
Sms.unreadCountNotifStep = 12;
|
||||
self.lastTotalUnreadCount = self.totalUnreadMessages;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
orderedContacts: function () {
|
||||
return _.orderBy(this.contacts, [SmsSettings.contactOrderBy], [SmsSettings.reverseContactOrder ? 'desc' : 'asc'])
|
||||
}
|
||||
}
|
||||
});
|
187
js/devel/conversation.js
Normal file
@ -0,0 +1,187 @@
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2018
|
||||
*/
|
||||
|
||||
var Conversation = new Vue({
|
||||
el: '#app-content',
|
||||
data: {
|
||||
selectedContact: {},
|
||||
isConvLoading: false,
|
||||
messages: [],
|
||||
lastConvMessageDate: 0,
|
||||
totalMessageCount: 0,
|
||||
refreshIntervalId: null
|
||||
},
|
||||
methods: {
|
||||
fetch: function (contact) {
|
||||
// If contact is not null, we will fetch a conversation for a new contact
|
||||
if (contact != null) {
|
||||
this.selectedContact = contact;
|
||||
this.isConvLoading = true;
|
||||
}
|
||||
|
||||
this.messages = [];
|
||||
this.lastConvMessageDate = 0;
|
||||
|
||||
let self = this;
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/conversation'), {'phoneNumber': self.selectedContact.nav},
|
||||
function (jsondata, status) {
|
||||
let phoneNumberLabel = self.selectedContact.nav;
|
||||
|
||||
if (typeof jsondata['phoneNumbers'] !== 'undefined') {
|
||||
const phoneNumberList = arrayUnique(jsondata['phoneNumbers']);
|
||||
phoneNumberLabel = phoneNumberList.toString();
|
||||
}
|
||||
|
||||
// Reinit messages before showing conversation
|
||||
self.formatConversation(jsondata);
|
||||
|
||||
if (typeof jsondata['contactName'] === 'undefined' || jsondata['contactName'] === '') {
|
||||
self.selectedContact.label = phoneNumberLabel;
|
||||
self.selectedContact.opt_numbers = "";
|
||||
}
|
||||
else {
|
||||
self.selectedContact.label = jsondata['contactName'];
|
||||
self.selectedContact.opt_numbers = phoneNumberLabel;
|
||||
}
|
||||
|
||||
self.totalMessageCount = jsondata['msgCount'] !== undefined ? jsondata['msgCount'] : 0;
|
||||
self.isConvLoading = false;
|
||||
|
||||
$('#app-content').scrollTop(1E10);
|
||||
|
||||
// If refreshInterval is already bound, clear previous
|
||||
if (self.refreshIntervalId !== null) {
|
||||
clearInterval(self.refreshIntervalId);
|
||||
}
|
||||
|
||||
self.refreshIntervalId = setInterval(self.refresh, 10000);
|
||||
}
|
||||
);
|
||||
},
|
||||
refresh: function () {
|
||||
var self = this;
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/conversation'),
|
||||
{
|
||||
'phoneNumber': Conversation.selectedContact.nav,
|
||||
"lastDate": Conversation.lastConvMessageDate
|
||||
},
|
||||
function (jsondata, status) {
|
||||
var fmt = self.formatConversation(jsondata);
|
||||
var conversationBuf = fmt[1];
|
||||
if (conversationBuf === true) {
|
||||
$('#app-content').scrollTop(1E10);
|
||||
// This will blink the tab because there is new messages
|
||||
if (document.hasFocus() === false) {
|
||||
Sms.unreadCountCurrentConv += parseInt(fmt[0]);
|
||||
document.title = Sms.originalTitle + " (" + Sms.unreadCountCurrentConv + ")";
|
||||
SmsNotifications.notify(Sms.unreadCountCurrentConv + " unread message(s) in conversation with "
|
||||
+ Conversation.selectedContact.label);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
self.totalMessageCount = jsondata['msgCount'] !== undefined ? parseInt(jsondata['msgCount']) : 0;
|
||||
}
|
||||
);
|
||||
},
|
||||
getContactColor: function(contact_id) {
|
||||
return ContactRenderer.generateColor(contact_id);
|
||||
},
|
||||
// Return (int) msgCount, (str) htmlConversation
|
||||
formatConversation: function (jsondata) {
|
||||
// Improve jQuery performance
|
||||
let buf = false;
|
||||
// Improve JS performance
|
||||
let msgClass = '';
|
||||
let msgCount = 0;
|
||||
let self = this;
|
||||
let twemojiOptions = { base: OC.generateUrl('/apps/ocsms/js/twemoji/')};
|
||||
|
||||
$.each(jsondata["conversation"], function (id, vals) {
|
||||
if (vals["type"] == 1) {
|
||||
msgClass = "recv";
|
||||
}
|
||||
else if (vals["type"] == 2) {
|
||||
msgClass = "sent";
|
||||
}
|
||||
else {
|
||||
msgClass = 'unknown';
|
||||
}
|
||||
|
||||
// Store the greater msg date for refresher
|
||||
// Note: we divide by 100 because number compare too large integers
|
||||
if ((id / 100) > (self.lastConvMessageDate / 100)) {
|
||||
self.lastConvMessageDate = id;
|
||||
|
||||
// Multiplicate ID to permit date to use it properly
|
||||
self.addConversationMessage({
|
||||
'id': id,
|
||||
'type': msgClass,
|
||||
'date': new Date(id * 1),
|
||||
'content': twemoji.parse(anchorme(escapeHTML(vals['msg'])), twemojiOptions)
|
||||
});
|
||||
buf = true;
|
||||
msgCount++;
|
||||
}
|
||||
|
||||
});
|
||||
return [msgCount, buf];
|
||||
},
|
||||
/*
|
||||
* Conversation messagelist management
|
||||
*/
|
||||
addConversationMessage: function (msg) {
|
||||
this.messages.push(msg);
|
||||
},
|
||||
removeConversationMessage: function (msgId) {
|
||||
const len = this.messages.length;
|
||||
let self = this;
|
||||
for (var i = 0; i < len; i++) {
|
||||
var curMsg = this.messages[i];
|
||||
if (curMsg['id'] === msgId) {
|
||||
$.post(Sms.generateURL('/delete/message'),
|
||||
{
|
||||
"messageId": msgId,
|
||||
"phoneNumber": this.selectedContact.label
|
||||
}, function (data) {
|
||||
self.messages.splice(i, 1);
|
||||
if (self.messages.length === 0) {
|
||||
self.clear();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
removeConversation: function () {
|
||||
var self = this;
|
||||
$.post(Sms.generateURL('/delete/conversation'), {"contact": self.selectedContact.label}, function (data) {
|
||||
self.clear();
|
||||
});
|
||||
},
|
||||
clear: function () {
|
||||
// Reinit main window
|
||||
this.selectedContact.label = "";
|
||||
this.selectedContact.opt_numbers = "";
|
||||
this.selectedContact.avatar = undefined;
|
||||
ContactList.removeContact(this.selectedContact);
|
||||
this.messages = [];
|
||||
this.selectedContact = {};
|
||||
OC.Util.History.pushState('');
|
||||
clearInterval(this.refreshIntervalId);
|
||||
this.refreshIntervalId = null;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
orderedMessages: function () {
|
||||
return _.orderBy(this.messages, ['date'], ['desc'])
|
||||
}
|
||||
}
|
||||
});
|
77
js/devel/helpers.js
Normal file
@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2018
|
||||
*/
|
||||
|
||||
function inArray(val, arr) {
|
||||
return ($.inArray(val, arr) !== -1);
|
||||
}
|
||||
|
||||
function arrayUnique(arr) {
|
||||
return arr.filter(function (item, i, arr) {
|
||||
return i === arr.indexOf(item);
|
||||
});
|
||||
}
|
||||
|
||||
function toBool(str) {
|
||||
if (str === "true") {
|
||||
return true;
|
||||
}
|
||||
else if (str === "false") {
|
||||
return false;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function escapeHTML(string) {
|
||||
var str = '' + string
|
||||
var matchHtmlRegExp = /["'&<>]/
|
||||
var match = matchHtmlRegExp.exec(str)
|
||||
|
||||
if (!match) {
|
||||
return str
|
||||
}
|
||||
|
||||
var escape
|
||||
var html = ''
|
||||
var index = 0
|
||||
var lastIndex = 0
|
||||
|
||||
for (index = match.index; index < str.length; index++) {
|
||||
switch (str.charCodeAt(index)) {
|
||||
case 34: // "
|
||||
escape = '"'
|
||||
break
|
||||
case 38: // &
|
||||
escape = '&'
|
||||
break
|
||||
case 39: // '
|
||||
escape = '''
|
||||
break
|
||||
case 60: // <
|
||||
escape = '<'
|
||||
break
|
||||
case 62: // >
|
||||
escape = '>'
|
||||
break
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
||||
if (lastIndex !== index) {
|
||||
html += str.substring(lastIndex, index)
|
||||
}
|
||||
|
||||
lastIndex = index + 1
|
||||
html += escape
|
||||
}
|
||||
|
||||
return lastIndex !== index
|
||||
? html + str.substring(lastIndex, index)
|
||||
: html
|
||||
}
|
46
js/devel/notifications.js
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2018
|
||||
*/
|
||||
|
||||
var SmsNotifications = {
|
||||
init: function () {
|
||||
if (!("Notification" in window)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Notification.requestPermission(function (permission) {
|
||||
if (!('permission' in Notification)) {
|
||||
Notification.permission = permission;
|
||||
}
|
||||
});
|
||||
},
|
||||
notify: function (message) {
|
||||
if (!SmsSettings.enableNotifications) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!("Notification" in window)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Notification.permission === "granted") {
|
||||
new Notification("Phone Sync - " + message);
|
||||
}
|
||||
else if (Notification.permission !== 'denied') {
|
||||
Notification.requestPermission(function (permission) {
|
||||
if (!('permission' in Notification)) {
|
||||
Notification.permission = permission;
|
||||
}
|
||||
if (permission === "granted") {
|
||||
new Notification("Phone Sync - " + message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
84
js/devel/settings.js
Normal file
@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Nextcloud - Phone Sync
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2018
|
||||
*/
|
||||
|
||||
var SmsSettings = new Vue({
|
||||
el: '#app-settings',
|
||||
data: {
|
||||
// Attributes
|
||||
messageLimit: 100,
|
||||
enableNotifications: true,
|
||||
contactOrderBy: 'lastmsg',
|
||||
reverseContactOrder: true,
|
||||
country: ''
|
||||
},
|
||||
|
||||
// Functions
|
||||
created: function () {
|
||||
var self = this;
|
||||
$.getJSON(Sms.generateURL('/front-api/v1/settings'), function (jsondata, status) {
|
||||
if (jsondata['status'] === true) {
|
||||
self.messageLimit = parseInt(jsondata["message_limit"]);
|
||||
self.enableNotifications = parseInt(jsondata["notification_state"]) !== 0 ? 1 : 0;
|
||||
self.contactOrderBy = jsondata["contact_order"];
|
||||
self.reverseContactOrder = toBool(jsondata["contact_order_reverse"]);
|
||||
self.country = jsondata["country"];
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
sendMessageLimit: function () {
|
||||
if (this.messageLimit === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
$.post(Sms.generateURL('/set/msglimit'),
|
||||
{
|
||||
'limit': self.messageLimit
|
||||
}
|
||||
);
|
||||
},
|
||||
sendNotificationFlag: function () {
|
||||
var self = this;
|
||||
$.post(Sms.generateURL('/set/notification_state'),
|
||||
{
|
||||
'notification': parseInt(self.enableNotifications)
|
||||
}
|
||||
);
|
||||
},
|
||||
sendContactOrder: function () {
|
||||
var self = this;
|
||||
$.post(Sms.generateURL('/set/contact_order'),
|
||||
{
|
||||
'attribute': self.contactOrderBy,
|
||||
'reverse': self.reverseContactOrder
|
||||
}
|
||||
);
|
||||
},
|
||||
sendCountry: function () {
|
||||
var self = this;
|
||||
$.post(Sms.generateURL('/set/country'),
|
||||
{
|
||||
'country': self.country
|
||||
}
|
||||
);
|
||||
},
|
||||
wipeAllMessages: function () {
|
||||
$.post(Sms.generateURL('/front-api/v1/delete/all'), {}, function () {
|
||||
ContactList.reset();
|
||||
Conversation.clear();
|
||||
});
|
||||
},
|
||||
isContactListEmpty: function () {
|
||||
return ContactList.contacts.length === 0;
|
||||
}
|
||||
}
|
||||
});
|
137
js/lodash.min.js
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
/**
|
||||
* @license
|
||||
* Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&false!==t(n[r],r,n););return n}function e(n,t){for(var r=null==n?0:n.length;r--&&false!==t(n[r],r,n););return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return false;
|
||||
return true}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!(null==n||!n.length)&&-1<v(n,t,0)}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return true;return false}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);
|
||||
return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return true;return false}function p(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,false}),e}function _(n,t,r,e){var u=n.length;for(r+=e?1:-1;e?r--:++r<u;)if(t(n[r],r,n))return r;return-1}function v(n,t,r){if(t===t)n:{--r;for(var e=n.length;++r<e;)if(n[r]===t){n=r;break n}n=-1}else n=_(n,d,r);return n}function g(n,t,r,e){
|
||||
--r;for(var u=n.length;++r<u;)if(e(n[r],t))return r;return-1}function d(n){return n!==n}function y(n,t){var r=null==n?0:n.length;return r?m(n,t)/r:F}function b(n){return function(t){return null==t?T:t[n]}}function x(n){return function(t){return null==n?T:n[t]}}function j(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=false,n):t(r,n,u,i)}),r}function w(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function m(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==T&&(r=r===T?i:r+i)}return r;
|
||||
}function A(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function E(n,t){return c(t,function(t){return[t,n[t]]})}function k(n){return function(t){return n(t)}}function S(n,t){return c(t,function(t){return n[t]})}function O(n,t){return n.has(t)}function I(n,t){for(var r=-1,e=n.length;++r<e&&-1<v(t,n[r],0););return r}function R(n,t){for(var r=n.length;r--&&-1<v(t,n[r],0););return r}function z(n){return"\\"+Un[n]}function W(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n];
|
||||
}),r}function B(n,t){return function(r){return n(t(r))}}function L(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&"__lodash_placeholder__"!==o||(n[r]="__lodash_placeholder__",i[u++]=r)}return i}function U(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function C(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function D(n){if(Rn.test(n)){for(var t=On.lastIndex=0;On.test(n);)++t;n=t}else n=Qn(n);return n}function M(n){return Rn.test(n)?n.match(On)||[]:n.split("");
|
||||
}var T,$=1/0,F=NaN,N=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],P=/\b__p\+='';/g,Z=/\b(__p\+=)''\+/g,q=/(__e\(.*?\)|\b__t\))\+'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,En="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",kn=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+En+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Bn={};
|
||||
Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object DataView]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=false;
|
||||
var Ln={};Ln["[object Arguments]"]=Ln["[object Array]"]=Ln["[object ArrayBuffer]"]=Ln["[object DataView]"]=Ln["[object Boolean]"]=Ln["[object Date]"]=Ln["[object Float32Array]"]=Ln["[object Float64Array]"]=Ln["[object Int8Array]"]=Ln["[object Int16Array]"]=Ln["[object Int32Array]"]=Ln["[object Map]"]=Ln["[object Number]"]=Ln["[object Object]"]=Ln["[object RegExp]"]=Ln["[object Set]"]=Ln["[object String]"]=Ln["[object Symbol]"]=Ln["[object Uint8Array]"]=Ln["[object Uint8ClampedArray]"]=Ln["[object Uint16Array]"]=Ln["[object Uint32Array]"]=true,
|
||||
Ln["[object Error]"]=Ln["[object Function]"]=Ln["[object WeakMap]"]=false;var Un={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cn=parseFloat,Dn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,Tn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function("return this")(),Fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nn=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){
|
||||
try{var n=Nn&&Nn.f&&Nn.f("util").types;return n?n:Zn&&Zn.binding&&Zn.binding("util")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I",
|
||||
"\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C",
|
||||
"\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i",
|
||||
"\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r",
|
||||
"\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij",
|
||||
"\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(du(n)&&!of(n)&&!(n instanceof Un)){if(n instanceof On)return n;if(ii.call(n,"__wrapped__"))return $e(n)}return new On(n)}function En(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Un(n){this.__wrapped__=n,
|
||||
this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Tn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Fn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Nn(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Fn;++t<r;)this.add(n[t]);
|
||||
}function Zn(n){this.size=(this.__data__=new Tn(n)).size}function qn(n,t){var r,e=of(n),u=!e&&uf(n),i=!e&&!u&&cf(n),o=!e&&!u&&!i&&pf(n),u=(e=e||u||i||o)?A(n.length,Xu):[],f=u.length;for(r in n)!t&&!ii.call(n,r)||e&&("length"==r||i&&("offset"==r||"parent"==r)||o&&("buffer"==r||"byteLength"==r||"byteOffset"==r)||Se(r,f))||u.push(r);return u}function Qn(n){var t=n.length;return t?n[ir(0,t-1)]:T}function et(n,t){return Ce(Ur(n),pt(t,0,n.length))}function ut(n){return Ce(Ur(n))}function it(n,t,r){(r===T||au(n[t],r))&&(r!==T||t in n)||st(n,t,r);
|
||||
}function ot(n,t,r){var e=n[t];ii.call(n,t)&&au(e,r)&&(r!==T||t in n)||st(n,t,r)}function ft(n,t){for(var r=n.length;r--;)if(au(n[r][0],t))return r;return-1}function ct(n,t,r,e){return eo(n,function(n,u,i){t(e,n,r(n),i)}),e}function at(n,t){return n&&Cr(t,zu(t),n)}function lt(n,t){return n&&Cr(t,Wu(t),n)}function st(n,t,r){"__proto__"==t&&mi?mi(n,t,{configurable:true,enumerable:true,value:r,writable:true}):n[t]=r}function ht(n,t){for(var r=-1,e=t.length,u=Vu(e),i=null==n;++r<e;)u[r]=i?T:Iu(n,t[r]);return u;
|
||||
}function pt(n,t,r){return n===n&&(r!==T&&(n=n<=r?n:r),t!==T&&(n=n>=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!gu(n))return n;if(u=of(n)){if(f=me(n),!c)return Ur(n,f)}else{var s=_o(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(cf(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Ln[s])return i?n:{};f=Ee(n,s,c)}}if(o||(o=new Zn),
|
||||
i=o.get(n))return i;if(o.set(n,f),hf(n))return n.forEach(function(r){f.add(_t(r,t,e,r,n,o))}),f;if(lf(n))return n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o))}),f;var a=l?a?ve:_e:a?Wu:zu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o))}),f}function vt(n){var t=zu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return!e;for(n=Yu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ni("Expected a function");
|
||||
return yo(function(){n.apply(T,r)},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,k(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++u<l;){var p=n[u],_=null==r?p:r(p),p=e||0!==p?p:0;if(a&&_===_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function bt(n,t){var r=true;return eo(n,function(n,e,u){return r=!!t(n,e,u)}),r}function xt(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===T?o===o&&!ju(o):r(o,f)))var f=o,c=i;
|
||||
}return c}function jt(n,t){var r=[];return eo(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function wt(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=ke),u||(u=[]);++i<o;){var f=n[i];0<t&&r(f)?1<t?wt(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function mt(n,t){return n&&io(n,t,zu)}function At(n,t){return n&&oo(n,t,zu)}function Et(n,t){return i(t,function(t){return pu(n[t])})}function kt(n,t){t=Sr(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[De(t[r++])];return r&&r==e?n:T}function St(n,t,r){return t=t(n),
|
||||
of(n)?t:a(t,r(n))}function Ot(n){if(null==n)n=n===T?"[object Undefined]":"[object Null]";else if(wi&&wi in Yu(n)){var t=ii.call(n,wi),r=n[wi];try{n[wi]=T;var e=true}catch(n){}var u=ci.call(n);e&&(t?n[wi]=r:delete n[wi]),n=u}else n=ci.call(n);return n}function It(n,t){return n>t}function Rt(n,t){return null!=n&&ii.call(n,t)}function zt(n,t){return null!=n&&t in Yu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Vu(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,k(t))),s=Ui(p.length,s),
|
||||
l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T}var p=n[0],_=-1,v=l[0];n:for(;++_<u&&h.length<s;){var g=p[_],d=t?t(g):g,g=r||0!==g?g:0;if(v?!O(v,d):!e(h,d,r)){for(a=i;--a;){var y=l[a];if(y?!O(y,d):!e(n[a],d,r))continue n}v&&v.push(d),h.push(g)}}return h}function Bt(n,t,r){var e={};return mt(n,function(n,u,i){t(e,r(n),u,i)}),e}function Lt(t,r,e){return r=Sr(r,t),t=2>r.length?t:kt(t,hr(r,0,-1)),r=null==t?t:t[De(qe(r))],null==r?T:n(r,t,e)}function Ut(n){return du(n)&&"[object Arguments]"==Ot(n)}function Ct(n){
|
||||
return du(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return du(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!du(n)&&!du(t))t=n!==n&&t!==t;else n:{var i=of(n),o=of(t),f=i?"[object Array]":_o(n),c=o?"[object Array]":_o(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&cf(n)){if(!cf(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Zn),t=i||pf(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{
|
||||
if(!(1&r)&&(i=a&&ii.call(n,"__wrapped__"),f=o&&ii.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Zn),t=Mt(n,t,r,e,u);break n}if(c)t:if(u||(u=new Zn),i=1&r,f=_e(n),o=f.length,c=_e(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:ii.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++a<o;){var l=f[a],h=n[l],p=t[l];if(e)var _=i?e(p,h,l,t,n,u):e(h,p,l,n,t,u);if(_===T?h!==p&&!Mt(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l);
|
||||
}c&&!s&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),u.delete(n),u.delete(t),t=c}}else t=false;else t=false}}return t}function Tt(n){return du(n)&&"[object Map]"==_o(n)}function $t(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=Yu(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return false}for(;++u<i;){var f=r[u],c=f[0],a=n[c],l=f[1];if(o&&f[2]){if(a===T&&!(c in n))return false;
|
||||
}else{if(f=new Zn,e)var s=e(a,l,c,n,t,f);if(s===T?!Mt(l,a,3,e,f):!s)return false}}return true}function Ft(n){return!(!gu(n)||fi&&fi in n)&&(pu(n)?si:dn).test(Me(n))}function Nt(n){return du(n)&&"[object RegExp]"==Ot(n)}function Pt(n){return du(n)&&"[object Set]"==_o(n)}function Zt(n){return du(n)&&vu(n.length)&&!!Bn[Ot(n)]}function qt(n){return typeof n=="function"?n:null==n?Tu:typeof n=="object"?of(n)?Jt(n[0],n[1]):Ht(n):Pu(n)}function Vt(n){if(!ze(n))return Bi(n);var t,r=[];for(t in Yu(n))ii.call(n,t)&&"constructor"!=t&&r.push(t);
|
||||
return r}function Kt(n,t){return n<t}function Gt(n,t){var r=-1,e=lu(n)?Vu(n.length):[];return eo(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Ht(n){var t=xe(n);return 1==t.length&&t[0][2]?We(t[0][0],t[0][1]):function(r){return r===n||$t(r,n,t)}}function Jt(n,t){return Ie(n)&&t===t&&!gu(t)?We(De(n),t):function(r){var e=Iu(r,n);return e===T&&e===t?Ru(r,n):Mt(t,e,3)}}function Yt(n,t,r,e,u){n!==t&&io(t,function(i,o){if(gu(i)){u||(u=new Zn);var f=u,c="__proto__"==o?T:n[o],a="__proto__"==o?T:t[o],l=f.get(a);
|
||||
if(l)it(n,o,l);else{var l=e?e(c,a,o+"",n,t,f):T,s=l===T;if(s){var h=of(a),p=!h&&cf(a),_=!h&&!p&&pf(a),l=a;h||p||_?of(c)?l=c:su(c)?l=Ur(c):p?(s=false,l=Ir(a,true)):_?(s=false,l=zr(a,true)):l=[]:bu(a)||uf(a)?(l=c,uf(c)?l=Su(c):(!gu(c)||r&&pu(c))&&(l=Ae(a))):s=false}s&&(f.set(a,l),Yt(l,a,r,e,f),f.delete(a)),it(n,o,l)}}else f=e?e("__proto__"==o?T:n[o],i,o+"",n,t,u):T,f===T&&(f=i),it(n,o,f)},Wu)}function Qt(n,t){var r=n.length;if(r)return t+=0>t?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[Tu],k(ye())),
|
||||
n=Gt(n,function(n){return{a:c(t,function(t){return t(n)}),b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e<o;){var c=Wr(u[e],i[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function nr(n,t){return tr(n,t,function(t,r){return Ru(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=kt(n,o);r(f,o)&&lr(i,Sr(o,n),f)}return i}function rr(n){return function(t){return kt(t,n)}}function er(n,t,r,e){var u=e?g:v,i=-1,o=t.length,f=n;
|
||||
for(n===t&&(t=Ur(t)),r&&(f=c(n,k(r)));++i<o;)for(var a=0,l=t[i],l=r?r(l):l;-1<(a=u(f,l,a,e));)f!==n&&bi.call(f,a,1),bi.call(n,a,1);return n}function ur(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Se(u)?bi.call(n,u,1):xr(n,u)}}}function ir(n,t){return n+Oi(Mi()*(t-n+1))}function or(n,t){var r="";if(!n||1>t||9007199254740991<t)return r;do t%2&&(r+=n),(t=Oi(t/2))&&(n+=n);while(t);return r}function fr(n,t){return bo(Be(n,t,Tu),n+"")}function cr(n){return Qn(Lu(n))}function ar(n,t){
|
||||
var r=Lu(n);return Ce(r,pt(t,0,r.length))}function lr(n,t,r,e){if(!gu(n))return n;t=Sr(t,n);for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var c=De(t[u]),a=r;if(u!=o){var l=f[c],a=e?e(l,c,f):T;a===T&&(a=gu(l)?l:Se(t[u+1])?[]:{})}ot(f,c,a),f=f[c]}return n}function sr(n){return Ce(Lu(n))}function hr(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Vu(u);++e<u;)r[e]=n[e+t];return r}function pr(n,t){var r;return eo(n,function(n,e,u){return r=t(n,e,u),
|
||||
!r}),!!r}function _r(n,t,r){var e=0,u=null==n?e:n.length;if(typeof t=="number"&&t===t&&2147483647>=u){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!ju(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return vr(n,t,Tu,r)}function vr(n,t,r,e){t=r(t);for(var u=0,i=null==n?0:n.length,o=t!==t,f=null===t,c=ju(t),a=t===T;u<i;){var l=Oi((u+i)/2),s=r(n[l]),h=s!==T,p=null===s,_=s===s,v=ju(s);(o?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?s<=t:s<t)?u=l+1:i=l}return Ui(i,4294967294)}function gr(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){
|
||||
var o=n[r],f=t?t(o):o;if(!r||!au(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function dr(n){return typeof n=="number"?n:ju(n)?F:+n}function yr(n){if(typeof n=="string")return n;if(of(n))return c(n,yr)+"";if(ju(n))return to?to.call(n):"";var t=n+"";return"0"==t&&1/n==-$?"-0":t}function br(n,t,r){var e=-1,u=o,i=n.length,c=true,a=[],l=a;if(r)c=false,u=f;else if(200<=i){if(u=t?null:lo(n))return U(u);c=false,u=O,l=new Nn}else l=t?[]:a;n:for(;++e<i;){var s=n[e],h=t?t(s):s,s=r||0!==s?s:0;if(c&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue n;
|
||||
t&&l.push(h),a.push(s)}else u(l,h,r)||(l!==a&&l.push(h),a.push(s))}return a}function xr(n,t){return t=Sr(t,n),n=2>t.length?n:kt(n,hr(t,0,-1)),null==n||delete n[De(qe(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?hr(n,e?0:i,e?i+1:u):hr(n,e?i+1:0,e?u:i)}function wr(n,t){var r=n;return r instanceof Un&&(r=r.value()),l(t,function(n,t){return t.func.apply(t.thisArg,a([n],t.args))},r)}function mr(n,t,r){var e=n.length;if(2>e)return e?br(n[0]):[];for(var u=-1,i=Vu(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=yt(i[u]||o,n[f],t,r));
|
||||
return br(wt(i,1),t,r)}function Ar(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;)r(o,n[e],e<i?t[e]:T);return o}function Er(n){return su(n)?n:[]}function kr(n){return typeof n=="function"?n:Tu}function Sr(n,t){return of(n)?n:Ie(n,t)?[n]:xo(Ou(n))}function Or(n,t,r){var e=n.length;return r=r===T?e:r,!t&&r>=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=vi?vi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new _i(t).set(new _i(n)),
|
||||
t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length)}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=ju(n),o=t!==T,f=null===t,c=t===t,a=ju(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Br(n,t,r,e){var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Li(i-o,0),l=Vu(c+a);for(e=!e;++f<c;)l[f]=t[f];for(;++u<o;)(e||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];
|
||||
return l}function Lr(n,t,r,e){var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Li(i-f,0),s=Vu(l+a);for(e=!e;++u<l;)s[u]=n[u];for(l=u;++c<a;)s[l+c]=t[c];for(;++o<f;)(e||u<i)&&(s[l+r[o]]=n[u++]);return s}function Ur(n,t){var r=-1,e=n.length;for(t||(t=Vu(e));++r<e;)t[r]=n[r];return t}function Cr(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):T;c===T&&(c=n[f]),u?st(r,f,c):ot(r,f,c)}return r}function Dr(n,t){return Cr(n,ho(n),t)}function Mr(n,t){return Cr(n,po(n),t);
|
||||
}function Tr(n,r){return function(e,u){var i=of(e)?t:ct,o=r?r():{};return i(e,n,ye(u,2),o)}}function $r(n){return fr(function(t,r){var e=-1,u=r.length,i=1<u?r[u-1]:T,o=2<u?r[2]:T,i=3<n.length&&typeof i=="function"?(u--,i):T;for(o&&Oe(r[0],r[1],o)&&(i=3>u?T:i,u=1),t=Yu(t);++e<u;)(o=r[e])&&n(t,o,e,i);return t})}function Fr(n,t){return function(r,e){if(null==r)return r;if(!lu(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=Yu(r);(t?i--:++i<u)&&false!==e(o[i],i,o););return r}}function Nr(n){return function(t,r,e){
|
||||
var u=-1,i=Yu(t);e=e(t);for(var o=e.length;o--;){var f=e[n?o:++u];if(false===r(i[f],f,i))break}return t}}function Pr(n,t,r){function e(){return(this&&this!==$n&&this instanceof e?i:n).apply(u?r:this,arguments)}var u=1&t,i=Vr(n);return e}function Zr(n){return function(t){t=Ou(t);var r=Rn.test(t)?M(t):T,e=r?r[0]:t.charAt(0);return t=r?Or(r,1).join(""):t.slice(1),e[n]()+t}}function qr(n){return function(t){return l(Du(Cu(t).replace(kn,"")),n,"")}}function Vr(n){return function(){var t=arguments;switch(t.length){
|
||||
case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=ro(n.prototype),t=n.apply(r,t);return gu(t)?t:r}}function Kr(t,r,e){function u(){for(var o=arguments.length,f=Vu(o),c=o,a=de(u);c--;)f[c]=arguments[c];return c=3>o&&f[0]!==a&&f[o-1]!==a?[]:L(f,a),
|
||||
o-=c.length,o<e?ue(t,r,Jr,u.placeholder,T,f,c,T,T,e-o):n(this&&this!==$n&&this instanceof u?i:t,this,f)}var i=Vr(t);return u}function Gr(n){return function(t,r,e){var u=Yu(t);if(!lu(t)){var i=ye(r,3);t=zu(t),r=function(n){return i(u[n],n,u)}}return r=n(t,r,e),-1<r?u[i?t[r]:r]:T}}function Hr(n){return pe(function(t){var r=t.length,e=r,u=On.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if(typeof i!="function")throw new ni("Expected a function");if(u&&!o&&"wrapper"==ge(i))var o=new On([],true)}for(e=o?e:r;++e<r;)var i=t[e],u=ge(i),f="wrapper"==u?so(i):T,o=f&&Re(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?o[ge(f[0])].apply(o,f[3]):1==i.length&&Re(i)?o[u]():o.thru(i);
|
||||
return function(){var n=arguments,e=n[0];if(o&&1==n.length&&of(e))return o.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++u<r;)n=t[u].call(this,n);return n}})}function Jr(n,t,r,e,u,i,o,f,c,a){function l(){for(var d=arguments.length,y=Vu(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=de(l),b=y.length;for(x=0;b--;)y[b]===j&&++x}if(e&&(y=Br(y,e,u,_)),i&&(y=Lr(y,i,o,_)),d-=x,_&&d<a)return j=L(y,j),ue(n,t,Jr,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[n]:n,d=y.length,f){x=y.length;for(var w=Ui(f.length,x),m=Ur(y);w--;){
|
||||
var A=f[w];y[w]=Se(A,x)?m[A]:T}}else v&&1<d&&y.reverse();return s&&c<d&&(y.length=c),this&&this!==$n&&this instanceof l&&(b=g||Vr(b)),b.apply(j,y)}var s=128&t,h=1&t,p=2&t,_=24&t,v=512&t,g=p?T:Vr(n);return l}function Yr(n,t){return function(r,e){return Bt(r,n,t(e))}}function Qr(n,t){return function(r,e){var u;if(r===T&&e===T)return t;if(r!==T&&(u=r),e!==T){if(u===T)return e;typeof r=="string"||typeof e=="string"?(r=yr(r),e=yr(e)):(r=dr(r),e=dr(e)),u=n(r,e)}return u}}function Xr(t){return pe(function(r){
|
||||
return r=c(r,k(ye())),fr(function(e){var u=this;return t(r,function(t){return n(t,u,e)})})})}function ne(n,t){t=t===T?" ":yr(t);var r=t.length;return 2>r?r?or(t,n):t:(r=or(t,Si(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Vu(l+c),h=this&&this!==$n&&this instanceof i?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++r];return n(h,o?e:this,s)}var o=1&r,f=Vr(t);return i}function re(n){return function(t,r,e){
|
||||
e&&typeof e!="number"&&Oe(t,r,e)&&(r=e=T),t=mu(t),r===T?(r=t,t=0):r=mu(r),e=e===T?t<r?1:-1:mu(e);var u=-1;r=Li(Si((r-t)/(e||1)),0);for(var i=Vu(r);r--;)i[n?r:++u]=t,t+=e;return i}}function ee(n){return function(t,r){return typeof t=="string"&&typeof r=="string"||(t=ku(t),r=ku(r)),n(t,r)}}function ue(n,t,r,e,u,i,o,f,c,a){var l=8&t,s=l?o:T;o=l?T:o;var h=l?i:T;return i=l?T:i,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),u=[n,t,u,h,s,i,o,f,c,a],r=r.apply(T,u),Re(n)&&go(r,u),r.placeholder=e,Le(r,n,t)}function ie(n){
|
||||
var t=Ju[n];return function(n,r){if(n=ku(n),r=null==r?0:Ui(Au(r),292)){var e=(Ou(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(Ou(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function oe(n){return function(t){var r=_o(t);return"[object Map]"==r?W(t):"[object Set]"==r?C(t):E(t,n(t))}}function fe(n,t,r,e,u,i,o,f){var c=2&t;if(!c&&typeof n!="function")throw new ni("Expected a function");var a=e?e.length:0;if(a||(t&=-97,e=u=T),o=o===T?o:Li(Au(o),0),f=f===T?f:Au(f),a-=u?u.length:0,64&t){
|
||||
var l=e,s=u;e=u=T}var h=c?T:so(n);return i=[n,t,r,e,u,l,s,i,o,f],h&&(r=i[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&i[7].length<=h[8]||384==n&&h[7].length<=h[8]&&8==r,131>t||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Br(e,r,h[4]):r,i[4]=e?L(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Lr(e,r,h[6]):r,i[6]=e?L(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ui(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0],t=i[1],
|
||||
r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Li(i[9]-a,0),!f&&24&t&&(t&=-25),Le((h?fo:go)(t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),i),n,t)}function ce(n,t,r,e){return n===T||au(n,ri[r])&&!ii.call(e,r)?t:n}function ae(n,t,r,e,u,i){return gu(n)&&gu(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return bu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t;var c=-1,a=true,l=2&r?new Nn:T;
|
||||
for(i.set(n,t),i.set(t,n);++c<f;){var s=n[c],p=t[c];if(e)var _=o?e(p,s,c,t,n,i):e(s,p,c,n,t,i);if(_!==T){if(_)continue;a=false;break}if(l){if(!h(t,function(n,t){if(!O(l,t)&&(s===n||u(s,n,r,e,i)))return l.push(t)})){a=false;break}}else if(s!==p&&!u(s,p,r,e,i)){a=false;break}}return i.delete(n),i.delete(t),a}function he(n,t,r,e,u,i,o){switch(r){case"[object DataView]":if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)break;n=n.buffer,t=t.buffer;case"[object ArrayBuffer]":if(n.byteLength!=t.byteLength||!i(new _i(n),new _i(t)))break;
|
||||
return true;case"[object Boolean]":case"[object Date]":case"[object Number]":return au(+n,+t);case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object RegExp]":case"[object String]":return n==t+"";case"[object Map]":var f=W;case"[object Set]":if(f||(f=U),n.size!=t.size&&!(1&e))break;return(r=o.get(n))?r==t:(e|=2,o.set(n,t),t=se(f(n),f(t),e,u,i,o),o.delete(n),t);case"[object Symbol]":if(no)return no.call(n)==no.call(t)}return false}function pe(n){return bo(Be(n,T,Pe),n+"")}function _e(n){
|
||||
return St(n,zu,ho)}function ve(n){return St(n,Wu,po)}function ge(n){for(var t=n.name+"",r=Ki[t],e=ii.call(Ki,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function de(n){return(ii.call(An,"placeholder")?An:n).placeholder}function ye(){var n=An.iteratee||$u,n=n===$u?qt:n;return arguments.length?n(arguments[0],arguments[1]):n}function be(n,t){var r=n.__data__,e=typeof t;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?r[typeof t=="string"?"string":"hash"]:r.map;
|
||||
}function xe(n){for(var t=zu(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,u===u&&!gu(u)]}return t}function je(n,t){var r=null==n?T:n[t];return Ft(r)?r:T}function we(n,t,r){t=Sr(t,n);for(var e=-1,u=t.length,i=false;++e<u;){var o=De(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&vu(u)&&Se(o,u)&&(of(n)||uf(n)))}function me(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&ii.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ae(n){
|
||||
return typeof n.constructor!="function"||ze(n)?{}:ro(gi(n))}function Ee(n,t,r){var e=n.constructor;switch(t){case"[object ArrayBuffer]":return Rr(n);case"[object Boolean]":case"[object Date]":return new e(+n);case"[object DataView]":return t=r?Rr(n.buffer):n.buffer,new n.constructor(t,n.byteOffset,n.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":
|
||||
case"[object Uint16Array]":case"[object Uint32Array]":return zr(n,r);case"[object Map]":return new e;case"[object Number]":case"[object String]":return new e(n);case"[object RegExp]":return t=new n.constructor(n.source,_n.exec(n)),t.lastIndex=n.lastIndex,t;case"[object Set]":return new e;case"[object Symbol]":return no?Yu(no.call(n)):{}}}function ke(n){return of(n)||uf(n)||!!(xi&&n&&n[xi])}function Se(n,t){var r=typeof n;return t=null==t?9007199254740991:t,!!t&&("number"==r||"symbol"!=r&&bn.test(n))&&-1<n&&0==n%1&&n<t;
|
||||
}function Oe(n,t,r){if(!gu(r))return false;var e=typeof t;return!!("number"==e?lu(r)&&Se(t,r.length):"string"==e&&t in r)&&au(r[t],n)}function Ie(n,t){if(of(n))return false;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!ju(n))||(nn.test(n)||!X.test(n)||null!=t&&n in Yu(t))}function Re(n){var t=ge(n),r=An[t];return typeof r=="function"&&t in Un.prototype&&(n===r||(t=so(r),!!t&&n===t[0]))}function ze(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||ri)}function We(n,t){
|
||||
return function(r){return null!=r&&(r[n]===t&&(t!==T||n in Yu(r)))}}function Be(t,r,e){return r=Li(r===T?t.length-1:r,0),function(){for(var u=arguments,i=-1,o=Li(u.length-r,0),f=Vu(o);++i<o;)f[i]=u[r+i];for(i=-1,o=Vu(r+1);++i<r;)o[i]=u[i];return o[r]=e(f),n(t,this,o)}}function Le(n,t,r){var e=t+"";t=bo;var u,i=Te;return u=(u=e.match(an))?u[1].split(ln):[],r=i(u,r),(i=r.length)&&(u=i-1,r[u]=(1<i?"& ":"")+r[u],r=r.join(2<i?", ":" "),e=e.replace(cn,"{\n/* [wrapped with "+r+"] */\n")),t(n,e)}function Ue(n){
|
||||
var t=0,r=0;return function(){var e=Ci(),u=16-(e-r);if(r=e,0<u){if(800<=++t)return arguments[0]}else t=0;return n.apply(T,arguments)}}function Ce(n,t){var r=-1,e=n.length,u=e-1;for(t=t===T?e:t;++r<t;){var e=ir(r,u),i=n[e];n[e]=n[r],n[r]=i}return n.length=t,n}function De(n){if(typeof n=="string"||ju(n))return n;var t=n+"";return"0"==t&&1/n==-$?"-0":t}function Me(n){if(null!=n){try{return ui.call(n)}catch(n){}return n+""}return""}function Te(n,t){return r(N,function(r){var e="_."+r[0];t&r[1]&&!o(n,e)&&n.push(e);
|
||||
}),n.sort()}function $e(n){if(n instanceof Un)return n.clone();var t=new On(n.__wrapped__,n.__chain__);return t.__actions__=Ur(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function Fe(n,t,r){var e=null==n?0:n.length;return e?(r=null==r?0:Au(r),0>r&&(r=Li(e+r,0)),_(n,ye(t,3),r)):-1}function Ne(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==T&&(u=Au(r),u=0>r?Li(e+u,0):Ui(u,e-1)),_(n,ye(t,3),u,true)}function Pe(n){return(null==n?0:n.length)?wt(n,1):[]}function Ze(n){
|
||||
return n&&n.length?n[0]:T}function qe(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ve(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ke(n){return null==n?n:Ti.call(n)}function Ge(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(su(n))return t=Li(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function He(t,r){if(!t||!t.length)return[];var e=Ge(t);return null==r?e:c(e,function(t){return n(r,T,t)})}function Je(n){return n=An(n),n.__chain__=true,n}function Ye(n,t){
|
||||
return t(n)}function Qe(){return this}function Xe(n,t){return(of(n)?r:eo)(n,ye(t,3))}function nu(n,t){return(of(n)?e:uo)(n,ye(t,3))}function tu(n,t){return(of(n)?c:Gt)(n,ye(t,3))}function ru(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function eu(n,t){var r;if(typeof t!="function")throw new ni("Expected a function");return n=Au(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T),r}}function uu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=uu.placeholder,
|
||||
n}function iu(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=iu.placeholder,n}function ou(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Ko();if(u(n))return o(n);var r,e=yo;r=n-_,n=t-(n-p),r=g?Ui(n,l-r):n,h=e(i,r)}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Ko(),r=u(n);if(c=arguments,a=this,p=n,r){if(h===T)return _=n=p,h=yo(i,t),v?e(n):s;if(g)return h=yo(i,t),e(p)}return h===T&&(h=yo(i,t)),
|
||||
s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ni("Expected a function");return t=ku(t)||0,gu(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Li(ku(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&ao(h),_=0,c=p=a=h=T},f.flush=function(){return h===T?s:o(Ko())},f}function fu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=n.apply(this,e),r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ni("Expected a function");
|
||||
return r.cache=new(fu.Cache||Fn),r}function cu(n){if(typeof n!="function")throw new ni("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function au(n,t){return n===t||n!==n&&t!==t}function lu(n){return null!=n&&vu(n.length)&&!pu(n)}function su(n){return du(n)&&lu(n)}function hu(n){if(!du(n))return false;var t=Ot(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!bu(n);
|
||||
}function pu(n){return!!gu(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function _u(n){return typeof n=="number"&&n==Au(n)}function vu(n){return typeof n=="number"&&-1<n&&0==n%1&&9007199254740991>=n}function gu(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function du(n){return null!=n&&typeof n=="object"}function yu(n){return typeof n=="number"||du(n)&&"[object Number]"==Ot(n)}function bu(n){return!(!du(n)||"[object Object]"!=Ot(n))&&(n=gi(n),
|
||||
null===n||(n=ii.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ui.call(n)==ai))}function xu(n){return typeof n=="string"||!of(n)&&du(n)&&"[object String]"==Ot(n)}function ju(n){return typeof n=="symbol"||du(n)&&"[object Symbol]"==Ot(n)}function wu(n){if(!n)return[];if(lu(n))return xu(n)?M(n):Ur(n);if(ji&&n[ji]){n=n[ji]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=_o(n),("[object Map]"==t?W:"[object Set]"==t?U:Lu)(n)}function mu(n){return n?(n=ku(n),
|
||||
n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Au(n){n=mu(n);var t=n%1;return n===n?t?n-t:n:0}function Eu(n){return n?pt(Au(n),0,4294967295):0}function ku(n){if(typeof n=="number")return n;if(ju(n))return F;if(gu(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n,n=gu(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Dn(n.slice(2),t?2:8):vn.test(n)?F:+n}function Su(n){return Cr(n,Wu(n))}function Ou(n){return null==n?"":yr(n);
|
||||
}function Iu(n,t,r){return n=null==n?T:kt(n,t),n===T?r:n}function Ru(n,t){return null!=n&&we(n,t,zt)}function zu(n){return lu(n)?qn(n):Vt(n)}function Wu(n){if(lu(n))n=qn(n,true);else if(gu(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&ii.call(n,t))&&e.push(t);n=e}else{if(t=[],null!=n)for(r in Yu(n))t.push(r);n=t}return n}function Bu(n,t){if(null==n)return{};var r=c(ve(n),function(n){return[n]});return t=ye(t),tr(n,r,function(n,r){return t(n,r[0])})}function Lu(n){return null==n?[]:S(n,zu(n));
|
||||
}function Uu(n){return Tf(Ou(n).toLowerCase())}function Cu(n){return(n=Ou(n))&&n.replace(xn,Xn).replace(Sn,"")}function Du(n,t,r){return n=Ou(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Mu(n){return function(){return n}}function Tu(n){return n}function $u(n){return qt(typeof n=="function"?n:_t(n,1))}function Fu(n,t,e){var u=zu(t),i=Et(t,u);null!=e||gu(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=Et(t,zu(t)));var o=!(gu(e)&&"chain"in e&&!e.chain),f=pu(n);return r(i,function(r){
|
||||
var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Ur(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Nu(){}function Pu(n){return Ie(n)?b(De(n)):rr(n)}function Zu(){return[]}function qu(){return false}mn=null==mn?$n:rt.defaults($n.Object(),mn,rt.pick($n,Wn));var Vu=mn.Array,Ku=mn.Date,Gu=mn.Error,Hu=mn.Function,Ju=mn.Math,Yu=mn.Object,Qu=mn.RegExp,Xu=mn.String,ni=mn.TypeError,ti=Vu.prototype,ri=Yu.prototype,ei=mn["__core-js_shared__"],ui=Hu.prototype.toString,ii=ri.hasOwnProperty,oi=0,fi=function(){
|
||||
var n=/[^.]+$/.exec(ei&&ei.keys&&ei.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ci=ri.toString,ai=ui.call(Yu),li=$n._,si=Qu("^"+ui.call(ii).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hi=Pn?mn.Buffer:T,pi=mn.Symbol,_i=mn.Uint8Array,vi=hi?hi.g:T,gi=B(Yu.getPrototypeOf,Yu),di=Yu.create,yi=ri.propertyIsEnumerable,bi=ti.splice,xi=pi?pi.isConcatSpreadable:T,ji=pi?pi.iterator:T,wi=pi?pi.toStringTag:T,mi=function(){try{var n=je(Yu,"defineProperty");
|
||||
return n({},"",{}),n}catch(n){}}(),Ai=mn.clearTimeout!==$n.clearTimeout&&mn.clearTimeout,Ei=Ku&&Ku.now!==$n.Date.now&&Ku.now,ki=mn.setTimeout!==$n.setTimeout&&mn.setTimeout,Si=Ju.ceil,Oi=Ju.floor,Ii=Yu.getOwnPropertySymbols,Ri=hi?hi.isBuffer:T,zi=mn.isFinite,Wi=ti.join,Bi=B(Yu.keys,Yu),Li=Ju.max,Ui=Ju.min,Ci=Ku.now,Di=mn.parseInt,Mi=Ju.random,Ti=ti.reverse,$i=je(mn,"DataView"),Fi=je(mn,"Map"),Ni=je(mn,"Promise"),Pi=je(mn,"Set"),Zi=je(mn,"WeakMap"),qi=je(Yu,"create"),Vi=Zi&&new Zi,Ki={},Gi=Me($i),Hi=Me(Fi),Ji=Me(Ni),Yi=Me(Pi),Qi=Me(Zi),Xi=pi?pi.prototype:T,no=Xi?Xi.valueOf:T,to=Xi?Xi.toString:T,ro=function(){
|
||||
function n(){}return function(t){return gu(t)?di?di(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=En.prototype,An.prototype.constructor=An,On.prototype=ro(En.prototype),On.prototype.constructor=On,Un.prototype=ro(En.prototype),Un.prototype.constructor=Un,Mn.prototype.clear=function(){this.__data__=qi?qi(null):{},this.size=0},Mn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n],
|
||||
this.size-=n?1:0,n},Mn.prototype.get=function(n){var t=this.__data__;return qi?(n=t[n],"__lodash_hash_undefined__"===n?T:n):ii.call(t,n)?t[n]:T},Mn.prototype.has=function(n){var t=this.__data__;return qi?t[n]!==T:ii.call(t,n)},Mn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=qi&&t===T?"__lodash_hash_undefined__":t,this},Tn.prototype.clear=function(){this.__data__=[],this.size=0},Tn.prototype.delete=function(n){var t=this.__data__;return n=ft(t,n),!(0>n)&&(n==t.length-1?t.pop():bi.call(t,n,1),
|
||||
--this.size,true)},Tn.prototype.get=function(n){var t=this.__data__;return n=ft(t,n),0>n?T:t[n][1]},Tn.prototype.has=function(n){return-1<ft(this.__data__,n)},Tn.prototype.set=function(n,t){var r=this.__data__,e=ft(r,n);return 0>e?(++this.size,r.push([n,t])):r[e][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(Fi||Tn),string:new Mn}},Fn.prototype.delete=function(n){return n=be(this,n).delete(n),this.size-=n?1:0,n},Fn.prototype.get=function(n){return be(this,n).get(n);
|
||||
},Fn.prototype.has=function(n){return be(this,n).has(n)},Fn.prototype.set=function(n,t){var r=be(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Nn.prototype.add=Nn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.clear=function(){this.__data__=new Tn,this.size=0},Zn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Zn.prototype.get=function(n){
|
||||
return this.__data__.get(n)},Zn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Fi||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Fn(e)}return r.set(n,t),this.size=r.size,this};var eo=Fr(mt),uo=Fr(At,true),io=Nr(),oo=Nr(true),fo=Vi?function(n,t){return Vi.set(n,t),n}:Tu,co=mi?function(n,t){return mi(n,"toString",{configurable:true,enumerable:false,value:Mu(t),writable:true})}:Tu,ao=Ai||function(n){
|
||||
return $n.clearTimeout(n)},lo=Pi&&1/U(new Pi([,-0]))[1]==$?function(n){return new Pi(n)}:Nu,so=Vi?function(n){return Vi.get(n)}:Nu,ho=Ii?function(n){return null==n?[]:(n=Yu(n),i(Ii(n),function(t){return yi.call(n,t)}))}:Zu,po=Ii?function(n){for(var t=[];n;)a(t,ho(n)),n=gi(n);return t}:Zu,_o=Ot;($i&&"[object DataView]"!=_o(new $i(new ArrayBuffer(1)))||Fi&&"[object Map]"!=_o(new Fi)||Ni&&"[object Promise]"!=_o(Ni.resolve())||Pi&&"[object Set]"!=_o(new Pi)||Zi&&"[object WeakMap]"!=_o(new Zi))&&(_o=function(n){
|
||||
var t=Ot(n);if(n=(n="[object Object]"==t?n.constructor:T)?Me(n):"")switch(n){case Gi:return"[object DataView]";case Hi:return"[object Map]";case Ji:return"[object Promise]";case Yi:return"[object Set]";case Qi:return"[object WeakMap]"}return t});var vo=ei?pu:qu,go=Ue(fo),yo=ki||function(n,t){return $n.setTimeout(n,t)},bo=Ue(co),xo=function(n){n=fu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(tn,function(n,r,e,u){
|
||||
t.push(e?u.replace(hn,"$1"):r||n)}),t}),jo=fr(function(n,t){return su(n)?yt(n,wt(t,1,su,true)):[]}),wo=fr(function(n,t){var r=qe(t);return su(r)&&(r=T),su(n)?yt(n,wt(t,1,su,true),ye(r,2)):[]}),mo=fr(function(n,t){var r=qe(t);return su(r)&&(r=T),su(n)?yt(n,wt(t,1,su,true),T,r):[]}),Ao=fr(function(n){var t=c(n,Er);return t.length&&t[0]===n[0]?Wt(t):[]}),Eo=fr(function(n){var t=qe(n),r=c(n,Er);return t===qe(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),ko=fr(function(n){var t=qe(n),r=c(n,Er);return(t=typeof t=="function"?t:T)&&r.pop(),
|
||||
r.length&&r[0]===n[0]?Wt(r,T,t):[]}),So=fr(Ve),Oo=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Io=fr(function(n){return br(wt(n,1,su,true))}),Ro=fr(function(n){var t=qe(n);return su(t)&&(t=T),br(wt(n,1,su,true),ye(t,2))}),zo=fr(function(n){var t=qe(n),t=typeof t=="function"?t:T;return br(wt(n,1,su,true),T,t)}),Wo=fr(function(n,t){return su(n)?yt(n,t):[]}),Bo=fr(function(n){return mr(i(n,su))}),Lo=fr(function(n){var t=qe(n);return su(t)&&(t=T),
|
||||
mr(i(n,su),ye(t,2))}),Uo=fr(function(n){var t=qe(n),t=typeof t=="function"?t:T;return mr(i(n,su),T,t)}),Co=fr(Ge),Do=fr(function(n){var t=n.length,t=1<t?n[t-1]:T,t=typeof t=="function"?(n.pop(),t):T;return He(n,t)}),Mo=pe(function(n){function t(t){return ht(t,n)}var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return!(1<r||this.__actions__.length)&&u instanceof Un&&Se(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:Ye,args:[t],thisArg:T}),new On(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(T),
|
||||
n})):this.thru(t)}),To=Tr(function(n,t,r){ii.call(n,r)?++n[r]:st(n,r,1)}),$o=Gr(Fe),Fo=Gr(Ne),No=Tr(function(n,t,r){ii.call(n,r)?n[r].push(t):st(n,r,[t])}),Po=fr(function(t,r,e){var u=-1,i=typeof r=="function",o=lu(t)?Vu(t.length):[];return eo(t,function(t){o[++u]=i?n(r,t,e):Lt(t,r,e)}),o}),Zo=Tr(function(n,t,r){st(n,r,t)}),qo=Tr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Vo=fr(function(n,t){if(null==n)return[];var r=t.length;return 1<r&&Oe(n,t[0],t[1])?t=[]:2<r&&Oe(t[0],t[1],t[2])&&(t=[t[0]]),
|
||||
Xt(n,wt(t,1),[])}),Ko=Ei||function(){return $n.Date.now()},Go=fr(function(n,t,r){var e=1;if(r.length)var u=L(r,de(Go)),e=32|e;return fe(n,e,t,r,u)}),Ho=fr(function(n,t,r){var e=3;if(r.length)var u=L(r,de(Ho)),e=32|e;return fe(t,e,n,r,u)}),Jo=fr(function(n,t){return dt(n,1,t)}),Yo=fr(function(n,t,r){return dt(n,ku(t)||0,r)});fu.Cache=Fn;var Qo=fr(function(t,r){r=1==r.length&&of(r[0])?c(r[0],k(ye())):c(wt(r,1),k(ye()));var e=r.length;return fr(function(u){for(var i=-1,o=Ui(u.length,e);++i<o;)u[i]=r[i].call(this,u[i]);
|
||||
return n(t,this,u)})}),Xo=fr(function(n,t){return fe(n,32,T,t,L(t,de(Xo)))}),nf=fr(function(n,t){return fe(n,64,T,t,L(t,de(nf)))}),tf=pe(function(n,t){return fe(n,256,T,T,T,t)}),rf=ee(It),ef=ee(function(n,t){return n>=t}),uf=Ut(function(){return arguments}())?Ut:function(n){return du(n)&&ii.call(n,"callee")&&!yi.call(n,"callee")},of=Vu.isArray,ff=Vn?k(Vn):Ct,cf=Ri||qu,af=Kn?k(Kn):Dt,lf=Gn?k(Gn):Tt,sf=Hn?k(Hn):Nt,hf=Jn?k(Jn):Pt,pf=Yn?k(Yn):Zt,_f=ee(Kt),vf=ee(function(n,t){return n<=t}),gf=$r(function(n,t){
|
||||
if(ze(t)||lu(t))Cr(t,zu(t),n);else for(var r in t)ii.call(t,r)&&ot(n,r,t[r])}),df=$r(function(n,t){Cr(t,Wu(t),n)}),yf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e)}),bf=$r(function(n,t,r,e){Cr(t,zu(t),n,e)}),xf=pe(ht),jf=fr(function(n,t){n=Yu(n);var r=-1,e=t.length,u=2<e?t[2]:T;for(u&&Oe(t[0],t[1],u)&&(e=1);++r<e;)for(var u=t[r],i=Wu(u),o=-1,f=i.length;++o<f;){var c=i[o],a=n[c];(a===T||au(a,ri[c])&&!ii.call(n,c))&&(n[c]=u[c])}return n}),wf=fr(function(t){return t.push(T,ae),n(Sf,T,t)}),mf=Yr(function(n,t,r){
|
||||
null!=t&&typeof t.toString!="function"&&(t=ci.call(t)),n[t]=r},Mu(Tu)),Af=Yr(function(n,t,r){null!=t&&typeof t.toString!="function"&&(t=ci.call(t)),ii.call(n,t)?n[t].push(r):n[t]=[r]},ye),Ef=fr(Lt),kf=$r(function(n,t,r){Yt(n,t,r)}),Sf=$r(function(n,t,r,e){Yt(n,t,r,e)}),Of=pe(function(n,t){var r={};if(null==n)return r;var e=false;t=c(t,function(t){return t=Sr(t,n),e||(e=1<t.length),t}),Cr(n,ve(n),r),e&&(r=_t(r,7,le));for(var u=t.length;u--;)xr(r,t[u]);return r}),If=pe(function(n,t){return null==n?{}:nr(n,t);
|
||||
}),Rf=oe(zu),zf=oe(Wu),Wf=qr(function(n,t,r){return t=t.toLowerCase(),n+(r?Uu(t):t)}),Bf=qr(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Lf=qr(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Uf=Zr("toLowerCase"),Cf=qr(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Df=qr(function(n,t,r){return n+(r?" ":"")+Tf(t)}),Mf=qr(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Tf=Zr("toUpperCase"),$f=fr(function(t,r){try{return n(t,T,r)}catch(n){return hu(n)?n:new Gu(n)}}),Ff=pe(function(n,t){
|
||||
return r(t,function(t){t=De(t),st(n,t,Go(n[t],n))}),n}),Nf=Hr(),Pf=Hr(true),Zf=fr(function(n,t){return function(r){return Lt(r,n,t)}}),qf=fr(function(n,t){return function(r){return Lt(n,r,t)}}),Vf=Xr(c),Kf=Xr(u),Gf=Xr(h),Hf=re(),Jf=re(true),Yf=Qr(function(n,t){return n+t},0),Qf=ie("ceil"),Xf=Qr(function(n,t){return n/t},1),nc=ie("floor"),tc=Qr(function(n,t){return n*t},1),rc=ie("round"),ec=Qr(function(n,t){return n-t},0);return An.after=function(n,t){if(typeof t!="function")throw new ni("Expected a function");
|
||||
return n=Au(n),function(){if(1>--n)return t.apply(this,arguments)}},An.ary=ru,An.assign=gf,An.assignIn=df,An.assignInWith=yf,An.assignWith=bf,An.at=xf,An.before=eu,An.bind=Go,An.bindAll=Ff,An.bindKey=Ho,An.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return of(n)?n:[n]},An.chain=Je,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Li(Au(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Vu(Si(r/t));e<r;)i[u++]=hr(n,e,e+=t);return i},An.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){
|
||||
var i=n[t];i&&(u[e++]=i)}return u},An.concat=function(){var n=arguments.length;if(!n)return[];for(var t=Vu(n-1),r=arguments[0];n--;)t[n-1]=arguments[n];return a(of(r)?Ur(r):[r],wt(t,1))},An.cond=function(t){var r=null==t?0:t.length,e=ye();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new ni("Expected a function");return[e(n[0]),n[1]]}):[],fr(function(e){for(var u=-1;++u<r;){var i=t[u];if(n(i[0],this,e))return n(i[1],this,e)}})},An.conforms=function(n){return vt(_t(n,1))},An.constant=Mu,
|
||||
An.countBy=To,An.create=function(n,t){var r=ro(n);return null==t?r:at(r,t)},An.curry=uu,An.curryRight=iu,An.debounce=ou,An.defaults=jf,An.defaultsDeep=wf,An.defer=Jo,An.delay=Yo,An.difference=jo,An.differenceBy=wo,An.differenceWith=mo,An.drop=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Au(t),hr(n,0>t?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Au(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[];
|
||||
},An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=Au(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Au(e),0>e&&(e+=u),e=r>e?0:Eu(e);r<e;)n[r++]=t;return n},An.filter=function(n,t){return(of(n)?i:jt)(n,ye(t,3))},An.flatMap=function(n,t){return wt(tu(n,t),1)},An.flatMapDeep=function(n,t){return wt(tu(n,t),$)},An.flatMapDepth=function(n,t,r){return r=r===T?1:Au(r),
|
||||
wt(tu(n,t),r)},An.flatten=Pe,An.flattenDeep=function(n){return(null==n?0:n.length)?wt(n,$):[]},An.flattenDepth=function(n,t){return null!=n&&n.length?(t=t===T?1:Au(t),wt(n,t)):[]},An.flip=function(n){return fe(n,512)},An.flow=Nf,An.flowRight=Pf,An.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},An.functions=function(n){return null==n?[]:Et(n,zu(n))},An.functionsIn=function(n){return null==n?[]:Et(n,Wu(n))},An.groupBy=No,An.initial=function(n){
|
||||
return(null==n?0:n.length)?hr(n,0,-1):[]},An.intersection=Ao,An.intersectionBy=Eo,An.intersectionWith=ko,An.invert=mf,An.invertBy=Af,An.invokeMap=Po,An.iteratee=$u,An.keyBy=Zo,An.keys=zu,An.keysIn=Wu,An.map=tu,An.mapKeys=function(n,t){var r={};return t=ye(t,3),mt(n,function(n,e,u){st(r,t(n,e,u),n)}),r},An.mapValues=function(n,t){var r={};return t=ye(t,3),mt(n,function(n,e,u){st(r,e,t(n,e,u))}),r},An.matches=function(n){return Ht(_t(n,1))},An.matchesProperty=function(n,t){return Jt(n,_t(t,1))},An.memoize=fu,
|
||||
An.merge=kf,An.mergeWith=Sf,An.method=Zf,An.methodOf=qf,An.mixin=Fu,An.negate=cu,An.nthArg=function(n){return n=Au(n),fr(function(t){return Qt(t,n)})},An.omit=Of,An.omitBy=function(n,t){return Bu(n,cu(ye(t)))},An.once=function(n){return eu(2,n)},An.orderBy=function(n,t,r,e){return null==n?[]:(of(t)||(t=null==t?[]:[t]),r=e?T:r,of(r)||(r=null==r?[]:[r]),Xt(n,t,r))},An.over=Vf,An.overArgs=Qo,An.overEvery=Kf,An.overSome=Gf,An.partial=Xo,An.partialRight=nf,An.partition=qo,An.pick=If,An.pickBy=Bu,An.property=Pu,
|
||||
An.propertyOf=function(n){return function(t){return null==n?T:kt(n,t)}},An.pull=So,An.pullAll=Ve,An.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?er(n,t,ye(r,2)):n},An.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?er(n,t,T,r):n},An.pullAt=Oo,An.range=Hf,An.rangeRight=Jf,An.rearg=tf,An.reject=function(n,t){return(of(n)?i:jt)(n,cu(ye(t,3)))},An.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=ye(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),
|
||||
u.push(e))}return ur(n,u),r},An.rest=function(n,t){if(typeof n!="function")throw new ni("Expected a function");return t=t===T?t:Au(t),fr(n,t)},An.reverse=Ke,An.sampleSize=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:Au(t),(of(n)?et:ar)(n,t)},An.set=function(n,t,r){return null==n?n:lr(n,t,r)},An.setWith=function(n,t,r,e){return e=typeof e=="function"?e:T,null==n?n:lr(n,t,r,e)},An.shuffle=function(n){return(of(n)?ut:sr)(n)},An.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&typeof r!="number"&&Oe(n,t,r)?(t=0,
|
||||
r=e):(t=null==t?0:Au(t),r=r===T?e:Au(r)),hr(n,t,r)):[]},An.sortBy=Vo,An.sortedUniq=function(n){return n&&n.length?gr(n):[]},An.sortedUniqBy=function(n,t){return n&&n.length?gr(n,ye(t,2)):[]},An.split=function(n,t,r){return r&&typeof r!="number"&&Oe(n,t,r)&&(t=r=T),r=r===T?4294967295:r>>>0,r?(n=Ou(n))&&(typeof t=="string"||null!=t&&!sf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ni("Expected a function");return r=null==r?0:Li(Au(r),0),
|
||||
fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:Au(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Au(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n),
|
||||
n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ni("Expected a function");return gu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ou(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Ye,An.toArray=wu,An.toPairs=Rf,An.toPairsIn=zf,An.toPath=function(n){return of(n)?c(n,De):ju(n)?[n]:Ur(xo(Ou(n)))},An.toPlainObject=Su,An.transform=function(n,t,e){var u=of(n),i=u||cf(n)||pf(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:gu(n)&&pu(o)?ro(gi(n)):{};
|
||||
}return(i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return ru(n,1)},An.union=Io,An.unionBy=Ro,An.unionWith=zo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=Ge,An.unzipWith=He,An.update=function(n,t,r){return null==n?n:lr(n,t,kr(r)(kt(n,t)),void 0)},An.updateWith=function(n,t,r,e){
|
||||
return e=typeof e=="function"?e:T,null!=n&&(n=lr(n,t,kr(r)(kt(n,t)),e)),n},An.values=Lu,An.valuesIn=function(n){return null==n?[]:S(n,Wu(n))},An.without=Wo,An.words=Du,An.wrap=function(n,t){return Xo(kr(t),n)},An.xor=Bo,An.xorBy=Lo,An.xorWith=Uo,An.zip=Co,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Do,An.entries=Rf,An.entriesIn=zf,An.extend=df,An.extendWith=yf,Fu(An,An),An.add=Yf,An.attempt=$f,An.camelCase=Wf,An.capitalize=Uu,
|
||||
An.ceil=Qf,An.clamp=function(n,t,r){return r===T&&(r=t,t=T),r!==T&&(r=ku(r),r=r===r?r:0),t!==T&&(t=ku(t),t=t===t?t:0),pt(ku(n),t,r)},An.clone=function(n){return _t(n,4)},An.cloneDeep=function(n){return _t(n,5)},An.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,5,t)},An.cloneWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,4,t)},An.conformsTo=function(n,t){return null==t||gt(n,t,zu(t))},An.deburr=Cu,An.defaultTo=function(n,t){return null==n||n!==n?t:n},An.divide=Xf,An.endsWith=function(n,t,r){
|
||||
n=Ou(n),t=yr(t);var e=n.length,e=r=r===T?e:pt(Au(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},An.eq=au,An.escape=function(n){return(n=Ou(n))&&H.test(n)?n.replace(K,nt):n},An.escapeRegExp=function(n){return(n=Ou(n))&&en.test(n)?n.replace(rn,"\\$&"):n},An.every=function(n,t,r){var e=of(n)?u:bt;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.find=$o,An.findIndex=Fe,An.findKey=function(n,t){return p(n,ye(t,3),mt)},An.findLast=Fo,An.findLastIndex=Ne,An.findLastKey=function(n,t){return p(n,ye(t,3),At);
|
||||
},An.floor=nc,An.forEach=Xe,An.forEachRight=nu,An.forIn=function(n,t){return null==n?n:io(n,ye(t,3),Wu)},An.forInRight=function(n,t){return null==n?n:oo(n,ye(t,3),Wu)},An.forOwn=function(n,t){return n&&mt(n,ye(t,3))},An.forOwnRight=function(n,t){return n&&At(n,ye(t,3))},An.get=Iu,An.gt=rf,An.gte=ef,An.has=function(n,t){return null!=n&&we(n,t,Rt)},An.hasIn=Ru,An.head=Ze,An.identity=Tu,An.includes=function(n,t,r,e){return n=lu(n)?n:Lu(n),r=r&&!e?Au(r):0,e=n.length,0>r&&(r=Li(e+r,0)),xu(n)?r<=e&&-1<n.indexOf(t,r):!!e&&-1<v(n,t,r);
|
||||
},An.indexOf=function(n,t,r){var e=null==n?0:n.length;return e?(r=null==r?0:Au(r),0>r&&(r=Li(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=mu(t),r===T?(r=t,t=0):r=mu(r),n=ku(n),n>=Ui(t,r)&&n<Li(t,r)},An.invoke=Ef,An.isArguments=uf,An.isArray=of,An.isArrayBuffer=ff,An.isArrayLike=lu,An.isArrayLikeObject=su,An.isBoolean=function(n){return true===n||false===n||du(n)&&"[object Boolean]"==Ot(n)},An.isBuffer=cf,An.isDate=af,An.isElement=function(n){return du(n)&&1===n.nodeType&&!bu(n)},An.isEmpty=function(n){
|
||||
if(null==n)return true;if(lu(n)&&(of(n)||typeof n=="string"||typeof n.splice=="function"||cf(n)||pf(n)||uf(n)))return!n.length;var t=_o(n);if("[object Map]"==t||"[object Set]"==t)return!n.size;if(ze(n))return!Vt(n).length;for(var r in n)if(ii.call(n,r))return false;return true},An.isEqual=function(n,t){return Mt(n,t)},An.isEqualWith=function(n,t,r){var e=(r=typeof r=="function"?r:T)?r(n,t):T;return e===T?Mt(n,t,T,r):!!e},An.isError=hu,An.isFinite=function(n){return typeof n=="number"&&zi(n)},An.isFunction=pu,
|
||||
An.isInteger=_u,An.isLength=vu,An.isMap=lf,An.isMatch=function(n,t){return n===t||$t(n,t,xe(t))},An.isMatchWith=function(n,t,r){return r=typeof r=="function"?r:T,$t(n,t,xe(t),r)},An.isNaN=function(n){return yu(n)&&n!=+n},An.isNative=function(n){if(vo(n))throw new Gu("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ft(n)},An.isNil=function(n){return null==n},An.isNull=function(n){return null===n},An.isNumber=yu,An.isObject=gu,An.isObjectLike=du,An.isPlainObject=bu,An.isRegExp=sf,
|
||||
An.isSafeInteger=function(n){return _u(n)&&-9007199254740991<=n&&9007199254740991>=n},An.isSet=hf,An.isString=xu,An.isSymbol=ju,An.isTypedArray=pf,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return du(n)&&"[object WeakMap]"==_o(n)},An.isWeakSet=function(n){return du(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Wi.call(n,t)},An.kebabCase=Bf,An.last=qe,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==T&&(u=Au(r),u=0>u?Li(e+u,0):Ui(u,e-1)),
|
||||
t===t){for(r=u+1;r--&&n[r]!==t;);n=r}else n=_(n,d,u,true);return n},An.lowerCase=Lf,An.lowerFirst=Uf,An.lt=_f,An.lte=vf,An.max=function(n){return n&&n.length?xt(n,Tu,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,Tu)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,Tu,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=Zu,An.stubFalse=qu,An.stubObject=function(){return{}},An.stubString=function(){
|
||||
return""},An.stubTrue=function(){return true},An.multiply=tc,An.nth=function(n,t){return n&&n.length?Qt(n,Au(t)):T},An.noConflict=function(){return $n._===this&&($n._=li),this},An.noop=Nu,An.now=Ko,An.pad=function(n,t,r){n=Ou(n);var e=(t=Au(t))?D(n):0;return!t||e>=t?n:(t=(t-e)/2,ne(Oi(t),r)+n+ne(Si(t),r))},An.padEnd=function(n,t,r){n=Ou(n);var e=(t=Au(t))?D(n):0;return t&&e<t?n+ne(t-e,r):n},An.padStart=function(n,t,r){n=Ou(n);var e=(t=Au(t))?D(n):0;return t&&e<t?ne(t-e,r)+n:n},An.parseInt=function(n,t,r){
|
||||
return r||null==t?t=0:t&&(t=+t),Di(Ou(n).replace(on,""),t||0)},An.random=function(n,t,r){if(r&&typeof r!="boolean"&&Oe(n,t,r)&&(t=r=T),r===T&&(typeof t=="boolean"?(r=t,t=T):typeof n=="boolean"&&(r=n,n=T)),n===T&&t===T?(n=0,t=1):(n=mu(n),t===T?(t=n,n=0):t=mu(t)),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Mi(),Ui(n+r*(t-n+Cn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=of(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,eo)},An.reduceRight=function(n,t,r){var e=of(n)?s:j,u=3>arguments.length;
|
||||
return e(n,ye(t,4),r,u,uo)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:Au(t),or(Ou(n),t)},An.replace=function(){var n=arguments,t=Ou(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++e<u;){var i=null==n?T:n[De(t[e])];i===T&&(e=u,i=r),n=pu(i)?i.call(n):i}return n},An.round=rc,An.runInContext=x,An.sample=function(n){return(of(n)?Qn:cr)(n)},An.size=function(n){if(null==n)return 0;if(lu(n))return xu(n)?D(n):n.length;
|
||||
var t=_o(n);return"[object Map]"==t||"[object Set]"==t?n.size:Vt(n).length},An.snakeCase=Cf,An.some=function(n,t,r){var e=of(n)?h:pr;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.sortedIndex=function(n,t){return _r(n,t)},An.sortedIndexBy=function(n,t,r){return vr(n,t,ye(r,2))},An.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=_r(n,t);if(e<r&&au(n[e],t))return e}return-1},An.sortedLastIndex=function(n,t){return _r(n,t,true)},An.sortedLastIndexBy=function(n,t,r){return vr(n,t,ye(r,2),true);
|
||||
},An.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var r=_r(n,t,true)-1;if(au(n[r],t))return r}return-1},An.startCase=Df,An.startsWith=function(n,t,r){return n=Ou(n),r=null==r?0:pt(Au(r),0,n.length),t=yr(t),n.slice(r,r+t.length)==t},An.subtract=ec,An.sum=function(n){return n&&n.length?m(n,Tu):0},An.sumBy=function(n,t){return n&&n.length?m(n,ye(t,2)):0},An.template=function(n,t,r){var e=An.templateSettings;r&&Oe(n,t,r)&&(t=T),n=Ou(n),t=yf({},t,e,ce),r=yf({},t.imports,e.imports,ce);var u,i,o=zu(r),f=S(r,o),c=0;
|
||||
r=t.interpolate||jn;var a="__p+='";r=Qu((t.escape||jn).source+"|"+r.source+"|"+(r===Q?pn:jn).source+"|"+(t.evaluate||jn).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,o,f,l){return e||(e=o),a+=n.slice(c,l).replace(wn,z),r&&(u=true,a+="'+__e("+r+")+'"),f&&(i=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+t.length,t}),a+="';",(t=t.variable)||(a="with(obj){"+a+"}"),a=(i?a.replace(P,""):a).replace(Z,"$1").replace(q,"$1;"),
|
||||
a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=$f(function(){return Hu(o,l+"return "+a).apply(T,f)}),t.source=a,hu(t))throw t;return t},An.times=function(n,t){if(n=Au(n),1>n||9007199254740991<n)return[];var r=4294967295,e=Ui(n,4294967295);for(t=ye(t),n-=4294967295,e=A(e,t);++r<n;)t(r);return e},An.toFinite=mu,An.toInteger=Au,An.toLength=Eu,An.toLower=function(n){
|
||||
return Ou(n).toLowerCase()},An.toNumber=ku,An.toSafeInteger=function(n){return n?pt(Au(n),-9007199254740991,9007199254740991):0===n?n:0},An.toString=Ou,An.toUpper=function(n){return Ou(n).toUpperCase()},An.trim=function(n,t,r){return(n=Ou(n))&&(r||t===T)?n.replace(un,""):n&&(t=yr(t))?(n=M(n),r=M(t),t=I(n,r),r=R(n,r)+1,Or(n,t,r).join("")):n},An.trimEnd=function(n,t,r){return(n=Ou(n))&&(r||t===T)?n.replace(fn,""):n&&(t=yr(t))?(n=M(n),t=R(n,M(t))+1,Or(n,0,t).join("")):n},An.trimStart=function(n,t,r){
|
||||
return(n=Ou(n))&&(r||t===T)?n.replace(on,""):n&&(t=yr(t))?(n=M(n),t=I(n,M(t)),Or(n,t).join("")):n},An.truncate=function(n,t){var r=30,e="...";if(gu(t))var u="separator"in t?t.separator:u,r="length"in t?Au(t.length):r,e="omission"in t?yr(t.omission):e;n=Ou(n);var i=n.length;if(Rn.test(n))var o=M(n),i=o.length;if(r>=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),sf(u)){if(n.slice(i).search(u)){var f=r;for(u.global||(u=Qu(u.source,Ou(_n.exec(u))+"g")),
|
||||
u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c)}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1<u&&(r=r.slice(0,u)));return r+e},An.unescape=function(n){return(n=Ou(n))&&G.test(n)?n.replace(V,tt):n},An.uniqueId=function(n){var t=++oi;return Ou(n)+t},An.upperCase=Mf,An.upperFirst=Tf,An.each=Xe,An.eachRight=nu,An.first=Ze,Fu(An,function(){var n={};return mt(An,function(t,r){ii.call(An.prototype,r)||(n[r]=t)}),n}(),{chain:false}),An.VERSION="4.17.10",r("bind bindKey curry curryRight partial partialRight".split(" "),function(n){
|
||||
An[n].placeholder=An}),r(["drop","take"],function(n,t){Un.prototype[n]=function(r){r=r===T?1:Li(Au(r),0);var e=this.__filtered__&&!t?new Un(this):this.clone();return e.__filtered__?e.__takeCount__=Ui(r,e.__takeCount__):e.__views__.push({size:Ui(r,4294967295),type:n+(0>e.__dir__?"Right":"")}),e},Un.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Un.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({
|
||||
iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Un.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Un.prototype[n]=function(){return this.__filtered__?new Un(this):this[r](1)}}),Un.prototype.compact=function(){return this.filter(Tu)},Un.prototype.find=function(n){return this.filter(n).head()},Un.prototype.findLast=function(n){return this.reverse().find(n);
|
||||
},Un.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Un(this):this.map(function(r){return Lt(r,n,t)})}),Un.prototype.reject=function(n){return this.filter(cu(ye(n)))},Un.prototype.slice=function(n,t){n=Au(n);var r=this;return r.__filtered__&&(0<n||0>t)?new Un(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=Au(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Un.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Un.prototype.toArray=function(){return this.take(4294967295);
|
||||
},mt(Un.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){function t(n){return n=u.apply(An,a([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Un,l=f[0],s=c||of(o);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=i&&!h,c=c&&!p;return!i&&s?(o=c?o:new Un(this),o=n.apply(o,f),o.__actions__.push({
|
||||
func:Ye,args:[t],thisArg:T}),new On(o,h)):l&&c?n.apply(this,f):(o=this.thru(t),l?e?o.value()[0]:o.value():o)})}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ti[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(of(u)?u:[],n)}return this[r](function(r){return t.apply(of(r)?r:[],n)})}}),mt(Un.prototype,function(n,t){var r=An[t];if(r){var e=r.name+"";
|
||||
(Ki[e]||(Ki[e]=[])).push({name:t,func:r})}}),Ki[Jr(T,2).name]=[{name:"wrapper",func:T}],Un.prototype.clone=function(){var n=new Un(this.__wrapped__);return n.__actions__=Ur(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ur(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ur(this.__views__),n},Un.prototype.reverse=function(){if(this.__filtered__){var n=new Un(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n;
|
||||
},Un.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=of(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c<a;){var l=o[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=Ui(n,f+s);break;case"takeRight":f=Li(f,n-s)}}if(n={start:f,end:n},o=n.start,f=n.end,n=f-o,o=u?f:o-1,f=this.__iteratees__,c=f.length,a=0,l=Ui(n,this.__takeCount__),!e||!u&&i==n&&l==n)return wr(t,this.__actions__);e=[];n:for(;n--&&a<l;){for(o+=r,
|
||||
u=-1,i=t[o];++u<c;){var h=f[u],s=h.type,h=(0,h.iteratee)(i);if(2==s)i=h;else if(!h){if(1==s)continue n;break n}}e[a++]=i}return e},An.prototype.at=Mo,An.prototype.chain=function(){return Je(this)},An.prototype.commit=function(){return new On(this.value(),this.__chain__)},An.prototype.next=function(){this.__values__===T&&(this.__values__=wu(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){for(var t,r=this;r instanceof En;){
|
||||
var e=$e(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Un?(this.__actions__.length&&(n=new Un(this)),n=n.reverse(),n.__actions__.push({func:Ye,args:[Ke],thisArg:T}),new On(n,this.__chain__)):this.thru(Ke)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,ji&&(An.prototype[ji]=Qe),
|
||||
An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($n._=rt, define(function(){return rt})):Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt}).call(this);
|
406
js/public/app.js
@ -1,406 +0,0 @@
|
||||
/**
|
||||
* ownCloud - ocsms
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2014-2015
|
||||
*/
|
||||
|
||||
|
||||
// Some global vars to improve performances
|
||||
var selectedConversation = null;
|
||||
var curPhoneNumber = null;
|
||||
var curContactName = '';
|
||||
var lastMsgDate = 0;
|
||||
var unreadCountCurrentConv = 0;
|
||||
var unreadCountAllConv = 0;
|
||||
var unreadCountNotifStep = 12;
|
||||
var lastUnreadCountAllConv = 0;
|
||||
var originalTitle = document.title;
|
||||
|
||||
var app = angular.module('OcSms', []);
|
||||
|
||||
app.controller('OcSmsController', ['$scope',
|
||||
function ($scope) {
|
||||
$scope.buttons = [
|
||||
{text: "Send"}
|
||||
];
|
||||
$scope.contacts = [];
|
||||
$scope.sendCountry = function () {
|
||||
$.post(OC.generateUrl('/apps/ocsms/set/country'),{'country': $('select[name=intl_phone]').val()});
|
||||
};
|
||||
$scope.loadConversation = function (contact) {
|
||||
OC.Util.History.pushState('phonenumber=' + contact.nav);
|
||||
|
||||
// phoneNumber must exist
|
||||
if (contact.nav !== null) {
|
||||
fetchConversation(contact.nav);
|
||||
changeSelectedConversation($("a[mailbox-navigation='" + contact.nav + "']"));
|
||||
}
|
||||
};
|
||||
|
||||
$scope.addContact = function (ct) {
|
||||
$scope.$apply(function () {
|
||||
$scope.contacts.push(ct);
|
||||
});
|
||||
};
|
||||
}
|
||||
]);
|
||||
|
||||
$.urlParam = function(name){
|
||||
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
|
||||
if (results == null) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return results[1] || 0;
|
||||
}
|
||||
};
|
||||
|
||||
var refreshConversation = function() {
|
||||
// if no conversation selected, then don't fetch page
|
||||
if (curPhoneNumber == null) {
|
||||
if ($('#app-content-header').is(':visible')) {
|
||||
$('#app-content-header').hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
$.getJSON(OC.generateUrl('/apps/ocsms/get/conversation'),
|
||||
{
|
||||
'phoneNumber': curPhoneNumber,
|
||||
"lastDate": lastMsgDate
|
||||
},
|
||||
function(jsondata, status) {
|
||||
var fmt = formatConversation(jsondata);
|
||||
conversationBuf = fmt[1];
|
||||
if (conversationBuf != '') {
|
||||
$('.msg-endtag').before(conversationBuf);
|
||||
$('#app-content').scrollTop(1E10);
|
||||
// This will blink the tab because there is new messages
|
||||
if (document.hasFocus() == false) {
|
||||
unreadCountCurrentConv += fmt[0];
|
||||
document.title = originalTitle + " (" + unreadCountCurrentConv + ")";
|
||||
desktopNotify(unreadCountCurrentConv + " unread message(s) in conversation with " + curContactName);
|
||||
}
|
||||
}
|
||||
|
||||
setMessageCountInfo(jsondata);
|
||||
|
||||
if ($('#app-content-header').is(':hidden')) {
|
||||
$('#app-content-header').show();
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
var checkNewMessages = function() {
|
||||
unreadCountAllConv = 0;
|
||||
$.getJSON(OC.generateUrl('/apps/ocsms/get/new_messages'),
|
||||
{ 'lastDate': lastMsgDate },
|
||||
function(jsondata, status) {
|
||||
var peerListBuf = '';
|
||||
var bufferedContacts = [];
|
||||
|
||||
$.each(jsondata['phonelist'], function(id, val) {
|
||||
var fn, peerLabel, idxVal;
|
||||
idxVal = id.replace(/\//g,' ');
|
||||
idxVal2 = idxVal.replace('/ /g','');
|
||||
if (typeof jsondata['contacts'][id] == 'undefined') {
|
||||
fn = '';
|
||||
peerLabel = idxVal;
|
||||
}
|
||||
else {
|
||||
fn = jsondata['contacts'][id];
|
||||
peerLabel = fn;
|
||||
}
|
||||
|
||||
if ($.inArray(peerLabel, bufferedContacts) == -1) {
|
||||
$("li[peer-label='" + peerLabel + "']").remove();
|
||||
peerListBuf = '<li peer-label="' + peerLabel + '"><div class="ocsms-plavatar"';
|
||||
if (typeof jsondata['photos'][peerLabel] != 'undefined') {
|
||||
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
|
||||
}
|
||||
peerListBuf += '></div><a href="#" ng-click="loadConversation(' + idxVal2 + ');" mailbox-navigation="' + idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>';
|
||||
$('#app-mailbox-peers ul').prepend(peerListBuf);
|
||||
bufferedContacts.push(peerLabel);
|
||||
|
||||
// Re-set conversation because we reload the element
|
||||
if (idxVal == curPhoneNumber) {
|
||||
changeSelectedConversation($("a[mailbox-navigation='" + idxVal + "']"));
|
||||
}
|
||||
|
||||
unreadCountAllConv += parseInt(val);
|
||||
|
||||
// Now bind the events when we click on the phone number
|
||||
$("a[mailbox-navigation='" + idxVal + "']").on('click', function (event) {
|
||||
var phoneNumber = $(this).attr('mailbox-navigation');
|
||||
OC.Util.History.pushState('phonenumber=' + phoneNumber);
|
||||
|
||||
// phoneNumber must exist
|
||||
if (phoneNumber != null) {
|
||||
fetchConversation(phoneNumber);
|
||||
unreadCountAllConv += val;
|
||||
changeSelectedConversation($(this));
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Decrement notification step counter, but stop it a zero
|
||||
* Stop at zero permit to notify instanly the user when
|
||||
* there is new messages in all conversations
|
||||
*/
|
||||
|
||||
if (unreadCountNotifStep > 0) {
|
||||
unreadCountNotifStep--;
|
||||
}
|
||||
|
||||
if (unreadCountAllConv > 0) {
|
||||
/*
|
||||
* We notify user every two minutes for all messages
|
||||
* or if unreadCount changes
|
||||
*/
|
||||
if (unreadCountNotifStep == 0 || lastUnreadCountAllConv != unreadCountAllConv) {
|
||||
desktopNotify(unreadCountAllConv + " unread message(s) for all conversations");
|
||||
unreadCountNotifStep = 12;
|
||||
lastUnreadCountAllConv = unreadCountAllConv;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
function setMessageCountInfo(jsondata) {
|
||||
if (typeof jsondata['msgCount'] != 'undefined') {
|
||||
if (jsondata['msgCount'] == 1) {
|
||||
$('#ocsms-phone-msg-nb').html(jsondata['msgCount'] + ' message');
|
||||
}
|
||||
else {
|
||||
$('#ocsms-phone-msg-nb').html(jsondata['msgCount'] + ' messages');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#ocsms-phone-msg-nb').html('');
|
||||
}
|
||||
}
|
||||
|
||||
function fetchConversation(phoneNumber) {
|
||||
$.getJSON(OC.generateUrl('/apps/ocsms/get/conversation'),
|
||||
{
|
||||
'phoneNumber': phoneNumber
|
||||
},
|
||||
function(jsondata, status) {
|
||||
var phoneNumberLabel = phoneNumber;
|
||||
|
||||
if (typeof jsondata['phoneNumbers'] != 'undefined') {
|
||||
var len = jsondata["phoneNumbers"].length;
|
||||
var ctLen = 0;
|
||||
phoneNumberLabel = '';
|
||||
|
||||
$.each(jsondata["phoneNumbers"], function(id, val) {
|
||||
phoneNumberLabel += val;
|
||||
ctLen++;
|
||||
if (ctLen != len) {
|
||||
phoneNumberLabel += ",";
|
||||
}
|
||||
phoneNumberLabel += " ";
|
||||
});
|
||||
}
|
||||
|
||||
conversationBuf = formatConversation(jsondata)[1];
|
||||
conversationBuf += '<div class="msg-endtag"></div>';
|
||||
if (typeof jsondata['contactName'] == 'undefined' || jsondata['contactName'] == '') {
|
||||
$('#ocsms-phone-label').html(phoneNumberLabel);
|
||||
curContactName = phoneNumberLabel;
|
||||
$('#ocsms-phone-opt-number').html('');
|
||||
}
|
||||
else {
|
||||
$('#ocsms-phone-label').html(jsondata['contactName']);
|
||||
curContactName = jsondata['contactName'];
|
||||
$('#ocsms-phone-opt-number').html(phoneNumberLabel);
|
||||
}
|
||||
|
||||
setMessageCountInfo(jsondata);
|
||||
|
||||
if ($('#app-content-header').is(':hidden')) {
|
||||
$('#app-content-header').show();
|
||||
}
|
||||
|
||||
$('#app-content-wrapper').html(conversationBuf);
|
||||
$('#app-content').scrollTop(1E10);
|
||||
|
||||
curPhoneNumber = phoneNumber;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Return (int) msgCount, (str) htmlConversation
|
||||
function formatConversation(jsondata) {
|
||||
// Improve jQuery performance
|
||||
var buf = "";
|
||||
// Improve JS performance
|
||||
var msgClass = '';
|
||||
|
||||
var msgCount = 0;
|
||||
var formatedDate = '';
|
||||
var formatedHour = '00';
|
||||
var formatedMin = '00';
|
||||
var months = ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May', 'Jun.', 'Jul.', 'Aug.', 'Sep.',
|
||||
'Oct.', 'Nov.', 'Dec.'];
|
||||
|
||||
$.each(jsondata["conversation"], function(id, vals) {
|
||||
if (vals["type"] == 1) {
|
||||
msgClass = "msg-recv";
|
||||
}
|
||||
else if (vals["type"] == 2) {
|
||||
msgClass = "msg-sent";
|
||||
}
|
||||
else {
|
||||
msgClass = '';
|
||||
}
|
||||
|
||||
// Store the greater msg date for refresher
|
||||
// Note: we divide by 100 because number compare too large integers
|
||||
if ((id/100) > (lastMsgDate/100)) {
|
||||
lastMsgDate = id;
|
||||
}
|
||||
|
||||
// Multiplicate ID to permit date to use it properly
|
||||
msgDate = new Date(id*1);
|
||||
|
||||
formatedHour = msgDate.getHours();
|
||||
if (formatedHour < 10) {
|
||||
formatedHour = '0' + formatedHour;
|
||||
}
|
||||
|
||||
formatedMin = msgDate.getMinutes();
|
||||
if (formatedMin < 10) {
|
||||
formatedMin = '0' + formatedMin;
|
||||
}
|
||||
formatedDate = msgDate.getDate() + " " + months[msgDate.getMonth()] + " " +
|
||||
formatedHour + ":" + formatedMin;
|
||||
|
||||
buf += '<div><div class="' + msgClass + '"><div>' +
|
||||
vals["msg"] + '</div><div class="msg-date">' +
|
||||
formatedDate + '</div></div><div class="msg-spacer"></div></div>';
|
||||
msgCount++;
|
||||
|
||||
});
|
||||
|
||||
return [msgCount,buf];
|
||||
}
|
||||
|
||||
function changeSelectedConversation(item) {
|
||||
if (item === 'undefined' || item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedConversation != null) {
|
||||
selectedConversation.parent().removeClass('selected');
|
||||
}
|
||||
selectedConversation = item;
|
||||
selectedConversation.parent().addClass('selected');
|
||||
selectedConversation.css("font-weight", "normal");
|
||||
selectedConversation.html(selectedConversation.attr("mailbox-label"));
|
||||
}
|
||||
|
||||
function fetchInitialPeerList(jsondata) {
|
||||
// Use a buffer for better jQuery performance
|
||||
var peerListBuf = "";
|
||||
|
||||
var bufferedContacts = [];
|
||||
|
||||
var aScope = angular.element('[ng-controller="OcSmsController"]').scope();
|
||||
|
||||
$.each(jsondata['phonelist'], function(id, val) {
|
||||
var fn, peerLabel, idxVal;
|
||||
idxVal = id.replace(/\//g,' ');
|
||||
idxVal2 = idxVal.replace('/ /g','');
|
||||
if (typeof jsondata['contacts'][id] == 'undefined') {
|
||||
fn = '';
|
||||
peerLabel = idxVal;
|
||||
}
|
||||
else {
|
||||
fn = jsondata['contacts'][id];
|
||||
peerLabel = fn;
|
||||
}
|
||||
if ($.inArray(peerLabel, bufferedContacts) == -1) {
|
||||
aScope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': jsondata['photos'][peerLabel]});
|
||||
bufferedContacts.push(peerLabel);
|
||||
}
|
||||
});
|
||||
|
||||
lastMsgDate = jsondata["lastRead"];
|
||||
}
|
||||
|
||||
function initDesktopNotifies() {
|
||||
if (!("Notification" in window)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Notification.requestPermission(function (permission) {
|
||||
if(!('permission' in Notification)) {
|
||||
Notification.permission = permission;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function desktopNotify(msg) {
|
||||
if (!("Notification" in window)) {
|
||||
return;
|
||||
}
|
||||
else if (Notification.permission === "granted") {
|
||||
new Notification("ownCloud SMS - " + msg);
|
||||
}
|
||||
else if (Notification.permission !== 'denied') {
|
||||
Notification.requestPermission(function (permission) {
|
||||
if(!('permission' in Notification)) {
|
||||
Notification.permission = permission;
|
||||
}
|
||||
if (permission === "granted") {
|
||||
new Notification("ownCloud SMS - " + msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
(function ($, OC) {
|
||||
$(document).ready(function () {
|
||||
// Register real title
|
||||
originalTitle = document.title;
|
||||
|
||||
// Now bind the events when we click on the phone number
|
||||
$.getJSON(OC.generateUrl('/apps/ocsms/get/peerlist'), function(jsondata, status) {
|
||||
fetchInitialPeerList(jsondata);
|
||||
|
||||
var pnParam = $.urlParam('phonenumber');
|
||||
if (pnParam != null) {
|
||||
var urlPhoneNumber = decodeURIComponent(pnParam);
|
||||
if (urlPhoneNumber != null) {
|
||||
fetchConversation(urlPhoneNumber);
|
||||
changeSelectedConversation($("a[mailbox-navigation='" + urlPhoneNumber + "']"));
|
||||
}
|
||||
}
|
||||
// Don't show message headers if no conversation selected
|
||||
else {
|
||||
if ($('#app-content-header').is(':visible')) {
|
||||
$('#app-content-header').hide();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
initDesktopNotifies();
|
||||
setInterval(refreshConversation, 10000);
|
||||
setInterval(checkNewMessages, 10000);
|
||||
});
|
||||
|
||||
// reset count and title
|
||||
window.onfocus = function () {
|
||||
unreadCountCurrentConv = 0;
|
||||
document.title = originalTitle;
|
||||
};
|
||||
})(jQuery, OC);
|
BIN
js/twemoji/72x72/1f004.png
Normal file
After Width: | Height: | Size: 551 B |
BIN
js/twemoji/72x72/1f0cf.png
Normal file
After Width: | Height: | Size: 923 B |
BIN
js/twemoji/72x72/1f170.png
Normal file
After Width: | Height: | Size: 557 B |
BIN
js/twemoji/72x72/1f171.png
Normal file
After Width: | Height: | Size: 458 B |
BIN
js/twemoji/72x72/1f17e.png
Normal file
After Width: | Height: | Size: 562 B |
BIN
js/twemoji/72x72/1f17f.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
js/twemoji/72x72/1f18e.png
Normal file
After Width: | Height: | Size: 682 B |
BIN
js/twemoji/72x72/1f191.png
Normal file
After Width: | Height: | Size: 561 B |
BIN
js/twemoji/72x72/1f192.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
js/twemoji/72x72/1f193.png
Normal file
After Width: | Height: | Size: 517 B |
BIN
js/twemoji/72x72/1f194.png
Normal file
After Width: | Height: | Size: 495 B |
BIN
js/twemoji/72x72/1f195.png
Normal file
After Width: | Height: | Size: 668 B |
BIN
js/twemoji/72x72/1f196.png
Normal file
After Width: | Height: | Size: 670 B |
BIN
js/twemoji/72x72/1f197.png
Normal file
After Width: | Height: | Size: 640 B |
BIN
js/twemoji/72x72/1f198.png
Normal file
After Width: | Height: | Size: 722 B |
BIN
js/twemoji/72x72/1f199.png
Normal file
After Width: | Height: | Size: 553 B |
BIN
js/twemoji/72x72/1f19a.png
Normal file
After Width: | Height: | Size: 747 B |
BIN
js/twemoji/72x72/1f1e6-1f1e8.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
js/twemoji/72x72/1f1e6-1f1e9.png
Normal file
After Width: | Height: | Size: 697 B |
BIN
js/twemoji/72x72/1f1e6-1f1ea.png
Normal file
After Width: | Height: | Size: 287 B |
BIN
js/twemoji/72x72/1f1e6-1f1eb.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
js/twemoji/72x72/1f1e6-1f1ec.png
Normal file
After Width: | Height: | Size: 849 B |
BIN
js/twemoji/72x72/1f1e6-1f1ee.png
Normal file
After Width: | Height: | Size: 989 B |
BIN
js/twemoji/72x72/1f1e6-1f1f1.png
Normal file
After Width: | Height: | Size: 662 B |
BIN
js/twemoji/72x72/1f1e6-1f1f2.png
Normal file
After Width: | Height: | Size: 245 B |
BIN
js/twemoji/72x72/1f1e6-1f1f4.png
Normal file
After Width: | Height: | Size: 723 B |
BIN
js/twemoji/72x72/1f1e6-1f1f6.png
Normal file
After Width: | Height: | Size: 481 B |
BIN
js/twemoji/72x72/1f1e6-1f1f7.png
Normal file
After Width: | Height: | Size: 453 B |
BIN
js/twemoji/72x72/1f1e6-1f1f8.png
Normal file
After Width: | Height: | Size: 847 B |
BIN
js/twemoji/72x72/1f1e6-1f1f9.png
Normal file
After Width: | Height: | Size: 205 B |
BIN
js/twemoji/72x72/1f1e6-1f1fa.png
Normal file
After Width: | Height: | Size: 835 B |
BIN
js/twemoji/72x72/1f1e6-1f1fc.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
js/twemoji/72x72/1f1e6-1f1fd.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
js/twemoji/72x72/1f1e6-1f1ff.png
Normal file
After Width: | Height: | Size: 402 B |
BIN
js/twemoji/72x72/1f1e6.png
Normal file
After Width: | Height: | Size: 559 B |
BIN
js/twemoji/72x72/1f1e7-1f1e6.png
Normal file
After Width: | Height: | Size: 652 B |
BIN
js/twemoji/72x72/1f1e7-1f1e7.png
Normal file
After Width: | Height: | Size: 406 B |
BIN
js/twemoji/72x72/1f1e7-1f1e9.png
Normal file
After Width: | Height: | Size: 336 B |
BIN
js/twemoji/72x72/1f1e7-1f1ea.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
js/twemoji/72x72/1f1e7-1f1eb.png
Normal file
After Width: | Height: | Size: 390 B |
BIN
js/twemoji/72x72/1f1e7-1f1ec.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
js/twemoji/72x72/1f1e7-1f1ed.png
Normal file
After Width: | Height: | Size: 411 B |
BIN
js/twemoji/72x72/1f1e7-1f1ee.png
Normal file
After Width: | Height: | Size: 940 B |
BIN
js/twemoji/72x72/1f1e7-1f1ef.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
js/twemoji/72x72/1f1e7-1f1f1.png
Normal file
After Width: | Height: | Size: 978 B |