From 78e35adfba35d71346b06547ef79933331ef795b Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Thu, 26 Mar 2020 13:15:57 +0300 Subject: [PATCH 01/36] Initial commit --- LICENSE | 21 +++++++++++++++++++++ README.md | 1 + 2 files changed, 22 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a4f9de33 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 ONLYOFFICE + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..1edee0bb --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# plugin-speech \ No newline at end of file From 097c00864396896903a28adff0a9e965e41cdfee Mon Sep 17 00:00:00 2001 From: hellonadya Date: Fri, 3 Apr 2020 18:31:54 +0300 Subject: [PATCH 02/36] Update README.md - add basic plugin info --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1edee0bb..dc5024f0 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ -# plugin-speech \ No newline at end of file +# Speech plugin + +The Speech plugin allows users to have text documents read out loud to them, by converting the selected text passage into speech. + +The plugin uses Yandex.Translate to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. + +The plugin is pre-installed in ONLYOFFICE Enterprise Edition, Community Edition (Document Server + Community Server),ONLYOFFICE Integration Edition, ONLYOFFICE cloud service, and ONLYOFFICE Personal. + +## How to use + +1. Highlight the phrase you want to hear. +2. Open the Plugins tab and press Speech. + +## Documentation + +Plugins structure and installation https://api.onlyoffice.com/plugin/basic. + +Plugins code and methods https://api.onlyoffice.com/docbuilder/basic. + +## User feedback and support + +To ask questions and share feedback, use Issues in this repository. + From a81784ca2f89b8b0e0f4e6be5eacc5905446f1ad Mon Sep 17 00:00:00 2001 From: hellonadya Date: Fri, 3 Apr 2020 19:05:55 +0300 Subject: [PATCH 03/36] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dc5024f0..45d54590 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The Speech plugin allows users to have text documents read out loud to them, by The plugin uses Yandex.Translate to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. -The plugin is pre-installed in ONLYOFFICE Enterprise Edition, Community Edition (Document Server + Community Server),ONLYOFFICE Integration Edition, ONLYOFFICE cloud service, and ONLYOFFICE Personal. +The plugin is pre-installed in ONLYOFFICE Enterprise Edition, Community Edition (Document Server + Community Server), ONLYOFFICE Integration Edition, ONLYOFFICE cloud service, and ONLYOFFICE Personal. ## How to use From e23bb695efdabc10e9d9121e470a65483e42a8a8 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 6 Apr 2020 14:40:09 +0300 Subject: [PATCH 04/36] Added source files --- README.md | 19 ++------- config.json | 38 +++++++++++++++++ icon.png | Bin 0 -> 1549 bytes icon2.png | Bin 0 -> 1491 bytes icon2@2x.png | Bin 0 -> 1900 bytes icon@2x.png | Bin 0 -> 3924 bytes index.html | 12 ++++++ speech.js | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 166 insertions(+), 15 deletions(-) create mode 100644 config.json create mode 100644 icon.png create mode 100644 icon2.png create mode 100644 icon2@2x.png create mode 100644 icon@2x.png create mode 100644 index.html create mode 100644 speech.js diff --git a/README.md b/README.md index 45d54590..56b64821 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,12 @@ -# Speech plugin +## Overview -The Speech plugin allows users to have text documents read out loud to them, by converting the selected text passage into speech. +Convert selected text into speech. The plugin uses Yandex.Translate to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. -The plugin is pre-installed in ONLYOFFICE Enterprise Edition, Community Edition (Document Server + Community Server), ONLYOFFICE Integration Edition, ONLYOFFICE cloud service, and ONLYOFFICE Personal. +The Speech plugin is installed by default in cloud, [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) and [desktop version](https://github.com/ONLYOFFICE/DesktopEditors) of ONLYOFFICE editors. ## How to use -1. Highlight the phrase you want to hear. +1. Highlight the phrase you want to here. 2. Open the Plugins tab and press Speech. - -## Documentation - -Plugins structure and installation https://api.onlyoffice.com/plugin/basic. - -Plugins code and methods https://api.onlyoffice.com/docbuilder/basic. - -## User feedback and support - -To ask questions and share feedback, use Issues in this repository. - diff --git a/config.json b/config.json new file mode 100644 index 00000000..710f9dc9 --- /dev/null +++ b/config.json @@ -0,0 +1,38 @@ +{ + "name": "Speech", + "nameLocale": { + "ru": "Речь", + "fr": "Parole", + "es": "Habla", + "de": "Rede" + }, + "guid": "asc.{D71C2EF0-F15B-47C7-80E9-86D671F9C595}", + + "variations": [ + { + "description": "Speech", + "descriptionLocale": { + "ru": "Речь", + "fr": "Parole", + "es": "Habla", + "de": "Rede" + }, + "url": "index.html", + + "icons": [ "icon.png", "icon@2x.png", "icon2.png", "icon2@2x.png" ], + "isViewer": true, + "EditorsSupport": [ "word" ], + + "isVisual": false, + "isModal": false, + "isInsideMode": false, + + "initDataType": "text", + "initData": "", + + "isUpdateOleOnResize": false, + + "buttons": [] + } + ] +} diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..975d5c95c8b4b9fd27f241d584aa9cd3c51cef7d GIT binary patch literal 1549 zcmV+o2J-odP)5}AGwYzq`hp-`Z-C~cuep!||bfEXl%z#0q;~1UmA_Z^GtPc(AwIXrq}DQXtmm{va+%)H?#U3H|;38HI&~-xE0!yWPIPn*SC1CQ5^mu+JS43Wbhz zcX!)!b8~Nt+8?E-R`SAv7HFgLE(^=2k<>%*LYiMXlV$JbEO-)U@PNxg<14#u$ zR+xDdh~6RW?rTz8wOW0FncP1R87*??Pw601sjI8|Lz>I@RxU0sK5n&E`K9&+1qCi< zwm&Q{FF#OUU+dK&RoEB*|o9zRs52AZYaM&w+KA#Hb z+hu8o_mcAR^3R#OVrglq&R{S^usJr69tMi!>gsATqWm-OgM3`{dcB7Pr{?BnkI7_u z8?2p0MMVw}coSi+)amqwyu7?KSjHESXPIz%1Nso((QX6;F9`zy=>II=*4x`_rzi#j zffS7O9p6@5Tx=Aac%>YI$wvv|dzx><udh!{1QEq^ydGEP zJF*i*vG6J576tPBUET&8W|Z##nVFeac|G#bFFQe}^R1hVR}>Qy6EE^MIXO82MDXzD z=H@dxU4Deq|0+8{m&NWxcJ?vokK#;R;QeJMXtUX`6G2D==1cBuJ4gEiH|)!xefOHtAU68@yh2g2=UxDKd~m`Xz!>Q&TaU1h>>p zw5dS+Aso=ZiF#}j`3d6g9TAC%K!NJvZLC)7Fl>~5zyCR2k7$NvCkQfEG59|hKY;r1 zS?KTZHiLtMuTfh?MTLvkqk#3vPOzk;^k3$T>Of1bYo-VDcHswF#`hw z#j+Db#BP8fy%1H%DQPvdj$+{@B9FT9Wxfq$Z-ewP11j3+u1v*tWHa1@5JG_@*1xA>w zSn`_@9br>YUpObvOMS38^n$~FK{Fp38tO(gq8Iyif=$uO+ysJ566tM&G_I%XCF_#|Rtvt)zg$DNs(sbWp?fM)M@ zyUobUm~tLF@*Fb}BPc8({r7l0r;q|gvXkS1NIs3_ioTtt1liyJ9$8sguc+1PAP)EV z?aFwAmaeU>?F?-SraE|Fc^9o_4kY%!#0tgV9f^tKLkH1)00000NkvXXu0mjf1%Aj% literal 0 HcmV?d00001 diff --git a/icon2.png b/icon2.png new file mode 100644 index 0000000000000000000000000000000000000000..5623f557a537b827fba0eddae60a0d8f57b92a17 GIT binary patch literal 1491 zcmah}ZA=?=7{8XTunI}%h;g`V=fQ_5^sd)edQ$1j0WGdw1C1+wFkJ8c&;xpR+#PF6 zW*k))wi(B^L_^}xER293Oc?TE(YVFn%QTv3*oW~!12Ig=%wCuuRCNBYKsOVJm%IO4 ze$VfD{=esW?nErwQemnxAqY|t4$*CJuF}3TBOIq%4}J%yJ!(@zZ5O-L3?l=?&xuKZ zhSN+pXafwF>%RsX5TxWLA5W->$U%w~(>SAH@N8Ow)(Fzjn3Wi|7pQ0wbn}82yZ!MM z4COg5cGwxQMx-D}@u5K(v=2t(>|ihJ;jqT%(S|Gq3DQ7i&}_O-P^hdIEAUcqtsN5> zT7am%UTi(6L?ng=MH!$@+-_m5B#F9QIO%Y@Tx1<;vywK#3SXCnbWlzgWpkq&4+g!- zTo=_wH*ffYJ1>?}Rf!^qOeTY8?6@d*6QsxE(Ku{23q)9yoS-sUi=b3*GSEO_WnNNw zQ9w0DCMgc6UJORMeucDDq!pA6nV?`qmXQb&w`x}^06DgZlLq9zf^&`~Kp#j0K~*4@ zEMlQbkw_7~C2cxgL@R0=czCxh(Mmig0iq2k;(*M;BzIM7VM$a_28=4oaZ&8sR6Ldv zRZ&Ta5*loGp$8800w-paXCA==no)rlgX+62)_N#?oODuFJ5;|Gj#leBG$L|*S8gjP zX{BuT|3G2tIYwpv7tFC#mnf$hs6Ve&D2%gxn>-}hE*N;P(eyF1tIhX-kXjfR=?#TkfH)Yg=2bp0zwtG?4itfNPe; zG+M|7#cv;reOtZ_TWk*qcXBO@$Cd zmk-nacy=MV_TWKdi5J;ja{lU_nPFXJ%lH@PPMvzeG(Fh4JTsEg)sC!`F7=^fuQiSB z4|#6gnCY&*;V*U2m7(AAFXbPrGb~m3X3u?fsciClBy`?*`R!vr96(<#oxAMwj@EP- z=FP_OxAfBuPtRUO|1!?rde)rL|8Dy1=fp^P&2u;NOUBf-mPyb!wAK?d>-+1>hc2|< zGgkGKkK?*uYibrPzO{YBuS|`erjI46hF8zz?+_!@&bdG1Gi9k?qUh|-;enw~lg(!b z^>Y{I@jXB4?>5H%8SmI-xc^4^$US7~8{bcV2hZwHT$z|S{mJ{sqrOXfD_>vs9oXDCsd=MBV7v u$(D`=b18CtxgzoTm-P##s{2pq3{N7r(UXqaixbn@Z#LW%r9TXG=KlrJw(Q;j literal 0 HcmV?d00001 diff --git a/icon2@2x.png b/icon2@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5ff5b7d41a00e25f30c5d553385609101b483e3b GIT binary patch literal 1900 zcmah~2~ZPf6pm6n5HTny2%0r?JP@+kgaooAAUTj&LN!D{#p;sXgeb|z-Gu}wML8;^ zYC(YkMXioTMMkOxYXvK^k zYW{eqsZIMh;@faI8i%ZOveaL#<{+yBec_1Wa!*N!VSrC)t1jm9S$4 zDz3^b!x9Y7b;LXFPy%DGm zR?EZR_@Z|bb|OWYVGy)fEF24;gA;lX5{X214j#{+M);GdCJM3on@FEQ202D*34@t3 z;3mM%h$P_2l!Q%3`uYk+^AN3xd?OPr7-&VzAjIL?uQUKewL>^_GLbak9MytY5@y6q z6iH*DAuO$uN;L$3FRjrygeEC9_V#Y?MU$FTGX|FqJ_ZhSc3`0E##bc@R%H-FbSJhKhU2WL`$!M1TdFRt3Q_>x!l)K z6^b&It-YS@ zd4lB_VMxKyZ~`|11G#_=!^grOmhX)%I(#ev!`gy$Frd9U->KHYBf16b%c0(*H$&Zv zndp`!=-xd4DvLw6yq8iQrmN5ADxTiVd86TgW6fp&tZQ=3o7HAH%P8dK&7DUsisT@?V&;kZO@>!hxBI3byCrajv~|=LSQgi` zDlcSZr{?)RSQcqx#WgLyvM&6^KiXbr1gc?XyQ0+jn1(Eu5jQ-7s~;YPZikKOeh&Jg z-jC&8azU5+XaGZBS?bN|8&|KK7JVi8R}YKJ>5MflnGTOGWnL|9M4FxQ(zl||ZX8&_ z{AcY~KNZ$^@kIqo9G`k$#m+6uy6hp}vcKX~-L{(Fgj3aC091*rD&y9=CX^i?X^j^4!4*w+jordaqaZY4f%t&t5eF->7m6-I4{7qowv3w z>YjP4j#wA&{-EOK@nfGbYHIl)DtR@UKdq1vcAl$EH?k#6_J5=}D?zm09`~CDIy}|XzM=CSU-4>_h zf5$97_%q?u^TEmDGY17#8g9p*XFrT37Ke7@{F3PUThx!8BRHPsM|U059X%Ip_U2EY zQ_$(KFRQWVnp}#ONX1TlztkPo@k3&ytjM+ou(5DtqxX92{IRZ!GJHxSi?3~LpSNl) zSRd%<{CvZOxyxp|f6CD6^Cy-+YmYc!JJa$w^mMK4UJdK!dh*zdyLIK^mA1Ze9+~+h zK_4cnp4pJI!EJTn$cW_GYf8&DeA&N(MOWoBdvWg1Yv0LmVCbwpSsn%JD(wG1r6Njx INV+oXU$nK%g#Z8m literal 0 HcmV?d00001 diff --git a/icon@2x.png b/icon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..402e560cf0e39fb30274b8802a0ef9c7fa1cc681 GIT binary patch literal 3924 zcmV-a53BHrP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D06}y`Sad^gZEa<4 zbO1wAML|?gQaT`KWG!lNWoICEF)lD5D0OpbZf77#N=G0{P(?=|b~rF8EFf`pVQgu1 zc_2L?IWP)+RNCDD000hRU=W+)CVAeh#HMU#Kd4tMNO(Q8U!XP+Bk`zqM%^YCKdYsF8ACX&VKjqvhEt) z|IE+bd(L;hd(X#t-E;5SO;&q*yVv1lmM^Efny03F8$(>Cr{Uzx&Mci|mM$ch^%jP> zOi#nf6+35nW|GT!3qxF{r%)xQskQ=DY92mq*REZA?$Dt_8OM$t`=M;ZN#uDN?>kqd z=E?RdW$ zM`UMbkLAh3MF!Cc29%vplnO zlAI^&WX%5IT zOP7T_|E8v$j{F&ll^s(zMz+q<}zIp3fO?3jGpBnd=acig_6C{=)@K z#oYjgg@rv$Pfu@=gX0Qa4PaYan;%-=S=CQ)aL6~f zvw4LpV@Ah6Zi*`_r-_reKrc)d@slP^?o=UH>0$tF_#ELVZ9P*6~? zU-oMzblu*V)sJyLR00D78&gx$oK7lk>82e(ZEfv-)22UyN>?Xh+1 z*2$a?4)ltDNM%{vl9?0EA(wXP(xrQ&qoZrMi*|>iqT(-c9&PsIB+~KeM|U+fH8n3p zN5|B0zEmP2BGyrPGu)Du6Dz04!+5thz}5Ags}vU(*Tc8g-ONPi26Qh>HvrwS)_ii- ztXZFN{#25Zk|vRF4!7mZk(!1j$^Z=ZTeu6nS@QDoKg9Xi7Kk*z8#itY!}v$HofJHg z?%&eV^5TL83-)q8RdDSOQCXFaf83OVGZSHnGCVy!!|5%VyR2RNW)^o1IQB=ErCGNn zE^bOiLqo$*VS`Ubdc~_x0=7t5Q=_jo~6FDCo?#ZQDj(ym+xU^2HWcHwt26Vq&xGlOruHZH6c# z@Q664__Sfh8;SAGYb{T(Vnxm$)oTDlj~+eB+HcviH4ORG0>!ls#t^eRBqY@7T6E8z zJ)Jfk=${BM3JeCc*+>R`0R5GE0{Tmd-4_~Xv^_L4Q9fE-pPZbWIPL3jBRwg+)*%&T}Zjq6ZUqwVjHiLRh*C>nGiL;kEc<^99VNYA-tkInW7r^o3$LDgkGH5*Qjg6P71sdhh za{C4chqQ6_g8B33#|nEN3E&E&LIU)JX`HPJg7G>gk$(E{LtXlT&6_u`;cNvM*PBk9 zIMK20R{y{;(=ee>1%-Wwd zH#h$X_OxspgxkF2xVX5lI9owQMa3|m?7|{&GOJdt(jFjLar*RWdO%MbsT9Of+qZAG zyiZ=fe0iWx1aRfbRml`2S#+%6kF~1hEoDJL!84M5_uAUp-*a{XwAvh>2;hbd8@Gsx z%aVejQCwWSo+~eij*bqL?ENsYjKZ3bwI!mWqW1Yj0E>!>zd(hJ$B{zfSa9mpso7k4 z0b1xTOgeNsOTOr3q=^X$38weQ7*|_;B7h|&C10bm{(9UDQP5;sTU(8Tryd(`^qAix)3ueF*C6&P<2hcL6PBhOS<{ zdL3sc@QDEGk2OaEYI*dw>1Z$vbP8ZoQ`2B9epw%avuDpPge^VZppDkCSy|Z)oSncY z0+^HYMgl5ptON0#T9C0dC8(>bvwX3L9$n(@gIX_@rI!3ye0;(w&Q{b)N{}^5x5;P;p}&CbA$ofu zE-tQ?vlUcVS1<920E*wrals>!lc!m}(n}mZe0Ujb2Z%CNRaL_|J3(-8@Hc3&&-+9G zr%s*P@q~;C;EWkFUggTj#Kgp0LNI;-d)mUHWzZ0G&wS2SFmq&`|p~oULI0{{3%he=#oeP6M}RRj4?% zLJC6n8#itY#`v|AvsIZte||kZT|+t1YHb@fY_MD}qWiWZ$e}(H!2JCDQdC@fyMTl{ zj{alDj5)*E%GmApDtdPjWwq8zqE|bRcUZNR$;ruSLYarP0$2=IfujsZm^78+fL=H{ z3C@5ovDUg`w})A-w>*u0Ct|!cM&D=8p1qp06$AzbHq_SE(py>7ZE4}%m)}AfJIrA3mdx(?K>kKq~lM@+nW6pgNRED5#LtTKj!0D}}p=jQtF$i03M0%2}tgKhH z%ILy1*qWQ06VTO6UlQ83Z5urbHO5QOK>%&I-nJ!%~y6&U67q)zmPN3CxjD12>*qdCq zaG_6hbaXX$F`hzyJ4^1u8Z+2?akZ`v!nryVge*^%08}Epp|B zP+BTR?54p|A7$_iRXaTn<>STK*$t78b~6aOEA=&m%$(d4IH z3%#|4Zkx*aQ^Cyq5z06`ch)2v-a`6d%$YrT@??)Kb)ur8XctAVQAhBAR$={|B8`IB z7h~hli4!L}opFf?6DE9q{`~n~nqx`i)A;f&Kx5CS1q&8*`u|_t1#7;achsgs@Xu{+ z(Gu*jnwpv-OeWVkKPs@RJ96ZRL-0CDI>9Z6R{eQ-d2e$U-xY9YKpUa*EKFmayv0wg zkH)}~*x1+`oDUT&wD+!Fo!hZkwi29v+t~K)+xH4>4{;T71$skOuZ|}23B($YTHd|- z=fhQ1Rb`wH8MM6ZGiT0p9y}79-WFWCbZKC8bc|cGGzR%!>eVqsJ~`2k9<#Hv4{&}6 z{2}Qv=1ARKlbJ8CNDfL@p}~6Y+_~G-N;yOS-`k8XOd@|m@^?~GQ`4ZZu&{HgpWxsS z+QI1*ye>;r#uco@*}DS${vtm=KToZk6-$>cv+JjIDsi5&va%n`KJ0dTB0lNaa;NKY zDz(7PU?tAp0>6U?4=zA=a%riPk&*GDej29|=fIk@-@=6pwcmmyB_+|ut3&Vvmf{L{ z3QnAz3AT$DFFp|y6H_k-iz7Wf{RQ2P7>l-;E%S_~3&N?t>50;0a`P zI#vz60VmFmqpq&52WG@9HE1&QGY8$RCX_Q4(ymB8pB1b)LvLXw&Q@j0lqtgl0s`2b zVzj{D>8?77^CJ-A@~m(WXLKvz#M!A}TudH6e*8f>fa28-VIw4$QxW3wtZ)!#bgMBF zXDh&BH)Gtmag`K6{pYSUu4#Ef;+R8-%d^5koYA+1nK)YlL40WJ*s&Y;?AbFL$KTP- z4XO4rLR_8|4&sb%7tAEvJpT9-w#v#%daHD(o^43BQ<25xbFktJZ#T>&@*5i)={}dX zsydZ(hAb{$MU|GO8r|-wlJc~*o^d1 iTLC0om1EiVZvO+GD2Z#;n&5f>0000 + + + + speech + + + + + + + \ No newline at end of file diff --git a/speech.js b/speech.js new file mode 100644 index 00000000..8db0d4eb --- /dev/null +++ b/speech.js @@ -0,0 +1,112 @@ +(function(window, undefined) +{ + var text_init = ""; + + window.Asc.plugin.init = function(text) + { + if ("" == text) + { + window.Asc.plugin.executeCommand("close", ""); + return; + } + + text_init = text; + function StartCallback() + { + } + + function EndCallback() + { + window.Asc.plugin.button(-1); + } + + function Run(lang) + { + var voicelist = responsiveVoice.getVoices(); + + var _data = []; + var _langs = responsiveVoice.responsivevoices; + + var _map = {}; + _map["en"] = ["gb"]; + _map["ko"] = ["kr"]; + for (var i = 0; i < _langs.length; i++) + { + if (_langs[i].flag == lang) + { + _data.push({index : i, gender : _langs[i].gender}); + } + else if (_map[lang]) + { + for (var k = 0; k < _map[lang].length; k++) + { + if (_langs[i].flag == _map[lang][k]) + { + _data.push({index : i, gender : _langs[i].gender}); + break; + } + } + } + } + + var _index = 0; + if (_data.length > 0) + _index = _data[0].index; + + for (var j = 0; j < _data.length; j++) + { + // family + if (_data[j].gender == "f") + { + _index = _data[j].index; + break; + } + } + + responsiveVoice.speak(text_init, voicelist[_index].name, {onstart : StartCallback, onend : EndCallback}); + } + + responsiveVoice.AddEventListener("OnReady", function() { + setTimeout(function() + { + // detect language with yandex translate api + var xhr = new XMLHttpRequest(); + var _url = "https://translate.yandex.net/api/v1.5/tr.json/detect?"; + _url += "key=trnsl.1.1.20160604T115612Z.107ebb05a7757bcc.804e900f347ddfbeadd7ca5999bd5cb6ca32805b"; + _url += "&text="; + _url += encodeURIComponent(text_init); + xhr.open('POST', _url, true); + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xhr.onreadystatechange = function() + { + if (this.readyState == 4 && this.status == 200) + { + try + { + var _obj = JSON.parse(this.responseText); + Run(_obj.lang); + } + catch (err) + { + Run("en"); + } + } + else if (401 == this.readyState || 404 == this.readyState || 413 == this.readyState || 422 == this.readyState || 501 == this.readyState) + { + Run("en"); + } + }; + xhr.send(null); + }, 1); + }); + }; + + window.Asc.plugin.button = function(id) + { + if (-1 == id) + responsiveVoice.cancel(); + + this.executeCommand("close", ""); + }; + +})(window, undefined); \ No newline at end of file From ac0f8e79b992e5bbbf27817b34695fdc2f708a36 Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Wed, 15 Apr 2020 10:44:29 +0300 Subject: [PATCH 05/36] Changes for new scheme --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ef448ca6..64391da0 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ speech - + From cf2692f576112b378acdabcdb4ee66fe7d2a2aab Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Thu, 28 May 2020 17:10:21 +0300 Subject: [PATCH 06/36] Fix select voice name --- speech.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/speech.js b/speech.js index 8db0d4eb..93eab8b8 100644 --- a/speech.js +++ b/speech.js @@ -49,21 +49,22 @@ } } - var _index = 0; - if (_data.length > 0) - _index = _data[0].index; - + _data.sort(function(a, b) { return a.gender.charCodeAt(0) - b.gender.charCodeAt(0) }); // family :) + var voiceName = ""; for (var j = 0; j < _data.length; j++) { - // family - if (_data[j].gender == "f") + var nameCandidate = _langs[_data[j].index].name; + for (var k = 0, k_len = voicelist.length; k < k_len; k++) { - _index = _data[j].index; - break; + if (voicelist[k].name === nameCandidate) + { + voiceName = nameCandidate; + break; + } } } - responsiveVoice.speak(text_init, voicelist[_index].name, {onstart : StartCallback, onend : EndCallback}); + responsiveVoice.speak(text_init, voiceName, {onstart : StartCallback, onend : EndCallback}); } responsiveVoice.AddEventListener("OnReady", function() { From 7e8067e39c1412f2cf942c9389824f748e9f597f Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Mon, 15 Jun 2020 16:06:38 +0300 Subject: [PATCH 07/36] Fix unstarted bug --- speech.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/speech.js b/speech.js index 93eab8b8..c23f1f5b 100644 --- a/speech.js +++ b/speech.js @@ -1,6 +1,7 @@ (function(window, undefined) { var text_init = ""; + var is_end_callback = false; window.Asc.plugin.init = function(text) { @@ -13,10 +14,17 @@ text_init = text; function StartCallback() { + setTimeout(function(){ + if (!is_end_callback && !responsiveVoice.isPlaying()) + { + responsiveVoice.speak(text_init, undefined, {onstart : StartCallback, onend : EndCallback, onerror : EndCallback}); + } + }, 5000); } function EndCallback() { + is_end_callback = true; window.Asc.plugin.button(-1); } @@ -62,9 +70,11 @@ break; } } + if (voiceName !== "") + break; } - responsiveVoice.speak(text_init, voiceName, {onstart : StartCallback, onend : EndCallback}); + responsiveVoice.speak(text_init, voiceName, {onstart : StartCallback, onend : EndCallback, onerror : EndCallback}); } responsiveVoice.AddEventListener("OnReady", function() { From 115d297073385d69a442390e53da6dc01292b2cf Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 14 Sep 2020 19:59:35 +0300 Subject: [PATCH 08/36] Fixed problem with invalid ApiKey --- speech.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speech.js b/speech.js index c23f1f5b..0aa53575 100644 --- a/speech.js +++ b/speech.js @@ -102,7 +102,7 @@ Run("en"); } } - else if (401 == this.readyState || 404 == this.readyState || 413 == this.readyState || 422 == this.readyState || 501 == this.readyState) + else if ( (this.readyState == 4 && this.status == 403) || (401 == this.readyState || 404 == this.readyState || 413 == this.readyState || 422 == this.readyState || 501 == this.readyState) ) { Run("en"); } From b08b16ba285fc222e18e867257d27677072508fd Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Mon, 19 Oct 2020 13:47:37 +0300 Subject: [PATCH 09/36] Remove info about plugin in DesktopEditors (#11) Plugin may be included in older version, but currently in v6.0.0 and later is not See: https://github.com/ONLYOFFICE/build_tools/blob/a1f19d41dcc63a5c0c97a9deb0e5e6a1ce107641/defaults#L1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 56b64821..d03296fb 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Convert selected text into speech. The plugin uses Yandex.Translate to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. -The Speech plugin is installed by default in cloud, [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) and [desktop version](https://github.com/ONLYOFFICE/DesktopEditors) of ONLYOFFICE editors. +The Speech plugin is installed by default in cloud and [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) of ONLYOFFICE editors. ## How to use From 49b9e49bb40af7f465ca928e0fe4f5d616d5d19d Mon Sep 17 00:00:00 2001 From: Alexey Matveev <34643750+AlexeyMatveev686@users.noreply.github.com> Date: Thu, 12 Nov 2020 12:29:05 +0300 Subject: [PATCH 10/36] Changed files location (#15) --- config.json | 2 +- index.html | 2 +- icon.png => resources/img/icon.png | Bin icon2.png => resources/img/icon2.png | Bin icon2@2x.png => resources/img/icon2@2x.png | Bin icon@2x.png => resources/img/icon@2x.png | Bin speech.js => scripts/speech.js | 0 7 files changed, 2 insertions(+), 2 deletions(-) rename icon.png => resources/img/icon.png (100%) rename icon2.png => resources/img/icon2.png (100%) rename icon2@2x.png => resources/img/icon2@2x.png (100%) rename icon@2x.png => resources/img/icon@2x.png (100%) rename speech.js => scripts/speech.js (100%) diff --git a/config.json b/config.json index 710f9dc9..286bcdcc 100644 --- a/config.json +++ b/config.json @@ -19,7 +19,7 @@ }, "url": "index.html", - "icons": [ "icon.png", "icon@2x.png", "icon2.png", "icon2@2x.png" ], + "icons": [ "resources/img/icon.png", "resources/img/icon@2x.png", "resources/img/icon2.png", "resources/img/icon2@2x.png" ], "isViewer": true, "EditorsSupport": [ "word" ], diff --git a/index.html b/index.html index 64391da0..c869716f 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ speech - + diff --git a/icon.png b/resources/img/icon.png similarity index 100% rename from icon.png rename to resources/img/icon.png diff --git a/icon2.png b/resources/img/icon2.png similarity index 100% rename from icon2.png rename to resources/img/icon2.png diff --git a/icon2@2x.png b/resources/img/icon2@2x.png similarity index 100% rename from icon2@2x.png rename to resources/img/icon2@2x.png diff --git a/icon@2x.png b/resources/img/icon@2x.png similarity index 100% rename from icon@2x.png rename to resources/img/icon@2x.png diff --git a/speech.js b/scripts/speech.js similarity index 100% rename from speech.js rename to scripts/speech.js From 9bf1ac0fdd4bfaa1e526f8bee79277dfacd64c52 Mon Sep 17 00:00:00 2001 From: Alexey Matveev <34643750+AlexeyMatveev686@users.noreply.github.com> Date: Tue, 24 Nov 2020 15:39:16 +0300 Subject: [PATCH 11/36] Removed Yandex API and add new library for language detect. (#16) --- index.html | 5 +- scripts/guessLanguage/README.md | 175 +++++++ scripts/guessLanguage/_languageData.js | 73 +++ scripts/guessLanguage/guessLanguage.js | 687 +++++++++++++++++++++++++ scripts/speech.js | 55 +- 5 files changed, 965 insertions(+), 30 deletions(-) create mode 100644 scripts/guessLanguage/README.md create mode 100644 scripts/guessLanguage/_languageData.js create mode 100644 scripts/guessLanguage/guessLanguage.js diff --git a/index.html b/index.html index c869716f..2ee3bdba 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,10 @@ speech - + + + + diff --git a/scripts/guessLanguage/README.md b/scripts/guessLanguage/README.md new file mode 100644 index 00000000..69a559e2 --- /dev/null +++ b/scripts/guessLanguage/README.md @@ -0,0 +1,175 @@ +guessLanguage.js +==================== + +A natural language detection library based on trigram statistical analysis. This library is written in JavaScript and works equally well when run in either the Browser or Node.js. + +#### Demo #### + +An online demo is available [here](http://richtr.github.com/guessLanguage.js/). + +#### Usage #### + +You can clone this repo as follows: + +```bash +git clone git@github.com:richtr/guessLanguage.js.git +``` + +You can use this library in a web page by including the following files: + +```html + + +``` + +You can also use this library in a Node.js project. This library can be installed via [npm](https://www.npmjs.com) as follows: + +```bash +sudo npm install -g guesslanguage +``` + +Including this library for use in a Node.js project can then be done as follows: + +```javascript +var guessLanguage = require('./lib/guessLanguage'); +// See the API section for usage +``` + +#### API #### + +You can use guessLanguage.js in any of the following ways: + +``` javascript +guessLanguage.detect('...input text here...', function(language) { + console.log('Detected language code of provided text is [' + language + ']'); +}); +``` + +``` javascript +guessLanguage.name('...input text here...', function(languageName) { + console.log('Detected language name of provided text is [' + languageName + ']'); +}); +``` + +``` javascript +guessLanguage.code('...input text here...', function(languageIANA) { + console.log('Detected language IANA number of provided text is [' + languageIANA + ']'); +}); +``` + +``` javascript +guessLanguage.info('...input text here...', function(languageInfo) { + console.log('Detected language code of provided text is [' + languageInfo[0] + ']'); + console.log('Detected language IANA number of provided text is [' + languageInfo[1] + ']'); + console.log('Detected language name of provided text is [' + languageInfo[2] + ']'); +}); +``` + +#### Languages Supported: 100 #### + +* "ab": Abkhazian +* "af": Afrikaans +* "ar": Arabic +* "az": Azerbaijani +* "be": Belarusian +* "bg": Bulgarian +* "bn": Bengali +* "bo": Tibetan +* "br": Breton +* "ca": Catalan, Valencian +* "ceb": Cebuano +* "cs": Czech +* "cy": Welsh +* "da": Danish +* "de": German +* "el": Modern Greek +* "en": English +* "eo": Esperanto +* "es": Spanish, Castilian +* "et": Estonian +* "eu": Basque +* "fa": Persian +* "fi": Finnish +* "fo": Faroese +* "fr": French +* "fy": Western Frisian +* "gd": Scottish Gaelic, Gaelic +* "gl": Galician +* "gu": Gujarati +* "ha": Hausa +* "haw": Hawaiian +* "he": Hebrew +* "hi": Hindi +* "hr": Croatian +* "hu": Hungarian +* "hy": Armenian +* "id": Indonesian +* "is": Icelandic +* "it": Italian +* "ja": Japanese +* "ka": Georgian +* "kk": Kazakh +* "km": Central Khmer +* "kn": Kannada +* "ko": Korean +* "ku": Kurdish +* "ky": Kirghiz, Kyrgyz +* "la": Latin +* "lo": Lao +* "lt": Lithuanian +* "lv": Latvian +* "mg": Malagasy +* "mk": Macedonian +* "ml": Malayalam +* "mn": Mongolian +* "mr": Marathi +* "ms": Malay (macrolanguage) +* "nd": North Ndebele +* "ne": Nepali +* "nl": Dutch, Flemish +* "nn": Norwegian Nynorsk +* "no": Norwegian +* "nso": Pedi, Northern Sotho, Sepedi +* "or": Oriya +* "pa": Panjabi, Punjabi +* "pl": Polish +* "ps": Pushto, Pashto +* "pt": Portuguese +* "pt-BR": Portuguese (Brazil) +* "pt-PT": Portuguese (Portugal) +* "ro": Romanian, Moldavian, Moldovan +* "ru": Russian +* "sa": Sanskrit +* "sh": Serbo-Croatian +* "si": Sinhala, Sinhalese +* "sk": Slovak +* "sl": Slovenian, Slovene +* "so": Somali +* "sq": Albanian +* "sr": Serbian +* "sv": Swedish +* "sw": Swahili (macrolanguage) +* "ta": Tamil +* "te": Telugu +* "th": Thai +* "tl": Tagalog +* "tlh": Klingon, tlhIngan-Hol +* "tn": Tswana, Setswana +* "tr": Turkish +* "ts": Tsonga +* "tw": Twi +* "uk": Ukrainian +* "ur": Urdu +* "uz": Uzbek +* "ve": Venda +* "vi": Vietnamese +* "xh": Xhosa +* "zh": Chinese +* "zh-TW" Chinese (Taiwan) +* "zu": Zulu + +#### Feedback #### + +If you find any bugs or issues please file them on this project and I'll take a look. + +Please also feel free to catch me on Twitter [@richtibbett](http://twitter.com/richtibbett/). diff --git a/scripts/guessLanguage/_languageData.js b/scripts/guessLanguage/_languageData.js new file mode 100644 index 00000000..1fb91978 --- /dev/null +++ b/scripts/guessLanguage/_languageData.js @@ -0,0 +1,73 @@ +( function(global) { + + var models = { +"af":"ie didieen ingan envan vang te n dverer e v ge bede vende in tele dererset oor 'n'n at eersteordaarsie waes e saan onis in e ordee basirinonde wel isande eeide dom ke omeri woe gr dalewat void it rd aalik wet d ope tngsse enduit st leenster ree aiesworg vstan s na prn o meal of vierdleee k deiteerkik e re pn ve ie neeneliwer of datelnieikes etaage virheiir regedes vur proeleionwete l moe mdaasios d he toentardnge ooeurlleienn bekelinraa niontbesrdivoons n adeldignas sa grniskom uimenop insonaeres o son gig moe kors gesnalvole hgebruiangigeoetar wysligas n w asmetgs deut vaalerwditkenssekel huewedinn t seestikan pntwt ieni kan edoealiemegronte honsigeniergewn hor maindne ek aatn ' skide tadatskagersoon ks i afteend eelhulneewoorikd vn mre artebrlankkeronaamtrestrkanreeleit ograhetevotandenist dobrutoeolgrskuikrwyminlgeg eg onstr vgtewaawe ansesiesevoeepagel hivinnses ws tteieitpre", +"ar":" الالعلعرعراراق فيفي ين ية ن االمات من ي ا منالأة ااق وااء الإ أنوالما عللى ت اون هم اقيام ل اأن م االتلا الاان ها ال ة وا ارهالاميين وللأمنا علىن يالباد القد اذا ه ا باالدب امريلم إن للسلاأمرريكمة ى اا ي عن هذء ار اكانقتلإسلالحوا إلا أبالن مالسرة لإسن وهابي وير كالة يات لاانتن أيكيالرالوة فدة الجقي وي الذالشاميانيذه عن لماهذهول اف اويبرية ل أم لم مايد أيإرهع اعملولاإلىابين فختطلك نه ني إن دينف الذيي أي ب وأا عالختل تي قد لدي كل معاب اختار النعلام ومع س اكل لاءن بن تي معربم ب وق يقا لا مالفتطادادلمسله هذا محؤلابي ة من لهؤلكن لإرلتي أو ان عما فة أطافعب ل من عور يا يسا تة براءعالقواقيةلعام يمي ميةنيةأي ابابغدبل رب عماغدامالملييس بأ بع بغ ومباتبيةذلكعة قاوقييكي م مي ع عر قاا ورى ق اواتوم هؤا بدامدي راتشعبلانلشعلقوليان هي تي ي وه يحجراجماحمددم كم لاولرهماعن قنة هي بل به له ويا كاذااع ت متخاخابر ملمتمسلى أيستيطا لأ ليأمناستبعضة تري صداق وقولمد نتخنفسنهاهناأعمأنهائنالآالكحة د مر عربي", +"az":"lərin ın larda an ir də ki biən əriarıər dirnda kirinnınəsiini ed qa tə ba olasıilərın yaanı vəndəni araınıınd busi ib aq dəniyanə rə n bsınvə irilə ninəli de mübirn sri ək az səar bilzərbu danediindmanun ərə halanyyəiyy il ner kə b isna nunır da həa binəsinyanərb də mə qədırli olarbaazəcanlı nla et göalıaycbayeftistn ineftləycayətəcə laildnı tinldilikn hn moyuraqya əti aradaedəmassı ınaə dələayıiyilmaməkn dti yinyunət azıft i tllin ara cə gə ko nə oya danacəkeyiilmirllayliylubn ərilrləunuverün ə oəni he ma on paaladeyi mimalməmətparyə ətl al mi sa əladıakıandardartayii ai qi yiliillisən on qolurlastəsə tantelyarədə me rə ve yea kat başdiyentetihəsi iik la mişn nnu qarrantərxanə aə gə t düamab kdileraetmi bkilmiln rqlar srassiysontimyerə k gü so sö te xaai barctidi erigörgüngəlhbəihəikiisilinmaimaqn kn tn vonuqanqəztə xalyibyihzetzırıb ə məze br in ir pr ta to üça oalianianlaqlazibri", +"bg":"на нато пр зата поитете а па с отза атаия в е н даа н се кода от анипрене енио нни се и но анеетоа вва ване па ооторанат ред неа ди п допро съли принияскитела ипо ри е каиракатниените зи со состче раисто п из сае диники мин миа бавае вие полствт н въ ст тоазае оов ст ът и ниятнатра бъ чеалне сен ести дленнисо оови об сла ратоконносровще ре с спватешеи вието вовестаа ка тдатентка леднетористрстъти тър теа за мад анаенои оинаитима скаслетвотерцияят бе де паатевенви вити зи инарнововаповрезритса ята го щеалив пграе иедиелииликазкитлноменолираз ве гр им ме пъавиакоачавинво говданди до ед ериерождаитоковколлнимерначо золаон онапраравремсиястит птанха ше шенълг ба сиаробълв ргаре еелнемеикоимако коила лгао дозиоитподресриестот кт мт суст би дв дъ ма мо ни осалаансараатиацибешвъре редвемажави киалицаичекиялито бовоодиокапосродседслут итовувациачеся з во ил ск тр цеамиарибатби брабъд", +"ca":" dees de la lael que el coents d qu i en er a ls nt pee la d enperci ar ue al seestat ests s praci unresmens edels as p reles l'na a l ca d'elsa pia ns con letata ci da ara a e noant alt ds i dita re a scoms citaonsstaica por a inprotre pauesambiondesun mada s sa ian mb aml de dva pretere ee ca mciaunai encitra teonaos t en el cca ciol p trparr lt ae paqunta soameerar ee sadan as q si haalstes va m icintes ls mi aor moistectlitm s toir a tespranstrom l sst nts meno r dd'al'aatsrias t tasenrs eixtars nn ltale at part mi lltictenser aqinantra fstiol a qforuraersariintactl'e fir se ttorsi stereca r feis em n dcarbre fo vi analii pix elll mposorml li l acfers resseu e mensaraerisa ssius orttotll porora citanassn costnesraca uverontha tiitzgrat c n a vrencatnal riquat l dot srmauali ss fn ps vte t i bactetammanl tial faic veblea nalltzaies s'le ompr c ncrtiit rreficanyon sar ptur", +"ceb":"ng sa saangga nga ka ngan an na ma nia sa non pa sia ka m baonga iila mgmgaa piyaa aay ka alaingg mn sg nlan gina ni o sg pn n daag pagg syanayoo nsi moa bg aailg bhana dasunagya manne pankon il laakaakoanabasko od yo di ko uga ug kkanla lensurug aiapaaw d sg dg gilenin iy sueneog ot abaahaas imo kia tagabaneronano kranronsilunausa usa gahianier ha i areryon puininakro to ure ed og wailimo n and o a ad du praroi sma n mulound taaraasaatoawadmue nedminamakmunniysanwa tu una lbayigaikaitakinlismayos arad aliamaersipaisamaonimt stin ak ap hiaboagpanoatag igangkagpai mihak slawor rs siytag al at ha hu ima hbu e sgmakaslagmonnahngor sra sabsamsulubauha lo readaakiayabahce d nlabpa paks ns stantawte umaura in lua cabiat awobatdaldlaeleg tg ugaygo habhini ei nkabkaplaylinnilpampaspropulta tonugaugmunt co gu mi pi tia oabuadladoaghagkao artbalcitdi dtodunentg egongugia ibaicein inuit kaa", +"cs":" pr poní pro nana přch je neže že se do ro st v vepřese ho sta to vy zaou a to byla ce e vistle podí p vle ne sje ké by em ých odovaředdy eníkonli ně str záve ka sve pit ládohorovroztervláím kohodnispříský mi ob soa palibudednickkteku o sal ci e til ny né odlovárotsouání bu mo o astbylde ek ost mí taes jedky lasm pnesnímranremrosého de kt ni si výat jí ký mi pretaktany vřek ch li ná pa ředa dlednei pi vly mino no vpoltravalvnííchý přej ce kd lea sa zcene kedseklemikl latlo miénovpraskuskéstitavti ty vánvé y ny sí sí vě p dn ně sp čsa na tak dnídohe be mejnenaestinim znalnouná oviovéovýrskstátí třetů udeza é pém í d ir zvaleaněaveckédene zechen erýhlai siérlovmu nebnico bo mpadpotravroprý sedsi t ptictu tě u pu vvá výšzvýčníří ům bl br ho ja re s z zda vaniatoblabriečneřeh vi nie ilairsitekovnoso oo poceodyohloliovoplapočprára ritrodry sd skossdtelu svatveřvitvlay pálnčssšen al", +"cy":"yn dd yn y yddethth i aetd ych od ol edd ga gw'r au ddiad cy gy ei o iadyr an bodwed bo ddel n y amdi edion we ym ar rhodd ca maaeloeddaen addaer h yallei llam eu fodfydl yn gwynd ai gmaeneuos ned idoddoln cr hwydwyrai ar in rth fy he me yr'n diaesth chaii did r yy b dy haadai bn ioterottesy gyd ad mr uncyndauddyedoi ci withlaelland odarydtho a draidainddodydfyngynholio o awchwybyboych br by di fe na o' peartbyddrogall elaimr n nr arhywn ynn on r caed gd od wgangwyn dn fn onedni o'rr dud weiwrt an cw da ni pa pr wyd edaidimeudgwaiddim irilwyn bnolr orwy ch er fo ge hy i' ro sa trbobcwycyfdiodyneithelhynichll mddn rondpror cr gredrhau au cu yy cymdymryw ac be bl co osadwae af d pefneicen eoles fergelh ghodiedir lafn hna nydodoofyrddrierosstwtwyydayng at de go id oe â 'chac achae'al bl d cd ldanddeddwdirdlaed elaelleneewngydhauhywi ai fiolionl al iliamedmonn sno oblolarefrn thiun ", +"da":"er en deet derde for fo i at atre det handeereingden me oggerter er siand afor st ti enog ar il r sigetilke r eaf kke ma påom på ed ge endnget se sler skelsernsigne ligr dska vihar be sean ikkllegenn fstet at drin ikes ng verr bsenedemenr i he etig lanmednd rne da ine tmmeund ome ee mherle r ft fså te soelet e koestske ble fektmarbrue ael ersretsomtteve la ud veagee de hlsemanrugselser fi op prdt e in mr m an re saionnerrest igetn soneorbt hvisår frbile kensindommt m hv jedanentftenin mie oe pn onte kuellnasorer hr kstastodagerikunldemerr ar vrekrert otortør få må toboechee vi divekabns oelse t v al bo unansdreirekøborsoverent bør kaaldbetgt iskkalkomlevn dn iprir prbrsøgtel så te vaal direjefisgsåiscjerkerogsschst t kuge diag d ag iilll alskn aon samstrtetvar moartashatte bhanhavklakonn tnedr ora rrevesvil el kr ovanne uessfrag ag dintngsrdetra åraktasiem gelgymholkanmnan hnskold", +"de":"en er dederie didiescheincheichdenin te ch eiungn dnd beveres zueitgenund un au inchtit ten daent veand geine mir dhenng nde voe dbermenei mit stterrent d ereren sste see sht desistne aufe aiscon rte re wegesuch fü sobeie enenr sachfürierparür haas ert an pa sa sp wifortagzu dasreihe hrentesenvor scechetzheilann apd st staeselic ab sigte waitikein engeseitrazen im laartim llen wrderecsetstrteitte nie peheersg dnicvon al pran auserfr etzetüruf ag alsar chsendge igeionls n mngsnisnt ords ssse tüahle bedeem lenn iormprorkeruns dwahwerürk meageattellesthatn bollrafs atsc es fo gr jaabeaucbene negelien ur vre ritsag amagtahrbrade erdheritele n pn vor rbert sicwieübe is übchachie fe meriiedmmenerr astit at stis koarbds gann zr fr wranse t iweiwir br npam besd ddeue ge kefoet eutfenhselten rnpdr brhet wtz fr ih ke maameangd seilel eraerhh di dkann fn lntsochragrd spdsprtio ar en kaarkass", +"en":" ththehe ed to iner ingng annd ofandto of coat on in a d t hee tiones rere hat sa st haherthatioor ''en whe sentn ts aas foris t t beld e ars waut ve ll al mae i fo's an est hi mo se prs tatest tereretednt verd a wise e cectns only toley r t caatits all nohiss oerscone oearf te wwasonssta'' stin astot h weid th itce diaved hcouproad ollry d se m soillctite toreveg tit ch dehavoulty ulduse alarech me outovewitys chit aithoth ab te wos srest wtine be hncet sy te pelehins inte lile doaidheyne s w as fr trendsai el ne su't ay houivelecn't yebutd oo ty o ho mebe cale ehadple at bu lad bs hsayt i are fghthilighintnotren is pa shayscomn sr ariny a unn com thi miby d ie de nt o bye rerioldomewheyea grar itymplounoneow r ss ftat ba vobousamtimvotaboantds ialinemanmen or poampcandere llesny ot rectesthoicaildir ndeoseouspresteeraperr oredrie bo lealiarsorerics mstr faessie istlaturi", +"es":" dede laos la el es qu coe las que elue en ent en senteresconest ess d lo prlos y do ón ión unciódelo d poa dacistate adopreto para ea lra al e ese proar ia o e reidadadtrapors p a a paracia pacomno di inienn lad ante smena con un lasnci trcioierntotivn dn eor s cencernio a sicis e madose ae cempicaivol pn cr eta tere desaez mpro as a ca suion cu juan da eneerona recro tar al anbiee per l cn pompten emistnesntao cso teseral dl mlesntro sorerá s qs ystoa aa raridese qiviliclo n aoneoraperpuer lre renunaía adacasereideminn sndoranrno ac ex go noa tabableeceectl al glidnsionsracriostruerust ha le mi mu ob pe pu soa ialeca ctoe ie uesoferficgobjo ma mplo pobis msa sepstestitadtody s ciandcescó dore meciecoesiintizal elarmienerorcrciriatictor as sice dene re tenderiespialidoinaincmito lomeplirass tsidsuptabuenuesuravo vor sa tiablaliasoastcorcticuedivducensetiimiinileco qoceortralrmarocrod", +"et":"st kaon ja va on ja kose astle es as is ud sada ga taajasta ku pea kestistks ta al avaid saamiste val etnud teinn se tua value kiselu ma mes miet ikulinad el imene nna ha in ke võa sa tab e sesi la lie veksemalaslesrjutletsitusupauseustvar läaliarjde etei tigailmkuili tul ei me sõaalatadusei nikpeas ks osalsõnterul või el nea jateendi kitakarkorl olt maaolistivadään ju jä kü ma po ütaasaksat ed erihoii ska la nnioidpairitus ütl aa lo to vea eadaaidamianddlae jegagi gu i pidlik inijupkalkaskeskohs es pselsseui pi siaruedaevafili vidainglääme na ndanimoleotsriss lsiat p en mu ol põ su vä üha la pagaaleapsarve aelaikalleloomalpett kteetisvatäneõnn es fi via ia oaabaapalaaltamaanue pe tealelihaahinivakonku liklm minn toduoonpsari si stut et sti uleuurvasvee ki ni nä raaigakaallatue eeisersi eii iisil imaitskkakuhl klatmajnduni niiomaoolrsoru rvas tseksonstet mtajtamudeuhovai ag os pa re", +"eu":"en an etata etizan eko ide baa egiz es giarrbidrenrriarela sku beasuesksuntas izeanekoelaik kubn an itzaubiza zan era baskeran brretentze as koa aa galdanide deeea ek katkonn dontuan du naataegiestk enikntuntzskatua de di ez hea da kak akiakoartatuazibatberitzkunn ho briartetatunezar al ar haakuatzbaidardeadeleenemaerriakiarin inakianarnazneao eorrra stetekzakzekzio da em hi ho ma oiaguateaurbesdindirdutertez eziharherhitia ienikaio ireitek bk gkidkorldan onkoo aoinorirakrearierikrratanteatu unaundunturrutez ezko au eg gu ir ki ora ha jabeagiai ailaitapearideze eeareekerdereezaezkgirgithori eianiekilainkintiraitaituk nkapkoakumlanldemaimanmenn gn una ntao hoa oropenrdiri rtastateltettiktuetziumeun uztzeazenziazin az bi bu el ga jo mu ti un za zia na oa sa ta zabaadiakealaandar audbakbalbegbehbuldaudendu duie be de he oeakeetehaelkenbeteetigabgingo gusgutguzhauibeinbineioairuiuriziizkizo", +"fa":"ان ای ه ا اي دربه بردر ران بهی ااز ين می ازده ست است اس کهکه ايرند اين هايراود راهای خوته را رایرد ن بکرد و کرات براد کمانی د انخواشور بان ا ساتمیری اتما اواه ات عراق ر مراقعرای ب تا توار ر ان مه بور يد ی ک ام دا کناهدهد آن می ني گفد اگفت کشا بنی ها کشو روت کنيوه موی ی ت شوال دارمه ن که ديه ماامهد بزاروراگزا پيآن انتت افت ه نی خاماباتما مللنامير ی می ه آم ای منانسانيت دردهسازن دنه ورد او بي سو شدادهاندبا ت بر بز ازماستهن ره سوانوز ی ری س هساباام اورتخاخابخودد ددن رهاروزرگزنتخه شه ههستيت يم دو دي مو نو هم کااد اریانیبر بودت هح هحالرش عه لی وم ژان سلآمراح توسداددامر دره ريکزی سلاشودلاحمريننده عيمايکاپيمگر آژ ال بو مق مل ویآژاازمازیباربرنر آز سسعهشتهماتن آن پنس ه گوسعيانيومکا کامکند خا سرآورارداقدايمايیبرگت عتن خت د ور خرک زيرفتهقدال تمينن گه آه خه کورکويويوريوييی ک تی ش اق حا حق دس شک عم يکا تا دارجبينت مت وتايدستر حر سرناز بشکالل م کمز ندانواو اورهون ونديمز آو اع فر مت نه هر وز گز", +"fi":"en in an on istta ja n tsa staaann p onssattatä ka pasi jan kllaän eenn vksiettnentaattä vaillitt jo kon s tuia sua paa la llen mle ttena ta veat viutt saisesen ku nä päste ola taismaati a ooitpää pia valaineisiteltti sia kalliinkinstäuomvii ma seenä mua sestisslläloklä n jn otoivenytt liainet inan an nollplotenuställään todenmenokisuosä tääuksvat al ke tea eliitaiteiäisää plelli tideikkki ntaovaystyt ä päyt ha pe täa naiki pi vnytnäypalteeun mea messkaupaistuut voi eta heishtei oiikitajoumisninnutsiassävan ty yhaksimeloime n en hn loinomeottouksitstitettieukkä k ra tiajaasientigaiigitejankaakselaalanli näjoletiiusiäjä ova aantavaei erikankkulailisläimatoispelsilstytajtavttutyöyösä o ai pua ja laalarvassienimiimmitäka keskueleelinllooneri t ot ptu valvuo ei he hy my voalialoanoastattaukelielyhtiikakenkkilysminmyöohtomatusumiyksät äälös ar eu hu naaatalkaluansarjennhankuun ysetsim", +"fr":"es dede leentle nt la s d laionon re pae le d l'e p co prtions enne quer llesur en atiue po d'par a et it qumenonste ett d redes unie s l supou au à coner noaite cse té du du déce e eis n ds a soe re sourresssieur seemeestus surantiqus puneussl'aprotertreendrs cee at pun ma ru réousrisrussseansar come mirencentet l av mo teil me onttena pdanpasquis es s inistllenoupré'unaird'air n eropts daa sas au denmaimisorioutrmesiotteux a dienn antrommortouvs csontesverère il m sa vea raisavadi n pstiven miainencforitélaroirremrenrroréssiet atur pe tod'uellerrersideineissmesporransitst t rutivaié lési di n' éta casse tin ndeprerats mstetaitchui uroès es fo tr'adappauxe àettitilitnalopér dra rairors rtatutéà l afancaraartbrechédree fenslemn rn tndrnneonnposs ttiqure tualeandaveclacoue nembinsjoummerierèssemstrt iuesuniuveé dée ch do eu fa lo ne raarlattec ical al'ol'émmintaormou r urle", +"ha":" dada in an ya wa yana ar a d mawa a aa ka s tawan a ba kata a yn d ha na su sakinsa ata koa tsu gaai sha muwaiyama a wasayanka anishia ba ha camaba nann a muana yia g zai d kuakayi n kannke tar ciikin sko raki ne a zmathaknine dnnaumandaa nadacikni rinunaarakumakk ce dumann yncisarakiawaci kankararin mandhi n tga owaashkamdanewansaaliami ab doancn rayai nsunuka al nea'acewcinmastakun abakowa rra ja ƙaen r dsamtsa ruce i aabiidamutn gn jsana ƙharon i msuk ak jiyar'yakwamin 'yanebaninsruwi kn h adaken wshautu ƴabaytanƴanbinduke mn nokayinɗan faa ikkire za alaasuhani ymarranƙasaddarsgabirammau d tsabbabuagagarn b ɗaaciaikam dune si bi wkaskokwam amamfbbadinfangwai swatanoaredaiirima' laalldamikami shetumuni an ai ke kidagmaimfano nsuo dsakum bi gw kwjamyyaa jfa uta hu'a ansaɗaddahinniyr sbatdargani tntaokiomisala lkacllawadwarammdomr mrassai loatshalkatli lokn cnartinafabubi gisamak", +"haw":" kana o ka ma a laa ia m i la anaai ia a oa ka ho k kea ai k ho iaua na mee ke aau ke ma maiaku akahi ha ko e a l nome ku akakanno i aho ou aii oa po lo aamaa n ani mhani iihokoune iho iikionahoole e h heina waea akou ikahoe i lu a pahoie ierako u mkuamakoi kaii na ehinane oli hmeawahlake mo nu likaki a wmalhi e nu ohik kue lelera berineabeainalalo pokon abolehe paumahva elakaunak oekeioia ieram oioa ehohoviehova uaunaarao sawao onauu nwa waihel ae alae ta aik hialeilalelalieikoloonu loauae oolahonmamnan auahalaunuaohooma aoii aluimamauikeapaeloliipoeaianoa ino moka'u ahoei ekaha lu neiholinoo eemaiwaoluadanaapa u kewahualamluao hooku h liahuamuui il mo seeialaw hu ikaile pli lunuliio kiknohu e saaawaweenahalkollan le nea'uilokapokosa pehoploaopepe ad puaheaolia'lailohna'oomaauerikulwe akekeklaari ikukaklimnahnernuionoa udamkumlokmuaumawalwi 'i a'iaanaloetamu oheu pulauwa nuamo", +"hi":" हैमें मेने की के है के की कोों को ा ह कासे ा के कं कया कि सेका ी क ने औरऔर ना कि भी ी स जा परार करी ह होही िया इस रहर कुनाता ान े स भी राे ह चु पापर चुननाव कहप्र भाराजहैंा सै कैं नी ल कीं ़ी था री ाव े ब प्क्षपा ले देला हा ाजप था नहइस कर जपानहीभाजयोंर सहीं अम बा मा विरीकिए े प्या हीं मकारा जे ल ता दि सा हमा ना माक़्ता एक सं स्अमरक़ीताजमरीस्था थार् हुइराएक न कर मराकी जी न इर उन पहकहाते े अ तो सुति ती तो मिलिक ियो्रे अप फ़ लि लो समम कर्टहो ा चाई ानेिन ्य उस क़ सक सैं पं हगी त कमानर नष्टस कस्ताँ ी बी म्री दो मि मु ले शां सज़ात्रथी लिएसी ़ा ़ारांगे दे म्व ना बनंग्कांगा ग्रजा ज्यदी न मपारभा रहीरे रेसली सभाा राल ी अीकीे तेश अं तक याई हकरनतक देशवर्ायाी भेस ्ष गय जि थी बड यह वांतरअंतक़ गयाटी निकन्हपहलबड़मारर परनेाज़ि इी रे जे व्ट ्टी अब लग वर सीं भउन्क ककियदेखपूरफ़्यह यानरिकरियर्डलेकसकतहोंहोगा अा दा पाद ाराित ी ती पो को द ते नि सर हां दअपनजानत मथितपनीमहलर हलोगव कहनाहल हाँाज्ानािक्िस्", +"hr":"je na pr pona je zaijene i ti da ko neli bi da u ma mo a nih za a sko i sa pkojproju se goostto va do toe ni p od rano akoka ni ka se mo sti nimaja privatsta suatie pta tske inij trcijjennoso s izom troiliitipos ala ia oe sijainiprestrla og ovo svektnjeo podirva nialiminrija ta zatsivao tod ojera hra ma uhrvim ke o ioviredrivte bi e ogodi dlekumizvodine uenejedji ljenogsu a el mi o a daluelei uizvktrlumo doriradstoa kanjavae kmennico joj oveskitvrunavor di no s ta tvi ii okakrošskovod sa ćea badiamoenigovijuku o noraravrujsmotavtruu pve in placibitde dišemai mikaištjerki mogniknovnu ojioliplapodst stitratrevo sm štdane zi tio istkonlo stvu sujeustće ći što dr im liadaaftaniao arsatae temoi kinejemkovlikljimjenafnernihnjaogooizomepotranri roirtkskateru iu ovi vrt me ugak amadrže ee ge mem emeenjenter ereergeurgo i bi zjetksio uodaonaprarebremroptrižav ci eu re te uv veajuan ", +"hu":" a az szaz meen el hoek gy tt ettsze feés kitet beet ter kö éshogmegogysztte t azeta mneknt ségszáak vaan ezera ta miintköz iseszfelminnakorszer tea aa kis cseleer mensi tekti necsaentz ea talaerees lomltemonondrszszattezágány fo maai benel eneik jeltásáll ha le álagyaláiszy azteás ale aegyelyforlatlt n aogaon re st ságt mán ét ült jegi k aküllamlenlásmáss kvezásoözö taa sa vaszatáetőkezletmagnemszéz mát éteölt de gy ké mo vá éra ba famiat atoattbefdtagyahati slasndtrt szot ktártésvanásáól bé eg or pá pé vebanekeeküelőervetefogi akisládntenyenyiok omáos ránrássalt evályarágoálaégeényött táadóelhfejhethozilljárkésllomi ny ontrenresrins as esszzt ez ka ke ko rea ha ndendó efogadgatgyehelk eketlesmánndenisozzt bt it étattosvalz ozakád ályáraésiész ak am es há ny töakaartatóaztbbeberciócsoem etietégali tiniistja kerki korkozl éljályen vni pálrorrólrüls cs ps ss vsokt jt ttartelvat", +"id":"an mekanangng pemen di ke da seeng benganya teah beraka yadandi yann ppera mita pada ataadaya ta inalaeriia a dn kam ga at eran dter kaa pariembn mri baaanak ra itaraelani aliranar erulaha basiawaebagann b hainimer la miandenawan saahalamn inda waa iduag mmi n arustelyak andalh di singminnggtakamibebdengatianih padrgasanua dea targdareluhari ki mi pikain inyitumban tntupanpensahtantu a kbaneduekag dka kerndentaorausa du maa sai antbasendi dirakamlann sulial apaereertliamemrkasi talung aka aa waniaskentgarhaai iisakedmbeskatoruanuk uka ad toasaayabagdiadunerjmasna rekritsihus bia hamadibersg shanik kemma n lnitr brjasa ju or si tia yagaanyas culemeemuenyepaerberlgi h mi akelli melniaopartasiatahulaun unt at bu pu taagialuambbahbiser i tibeir ja k mkarlailallu mpangknjaor pa paspemrakriksebtamtemtoptukuniwar al ga ge ir ja mu na pr su unad adiaktannapobelbulderegaekeemaempeneenjesa", +"is":"að um aðir ið ur ve í na á se er ogar og ver miinnnn fyer fyr ek en ha heekk stki st ði ba me viig riryri umg flegleins ð s ei þain kkir hr segieinga ingra sta va þeannen milsemtjóarðdi eithafillinsistlljndir ar esegun var bi el fo ge yfandaugbaubigegaelderðfirfooginittn snginumod oodsinta tt viðyfið eð f hr sé þva ea áem gi i fjarjórljam er áreirstrðarðirðustjundvegví ð vþaðþví fj ko sleikendertessfjáfurgirhúsjárn eri tarð þðarðurþes br hú kr le upa seggi sirtja kiðlenmeðmikn bnarnirnunr fr vriðrt stit vti unauppða óna al fr gra vallan da eiðeð fa frag egergiðgt hanhefhelherhrai ai ei vi þikijónjörka królíkm hn angar lramru ráðrónsvoviní bí hð hð kð mörð af fa lí rá sk sv tea ba fa ha ka uafiagnarnastberefuennerbergfi g agariðskerkkelanljólltma miðn vn ínanndanduniðnnannunu r orbergislösé t at htiltinuguvilyggá sð að bórnögnöku at fi fé ka ma no sa si ti áka ma ta ía þafaafsaldarf", +"it":" dito la dedi no core ione d e le delne ti ell la unni i dper peent inonehe ta ziocheo da dna atoe s soi sllaa pli te al cher pa siconsta pra c seel ia si e p dae ii pontanoi callazinteon ntio s rii ao aun anarearie ai eitamenri ca il no poa santil in a laticiae cro annestglità que lnta a como cra le nealiereist ma è io lleme eraicaostprotaruna pida tat miattca mo nonparsti fa i re suessinintoo lssittoa eamecolei ma o iza sta aaleancanii miano ponisiotantti loi rociolionaonotra l a reriettlo nzaquestrtertta ba li teasse fenzfornnooloorirestor ci voa ial chie nliapreriauniver spimol al cransensoctic fi moa nce deiggigioitil slitll monolapacsimtituttvol ar fo ha saacce riremanntrratscotrotutva do gi me sc tu ve via mbercanciti lieritàlliminn pnatndao eo fo uoreoroortstotentivvanartccoci cosdale vi iilainol pn cnitoleomepo riosa ce es tra bandataderensersgi ialinaittizilanlormil", +"kk":"ан ен ың қа баай ндаын са алді арыды ып мұ біасыда най жамұнстағанн бұна боныңін ларсын деағатан көбірер меназаындыны меандеріболдыңқазатысы тынғы кеар зақық алаалыаныараағыгентартертырайдардде ға қобарің қан бе қыақсгердандарлықлғаынаір іріғас таа бгі едіелейдын кн толарыніп қстқтаң б ай ол соайтдағигелерлыпн аік ақтбағкенн қны ргерғаыр аралғасабасберге етіна ндене нигрдыры сай ау кү ни от өзаудеп ияллтын жн оосыотырыпрі ткеты ы бы жылыысыі сқар бұ да же тұ құадыайлап атаенійлан мн сндындір мтайтіны тыс інд биа жауыдепдіңекеерийынкеллдыма нанонып жп ор бриярлаудашылы аықті аі біз ілің қ ас ек жо мә ос ре сеалддалдегдейе бет жасй блаулдаметнынсарсі ті ырыытаісің аөте ат ел жү ма то шыа аалтамаарластбұлдайдықек ельесіздікөтлемль н еп ар аресса та ттетұршы ы ды қыз қыт ко не ой ор сұ түальареаттдірев егіедаекіелдергердиядкеркетлыслісмедмпин дні нінп тпекрелртарілрінсенталшілы кы мыст", +"ky":"ын ан жаен да таар ин каары ал ба билар бо кыалан к сандагантар деандн б кеардменн таранын да мекыр чен ары когендаркенктауу енеери шаалыат на кө эматыдандепдынеп ненрын беканлуургытаншайыргүн ар маагыактаныгы гызды рдаай бирболер н сндыун ча ында кагаайланаап га лгенчап крдытууыны ан өзамаатадинйт лгалоооо ри тиныз ып өрү па эка балгасыаштбизкелктетал не суакыентиндир калн дндеогоондоюнр бр мрансалстасы ураыгы аш ми сы туал артборелгениет жатйлокарн могуп ап жр эсынык юнч бу ура аак алдалубарбербоюге донегиектефтиз катлдын чн эн өндонефон сатторты удаул улаууды бы жы кыл ынаэкеясы ат до жы со чыаасайтастбаабашгаргындө е бек жыли бик ияскызлдалыкмдан жндини нинордрдостота терттитуртынуп ушуфтиыктүп өн ай бү ич иш мо пр ре өк өта да уа эаймамдаттбекбулголдегегеейтелеенджаки киниириймактоликмакмесн ун шнттол олопарракрүүсырти тикттатөру жу сшкаы мызыылдэмеүрүөлүөтө же тү эл өна жады", +"la":"um us ut et is et in qutur presttio auam em aut dientin dict e esur atiionst utae qua dent su siituuntrumia es ter rentiraes equiio proit peritaoneiciius cot dbuspram e noeditiaue ibu se ader fiiliquet ide oru teali peaedcitm dt stattemtist pstite cumereium exratta conctionira s i cu saeninisnteeriomire s aminos ti uer ma uem snemt m mo po uigenictm iriss st auae dom at c geas e ie pne cainequos p ale enturo tritusuitatuiniiqum postresura ac fua eantnesnimsuntrae as d pa uoecu om tuad cutomns q eiex icutoruid ip mee seraeruiamideips iua sdo e deiuicaim m cm utiu hocatistnaton ptiregrits tsicspe en spdiseliliqlismenmusnumpossio an grabiaccectri uan leeccetegranonse uenuis fa tratee cfilna ni puls fui at ccedami einalegnosoripecropstauiaeneiueiuisiut tt utibtit da nea dandegeequhomimulorm mmnindonero er esittumutua pbisbitcerctadomfuti signintmodndunitribrtitasund aberrersiteitim to p", +"lt":"as pa kaai us os is ne irir ti prausinis ppasių ta viiau ko sukaio pusi savo taialitų io jo s kstaiai bu nuiusmo poiens stas meuvokad iš lato aisie kururi kuijočiaau metje vaad apand gr tikalasii pičis is vinko nės buvs a gaaipavimaspritik reetujos daentoliparantarataramagalimoiško s at be į mintin tus n jodarip rei tedžikasninteivie li secijgarlaiartlaurasno o ktą arėjovičigapravis namenokirašs tietikaintkomtamaugavories b steimko nuspolriasauapime ne sik šii nia iciojasakstiui amelieo tpiečiu di pegriioslialins ds gta uot ja užauti sinomą ojeravdėlntio atojėl to vyar inalico vseisu mi pidiniš lansi tus baasaataklaomitat an jialsenajų nuoperrigs mvalytačio rai kliknetnė tistuoytięs ų sadaarido eikeisistlstma nessavsiotau kiaikaudiesoris rska geasteiget iamisamisnamomežiaabaaulikrką ntara tur madieei i tnasrinstotietuvvosų p dėareatsenėiliimakarms niar prods l o e pes ideik ja ", +"lv":"as la pa nees unun ka vaar s p ar viis ai noja ijaiemem tu tievielataksienkstiess arakatvtvi ja pika irir ta sats kāās tiot s n ie taarīparpie prkā at raam inātā izjaslai naautiešs s ap ko stiekietjauus rī tikībana gacijs i uzjums vms var ku majā stas u tādiekaikasska ci dakurlietasa peststāšannesnies ds mval di es reno to umuvaiši vēkumnu ries tām ad et mu s l beaudturvijviņājubasgadi nikaos a vnototistsaiku aā aāk toiedstuti u pvēlāci šogi ko pros rtāju su vvisaunks strzina aadīda darenaicikranasstīšu mēa necii sie iņaju lasr tumsšiebu citi ainama pusra au se sla saisešiiecikupārs bs ksotādā in li tranaesoikrmanne u k tuan av betbūtim isklīdnavrasri s gstiīdz aiarbcindasentgali plikmā nekpatrētsi traušivei br pu skalsamaedzekaešuiegjiskamlstnākoliprepēcrottāsusiēl ēs bi de me pāa iaidajāiktkatliclodmi ni prirādrīgsimtrāu lutouz ēc ītā ce jā sva tagaaizatuba ciedu dzidzī", +"mk":"на ната атаија прто ја заа н и а сте ите коот де поа дво за во од се несе доа вка ањеа по пувација оициетоо нанини влдекекањетќе е а за иат влаго е нод пре го да ма ре ќеалии ди ниотнатово па ра соовепраштоње а еда датдоне ве де зе сконнитно ониотопарпристат н шта кацива вање пенила ладмакнесноспроренјат ин ме тоа га ма ракеаковорговедоенаи ииракедне ницнијостра ратредскатен ка сп јаа тадеарте ге икатласниоо сри ба биаваатевнид ндендовдрждуве оен ереерии пи синакојнцио мо ооднпорскиспоствститвоти об ова балнарабаре кед ентеѓуи оии меѓо дојапотразрашспрстот дци бе гр др из стаа бидведглаекоендесеетсзаци тизаинсистки ковколку лицо зо иоваолкореориподрањрефржаровртисо торферценцит а вр гл дп мо ни но оп ота ќабоадаасаашаба ботвааватвотги граде диндумевредуеноераес ењеже заки вилаитукоакоиланлкуложмотндунсто воа оалобров овиовнои ор ормој ретседст тертијтоафорцииѓу ал ве вм ги ду", +"mn":"ын байн байийнуул улулсан ханийн хгаасыний лсы бой бэн ах болол н боло хэонгголгуунгоыг жил молаглламон тє хуайдны он санхий аж орл ун тулгайгдлыйг задэсн андэулаээ агаийгvй аа й алынн з аю зєаарад ар гvйзєважиал аюуг хлгvлж сниэснюулйдллыгнхиуудхам нэ сагийлахлєлрєнєгч таилллийлэхрийэх ер эрвлєерєийллонлєгєвлєнх хоариих ханэр єн vvлж бтэйх хэрх vн ньvндалтйлєнь тєр га суаандааилцйгул алаан нрууэй тон срилєриааггч лээн орэгсууэрэїїл yн бу дэ ол ту шиyндашиг тиг йл харшинэг єр их хє хїам ангин йгалсан vн еналнд хууцааэд ээрєл vйладаайналаамтгахд хдалзарл бланн дсэнуллх бхэр бv да зоvрэаадгээлэнн ин энганэ талтынхурэл на ни онvлэаг аж ай атабарг бгадгїйй хлт н мна ороульчинэж энэээдїй їлэ би тэ энаныдийдээлаллгалд логль н ун їр бралсонтайудлэлтэргєлє vй в гэ хvарабvрд нд ол хлс лтын гнэгогтолыоёрр трээтавтогуурхоёхэлхэээлэёр ав ас аш ду со чи эв єраалалдамжандасувэрг удвэжvvлцалэл", +"no":"er en et dedet i foril fo meingom ha ogter er ti stog tilne vire en sete or de kkeke ar ng r sene soe sderan somsteat ed r i av inmen at ko påhar sierepå ndeandelsetttteligt sdent iikkmedn srt serskat ekersenav lerr atene fr er tedeig rehanllener bl frle vee tlanmmenge be ik om å ellselstaver et sknteoneorer dske an ladelgenninr fr vse poir jonmernenommsjo fl saernkomr mr orenvilalees n at f leblie ee ie vhetye iral e oideitilitnnerant otaltattt kaansasjge innkonlsepett dvi utenteriolir pretrisstostrt a gaallapeg sillirakapnn oppr hrin br ope mertgerionkallsknes gj mi prange he reltenni sistjenkanlt nalrestorassdree be pmeln tnseortperregsjet pt v hv nå vaannatoe aestiseiskoilordpolra rakssetoi grak eg eleg aigeighm en fn vndrnskrert mundvarår he no nyendeteflyg igheierindintlinn dn prnesaksiet btid al pa trag dige de kessholi dlagledn en in oprir bst fe li ryairaked seasegi", +"ne":"को का मा हरु नेनेपपालेपा समले प्प्रकारा सएको भए छ भा्रम गररुक र भारारत का विभएकालीली ा पीहरार्ो छना रु ालक्या बाएकाने न्ता बाकोार ा भाहर्रोक्षन् ारी निा नी स डुक्रजनायो ा छेवा्ता रात्यन्दहुना कामाी न्दा सेछन्म्बरोतसेवस्तस्रेका्त बी हुक्तत्ररत र्नर्या राकाुको एक सं सुबीबबीसलकोस्यीबीीसीेकोो स्यक छन जन बि मु स्गर्ताहन्धबारमन्मस्रुललाईा वाई ाल िका त् मा यस रुताकबन्र बरण रुपरेकष्टसम्सी ाएकुकाुक् अध अन तथ थि दे पर बैतथाता दा द्दनी बाटयक्री रीहर्मलकासमसा अा एाट िय ो पो म्न ्ने्षा पा यो हाअधिडुवत भत सथा धिकपमाबैठमुदया युकर नरतिवानसारा आा जा हुद्ुपमुलेुवाैठको ब्तर्य ्यस क् मन रहचारतियदै निरनु पर्रक्र्दसमासुराउनान ानमारणालेि बियोुन्ुरक्त््बन्रा्ष आर जल बे या साआएकएक कर्जलसणकात रद्रधानधि नकानमानि ममारम रहेराजलस्ला वारसकाहिलहेका तारेिन्िस्े सो नो रोत ्धि्मी्रस दु पन बत बन भनंयुआरमखि ण्डतकातालदी देखनियपनिप्तबतामी म्भर सरम्लमाविशषाकसंया डा मानकालमि भित ी पी रु भुनेे गेखिेर ो भो वो ह्भ ्र ता नम ना", +"nl":"en de deet an heer van dvaneenhet geoor eeder enij aargente ver in meaanden weat in da teeerndetersten v vo ziingn hvoois optie aaedeerders beemetenkenn e ni veentijnjn meeietn wng nie ischtdatereie ijkn brdear e be amett del ondt h ale wop ren di onal andbijzij bi hi wior r dt v wae hllert anghijmenn an zrs ome oe vendestn tpar pa pr zee ge pn pordoudraascht eegeichienaatek lenn mngent overd wer ma midaae klijmern gn oom sent bwij hoe melegemhebpenude bo jadiee eelierkle prorij er zae densindke n knd nennter hs ds et z b co ik ko ovekehouik itilanns t gt m do le zoamse zg vit je ls maan inkerkeuit ha ka mo re st toagealsarkartbene re sertezeht ijdlemr vrtet pzegzicaakaalag alebbech e tebberzft ge ledmstn noekr it ot wteltteuurwe zit af li uiak allautdooe ieneergetegesheejaajkekeekelkomleemoen sortrecs os vtegtijvenwaawel an au bu gr pl ti'' adedage lecheeleftgergt ig ittj dpperda", +"nr":"okula ngaa n ngna amaa iko ukelelo elaanga ua kukuaba kuwa enzlelho ni ngoathphaethkhaanaisange nao nthoe ntheha esinyekwetjh kwise uma a nele hlaa elanbenndl noimiundungthinziye isiutho eebehetkutandsa elofunekosebbanuluakaeliwene i ameniba we nel wekuflwai n iszi lokwalokelwgokonalekhi li ganbon iiingka o iakhanethuulakelmth imga lendafannoki kendsi o waphhate ualakublunikho lezia lo usisnamemi abhulkus wosekazikhoiini uasiloliniuphuhlkhuno o yakoa bi eo ki l bemal yei indeiphmelekethakunngie kengo s yoso ma mkhjhaiswlwe ezdi a we akulunyumeza anyahlkuheen siiliitjzokihl eske hlohakpheluldlelukda ekaamb sezismbihondlaakujenzin bahami a boo aaliuseilesikhanwokokhhlunyasitanikuzo oufaswaindzaknislisgabmi em koano elhwaufua ywo inlimtlokatwakkanthwo zithndiyokyo mitmisaboekuhabinynanezekhealolu manhe ezokupubu zogamhelwanombamknzaolahumkukdu lakomi yobui boduokwgap kabe ilaluatje b", +"nso":"go go le a le dia gya lo yaa mka kala t o ya ta kba et wa mo e a b se ba ma boe gt a o a lo tna o la delodi a so go keleo ang t eo bmo e te megoeo e lngwse e bkgoela wa gae kagoo m kgga ditolot he do d yeanelelwe tlthuona tht whutanatlawanabaola megware ongt olaoe so sa yaloseta pi aenga ao etho kegwe hahloedi laao tsakahlaalaswa we bjo ogoragahabgobletke diksa i oba hlthedira nithbjaye no samollwati manolee etseo woreto at ethe ykantshgonnetanokarge ho lok sw nai bdipi ooka ge omko emopelnt e amellegtlhme etephea eo no iwalokonyabolodiwegte e nta anyyeokgapolangri it uto mmitiareo fha gatothikao h itsheathaleiriphaahl teohltha rebonlha phdin pero mi omii t faaroasei lne lalogokol wot iomo bemogmoklenilelwema utanseamoa o feokgja pannagekgi iapagetlonra aem yoatltlokeltel kh poe oa wenti ebo ganhetmala fotlutiogasenkwamaeekammekgejala ringlekseplagofewagg yrolepeekoboko padilog", +"pl":"ie nieem ni po prdzi naże rzena łemwie w żego byprzowaię do siowi pa zach egoał sięej wałym aniałeto i to tee p je z czybyłpanstakie jado ch cz wiiała ppow mili enizie ta wało ać dy ak e w a od stniarzyied ktodzcieczeia ielktóo ptórści sp wyjaktakzy moałęproskitemłęs tre mjesmy roedzeliiej rza nalean e sestle o si pki coadaczne te zentny prerząy s ko o acham e no tolipodzia go kaby iegiernośrozspoychząd mnaczadzbiechomnio nostpraze ła soa mczaiemić obiył yło mu móa tacjci e bichkanmi mieoścrowzenzyd al rea wdenedyił ko o wracśmy ma ra sz tye jiskji ka m sno o zrezwa ów łowść obecheczezyi wja konmówne ni nownympolpotyde dl sya sakialidlaiczku oczst strszytrzwiay pza wtchcesziecim la o msa waćy nzaczec gda zardco dare rienm nm wmiamożrawrdztantedtegwiłwtey zznazłoa rawibarcjicządoweż gdyiekje o dtałwalwszzedówięsa ba lu woalnarnba dzoe chodigiligm pmyśo conirelskustey wystz w", +"ps":" د اؤ اؤنو ې دره پهنه چې چېپه ه دته و اونوو د اوانوونهه ک داه ادې ښې کېان لو هم و مکښېه مى ا نو ته کښرونکې ده له به رو همه ووى او توندا کو کړقام تررانه پې وې پ به خوتو د دد اه تو پيا خپ دو را مش پرارورې م دمشر شو ورار دى اد دى مود پلي و ک مق يوؤ دخپلسرهه چور تا دې رو سر مل کاؤ اارهبرومه ه بو تپښت با دغ قب له وا پا پښد مد هلې ماتمو ه هوي ې بې ک ده قاال اماد نقبره نپار اث بي لا لراثاد خدارريخشرامقانۍ ه ره لولويو کوم دد لو مح مر وواتواريالواندخاند تسې لى نورو لي چړي ښتوې ل جو سيام بانتارتر ثارخو دو ر کل دمونندېو نول وه ى وي دې اې تې ي حک خب نه پوا دتې جوړحکمحکوخبردانر دغه قافمحکوالومتويلى دى ميرهپر کولې ه تي خا وک يا ځاؤ قانۍبى غو ه خو بودايدوړې کال بر قد مي وي کرؤ مات اييتى تياتيرخوادغودم ديمر وقديم خمانمې نيونږ ه يو سو چوانوروونږپورړه ړو ۍ دې ن اه زي سو شي هر هغ ښااتلاق انيبريبې ت اد بد سر مرى عرالانمى نى و خوئ ورکورېون وکړى چيمهيې ښتنکه کړيې خے ش تح تو در دپ صو عر ول يؤ پۀ څوا ا", +"pt":"de deos as que coão o d quue a do ent sea ds de aes prra da es pato o em cono p doestnteção da rema par tearaida e adeis um poa aa pdadno te noaçãproal come ds a asa cer mens eaisntoresa sadoists pteme ce sia o so ao ce pstata traura di pear e eserumamosse cao e naa edesontpor in maecto qrias csteverciadosicastr ao emdase titoizapretos nãadanãoesseveor rans ns ttur ac faa renserina sso si é braespmo nosro um a nao icolizmino nonspritenticões tra magae niliimem ancinhantaspetivam anoarcasscere oeceemoga o mragso são au os saalica emaempiciidoinhissl dla licm cmaioncpecrams q ci en foa oamecarco dereirho io om orar asenter br exa uculdeve uha mprnceocaoverios osa semtesunivenzaççõe ad al an mi mo ve à a ia qalaamoblicencolcosctoe me vedegásiasitaivandoo torer dralreas fsidtrovelvidás ap ar ce ou pú so via factarrbilcame fe iel forlemlidlo m dmarndeo oomoortperpúbr ureiremrosrressi", +"pt-br":"eq ent enq eq ig eg ing ididantete es inadeag dadde ia ing br saestinqlinmo nq o aseq co li ni o a aa cadoasibradoriq ntao bor q nrassilstrta treus a ag an ca e eq g i ir nc q se veantar ciacone aeirel ig iliimoio ir ncio tro vel ap bo de fr tra ba ea ga vapoas busca cetcindese be setafrei aibuil irola liqnibntio co qos ra re reqs as ssansimtarto ult ba ci el em fi gr gu ia mu pe po re ri si su te via oa sabealcandaraargaribenboccarco do e fe ge le oem emoen es espexeficg ng sgraguaiasicaidiilaileinhl bl eleiloqmosmulnadniont ntoo go roceontoq posq vr br er ir sradranremrg riarios es pstastitigtiltraua ue va xeq ' ab ad ae al am aq ar b bi bl bu cc ch di et ex fa ic il im is it ll m me na ne ng nu ob ou pi qu ss st ti ub un v x ' ca da fa ia na pa tabraciad adaadraerafealvambampan anaanganhanianoanqapaaq atiatoazib nbanbarbigbilbiqbliblubonbrebribsebucc fc icadcafcagcalcancc ", +"pt-pt":"equentquequiguiuen linguqu uid co vede gueidanteo aa aadedadel ingmo nquntasequ nvel de o sea cadoar estia inqio iqulino co portporta te ag eq nc pi po saa da eantas ca ciadesdo gu imol pnciro rtustrtugu suesui a an ap ba bi ca fr gu in pe quaguapacondore fe geirfreho i aicaiguiroliqntio bo lo sor r ora reqs csimtarto ue uinult ci en ho mu ni re s si sua sa vabeag al andanhapoatabanbenbicboicapcarcinco comctodeie be oe secaen er es exeficforgalgraiasichicoidiiliir iraisbla lismbomulna nhoniont o qo ro toc oioomboo os parpe r br er sranre recs as ssansboso statantratreu vugauguxeq ab ad al am aq ar au b bo c ch ct cu el es ex fa fi ga gr id ir ne ng nu ob oo pa ps pt r ra ri ss st ta te tr ub un vi voa fa ia la ma oa rachaciactad afaageagralfalham ambamianaanganqaquaraarbarcargariarrasaatiautazib nbarbatberbigbilbiqbliboaboeborbsec ic lc pcadcamcasch chachechiciococcoicouctrcuecul", +"ro":" de înde a ul coîn re e dea di prle şi areat conui şii dii cue aluiernte cu laa ccă dine cor ulune terla să tattre ac săestst tă ca ma pecuristmâna di cnat cei aia in scu miatoaţiie re sea aintntrtruuriă a fo paateinitulentminpreproa pe pe sei nă parrnarultor in ro tr unal aleartce e ee îfositanteomâostromru strver ex naa flornisrearit al eu noacecerilenalpriri stasteţie au da ju poar au eleereeriinan an cresse t atea că do fia satăcome şeurguvi siceilina recreprilrnertiurouveă p ar o su videcdreoaronspe rii ad gea ma rainalicarcatecueneeptextiloiu n porisecu puneă cştiţia ch guai aniceae fiscl alicliumarnicnt nulrist ct ptictidu aucr as dr fa nu pu tocradisenţescgenit ivil dn dnd nu ondpenralrivrtestit dta to unixteândînsă s bl st uca ba ia lairastblabricheducdule measediespi li picaicăir iunjudlailulmaimenni pusputra rairopsilti trau sua udeursân întţă lu mo s sa sca uan atu", +"ru":" на прто нели поно в на ть не и коом про тоих каатьото заие ователтор деой сти отах ми стр бе во раая ватей ет же ичеия ов сто обверго и ви пи сии исто восттра теелиерекотльнникнтио срорствчес бо ве да ин но с со сп ст чталиамивиддете нельескестзали ниваконогоодножнольорировскося терчто мо са этантвсеерреслидеинаиноироитека ко колкомла нияо толоранредсь тивтичых ви вс го ма слакоаниастбезделе де пем жнои дикаказкакки носо нопаприрроскити товые вы до ме ни од ро св чиа наетазаатебесв пва е ве ме сез ениза знаиникамкахктоловмерможналницны нымораороот порравресрисросскат нтомчитшко бы о тр уж чу шка ба ва рабиалаалоальаннатибинвесвново вшидалдатдное зегоелееннентетеи оилиисьит ициковленлькменмы нетни нныногнойномо побновеовнорыперпо прапреразропры се слисовтретсяуроцелчноь вькоьноэтоют я н ан ес же из кт ми мы пе се цеа ма па тавшажеак ал алеанеачиаютбнаболбы в ив сванградаждене к", +"sk":" pr po ne a ch na jení je dona ova v to ho ou toickterže st zaostých sepro tee s žea p ktpre by o se kon přa sné ně stiakoistmu ameentky la pod ve obom vat kostaem le a vby e pko eriktesa éhoe vmertel ak sv záhlalaslo taa nej li ne saak aniateia sou soeníie rece e noritic vya tké noso sstrti uje splovo poliová náaledene oku val am ro siniepoltra alalio vtor mo nici o ním le pa s al atierooverovváních ja z ckée z odbylde dobneppraricspotak vša ae tlitme nejno nýco ta je aen estjí mi slostáu vfornoupospřesi tom vla zly ormrisza zák k at ckýdnodosdy jakkovny resrorstovan opda do e jhodlenný o zpozpriranu s abaj astit ktoo oobyodou pva áníí pým in miať dovka nskáln an bu sl tre mechedni nkýcnícov příí a aj boa dideo ao dochpovsvoé s kd vo výbudichil ilini nímod oslouhravrozst stvtu u avály sí sí v hl li mea me bh si pi sitiládnemnovopouhlenoensmennesobote vedvláy n ma mu vábezbyvcho", +"sl":"je pr po je v za napreda daki ti ja ne inin li no na ni bijo nenjee pi pprio pred doanjem ih bo ki iz se soal dee vi sko biliraove br obe bi novase za la jaatiso ter taa sdele d dr oda nar jalji rit ka ko paa banie ser ililovo vtov ir ni voa jbi briitileto ntanše le teenieriitakatporproalike oliov prari uarve toa ia vakoarjatedi do ga le lo mero sodaoropod ma mo sia pbode negaju ka ljeravta a oe te zi di vilalitnihodostito varvedvol la no vsa daguajadejdnjedagovguajagjemkonku nijomoočipovrakrjastateva taj ed ejaentev i ii oijoistostskestr ra s tr šearnbo drži jiloizvjenljansko do iom oraovorazržatakva venžav me čeameavie ie oekagrei tijail itekraljumorniko tobiodnranre stostvudiv ivan am sp st tu ve žeajoaleapodaldrue jednejoeloestetjevaijiik im itvmobnapnekpolposratskitičtomtontratudtvev bvilvsečit av gra zansastavtdane medsfori zkotmi nimo bo ood odloizot parpotrjeroitemval", +"so":"ka ay da ayaaloo aan kaan in inadamaaaba soalibadaddsoo naahaku ta wayo a somayaa ba ku la ooiyashaa addanabnta da mankauu y iayaha raa dh qaa kalabaadoohadliyoom ha sha da ia naaree ey y kya ee iyaa aaqgaalam bua ba mad agaamaiyola a ca leenintshewaxyee si uua haasalkdhagu heeii iramado ao kqay ah ca wuankashaxaeeden ga haan an snaanayo dtaau buxuwuxxuu ci do ho taa ga uanaayodhiiinlaglinlkao isanu sunauun ga xa xuaababtaq aqaaraarlcaacireegeelisakallahneyqaarlasadsiiu dwad ad ar di jo ra sa u yia ja qaadaataayah aleamkarias ayebusdalddudiidu duued egegeyhayhiiidainejoolaalaymarmeen bn dn mno o bo loogoonrgash sidu qunkushxa y d bi gu is ke lo me mu qo uga ea oa wadiadoagual antarkasaawibtabuld adagdando e sgalgayguuh ehaligaihiiriiyekenladlidlshmagmunn hn ina o no woodoororaqabqorrabritrtas osabskato u au hu uud uguulsuudwaaxusy by qy syadyayyih aa bo br go ji mi of ti um wi xoa x", +"sq":"të tënë për pë e sht në shse et ë së t sehe jë ër dhe paë në p që dhnjëë m njëshin meqë poe ne tishmë së me htë ka sie ke p i anëar nuundve ëse s mënukparuaruk jo rë ta ë fen it minhetn eri shqë d do ndsh ën atëhqiistë q gj ng tha ndo endimindir tratë bëri muartashqip koe medherije ka ngasi te ë kësi ma tievehjeiramunon po re prim lito tur ë eë vët ku sëe des ga itijetndëolishitje bë z gjekanshkëndës de kj ru viaragovkjoor r prtorugtetugoaliarrat d tht i pipëizijnën noheshushët etika earëetëhumnd ndroshovarimtosva fa fia sheni nmarndoporrissa sistësumëvizzit di mbaj anaatadëre aeshimejeslarn sntepolr nranresrrëtarë aë i at jo kë rea kai akthë hëni ii mia mennisshmstrt kt nt së gërkëve ai ci ed ja kr qe ta vea pcilel erëgjihtei tjenjitk dmënn tnyroripasra rierëstoruajyreëm ëny ar du ga jedëse ee zha hmeikainiiteithkohkraku limlisqënrëns st dt ttirtënverë j ba in tr zga aa ma tabr", +"sr":" на је поје и не прга свог а сих на којога у а пне ни ти даом ве сри сско оба нда е нно ного јој зава е си пма никоброва коа идије пка ко когостсвествститраедиимапокпраразте бо ви саавобрагосе иелиениза икиио преравраду сју ња би до стастбојебои ним ку ланнебовоогоослојшпедстрчас го кр мо чла ма оакоачавелветвогедаиститиијеокослосрбчла бе ос от ре сеа ван богбровенграе оикаијакихкомли ну отаојнподрбсредројса снитачтваја ји ка ов тра јавиаз анобиовикво говдние чегои оиваивоик инеиниипекипликло нашносо тод одионаојипочпрора рисродрстсе спостатићу ду ну очинша једјниће м ме ни он па сл теа уаваавеавнанаао атиациајуањабскворвосвскдине уеднезиекаеноетоењаживи ги ии ки тикуичкки крсла лавлитме меннацо но по уоднолиорносноспочепскречрпссвоскисласрпсу та тавтвеу бјезћи ен жи им му од су та хр ча шт њеа да за ка тадуалоаниасованвачвањведви вновотвојву добдрудседу е бе де мем емаентенц", +"ss":" ku lela ekua knga nga nngea llo neetikwendze no l loelaemaentsi kwtsii lwa lelkute kundni elofunesi sieletintfo tile khatsee lphaungi k emti sa umisaelindlingsetwe isena angetfkheando n wentinyetfubena eutsletdzaimisekko lokeniye ba nkhebealoo klanga abaseb yehe lwakel te lakuswematiikhnekalakufi nokuatsmtshlawena t nagekuhlkubnguka akafutkankwa likuconkbananaulu se imakhumea ilestimulainilweza fo hul nohanli ipha stiskhuta dzibe emima endo tekea u kaanelekmelelwkunsislonutfanykhokulhlo baufuaphlune shalindiswo suseekwme ndvenguphhatne so lulnomte lolawunellu ha watmenete lwnemakozinkuhshabhagab inalemisteme eo ee twekdzeomewel luembnis ektsau lo ydleutelenswaphemkhntfukesitinye iwo aniphiwetsinnhlmalmbamfufu labsiktawno hlee uekiasealiulwve ekazelntabontekbo sigamaileuletfwmphumakupemtasidluishumtgeno wikeigahakabenetgankisndengiukhbekmo phuselelui tantdvoa yvo humlisdlagamivejenket", +"st":"ng ho lele ho tsa msa la kaa h diya ka yaa tengets ba moa l selo bowa tsaa bna ba e a a k maangtsese o ta da sha so o le ho ye ttlatsholoe le mo bo esebebeelathuelee kanae b th hatsoo ao k wakgotswthoo hong lahutditane mea e tlolaedielodi ona kewan o a papatjhhlo sasheletabaloklaoeo a ao smanto hla nisae dswesetpa nao mg lhet kggotahaethre e ejhaphelanotlg klekitsekgsenao disg mothe aithhlae ske molpelg hhabbetsanatsmo lwawe alalenntsdipkapiso mmutoaloe nsi ta o wemoswatsiokebedthe pha ywenkenenahwane oreatlanohelmotbo g ti bkgahorngonanno o ntlhshwkelphaetjbonellg sgolthaaledikkolbak ntikao d teohlg y loti hisileg boko ethana omatohoodilelmeldinkaro ouo monhahte me ito fnenhebingbolbelhlepuolaltlohalophebahatheoarobatko banleho ioletle fekgepanakeg eakaeko perike ymmeamalhaeha faebomohmaeeteaemotsahio putaokgntlpalgeti le fokaseplatahlboteselahlonakga f puaseg amorkannahbohe p", +"sv":"en deet er tt om förar de att föing in at i detch an gen ant ssomte octer halleoch sk sora r a mevarndeär koon ansintn sna en fr på st vaandntepå skata viderällörs omda krika nst hoas stär dt fupp benger staltälör avgerillng e sektadeeraersharll lldrinrnasäkundinnligns ma pr upageav ivaktildaornsonts ttaäkr sj tiavtberelsetakolmenn dt kvtaår jukmann fninr irsäsjusso ära sachag bacdenettftehornbaollrnbstetil ef sia ae hed eftga ig it lermedn ind så tiv bl et fi säat dese agargetlanlssostr br ere retstat i ge he rea fallbosetslekletnernnanner frits ssenstotorvavygg ka så tr utad al aree ogonkomn an hngar hrent dtagtartreätt få hä sea da ia paleannarabyggt hanigtkanla n onomnskommr kr pr vs fs kt at pver bo br ku nåa ba edelenses finigem sn pnågor r orbers rt s as nskrt otentioven al ja p r saa hbetckedrae fe iedaenoeräessionjagm fne nnspror trarrivrätt et tustvadöre ar by kr miarb", +"sw":" wawa a ka m ku yaa wya ni maka a una za ia naikama alia n amilikwa kwini haameanai n zaa hemai mi ykuwla o wa yatasem laatichii wuwaakili ekaira nca sikikatnch ka kia bajiambra ri rikadamatmbamesyo zi da hi i kja kuttekwan bia aakaao asichaeseezake mojoja hia zendha ji mu shiwat bwakearabw i himbtikwakwal hu mi mk ni ra uma lateeshinaishkimo k ira ialaaniaq azihini aidiimaitarairaqsha ms seaframaanoea elefrigo i iifaiwaiyokuslialiomajmkuno tanuliutawen ala jaadaidariawaba fa ndengenyao yu wua umowazye ut via da taifdi ereingkinndao noa taitoausautowasyakzo ji mwa paiaamuangbikbo dele weneengichiriitiitoki kirko kuumarmbomilngingoo longsi ta taku yumuusiuu wam af ba li si zia vamiatuawierifanfurgeri zisiizoleambimwanyeo ho monirezsaasersintattistu uinukiur wi yar da en mp ny ta ul wea ca faisapoayobardhie aekeenyeonhaihanhiyhuri simwkalkwelaklammakmsane nguru salswate ti ukuumaunauru", +"tl":"ng ang na saan nansa na ma caay n g anong gaat paala sia nga g ng mitog cmansang singto ilaina di taagaiyaacag t atayaamalana aquia ca snag bag itan't cuauag p nios 'y a m n la lao nyan ayusacayon ya ital apaatat nuanahaasapag gug ldi magabag aaraa pin anait si cusg buina tas n nhin hia'tali buganumaa dagcaqug d tuaonaricasi nniypina igcasiya'yyaoag ca hanilipansinualn snam lucanditguiy ngalhatnal isbagfra fr sua l coani bi daaloisaitamayo ssiluna in pil nnilo apatsact s uaaguailbindalg hndioonua haindrans ntinuloengg finilahlo rairintong uinulono'yt a ara bad baycalgyailematn apaura tayy mantbani mnasnayno sti tiagsg gta uituno ib yaa uabiaticapig is la' do puapiayogosgullaltagtiltuny cy syonanoburibaisilamnacnatni ntood pa rgourg m adrastcaggaygsii pinolenlinm gmarnahto' dea hcatcauconiqulacmabminog parsal zaao dooipinodnteuhaula reilllitmacnito'tor orasumy p al mi umacoadaagdcab", +"tlh":"tlhe' gh i' 'eu' viatla' ghej ho ch mu tlngameywi'be'an ch ganchulh ing'e'hinjatlhi da jao' ughaq cha poey 'a je'ej pang ad qaoh eh ah ghaje luholaw' jiongpu'aj vadw' ' jha'is tah' 'angh 'ponam lawmo'qu'hbeol vamaghmu'ahvbejoghuch' vachhug lo quchohvaij lalu'vis ne pu so ta va'acdi'hu'lahmoh 'o' mdaqhahn hnehu'may'ghoh vmehoy ma nu'meel ba be de ng' th dhvioq wa' l'wihmeli'uq bobogdelh ph tichvil qe wiahbbanenghaqhohov viq ha ti' n' p'a'hwiighlo'y' du no yu'mo'vadajdaseghhommucom otlus bi tu' hchmh qhovnisqaruj ' q'chh mhmojihparwij hu' d'a etlh gh jh llodmaqochwa'yuq di le pe ya'dicheechih ijain j 'j mlhwpa' 'i mi qi ro ru'beanpghighuh bhayhchiq npuod paqqayrdasoh do me qo sa' c' g' s'luamlardas d pgmeh nhtai'vj jjijlenngmqanqmevajwiv mo ni'la'pu'quar armdwig pghdh chamhlahquiloiqaiqij pj tj vladlhomarmugpusq sq trghrmasovta'tintu'u'dvetyliyu' to'ohaqqartat aylaytet hajhar", +"tn":" di lego le gong tsya yasa tlh mo boa mlo tsa e o ta bwa kaa ka tka a gengoloo yla a a detsmo se tl batsh maba a ltseso na elo seelee do llhoe tdi e g kgditkgoo kanglhae me ewe aneo me ke longsetwanelatsotlao de bolangwgweo babaatla p o a ao aotla so edirthuga gashwotsakahabhwaagao ggantswanamol kehut meonalelitslaokgadikgot falet waoseno t hsweediatsa ne sokoothkwakar tha ealatiro ndipisagatti anobot nn halenaloanyaroitiirio ssennetke ho maiikaekato ithre g mhatbo g let emoamaisorolfa iwakanshesi ao g kwenlolo obositla ythelwae n laore mmko thae aeo lhebolha poisii blan nai talene gonrisirabon sag yg gphaogamelro golo w kwi l titlologpor jaa f nehoklot pue yutog thomokg koo famegorta pents khthogeladiareeteasemonheooroomonennelilenngntlaboogoaranseegoheluo mogsanularagkolte etlbat tepuoamoofelatatiolerabtsiiromanaelegalwera dintlesekingyo a o reaotusoo rerejwaaemlamlek jwgwamok", +"tr":"laren leran in bi yaeride kair arı ba de haın arabir ve sailele ndeda buanainiınıer ve yılmayıl olar n bndaayali ası geindn kesilannlaak anıenini nı rınsan ko yemazbaşilirinalıaz halınd da güeleılmığıekigüni biçidenkarsi ile yna yorek n s içbu e bim ki lenri sın soün taniniğitanyan sinatnınkanrı çinğı elin aır aninen yola aral e slikn dsin al düanlne ya ım ına beadaalaamailmor sı yen meatıdi etikenla lı oru gö inande dmenun önea dat e ae gyar kuayıdanediiriünüği ılıemeeğii ki yıla çaa yalkdı edeel ndıra üne südıre kereik imiişimasn hsüryle ad fi gi sea karlaşıiyoklalığnemneyrmestetı unlver sı te toa saşkeklendkalliğmintıruluunuyapye ı işkaştı bü ke kiardartaşan inditi topı b va önakicakey filisiklekurmanncenlenunrakık en yoa glismakn gtiryas iş yöalebilbulet i diyekilma n en tnu olurlate yönçık ay mü ço çıa aa batadergeli gi iillistldılu mekmlen çonuoplranratrdırkesiysonta tçıtın", +"ts":" kuku na ka wa a n swa mya a k tiswihi la ya le hia ta v vani nandz maa h xia si nelei kanaa lngalo va le akaelairheka vuiwaa x kayi waisasa ko ta ga wu wi tir ek mi nio yeloawuisiswai thlaa e ta ng laa yri eri rirhiekeumbu tndl yilani veswmbei la re kanglesulati yono wonalawxa nelyo leliko loamb a i y xaanewani sondfanendi ho lu kmbin'wke dyo falamnhlo songno kou n haho okou hi mo n yonguo ku yatiu lvanuluandmbakumu vwo be ha riwdzasi eno h hlo teyi ntilalokdzinge mualato a w byarhakutsawakrho'wa ndminlavtimleytikdletinmatlerletselhismellu ikaa angoengo x nkamusiwanienima nhmi swoetitanmo hamiwe khhanlekntiunghakdzoete tsavahu fumkarvul wukulundi xnhuyisxikbisxi e yra hle huwekanoyena dsisolopfui wnyie nso ki funisotshkonnkuheli be hariimii eindvumntsimekommfuise mfhindlavutgani rbanbyamilintats dyu se xilekelkwa noi fasiza urio mrhae lin'etavoni akho woiki rau eo ezo yininkanyket", +"uk":" на занняня на прогого ськ по у відере мі неих ть пер віів пе щольнми ні не ти атиеннміспрауваникпроравівн табудвлірів ко ріально омущо виму ревся інн до упавланнкомли лінногупр бу з роза и нновороостстаті ють мо ні якборва ваненьи пнь овіронстіта у вькоіст в редо е пзабий нсьо во пприі п ку пі спа пабоансаціватвнии вимика неннічонаої повькиьноізнічн ав ма ор су чи іна зам ає вневтодоментжитзниим итлла нихницоваовиом портьсу рьсяідоільісь ва ді жи че і а ва наливезвноевеезезеництки кихконку ласля можначнимноїо бовуодиою ро роксноспотактвату у пцтвьния зі мії вс гр де но па се ук їха оавтастаютварденди ду знаи зикоисяитикогменномну о но собуовопларанривробскатантимтисто траудочинчниі вію а во да кв ме об ск ти фі є а ра са уак аніартаснв увиквіздовдподівевіенсже и ми сикаичнкі ківміжнанносо уоблоднок олоотрренримрозсь сі тлатіву зугоудічи ше я ня уідпій інаія ка ни ос си то тр уг", +"ur":"یں کیکے کےنے کہے ککی میں میہے وں کہ ہےان ہیںور کویا ان نےسے سے کرستا اواورتانر کی ک اسے ا پا ہو پررف کاا کی ا ہیدر کو ایں ک مش ملات صدراکسشرفمشرپاککستی م دی صد یہا ہن کوالیہ ے و بھ دواس ر انہیکا ے سئی ہ ایت ے ہت ک سالے ہا ے ب واار نی کہای ہے م سی لیانہانیر مر پریتن مھا یر جا جنئے پر ں نہ کی وے د تو تھ گیایکل کنا کر ں میک باا تدی ن سکیایوںے جال تو ں اے پ چاام بھیتی تے دوسس کملکن اہوریے مو وکائیارتالےبھاردیری وہ ویزں دھی ی س رہ من نہ ور وہ ہنا ااستت ات پد کز مند وردوکلگی گیاہ پیز ے ت اع اپ جس جم جو سراپناکثتھاثریدیار درت رویسی ملاندووستپروچاہکثرکلاہ ہہندہو ے ل اک دا سن وز پیا چاء اتھاقااہ تھ دو ر بروارے ساتف کقاتلا لاءم مم کمن نوںو اکرنں ہھارہوئہی یش ام لا مس پو پہانےت مت ہج کدونزیرس سش کف نل ہلاقلی وریوزیونوکھنگا ں سں گھنےھے ہ بہ جہر ی آی پ حا وف گاا جا گاد ادیاعظاہتجس جمہجو ر سر ہرنےس مسا سندسنگظم عظمل ملیےمل موہمہونگھو صورٹوہنکن گھ گے ں جں وں یہ دہن ہوںے حے گے ی اگ بع رو شا", +"uz":"ан ганларга нг ингнинда ни идаариигаиниар ди биани боданлга ҳа ва саги илан би б кў таир маагаалабирри тгаланлика кагиатита адидагрга йи ми па бў қа қиа биллли асии тик илиллаардвчива иб ирилигнгаран ке ўза сахтбўлигикўррдарниса бе бу да жаа тазиерии аилгйилманпахридти увчхта не со учайтллитла ай фр эт ҳоа қалиаробербилборимиистон ринтертилун фрақил ба олансефтзиркатмилнефсагчи ўра на те эна эам арнат иш ма нларличилшга иш му ўқаравази уиқ моқримучучунши энгқувҳам сў шибарбекдами ҳишиладолиоллориоқдр бра рлаунифт ўлгўқу де ка қўа ўабаамматлб кбошзбеи вим ин ишллаблейминн дндаоқ р мрилсидталтантидтонўзб ам киа ҳангандартаётдиренти ди ми ои эиройтинсуодиор си тиштобэтиқарқда бл ге до ду но пр ра фо қоа ма оайдалоамаблег ндолейрек ергжарзиди ки фий илолдилиблинми мман вн кн ўн ҳозиораосирасришркароқстотинхатшир ав рў ту ўта павтадаазаанлб ббойбу втог эгиндардендунидеионирлишгйхакелкўплио", +"ve":"ha vha mna u a ntshwa a u nangavha ts dz khdzaa vya yaa tho la zw muedzvhuga shiza a k ngkha mahumne ndo nlo dzishu haa do yndaelezwiahoangno a elaa zhu shai n waanahi kano danoa hzwa th migana lsa handi u tandndiyo thedo ri vhoni ka urisi o tmbeo wanewe zo i te ni hsheusho kzi da a athu laa pzan i a slwaulai daka domisheditali huiwa lui vhe kaeloso ambavh sho vi klelu vdzou s fhmo nweo lumiwahisihela iveladztani maththiwi urhatinele vheanya yhonisaalao aaluudiumb bvash te lilusnyahasledswahuso iumoonendetha itkhongomushake yea ivho mu nhinthomutayofhi satelhulhunuloithma yolane v phgo i ao uhud pfukazhiuvhdzwingelwilawo mbou diteiswasie kndufheo hmelu bikabo guddzhkonifh tae duth hoi zwanulumadinwothanidiswitou bveetsu iadie mfhanahdalwin sisho inyamlayekaa fi uendi yaloi lusomulta delu k mbpha didadalio spfukhwe a ko nehenmasumeiniishudziraoniluknelisombadzuhomi szwonguaraunz", +"vi":"ng th chg t nhông kh trnh côcôn tyty i tn t ngại tich y lền đưhi gởgởiiềntiềởi gi le vichoho khá vàhác pham hànáchôi i nượcợc tôchúiệttôiên úngệt cóc tcó húnviệđượ nag ci cn cn nt nvà n ln đàngác ất h lnamân ăm hà là nă qu tạg mnămtạiới lẹay e gh hi vi đle lẹ ều ời hânnhit t củ mộ về đian củalà mộtvề ànhết ột ủa bi cáa canhcách ciềum tện ho's avee'sel g nle'n vo cravs tthitravelận ến ba cu sa đó đếc cchuhiềhuykhinhânhưongronthuthưtroy cày đếnườiườnề vờng vớcuộg điếtiệnngào tu cuộcvớià cài ơngươnải ộc ức an lậ ra sẽ số tổa kbiếc nc đchứg vgiagàyhánhônhư hứci gi hi ki piênkhôlậpn kra rênsẽ t cthàtrêtổ u ny tìnhấy ập ổ c má đểai c sgườh vhoahoạinhm nmáyn gngưnhậo noa oànp csố t đy vào áy ăn đó để ướcần ển ớc bá cơ cả cầ họ kỳ li mạ sở tặ vé vụ đạa đbaycơ g shanhươi skỳ m cn mn po boạiquasở thathátặnvàové vụ y bàn ángơ sầu ật ặngọc ở tững du lu ta to từ ở a vao c vcả du g lgiả", +"xh":"la kulo ngaa k ngoku kw uka nukuye a iyo elaelea unyewe wa amae niseababa ho enzo nngokubngeathfuno elelungubako eloezio kthekwana kweange ile ka esio y nae kethpha inkunnziandni ban ye nolwalun okanyzi li neulua eeligoko lebeundisasebndo ezthoo ido beningkwindlunyalaa aeyoe ukan abthii ki no uo zelwsa sekayoheto oeka umhi bo so isiwenlweapha lya ekoana yokufiniimialiha awuwanentuththaza ulakho iianee aisouph leilezinnts siengnokonghlazwe elokaekilisazi lotsh amufuantiswo anguo s bainteniunewulhulseli euselanke nisemi li isiph ima oakamfu ziinkmalleymannyanekakhume koalotu i untuizwkelizii isi ganaseindi andinelalusisubokutmthkuslekmisnde zo weaniga ikosizno phue ehonondne ithkulgamgenpho izphehatkhuiinhanzo lu ulondaqo zikhelo m lwzisdleuhlmenolomeldelnzaokookwolukuknteswalawenk yai ygaqshaaqoe likhnkqule kaonkthuwo bonkupquba ykqudla eshe anolumbe iga zeo wakumgankete olze kumemfesh", +"zu":"okula nga nga n kua kthi ukezie nukule lo hi wa noa uelawe a ini elezinuthamaelophaingabaathandenzethesima lel um katheungngengothonyekweeniiziye kwndlho a ena zi hetkane ue iundiseisindakhaba i knomfun ez izke beno eisazwekelka akanzio ne komakwa neanyanghlai umthkubo kanaaneikhebekutha isaziulusebalaonkbani eazwwen abhana ai nimilanhatlwa nainiakhli ngunkenokumeekeelwyo aphkus es okiph immeli i lo in amkhoza gokseklunkunlweshasikkufhaka ythusa o ukhuayohule aalienglu ne koeliubadlee eith yoa lnelmis sikula osislokgeno zi aemiumaekaalomaniswthao ilonso uphuhlntuzimmalindwez bao o yi weulapheo yileo lwo welga tu hleokwfan lekazaseanindebo ngiule emmeninyambmbiganifuo santhelikaonai lfut fuze u anhlnin zoendsigu kgabufaishushkuzno gamkuh yenyanezzisdlukatdlatsh seikekuqgu osiswalul ziimae lkupmo nzaasiko kumleksheumtunyyokwanwamameonglismkhahlaleuseo aalugapsi hlonjeomto wokhhe komi s" + }; + + global._languageData = (typeof module === "object" && module.exports === global && module || {}).exports = models; + +})(this); diff --git a/scripts/guessLanguage/guessLanguage.js b/scripts/guessLanguage/guessLanguage.js new file mode 100644 index 00000000..00c72cde --- /dev/null +++ b/scripts/guessLanguage/guessLanguage.js @@ -0,0 +1,687 @@ +/* Guess the natural language of a text + * Copyright (c) 2012-2014, Rich Tibbett + * http://github.com/richtr/guessLanguage.js/ + * + * Original Python package: + * Copyright (c) 2008, Kent S Johnson + * http://code.google.com/p/guess-language/ + * + * Original C++ version for KDE: + * Copyright (c) 2006 Jacob R Rideout + * http://websvn.kde.org/branches/work/sonnet-refactoring/common/nlp/guesslanguage.cpp?view=markup + * + * Original Language::Guess Perl module: + * Copyright (c) 2004-2006 Maciej Ceglowski + * http://web.archive.org/web/20090228163219/http://languid.cantbedone.org/ + * + * Note: Language::Guess is GPL-licensed. KDE developers received permission + * from the author to distribute their port under LGPL: + * http://lists.kde.org/?l=kde-sonnet&m=116910092228811&w=2 + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +(function(global, undefined) { + + var guessLanguage = function() { + + var models = global._languageData || {}; + + if (typeof module === "object" && module.exports === global) { + models = require('./_languageData') || {}; + } + + var MAX_LENGTH = 4096; + var MIN_LENGTH = 20; + var MAX_GRAMS = 300; + + var NAME_MAP = { + "ab": "Abkhazian", + "af": "Afrikaans", + "ar": "Arabic", + "az": "Azeri", + "be": "Belarusian", + "bg": "Bulgarian", + "bn": "Bengali", + "bo": "Tibetan", + "br": "Breton", + "ca": "Catalan", + "ceb": "Cebuano", + "cs": "Czech", + "cy": "Welsh", + "da": "Danish", + "de": "German", + "el": "Greek", + "en": "English", + "eo": "Esperanto", + "es": "Spanish", + "et": "Estonian", + "eu": "Basque", + "fa": "Farsi", + "fi": "Finnish", + "fo": "Faroese", + "fr": "French", + "fy": "Frisian", + "gd": "Scots Gaelic", + "gl": "Galician", + "gu": "Gujarati", + "ha": "Hausa", + "haw": "Hawaiian", + "he": "Hebrew", + "hi": "Hindi", + "hmn": "Pahawh Hmong", + "hr": "Croatian", + "hu": "Hungarian", + "hy": "Armenian", + "id": "Indonesian", + "is": "Icelandic", + "it": "Italian", + "ja": "Japanese", + "ka": "Georgian", + "kk": "Kazakh", + "km": "Cambodian", + "ko": "Korean", + "ku": "Kurdish", + "ky": "Kyrgyz", + "la": "Latin", + "lt": "Lithuanian", + "lv": "Latvian", + "mg": "Malagasy", + "mk": "Macedonian", + "ml": "Malayalam", + "mn": "Mongolian", + "mr": "Marathi", + "ms": "Malay", + "nd": "Ndebele", + "ne": "Nepali", + "nl": "Dutch", + "nn": "Nynorsk", + "no": "Norwegian", + "nso": "Sepedi", + "pa": "Punjabi", + "pl": "Polish", + "ps": "Pashto", + "pt": "Portuguese", + "pt-PT": "Portuguese (Portugal)", + "pt-BR": "Portuguese (Brazil)", + "ro": "Romanian", + "ru": "Russian", + "sa": "Sanskrit", + "bs": "Serbo-Croatian", + "sk": "Slovak", + "sl": "Slovene", + "so": "Somali", + "sq": "Albanian", + "sr": "Serbian", + "sv": "Swedish", + "sw": "Swahili", + "ta": "Tamil", + "te": "Telugu", + "th": "Thai", + "tl": "Tagalog", + "tlh": "Klingon", + "tn": "Setswana", + "tr": "Turkish", + "ts": "Tsonga", + "tw": "Twi", + "uk": "Ukrainian", + "ur": "Urdu", + "uz": "Uzbek", + "ve": "Venda", + "vi": "Vietnamese", + "xh": "Xhosa", + "zh": "Chinese", + "zh-TW": "Traditional Chinese (Taiwan)", + "zu": "Zulu" + }; + + var IANA_MAP = { + "ab": 12026, + "af": 40, + "ar": 26020, + "az": 26030, + "be": 11890, + "bg": 26050, + "bn": 26040, + "bo": 26601, + "br": 1361, + "ca": 3, + "ceb": 26060, + "cs": 26080, + "cy": 26560, + "da": 26090, + "de": 26160, + "el": 26165, + "en": 26110, + "eo": 11933, + "es": 26460, + "et": 26120, + "eu": 1232, + "fa": 26130, + "fi": 26140, + "fo": 11817, + "fr": 26150, + "fy": 1353, + "gd": 65555, + "gl": 1252, + "gu": 26599, + "ha": 26170, + "haw": 26180, + "he": 26592, + "hi": 26190, + "hr": 26070, + "hu": 26200, + "hy": 26597, + "id": 26220, + "is": 26210, + "it": 26230, + "ja": 26235, + "ka": 26600, + "kk": 26240, + "km": 1222, + "ko": 26255, + "ku": 11815, + "ky": 26260, + "la": 26280, + "lt": 26300, + "lv": 26290, + "mg": 1362, + "mk": 26310, + "ml": 26598, + "mn": 26320, + "mr": 1201, + "ms": 1147, + "ne": 26330, + "nl": 26100, + "nn": 172, + "no": 26340, + "pa": 65550, + "pl": 26380, + "ps": 26350, + "pt": 26390, + "ro": 26400, + "ru": 26410, + "sa": 1500, + "bs": 1399, + "sk": 26430, + "sl": 26440, + "so": 26450, + "sq": 26010, + "sr": 26420, + "sv": 26480, + "sw": 26470, + "ta": 26595, + "te": 26596, + "th": 26594, + "tl": 26490, + "tlh": 26250, + "tn": 65578, + "tr": 26500, + "tw": 1499, + "uk": 26520, + "ur": 26530, + "uz": 26540, + "vi": 26550, + "zh": 26065, + "zh-TW": 22 + }; + + var SINGLETONS = [ + ["Armenian", "hy"], + ["Hebrew", "he"], + ["Bengali", "bn"], + ["Gurmukhi", "pa"], + ["Greek", "el"], + ["Gujarati", "gu"], + ["Oriya", "or"], + ["Tamil", "ta"], + ["Telugu", "te"], + ["Kannada", "kn"], + ["Malayalam", "ml"], + ["Sinhala", "si"], + ["Thai", "th"], + ["Lao", "lo"], + ["Tibetan", "bo"], + ["Burmese", "my"], + ["Georgian", "ka"], + ["Mongolian", "mn"], + ["Khmer", "km"], + ["Pahawh Hmong", "hmn"] + ]; + + var UNKNOWN = 'unknown'; + + var BASIC_LATIN = ["en", "ceb", "ha", "so", "tlh", "id", "haw", "la", "sw", "eu", "nr", "nso", "zu", "xh", "ss", "st", "tn", "ts"]; + var EXTENDED_LATIN = ["cs", "af", "pl", "hr", "ro", "sk", "sl", "tr", "hu", "az", "et", "sq", "ca", "es", "fr", "de", "nl", "it", "da", "is", "no", "sv", "fi", "lv", "pt", "ve", "lt", "tl", "cy", "vi"]; + var ALL_LATIN = BASIC_LATIN.concat(EXTENDED_LATIN); + var CYRILLIC = ["ru", "uk", "kk", "uz", "mn", "sr", "mk", "bg", "ky"]; + var ARABIC = ["ar", "fa", "ps", "ur"]; + var DEVANAGARI = ["hi", "ne"]; + var PT = ["pt-BR", "pt-PT"]; + + // Unicode char greedy regex block range matchers + var unicodeBlockTests = { + "Basic Latin": /[\u0000-\u007F]/g, + "Latin-1 Supplement": /[\u0080-\u00FF]/g, + "Latin Extended-A": /[\u0100-\u017F]/g, + "Latin Extended-B": /[\u0180-\u024F]/g, + "IPA Extensions": /[\u0250-\u02AF]/g, + "Spacing Modifier Letters": /[\u02B0-\u02FF]/g, + "Combining Diacritical Marks": /[\u0300-\u036F]/g, + "Greek and Coptic": /[\u0370-\u03FF]/g, + "Cyrillic": /[\u0400-\u04FF]/g, + "Cyrillic Supplement": /[\u0500-\u052F]/g, + "Armenian": /[\u0530-\u058F]/g, + "Hebrew": /[\u0590-\u05FF]/g, + "Arabic": /[\u0600-\u06FF]/g, + "Syriac": /[\u0700-\u074F]/g, + "Arabic Supplement": /[\u0750-\u077F]/g, + "Thaana": /[\u0780-\u07BF]/g, + "NKo": /[\u07C0-\u07FF]/g, + "Devanagari": /[\u0900-\u097F]/g, + "Bengali": /[\u0980-\u09FF]/g, + "Gurmukhi": /[\u0A00-\u0A7F]/g, + "Gujarati": /[\u0A80-\u0AFF]/g, + "Oriya": /[\u0B00-\u0B7F]/g, + "Tamil": /[\u0B80-\u0BFF]/g, + "Telugu": /[\u0C00-\u0C7F]/g, + "Kannada": /[\u0C80-\u0CFF]/g, + "Malayalam": /[\u0D00-\u0D7F]/g, + "Sinhala": /[\u0D80-\u0DFF]/g, + "Thai": /[\u0E00-\u0E7F]/g, + "Lao": /[\u0E80-\u0EFF]/g, + "Tibetan": /[\u0F00-\u0FFF]/g, + "Burmese": /[\u1000-\u109F]/g, + "Georgian": /[\u10A0-\u10FF]/g, + "Hangul Jamo": /[\u1100-\u11FF]/g, + "Ethiopic": /[\u1200-\u137F]/g, + "Ethiopic Supplement": /[\u1380-\u139F]/g, + "Cherokee": /[\u13A0-\u13FF]/g, + "Unified Canadian Aboriginal Syllabics": /[\u1400-\u167F]/g, + "Ogham": /[\u1680-\u169F]/g, + "Runic": /[\u16A0-\u16FF]/g, + "Pahawh Hmong": /[\u16B0-\u16B8]/g, + "Tagalog": /[\u1700-\u171F]/g, + "Hanunoo": /[\u1720-\u173F]/g, + "Buhid": /[\u1740-\u175F]/g, + "Tagbanwa": /[\u1760-\u177F]/g, + "Khmer": /[\u1780-\u17FF]/g, + "Mongolian": /[\u1800-\u18AF]/g, + "Limbu": /[\u1900-\u194F]/g, + "Tai Le": /[\u1950-\u197F]/g, + "New Tai Lue": /[\u1980-\u19DF]/g, + "Khmer Symbols": /[\u19E0-\u19FF]/g, + "Buginese": /[\u1A00-\u1A1F]/g, + "Balinese": /[\u1B00-\u1B7F]/g, + "Phonetic Extensions": /[\u1D00-\u1D7F]/g, + "Phonetic Extensions Supplement": /[\u1D80-\u1DBF]/g, + "Combining Diacritical Marks Supplement": /[\u1DC0-\u1DFF]/g, + "Latin Extended Additional": /[\u1E00-\u1EFF]/g, + "Greek Extended": /[\u1F00-\u1FFF]/g, + "General Punctuation": /[\u2000-\u206F]/g, + "Superscripts and Subscripts": /[\u2070-\u209F]/g, + "Currency Symbols": /[\u20A0-\u20CF]/g, + "Combining Diacritical Marks for Symbols": /[\u20D0-\u20FF]/g, + "Letterlike Symbols": /[\u2100-\u214F]/g, + "Number Forms": /[\u2150-\u218F]/g, + "Arrows": /[\u2190-\u21FF]/g, + "Mathematical Operators": /[\u2200-\u22FF]/g, + "Miscellaneous Technical": /[\u2300-\u23FF]/g, + "Control Pictures": /[\u2400-\u243F]/g, + "Optical Character Recognition": /[\u2440-\u245F]/g, + "Enclosed Alphanumerics": /[\u2460-\u24FF]/g, + "Box Drawing": /[\u2500-\u257F]/g, + "Block Elements": /[\u2580-\u259F]/g, + "Geometric Shapes": /[\u25A0-\u25FF]/g, + "Miscellaneous Symbols": /[\u2600-\u26FF]/g, + "Dingbats": /[\u2700-\u27BF]/g, + "Miscellaneous Mathematical Symbols-A": /[\u27C0-\u27EF]/g, + "Supplemental Arrows-A": /[\u27F0-\u27FF]/g, + "Braille Patterns": /[\u2800-\u28FF]/g, + "Supplemental Arrows-B": /[\u2900-\u297F]/g, + "Miscellaneous Mathematical Symbols-B": /[\u2980-\u29FF]/g, + "Supplemental Mathematical Operators": /[\u2A00-\u2AFF]/g, + "Miscellaneous Symbols and Arrows": /[\u2B00-\u2BFF]/g, + "Glagolitic": /[\u2C00-\u2C5F]/g, + "Latin Extended-C": /[\u2C60-\u2C7F]/g, + "Coptic": /[\u2C80-\u2CFF]/g, + "Georgian Supplement": /[\u2D00-\u2D2F]/g, + "Tifinagh": /[\u2D30-\u2D7F]/g, + "Ethiopic Extended": /[\u2D80-\u2DDF]/g, + "Supplemental Punctuation": /[\u2E00-\u2E7F]/g, + "CJK Radicals Supplement": /[\u2E80-\u2EFF]/g, + "KangXi Radicals": /[\u2F00-\u2FDF]/g, + "Ideographic Description Characters": /[\u2FF0-\u2FFF]/g, + "CJK Symbols and Punctuation": /[\u3000-\u303F]/g, + "Hiragana": /[\u3040-\u309F]/g, + "Katakana": /[\u30A0-\u30FF]/g, + "Bopomofo": /[\u3100-\u312F]/g, + "Hangul Compatibility Jamo": /[\u3130-\u318F]/g, + "Kanbun": /[\u3190-\u319F]/g, + "Bopomofo Extended": /[\u31A0-\u31BF]/g, + "CJK Strokes": /[\u31C0-\u31EF]/g, + "Katakana Phonetic Extensions": /[\u31F0-\u31FF]/g, + "Enclosed CJK Letters and Months": /[\u3200-\u32FF]/g, + "CJK Compatibility": /[\u3300-\u33FF]/g, + "CJK Unified Ideographs Extension A": /[\u3400-\u4DBF]/g, + "Yijing Hexagram Symbols": /[\u4DC0-\u4DFF]/g, + "CJK Unified Ideographs": /[\u4E00-\u9FFF]/g, + "Yi Syllables": /[\uA000-\uA48F]/g, + "Yi Radicals": /[\uA490-\uA4CF]/g, + "Modifier Tone Letters": /[\uA700-\uA71F]/g, + "Latin Extended-D": /[\uA720-\uA7FF]/g, + "Syloti Nagri": /[\uA800-\uA82F]/g, + "Phags-pa": /[\uA840-\uA87F]/g, + "Hangul Syllables": /[\uAC00-\uD7AF]/g, + "High Surrogates": /[\uD800-\uDB7F]/g, + "High Private Use Surrogates": /[\uDB80-\uDBFF]/g, + "Low Surrogates": /[\uDC00-\uDFFF]/g, + "Private Use Area": /[\uE000-\uF8FF]/g, + "CJK Compatibility Ideographs": /[\uF900-\uFAFF]/g, + "Alphabetic Presentation Forms": /[\uFB00-\uFB4F]/g, + "Arabic Presentation Forms-A": /[\uFB50-\uFDFF]/g, + "Variation Selectors": /[\uFE00-\uFE0F]/g, + "Vertical Forms": /[\uFE10-\uFE1F]/g, + "Combining Half Marks": /[\uFE20-\uFE2F]/g, + "CJK Compatibility Forms": /[\uFE30-\uFE4F]/g, + "Small Form Variants": /[\uFE50-\uFE6F]/g, + "Arabic Presentation Forms-B": /[\uFE70-\uFEFF]/g, + "Halfwidth and Fullwidth Forms": /[\uFF00-\uFFEF]/g, + "Specials": /[\uFFF0-\uFFFF]/g + }; + + function findRuns(text) { + + var relevantRuns = {}; + + for (var key in unicodeBlockTests) { + + // Count the number of characters in each character block. + var charCount = text.match(unicodeBlockTests[key]); + + // return run types that used for 40% or more of the string + // always return basic latin if found more than 15% + // and extended additional latin if over 10% (for Vietnamese) + var pct = (charCount ? charCount.length : 0) / text.length; + + relevantRuns[key] = pct; + + } + + return relevantRuns; + } + + function identify(text, callback) { + + var scripts = findRuns(text); + + // Identify the language. + if (scripts["Hangul Syllables"] + scripts["Hangul Jamo"] + scripts["Hangul Compatibility Jamo"] >= 0.4) { + callback.apply(undefined, ["ko"]); + return; + } + + if (scripts["Greek and Coptic"] >= 0.4) { + callback.apply(undefined, ["el"]); + return; + } + + if (scripts["Hiragana"] + scripts["Katakana"] + scripts["Katakana Phonetic Extensions"] >= 0.2) { + callback.apply(undefined, ["ja"]); + return; + } + + if (scripts["CJK Unified Ideographs"] + scripts["Bopomofo"] + scripts["Bopomofo Extended"] + scripts["KangXi Radicals"] >= 0.4) { + callback.apply(undefined, ["zh"]); + return; + } + + if (scripts["Cyrillic"] >= 0.4) { + check(text, CYRILLIC, callback); + return; + } + + if (scripts["Arabic"] + scripts["Arabic Presentation Forms-A"] + scripts["Arabic Presentation Forms-B"] >= 0.4) { + check(text, ARABIC, callback); + return; + } + + if (scripts["Devanagari"] >= 0.4) { + check(text, DEVANAGARI, callback); + return; + } + + // Try languages with unique scripts + for (var i = 0, l = SINGLETONS.length; i < l; i++) { + if (scripts[SINGLETONS[i][0]] >= 0.4) { + callback.apply(undefined, [SINGLETONS[i][1]]); + return; + } + } + + // Extended Latin + if (scripts["Latin-1 Supplement"] + scripts["Latin Extended-A"] + scripts["IPA Extensions"] >= 0.4) { + check(text, EXTENDED_LATIN, function(latinLang) { + if (latinLang == "pt") { + check(text, PT, callback); + } else { + callback.apply(undefined, [latinLang]); + } + }); + return; + } + + if (scripts["Basic Latin"] >= 0.15) { + check(text, ALL_LATIN, callback); + return; + } + + callback.apply(undefined, [UNKNOWN]); + } + + function check(sample, langs, callback) { + + if (sample.length < MIN_LENGTH) { + callback.apply(undefined, [UNKNOWN]); + return; + } + + var scores = {}; + var model = createOrderedModel(sample); + for (var i = 0, l = langs.length; i < l; i++) { + + var lkey = langs[i].toLowerCase(); + + var knownModel = createKnownModel(lkey) || null; + + if (!knownModel) { + continue; + } + + scores[lkey] = distance(model, knownModel); + + } + + var scoresArr = []; + for (var index in scores) { + scoresArr.push([index, scores[index]]); + } + + if (scoresArr.length == 0) { + callback.apply(undefined, [UNKNOWN]); + return; + } + + // we want the lowest score, less distance = greater chance of match + var sortedScores = scoresArr.sort(function(objA, objB) { + return objA[1] - objB[1]; // sort low-to-high + }); + + // return the best match we've now calculated + callback.apply(undefined, [sortedScores[0][0]]); + } + + function createOrderedModel(content) { + // Create a list of trigrams in content sorted by frequency. + var trigrams = {}, + sortedTrigrams = []; + var content = content.toLowerCase(); + + var contentArr = content.split(""); + for (var i = 0, l = contentArr.length - 2; i < l; i++) { + var trigramKey = contentArr[i] + contentArr[i + 1] + contentArr[i + 2] + ""; + if (!trigrams[trigramKey]) { + trigrams[trigramKey] = 1; + } else { + trigrams[trigramKey] += 1; + } + } + + // convert object to array + for (var i in trigrams) { + sortedTrigrams[sortedTrigrams.length] = [i, trigrams[i]]; + } + + // sort array results + return sortedTrigrams.sort(function(objA, objB) { + return objB[1] - objA[1]; // sort high-to-low + }); + } + + var knownModelCache = {}; + + function createKnownModel(key) { + // Check if known model has been pre-computed in cache + if (knownModelCache[key]) { + return knownModelCache[key]; + } + + var data = models[key]; + if (!data) { + return {}; + } + + // Extract known trigram model data + var dataArr = data.match(/([\s\S]{1,3})/g); + // Contruct known trigram object based on provided raw data + var knownModel = {}; + for (var i = 0, l = dataArr.length; i < l; i++) { + knownModel[dataArr[i]] = i; + } + + // Store in known model pre-computed cache + knownModelCache[key] = knownModel; + + return knownModel; + } + + function distance(model, knownModel) { + // Calculate the distance to the known model. + var dist = 0; + + for (var i = 0, l = model.length; i < l; i++) { + + if (knownModel[model[i][0]]) { + + dist += Math.abs(model[i][1] - knownModel[model[i][0]]); + + } else { + + dist += MAX_GRAMS; + + } + + } + + return dist; + } + + return { + detect: function(text, callback) { + // Return the ISO 639-2 language identifier, i.e. 'en'. + + if (!text) { + callback.apply(undefined, [UNKNOWN]); + return; + } + + text = text.substr(0, MAX_LENGTH).replace(/[\u0021-\u0040]/g, ''); + + identify(text, callback); + + }, + info: function(text, callback) { + // Return language info tuple (id, code, name), i.e. ('en', 26110, 'English'). + + this.detect(text, function(language) { + + if (language === UNKNOWN) { + callback.apply(undefined, [[ UNKNOWN, UNKNOWN, UNKNOWN ]]); + return; + } + + callback.apply(undefined, [ + + [ language, IANA_MAP[language], NAME_MAP[language] ] + + ]); + + }); + + }, + code: function(text, callback) { + // Return the language IANA code, i.e. 26110. + + this.detect(text, function(language) { + + if (language === UNKNOWN) { + callback.apply(undefined, [ -1 ]); + return; + } + + callback.apply(undefined, [ + + IANA_MAP[language] + + ]); + + }); + + }, + name: function(text, callback) { + // Return the full language name, i.e. 'English'. + + this.detect(text, function(language) { + + if (language === UNKNOWN) { + callback.apply(undefined, [ UNKNOWN ]); + return; + } + + callback.apply(undefined, [ + + NAME_MAP[language] + + ]); + + }); + + } + }; + + }; + + global.guessLanguage = (global.module || {}).exports = new guessLanguage(); + +})(this); diff --git a/scripts/speech.js b/scripts/speech.js index 0aa53575..e11a57ee 100644 --- a/scripts/speech.js +++ b/scripts/speech.js @@ -38,6 +38,25 @@ var _map = {}; _map["en"] = ["gb"]; _map["ko"] = ["kr"]; + _map["hy"] = ["ar"]; + _map["uk"] = ["ru"]; //ua not supported + _map["zh"] = ["cn"]; + _map["ja"] = ["jp"]; + _map["pt-BR"] = ["br"]; + _map["pt-Pt"] = ["pt"]; + _map["zh-TW"] = ["tw"]; + _map["cs"] = ["cz"]; + _map["da"] = ["dk"]; + _map["et"] = ["ee"]; + _map["el"] = ["gr"]; + _map["va"] = ["la"]; + _map["ne"] = ["np"]; + _map["nn"] = ["no"]; + _map["sl"] = ["sk"]; + _map["ta"] = ["hi"]; + _map["ro"] = ["md"]; + _map["sh"] = ["hr"]; + _map["ca"] = ["catalonia"]; for (var i = 0; i < _langs.length; i++) { if (_langs[i].flag == lang) @@ -56,7 +75,9 @@ } } } - + if (!_data.length) { + _data.push({index : 0, gender : "f"}); + } _data.sort(function(a, b) { return a.gender.charCodeAt(0) - b.gender.charCodeAt(0) }); // family :) var voiceName = ""; for (var j = 0; j < _data.length; j++) @@ -80,34 +101,10 @@ responsiveVoice.AddEventListener("OnReady", function() { setTimeout(function() { - // detect language with yandex translate api - var xhr = new XMLHttpRequest(); - var _url = "https://translate.yandex.net/api/v1.5/tr.json/detect?"; - _url += "key=trnsl.1.1.20160604T115612Z.107ebb05a7757bcc.804e900f347ddfbeadd7ca5999bd5cb6ca32805b"; - _url += "&text="; - _url += encodeURIComponent(text_init); - xhr.open('POST', _url, true); - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.onreadystatechange = function() - { - if (this.readyState == 4 && this.status == 200) - { - try - { - var _obj = JSON.parse(this.responseText); - Run(_obj.lang); - } - catch (err) - { - Run("en"); - } - } - else if ( (this.readyState == 4 && this.status == 403) || (401 == this.readyState || 404 == this.readyState || 413 == this.readyState || 422 == this.readyState || 501 == this.readyState) ) - { - Run("en"); - } - }; - xhr.send(null); + guessLanguage.info(text_init, function(info) { + //console.log('Detected Language: ' + info[2] + " [" + info[0] + "]" +"_____" +info[1]); + Run(info[0]); + }); }, 1); }); }; From e3ab914550cf3425fcb03b10ee9a9688465bccda Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 26 Nov 2020 15:25:49 +0300 Subject: [PATCH 12/36] Added vendors license --- 3rd-Party.txt | 10 + LICENSE => LICENSE.md | 0 README.md | 2 +- config.json | 32 ++ index.html | 4 +- index_about.html | 46 ++ license/ResponsiveVoice.license | 395 ++++++++++++++++++ {scripts => vendor}/guessLanguage/README.md | 0 .../guessLanguage/_languageData.js | 0 .../guessLanguage/guessLanguage.js | 0 10 files changed, 486 insertions(+), 3 deletions(-) create mode 100644 3rd-Party.txt rename LICENSE => LICENSE.md (100%) create mode 100644 index_about.html create mode 100644 license/ResponsiveVoice.license rename {scripts => vendor}/guessLanguage/README.md (100%) rename {scripts => vendor}/guessLanguage/_languageData.js (100%) rename {scripts => vendor}/guessLanguage/guessLanguage.js (100%) diff --git a/3rd-Party.txt b/3rd-Party.txt new file mode 100644 index 00000000..39336050 --- /dev/null +++ b/3rd-Party.txt @@ -0,0 +1,10 @@ +Plugin-ocr uses code from the following 3rd party projects. + + +1. ResponsiveVoice service to read the text out loud. By default, it uses a female voice. (https://responsivevoice.org/) + +License: CC-BY +License File: ResponsiveVoice.license + + +2. guessLanguage to recognize the language. (http://richtr.github.io/guessLanguage.js/) \ No newline at end of file diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md index d03296fb..e8c01b00 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Convert selected text into speech. -The plugin uses Yandex.Translate to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. +The plugin uses [guessLanguage](http://richtr.github.io/guessLanguage.js/) to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. The Speech plugin is installed by default in cloud and [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) of ONLYOFFICE editors. diff --git a/config.json b/config.json index 286bcdcc..895f7e7a 100644 --- a/config.json +++ b/config.json @@ -33,6 +33,38 @@ "isUpdateOleOnResize": false, "buttons": [] + }, + { + "description": "About", + "descriptionLocale": { + "ru": "Справка", + "fr": "À propos", + "es": "Sobre programa", + "de": "Über" + }, + "url": "index_about.html", + + "icons": [ "resources/img/icon.png", "resources/img/icon@2x.png", "resources/img/icon2.png", "resources/img/icon2@2x.png" ], + "isViewer": false, + "EditorsSupport": [ "word" ], + + "isVisual": true, + "isModal": true, + "isInsideMode": false, + + "initDataType": "none", + "initData": "", + + "isUpdateOleOnResize": false, + + "buttons": [ + { + "text": "Ok", + "primary": true + } + ], + + "size": [ 400, 50 ] } ] } diff --git a/index.html b/index.html index 2ee3bdba..aec85a54 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ - - + + diff --git a/index_about.html b/index_about.html new file mode 100644 index 00000000..a5524ea5 --- /dev/null +++ b/index_about.html @@ -0,0 +1,46 @@ + + + + + About + + + + + +
 
+ + \ No newline at end of file diff --git a/license/ResponsiveVoice.license b/license/ResponsiveVoice.license new file mode 100644 index 00000000..52bd1459 --- /dev/null +++ b/license/ResponsiveVoice.license @@ -0,0 +1,395 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More_considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff --git a/scripts/guessLanguage/README.md b/vendor/guessLanguage/README.md similarity index 100% rename from scripts/guessLanguage/README.md rename to vendor/guessLanguage/README.md diff --git a/scripts/guessLanguage/_languageData.js b/vendor/guessLanguage/_languageData.js similarity index 100% rename from scripts/guessLanguage/_languageData.js rename to vendor/guessLanguage/_languageData.js diff --git a/scripts/guessLanguage/guessLanguage.js b/vendor/guessLanguage/guessLanguage.js similarity index 100% rename from scripts/guessLanguage/guessLanguage.js rename to vendor/guessLanguage/guessLanguage.js From 1d46280d1d106adb040dfe4013664adef21d3f2c Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 26 Nov 2020 15:56:26 +0300 Subject: [PATCH 13/36] Fixed typo --- 3rd-Party.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rd-Party.txt b/3rd-Party.txt index 39336050..01e8ba60 100644 --- a/3rd-Party.txt +++ b/3rd-Party.txt @@ -1,4 +1,4 @@ -Plugin-ocr uses code from the following 3rd party projects. +This plugin uses code from the following 3rd party projects. 1. ResponsiveVoice service to read the text out loud. By default, it uses a female voice. (https://responsivevoice.org/) From 73879b1dc90c6321c5b268fd402b4c898bea65be Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 26 Nov 2020 17:46:00 +0300 Subject: [PATCH 14/36] Renamed license folder --- LICENSE.md => LICENSE | 0 {license => licenses}/ResponsiveVoice.license | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => LICENSE (100%) rename {license => licenses}/ResponsiveVoice.license (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE diff --git a/license/ResponsiveVoice.license b/licenses/ResponsiveVoice.license similarity index 100% rename from license/ResponsiveVoice.license rename to licenses/ResponsiveVoice.license From 618a6965f0b8826302f282a85e055e61a1c6cc48 Mon Sep 17 00:00:00 2001 From: Alexey Matveev <34643750+AlexeyMatveev686@users.noreply.github.com> Date: Thu, 26 Nov 2020 18:34:53 +0300 Subject: [PATCH 15/36] Added page about (#18) --- config.json | 32 ++++++++++++++++++++++++++++++++ index_about.html | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 index_about.html diff --git a/config.json b/config.json index 286bcdcc..895f7e7a 100644 --- a/config.json +++ b/config.json @@ -33,6 +33,38 @@ "isUpdateOleOnResize": false, "buttons": [] + }, + { + "description": "About", + "descriptionLocale": { + "ru": "Справка", + "fr": "À propos", + "es": "Sobre programa", + "de": "Über" + }, + "url": "index_about.html", + + "icons": [ "resources/img/icon.png", "resources/img/icon@2x.png", "resources/img/icon2.png", "resources/img/icon2@2x.png" ], + "isViewer": false, + "EditorsSupport": [ "word" ], + + "isVisual": true, + "isModal": true, + "isInsideMode": false, + + "initDataType": "none", + "initData": "", + + "isUpdateOleOnResize": false, + + "buttons": [ + { + "text": "Ok", + "primary": true + } + ], + + "size": [ 400, 50 ] } ] } diff --git a/index_about.html b/index_about.html new file mode 100644 index 00000000..a5524ea5 --- /dev/null +++ b/index_about.html @@ -0,0 +1,46 @@ + + + + + About + + + + + +
 
+ + \ No newline at end of file From 8ab588801daf6def6738e8c7ddbce5190b6251ce Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 3 Dec 2020 16:26:20 +0300 Subject: [PATCH 16/36] Added the version field in the config. --- README.md | 2 ++ config.json | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index e8c01b00..80856f46 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,5 @@ The Speech plugin is installed by default in cloud and [self-hosted](https://git 1. Highlight the phrase you want to here. 2. Open the Plugins tab and press Speech. + +If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic \ No newline at end of file diff --git a/config.json b/config.json index 895f7e7a..8b84467d 100644 --- a/config.json +++ b/config.json @@ -7,6 +7,7 @@ "de": "Rede" }, "guid": "asc.{D71C2EF0-F15B-47C7-80E9-86D671F9C595}", + "version" : "1.0", "variations": [ { From 4f46ff639352d26dcad38b3ef5a8947b15463e27 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 14 Dec 2020 16:07:21 +0300 Subject: [PATCH 17/36] Added version in index_about file --- index_about.html | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/index_about.html b/index_about.html index a5524ea5..d2ad1194 100644 --- a/index_about.html +++ b/index_about.html @@ -7,7 +7,7 @@ + + -
 
+
 
+

Version: 1.0

\ No newline at end of file From 7e11498b4247fa1ec913577bcad5d77a43ba3b34 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Tue, 23 Mar 2021 18:52:43 +0300 Subject: [PATCH 18/36] Change license (#30) Change license to Apache-2.0 --- LICENSE | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 197 insertions(+), 17 deletions(-) diff --git a/LICENSE b/LICENSE index a4f9de33..710abe3f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,201 @@ -MIT License + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2020 ONLYOFFICE + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + 1. Definitions. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2020] [Ascensio System SIA] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 810626a2693914c6b0a13635a223b86806e410fd Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Tue, 23 Mar 2021 18:53:00 +0300 Subject: [PATCH 19/36] Change license (#31) Change license to Apache-2.0 --- LICENSE | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 197 insertions(+), 17 deletions(-) diff --git a/LICENSE b/LICENSE index a4f9de33..710abe3f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,201 @@ -MIT License + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2020 ONLYOFFICE + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + 1. Definitions. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2020] [Ascensio System SIA] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 315e21ed578fa0805f966ebe46ece6a513fc8dc7 Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Wed, 24 Mar 2021 17:03:52 +0300 Subject: [PATCH 20/36] Added new License --- LICENSE | 2 +- index.html | 15 +++++++++++++++ index_about.html | 15 +++++++++++++++ scripts/speech.js | 17 +++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 710abe3f..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2020] [Ascensio System SIA] + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/index.html b/index.html index aec85a54..926e62a0 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,18 @@ + diff --git a/index_about.html b/index_about.html index d2ad1194..005afd46 100644 --- a/index_about.html +++ b/index_about.html @@ -1,3 +1,18 @@ + diff --git a/scripts/speech.js b/scripts/speech.js index e11a57ee..33db8b13 100644 --- a/scripts/speech.js +++ b/scripts/speech.js @@ -1,3 +1,20 @@ +/** + * + * (c) Copyright Ascensio System SIA 2020 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ (function(window, undefined) { var text_init = ""; From 415530c78d7b3e5b8bd3e4042d2d74c34785260f Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Tue, 30 Mar 2021 14:57:34 +0300 Subject: [PATCH 21/36] New icons scheme --- config.json | 29 ++++++++++++++++++++++++++++- resources/dark/icon.png | Bin 0 -> 387 bytes resources/dark/icon@1.5x.png | Bin 0 -> 535 bytes resources/dark/icon@2x.png | Bin 0 -> 738 bytes resources/img/icon.png | Bin 1549 -> 0 bytes resources/img/icon2.png | Bin 1491 -> 0 bytes resources/img/icon2@2x.png | Bin 1900 -> 0 bytes resources/img/icon@2x.png | Bin 3924 -> 0 bytes resources/light/icon.png | Bin 0 -> 462 bytes resources/light/icon@1.5x.png | Bin 0 -> 616 bytes resources/light/icon@2x.png | Bin 0 -> 842 bytes 11 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 resources/dark/icon.png create mode 100644 resources/dark/icon@1.5x.png create mode 100644 resources/dark/icon@2x.png delete mode 100644 resources/img/icon.png delete mode 100644 resources/img/icon2.png delete mode 100644 resources/img/icon2@2x.png delete mode 100644 resources/img/icon@2x.png create mode 100644 resources/light/icon.png create mode 100644 resources/light/icon@1.5x.png create mode 100644 resources/light/icon@2x.png diff --git a/config.json b/config.json index 8b84467d..5b6ef4fe 100644 --- a/config.json +++ b/config.json @@ -20,7 +20,34 @@ }, "url": "index.html", - "icons": [ "resources/img/icon.png", "resources/img/icon@2x.png", "resources/img/icon2.png", "resources/img/icon2@2x.png" ], + "icons": [ + { + "style" : "light", + + "100%": { + "normal": "resources/light/icon.png", + }, + "150%": { + "normal": "resources/light/icon@1.5x.png" + }, + "200%": { + "normal": "resources/light/icon@2x.png" + } + }, + { + "style" : "dark", + + "100%": { + "normal": "resources/dark/icon.png" + }, + "150%": { + "normal": "resources/dark/icon@1.5x.png" + }, + "200%": { + "normal": "resources/dark/icon@2x.png" + } + } + ], "isViewer": true, "EditorsSupport": [ "word" ], diff --git a/resources/dark/icon.png b/resources/dark/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6d1eaeab4a608e772a883ae2726f8daab45b0dfc GIT binary patch literal 387 zcmV-}0et?6P)zRmkTbJdwdZ-9Wd@$qF<+UuAV+{`hWR#Ng#M$k_o|@@9j7)YrQS{i`7oggG@>~e zITys1z0jP&Sg}{U5a)t|xs8)cLEg@L+aPzbY})&#XL{*o+#m{{h_+jgrA<+L5Zr;WeVE|!?z(LCO!x0ExJcXZg}txTF21QXNu hG(>c~4|u|V;|+&Go002ovPDHLkV1gHFmo5MR literal 0 HcmV?d00001 diff --git a/resources/dark/icon@1.5x.png b/resources/dark/icon@1.5x.png new file mode 100644 index 0000000000000000000000000000000000000000..5139a7cd5114c6bd4a17d2ec53a384fa61c7b6b3 GIT binary patch literal 535 zcmV+y0_gpTP)XKq!C)k~=AY6ae=?0Td8&j|;#BkOD{n44cm9s|zzl0kvKOow z^k#PUAPIl3cC|7@i9{lih>o%>XB0CKcn5ohef!L%0B*?$Jop|ihYdZKjIm|_Uu0SK z>zaH+28hTN`HN&e#jj+2Bb|lfArEkC*dSybM-j$5u!ZHWROloWKR%`^l0o@)48#_2 zKd{CEY%NqOdr3C1*pcjxN=BywoE7T>BJ~(DUqsHZZmx}+6q5xI$lE`xi|R#%Ld3J9 z!ardB3k4-?-5{2u+P_e2FQ1(pwPnqeJ=Gj@edH($RT~3dN%1vUc z4M=xV`@Y$w#0LnOP}PB^HB&excG|$DBl-uMN-k_TUTdt0UQAw{)qq-00bbg0Uz)I9|eGXkWUeS@KFFL04V_Q#cSzpu~5vP*jWau zzpAO$R`u@A+nMQ}X^9wyVHk#C7zr#Ei$nRTK-?MHgS5nNX$gq>19OSiO}wuMv(f2v z?qm&G5r|Iyg&CmzlXUuMT|8q8b_k(QDL4O;%uw8wtS3$x)2h&GJ};WA0?`>2rQ$Ya zO)z33m|e6PpL3NWGMhkjLf6`-#8p7#9OejZ%I6KZrh{Y=h?nokN?cSYVxY(qS&gL5 zjHp!8xIpH(bICw$BsI|VIZM1WDv;u`CUJ@!^71U??@SYICgW5z@SuMhRX24x_;O_S zG?9@J?XJ(MIDs+iis-26TI~ALMo|K*O#$p}DA#dEbI;43%dfN%e3rKfJ(Ol9v|BER zq6BhO_T^P%KXA(-g z<5}AGwYzq`hp-`Z-C~cuep!||bfEXl%z#0q;~1UmA_Z^GtPc(AwIXrq}DQXtmm{va+%)H?#U3H|;38HI&~-xE0!yWPIPn*SC1CQ5^mu+JS43Wbhz zcX!)!b8~Nt+8?E-R`SAv7HFgLE(^=2k<>%*LYiMXlV$JbEO-)U@PNxg<14#u$ zR+xDdh~6RW?rTz8wOW0FncP1R87*??Pw601sjI8|Lz>I@RxU0sK5n&E`K9&+1qCi< zwm&Q{FF#OUU+dK&RoEB*|o9zRs52AZYaM&w+KA#Hb z+hu8o_mcAR^3R#OVrglq&R{S^usJr69tMi!>gsATqWm-OgM3`{dcB7Pr{?BnkI7_u z8?2p0MMVw}coSi+)amqwyu7?KSjHESXPIz%1Nso((QX6;F9`zy=>II=*4x`_rzi#j zffS7O9p6@5Tx=Aac%>YI$wvv|dzx><udh!{1QEq^ydGEP zJF*i*vG6J576tPBUET&8W|Z##nVFeac|G#bFFQe}^R1hVR}>Qy6EE^MIXO82MDXzD z=H@dxU4Deq|0+8{m&NWxcJ?vokK#;R;QeJMXtUX`6G2D==1cBuJ4gEiH|)!xefOHtAU68@yh2g2=UxDKd~m`Xz!>Q&TaU1h>>p zw5dS+Aso=ZiF#}j`3d6g9TAC%K!NJvZLC)7Fl>~5zyCR2k7$NvCkQfEG59|hKY;r1 zS?KTZHiLtMuTfh?MTLvkqk#3vPOzk;^k3$T>Of1bYo-VDcHswF#`hw z#j+Db#BP8fy%1H%DQPvdj$+{@B9FT9Wxfq$Z-ewP11j3+u1v*tWHa1@5JG_@*1xA>w zSn`_@9br>YUpObvOMS38^n$~FK{Fp38tO(gq8Iyif=$uO+ysJ566tM&G_I%XCF_#|Rtvt)zg$DNs(sbWp?fM)M@ zyUobUm~tLF@*Fb}BPc8({r7l0r;q|gvXkS1NIs3_ioTtt1liyJ9$8sguc+1PAP)EV z?aFwAmaeU>?F?-SraE|Fc^9o_4kY%!#0tgV9f^tKLkH1)00000NkvXXu0mjf1%Aj% diff --git a/resources/img/icon2.png b/resources/img/icon2.png deleted file mode 100644 index 5623f557a537b827fba0eddae60a0d8f57b92a17..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1491 zcmah}ZA=?=7{8XTunI}%h;g`V=fQ_5^sd)edQ$1j0WGdw1C1+wFkJ8c&;xpR+#PF6 zW*k))wi(B^L_^}xER293Oc?TE(YVFn%QTv3*oW~!12Ig=%wCuuRCNBYKsOVJm%IO4 ze$VfD{=esW?nErwQemnxAqY|t4$*CJuF}3TBOIq%4}J%yJ!(@zZ5O-L3?l=?&xuKZ zhSN+pXafwF>%RsX5TxWLA5W->$U%w~(>SAH@N8Ow)(Fzjn3Wi|7pQ0wbn}82yZ!MM z4COg5cGwxQMx-D}@u5K(v=2t(>|ihJ;jqT%(S|Gq3DQ7i&}_O-P^hdIEAUcqtsN5> zT7am%UTi(6L?ng=MH!$@+-_m5B#F9QIO%Y@Tx1<;vywK#3SXCnbWlzgWpkq&4+g!- zTo=_wH*ffYJ1>?}Rf!^qOeTY8?6@d*6QsxE(Ku{23q)9yoS-sUi=b3*GSEO_WnNNw zQ9w0DCMgc6UJORMeucDDq!pA6nV?`qmXQb&w`x}^06DgZlLq9zf^&`~Kp#j0K~*4@ zEMlQbkw_7~C2cxgL@R0=czCxh(Mmig0iq2k;(*M;BzIM7VM$a_28=4oaZ&8sR6Ldv zRZ&Ta5*loGp$8800w-paXCA==no)rlgX+62)_N#?oODuFJ5;|Gj#leBG$L|*S8gjP zX{BuT|3G2tIYwpv7tFC#mnf$hs6Ve&D2%gxn>-}hE*N;P(eyF1tIhX-kXjfR=?#TkfH)Yg=2bp0zwtG?4itfNPe; zG+M|7#cv;reOtZ_TWk*qcXBO@$Cd zmk-nacy=MV_TWKdi5J;ja{lU_nPFXJ%lH@PPMvzeG(Fh4JTsEg)sC!`F7=^fuQiSB z4|#6gnCY&*;V*U2m7(AAFXbPrGb~m3X3u?fsciClBy`?*`R!vr96(<#oxAMwj@EP- z=FP_OxAfBuPtRUO|1!?rde)rL|8Dy1=fp^P&2u;NOUBf-mPyb!wAK?d>-+1>hc2|< zGgkGKkK?*uYibrPzO{YBuS|`erjI46hF8zz?+_!@&bdG1Gi9k?qUh|-;enw~lg(!b z^>Y{I@jXB4?>5H%8SmI-xc^4^$US7~8{bcV2hZwHT$z|S{mJ{sqrOXfD_>vs9oXDCsd=MBV7v u$(D`=b18CtxgzoTm-P##s{2pq3{N7r(UXqaixbn@Z#LW%r9TXG=KlrJw(Q;j diff --git a/resources/img/icon2@2x.png b/resources/img/icon2@2x.png deleted file mode 100644 index 5ff5b7d41a00e25f30c5d553385609101b483e3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1900 zcmah~2~ZPf6pm6n5HTny2%0r?JP@+kgaooAAUTj&LN!D{#p;sXgeb|z-Gu}wML8;^ zYC(YkMXioTMMkOxYXvK^k zYW{eqsZIMh;@faI8i%ZOveaL#<{+yBec_1Wa!*N!VSrC)t1jm9S$4 zDz3^b!x9Y7b;LXFPy%DGm zR?EZR_@Z|bb|OWYVGy)fEF24;gA;lX5{X214j#{+M);GdCJM3on@FEQ202D*34@t3 z;3mM%h$P_2l!Q%3`uYk+^AN3xd?OPr7-&VzAjIL?uQUKewL>^_GLbak9MytY5@y6q z6iH*DAuO$uN;L$3FRjrygeEC9_V#Y?MU$FTGX|FqJ_ZhSc3`0E##bc@R%H-FbSJhKhU2WL`$!M1TdFRt3Q_>x!l)K z6^b&It-YS@ zd4lB_VMxKyZ~`|11G#_=!^grOmhX)%I(#ev!`gy$Frd9U->KHYBf16b%c0(*H$&Zv zndp`!=-xd4DvLw6yq8iQrmN5ADxTiVd86TgW6fp&tZQ=3o7HAH%P8dK&7DUsisT@?V&;kZO@>!hxBI3byCrajv~|=LSQgi` zDlcSZr{?)RSQcqx#WgLyvM&6^KiXbr1gc?XyQ0+jn1(Eu5jQ-7s~;YPZikKOeh&Jg z-jC&8azU5+XaGZBS?bN|8&|KK7JVi8R}YKJ>5MflnGTOGWnL|9M4FxQ(zl||ZX8&_ z{AcY~KNZ$^@kIqo9G`k$#m+6uy6hp}vcKX~-L{(Fgj3aC091*rD&y9=CX^i?X^j^4!4*w+jordaqaZY4f%t&t5eF->7m6-I4{7qowv3w z>YjP4j#wA&{-EOK@nfGbYHIl)DtR@UKdq1vcAl$EH?k#6_J5=}D?zm09`~CDIy}|XzM=CSU-4>_h zf5$97_%q?u^TEmDGY17#8g9p*XFrT37Ke7@{F3PUThx!8BRHPsM|U059X%Ip_U2EY zQ_$(KFRQWVnp}#ONX1TlztkPo@k3&ytjM+ou(5DtqxX92{IRZ!GJHxSi?3~LpSNl) zSRd%<{CvZOxyxp|f6CD6^Cy-+YmYc!JJa$w^mMK4UJdK!dh*zdyLIK^mA1Ze9+~+h zK_4cnp4pJI!EJTn$cW_GYf8&DeA&N(MOWoBdvWg1Yv0LmVCbwpSsn%JD(wG1r6Njx INV+oXU$nK%g#Z8m diff --git a/resources/img/icon@2x.png b/resources/img/icon@2x.png deleted file mode 100644 index 402e560cf0e39fb30274b8802a0ef9c7fa1cc681..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3924 zcmV-a53BHrP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D06}y`Sad^gZEa<4 zbO1wAML|?gQaT`KWG!lNWoICEF)lD5D0OpbZf77#N=G0{P(?=|b~rF8EFf`pVQgu1 zc_2L?IWP)+RNCDD000hRU=W+)CVAeh#HMU#Kd4tMNO(Q8U!XP+Bk`zqM%^YCKdYsF8ACX&VKjqvhEt) z|IE+bd(L;hd(X#t-E;5SO;&q*yVv1lmM^Efny03F8$(>Cr{Uzx&Mci|mM$ch^%jP> zOi#nf6+35nW|GT!3qxF{r%)xQskQ=DY92mq*REZA?$Dt_8OM$t`=M;ZN#uDN?>kqd z=E?RdW$ zM`UMbkLAh3MF!Cc29%vplnO zlAI^&WX%5IT zOP7T_|E8v$j{F&ll^s(zMz+q<}zIp3fO?3jGpBnd=acig_6C{=)@K z#oYjgg@rv$Pfu@=gX0Qa4PaYan;%-=S=CQ)aL6~f zvw4LpV@Ah6Zi*`_r-_reKrc)d@slP^?o=UH>0$tF_#ELVZ9P*6~? zU-oMzblu*V)sJyLR00D78&gx$oK7lk>82e(ZEfv-)22UyN>?Xh+1 z*2$a?4)ltDNM%{vl9?0EA(wXP(xrQ&qoZrMi*|>iqT(-c9&PsIB+~KeM|U+fH8n3p zN5|B0zEmP2BGyrPGu)Du6Dz04!+5thz}5Ags}vU(*Tc8g-ONPi26Qh>HvrwS)_ii- ztXZFN{#25Zk|vRF4!7mZk(!1j$^Z=ZTeu6nS@QDoKg9Xi7Kk*z8#itY!}v$HofJHg z?%&eV^5TL83-)q8RdDSOQCXFaf83OVGZSHnGCVy!!|5%VyR2RNW)^o1IQB=ErCGNn zE^bOiLqo$*VS`Ubdc~_x0=7t5Q=_jo~6FDCo?#ZQDj(ym+xU^2HWcHwt26Vq&xGlOruHZH6c# z@Q664__Sfh8;SAGYb{T(Vnxm$)oTDlj~+eB+HcviH4ORG0>!ls#t^eRBqY@7T6E8z zJ)Jfk=${BM3JeCc*+>R`0R5GE0{Tmd-4_~Xv^_L4Q9fE-pPZbWIPL3jBRwg+)*%&T}Zjq6ZUqwVjHiLRh*C>nGiL;kEc<^99VNYA-tkInW7r^o3$LDgkGH5*Qjg6P71sdhh za{C4chqQ6_g8B33#|nEN3E&E&LIU)JX`HPJg7G>gk$(E{LtXlT&6_u`;cNvM*PBk9 zIMK20R{y{;(=ee>1%-Wwd zH#h$X_OxspgxkF2xVX5lI9owQMa3|m?7|{&GOJdt(jFjLar*RWdO%MbsT9Of+qZAG zyiZ=fe0iWx1aRfbRml`2S#+%6kF~1hEoDJL!84M5_uAUp-*a{XwAvh>2;hbd8@Gsx z%aVejQCwWSo+~eij*bqL?ENsYjKZ3bwI!mWqW1Yj0E>!>zd(hJ$B{zfSa9mpso7k4 z0b1xTOgeNsOTOr3q=^X$38weQ7*|_;B7h|&C10bm{(9UDQP5;sTU(8Tryd(`^qAix)3ueF*C6&P<2hcL6PBhOS<{ zdL3sc@QDEGk2OaEYI*dw>1Z$vbP8ZoQ`2B9epw%avuDpPge^VZppDkCSy|Z)oSncY z0+^HYMgl5ptON0#T9C0dC8(>bvwX3L9$n(@gIX_@rI!3ye0;(w&Q{b)N{}^5x5;P;p}&CbA$ofu zE-tQ?vlUcVS1<920E*wrals>!lc!m}(n}mZe0Ujb2Z%CNRaL_|J3(-8@Hc3&&-+9G zr%s*P@q~;C;EWkFUggTj#Kgp0LNI;-d)mUHWzZ0G&wS2SFmq&`|p~oULI0{{3%he=#oeP6M}RRj4?% zLJC6n8#itY#`v|AvsIZte||kZT|+t1YHb@fY_MD}qWiWZ$e}(H!2JCDQdC@fyMTl{ zj{alDj5)*E%GmApDtdPjWwq8zqE|bRcUZNR$;ruSLYarP0$2=IfujsZm^78+fL=H{ z3C@5ovDUg`w})A-w>*u0Ct|!cM&D=8p1qp06$AzbHq_SE(py>7ZE4}%m)}AfJIrA3mdx(?K>kKq~lM@+nW6pgNRED5#LtTKj!0D}}p=jQtF$i03M0%2}tgKhH z%ILy1*qWQ06VTO6UlQ83Z5urbHO5QOK>%&I-nJ!%~y6&U67q)zmPN3CxjD12>*qdCq zaG_6hbaXX$F`hzyJ4^1u8Z+2?akZ`v!nryVge*^%08}Epp|B zP+BTR?54p|A7$_iRXaTn<>STK*$t78b~6aOEA=&m%$(d4IH z3%#|4Zkx*aQ^Cyq5z06`ch)2v-a`6d%$YrT@??)Kb)ur8XctAVQAhBAR$={|B8`IB z7h~hli4!L}opFf?6DE9q{`~n~nqx`i)A;f&Kx5CS1q&8*`u|_t1#7;achsgs@Xu{+ z(Gu*jnwpv-OeWVkKPs@RJ96ZRL-0CDI>9Z6R{eQ-d2e$U-xY9YKpUa*EKFmayv0wg zkH)}~*x1+`oDUT&wD+!Fo!hZkwi29v+t~K)+xH4>4{;T71$skOuZ|}23B($YTHd|- z=fhQ1Rb`wH8MM6ZGiT0p9y}79-WFWCbZKC8bc|cGGzR%!>eVqsJ~`2k9<#Hv4{&}6 z{2}Qv=1ARKlbJ8CNDfL@p}~6Y+_~G-N;yOS-`k8XOd@|m@^?~GQ`4ZZu&{HgpWxsS z+QI1*ye>;r#uco@*}DS${vtm=KToZk6-$>cv+JjIDsi5&va%n`KJ0dTB0lNaa;NKY zDz(7PU?tAp0>6U?4=zA=a%riPk&*GDej29|=fIk@-@=6pwcmmyB_+|ut3&Vvmf{L{ z3QnAz3AT$DFFp|y6H_k-iz7Wf{RQ2P7>l-;E%S_~3&N?t>50;0a`P zI#vz60VmFmqpq&52WG@9HE1&QGY8$RCX_Q4(ymB8pB1b)LvLXw&Q@j0lqtgl0s`2b zVzj{D>8?77^CJ-A@~m(WXLKvz#M!A}TudH6e*8f>fa28-VIw4$QxW3wtZ)!#bgMBF zXDh&BH)Gtmag`K6{pYSUu4#Ef;+R8-%d^5koYA+1nK)YlL40WJ*s&Y;?AbFL$KTP- z4XO4rLR_8|4&sb%7tAEvJpT9-w#v#%daHD(o^43BQ<25xbFktJZ#T>&@*5i)={}dX zsydZ(hAb{$MU|GO8r|-wlJc~*o^d1 iTLC0om1EiVZvO+GD2Z#;n&5f>0000n9P!u>?YXXNlMX_BXo% z@?V>#nelQgFHO@|kZ$U_KJ`_qM92p%%VIJ|B|p#e3sgAZ2anx7LwjsO4v07*qoM6N<$ Eg7KZa3jhEB literal 0 HcmV?d00001 diff --git a/resources/light/icon@1.5x.png b/resources/light/icon@1.5x.png new file mode 100644 index 0000000000000000000000000000000000000000..e08f81eaa72704fefb39fa8b0c51da8067bcdb0c GIT binary patch literal 616 zcmV-u0+;=XP)3|Z*nUC{!;sZ0RjBINJ2fZ1O zG_$MG(`w(YOyuC;;Nb9Z=yW<`G7O&#A`HW)ZnrzbG}7^<956-{8`pv$*d$3Z(DCHL?y&#-`KR4XI&h}`_*bS!gPW4 zpSL1gifFste#O9%%$0AKST2_l4*3PLnF1_Kl$Gsy-kc2JbUHEF9^a12C!lKr30VfG z0rnkY%2ACaAEV`|43GjbqFPr))hf|et2M|{I8tefA(U*^Bgz#bgKUiNSu$89x?Zp6 z7^WaQlkCUiafhhZB%Ae!g3N>zjRB(Csp|2)#FV@4S|^HD%S~b-+0yQ`muvx91YTBe z=d_%G$cR3}tlFe#FLGYJJaxO}C?oJTXk7TnN(Ny(H;OX~*p)c9263qfP14ML( z4kcdw6;U{Pqye7P z+b|G@SFgJ|h*Cl13PS5~k1B9nft3nES75sWsRKJ_Jbl2q6$RCWA0J(|cQ zLX&aUoD6m{N>d*x$$51=jghABRjXd~tjw3lh0vj3=iXESIacBl)A82BL|Ks-$6$WC za|q~##F1L!pb~i{8BZ!55Xd-py;v-!Ri;taKq~ZTyXN}gs0V?^ Date: Tue, 30 Mar 2021 16:27:38 +0300 Subject: [PATCH 22/36] Fix config.json --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 5b6ef4fe..9bb0959a 100644 --- a/config.json +++ b/config.json @@ -25,7 +25,7 @@ "style" : "light", "100%": { - "normal": "resources/light/icon.png", + "normal": "resources/light/icon.png" }, "150%": { "normal": "resources/light/icon@1.5x.png" From 9a8a6a7947a2c2a12dd0c6c0f2747cac457a0c30 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 8 Apr 2021 17:27:41 +0300 Subject: [PATCH 23/36] Added themes suppor (changed index about) --- index_about.html | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/index_about.html b/index_about.html index d2ad1194..57c52831 100644 --- a/index_about.html +++ b/index_about.html @@ -4,29 +4,48 @@ About + + - + a:link { + color: darkgrey; + } + + /* visited link */ + a:visited { + color: darkgrey; + } + + /* mouse over link */ + a:hover { + color: #8d8d8d; + } + + /* selected link */ + a:active { + color: darkgrey; + } + - + -
 
-

Version: 1.0

+
 
+

Version: 1.0

\ No newline at end of file From c9994538145c350238f6b5def9792421be8e1d80 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 9 Apr 2021 11:05:52 +0300 Subject: [PATCH 24/36] Fix bug #49528 --- index_about.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index_about.html b/index_about.html index 57c52831..9ce4b9a8 100644 --- a/index_about.html +++ b/index_about.html @@ -44,7 +44,7 @@ + ResponsiveVoice used under Non-Commercial License
 

Version: 1.0

From b134e74775ab20bed5b54046d2237c38d4324b58 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 9 Apr 2021 13:03:03 +0300 Subject: [PATCH 25/36] Added classes for links in index_about --- index_about.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index_about.html b/index_about.html index 9ce4b9a8..a799931f 100644 --- a/index_about.html +++ b/index_about.html @@ -44,8 +44,8 @@ + ResponsiveVoice used under Non-Commercial License
 
-

Version: 1.0

+

Version: 1.0

\ No newline at end of file From fa4e1af354c57dead0dffa6607725f8d8c3c3558 Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Tue, 13 Apr 2021 13:17:48 +0300 Subject: [PATCH 26/36] Fix for older versions of editors --- config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.json b/config.json index 9bb0959a..3477e365 100644 --- a/config.json +++ b/config.json @@ -20,7 +20,8 @@ }, "url": "index.html", - "icons": [ + "icons": [ "resources/light/icon.png", "resources/light/icon@2x.png" ], + "icons2": [ { "style" : "light", From ef18d719c737e6b3aab3f86e31d2b4c175ab1fb7 Mon Sep 17 00:00:00 2001 From: Nadya Knyazeva Date: Mon, 5 Jul 2021 17:37:11 +0300 Subject: [PATCH 27/36] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80856f46..475cb91d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The Speech plugin is installed by default in cloud and [self-hosted](https://git ## How to use -1. Highlight the phrase you want to here. +1. Highlight the phrase you want to hear. 2. Open the Plugins tab and press Speech. -If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic \ No newline at end of file +If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic From 8da36fd29eddfa57e38c6c32921654616b66d442 Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Tue, 3 Aug 2021 11:46:32 +0300 Subject: [PATCH 28/36] Icons for 125%/175% zoom --- config.json | 12 ++++++++++++ resources/dark/icon@1.25x.png | Bin 0 -> 469 bytes resources/dark/icon@1.75x.png | Bin 0 -> 590 bytes resources/light/icon@1.25x.png | Bin 0 -> 545 bytes resources/light/icon@1.75x.png | Bin 0 -> 677 bytes 5 files changed, 12 insertions(+) create mode 100644 resources/dark/icon@1.25x.png create mode 100644 resources/dark/icon@1.75x.png create mode 100644 resources/light/icon@1.25x.png create mode 100644 resources/light/icon@1.75x.png diff --git a/config.json b/config.json index 3477e365..0cd67dd8 100644 --- a/config.json +++ b/config.json @@ -28,9 +28,15 @@ "100%": { "normal": "resources/light/icon.png" }, + "125%": { + "normal": "resources/light/icon@1.25x.png" + }, "150%": { "normal": "resources/light/icon@1.5x.png" }, + "175%": { + "normal": "resources/light/icon@1.75x.png" + }, "200%": { "normal": "resources/light/icon@2x.png" } @@ -41,9 +47,15 @@ "100%": { "normal": "resources/dark/icon.png" }, + "125%": { + "normal": "resources/dark/icon@1.25x.png" + }, "150%": { "normal": "resources/dark/icon@1.5x.png" }, + "175%": { + "normal": "resources/dark/icon@1.75x.png" + }, "200%": { "normal": "resources/dark/icon@2x.png" } diff --git a/resources/dark/icon@1.25x.png b/resources/dark/icon@1.25x.png new file mode 100644 index 0000000000000000000000000000000000000000..6b2f10036d83db65d5f0661946ae6855ae851044 GIT binary patch literal 469 zcmV;`0V@89P)500009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP&$__hpM;rildH`|&dVsQr-;)fAjGH3F*T`l^cQwt*9okr`I3M;<{n@1W)Q6 z8!38(Z$OiqKUB#1HmZ>zy%Qqjlp`!lWQ?t~?3~6ED(&b6= z!$1&*Cn(nx00o!=;0^^O1q9B70^kk>q=BS>_zo$60)RUy017a7^N$!yhU|L1&aS+c z=95OYv=8s^otb?QDT<;figGw*SuSYEK)?g+l_GLPk-)$wEC8=F&vpygu}_;QB3J+( zEAkW|6x^?J zMBrl?1rShC6XJ}KAR_RQGYTl6LWJb7$EJE?G7lT<$H2xA+DF~Ot6q0{r>5zhH4+M zQ&T}of&C1#x|F0_<4h$ZLIydZ4kRN&;^C7zkdiy`j`!VGDBGHysVoT*GC+=pRYNsS z#f7OLm6=$=))E&sE?_UFf-$ARH3SrnI=n{Yrh-(~iADi%H;$KYSx@#D$_DTTwy_l& z-O1-D$;ifx{kl`0cl14%F>P&ig3N^MfA|#EDbL%GwPP-QTM6b);;+Gk)XwX(^b literal 0 HcmV?d00001 diff --git a/resources/light/icon@1.25x.png b/resources/light/icon@1.25x.png new file mode 100644 index 0000000000000000000000000000000000000000..f89f5ed2a8afc7a8e939666e2eb4203f4098e7f5 GIT binary patch literal 545 zcmV++0^a?JP)500009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP2 zf$5clK;Mphw^aN!I-Gx{6d;Qv<{yOu67~ zhMI1eH{GwBChE|k!<}I=nXITGOlk<%b?xbNy2InT$`52+YLg5Tu`KJ9=lQ(O7d|@> z+E5#0K*Z_y`)523{^Fme>CiBY2M{`!`52@C5E+2T0k?Io_dU<6{T@=f$9tdfU5d7w zBg45bQsa;U;y7O5-I+{7mgKOUT0|IzUpV6pDPz$;UfUX1lM0Zc5YdUm=(I|POMWyO z%}dNjL}y02$Uq-k9JoRR7NRXlk`T)?=^_JtTtJ5P@h&k(NR>^x$S?|hIO0AF8H-*r z+>@|eB>T3w*D4vV7H*DNmTe_whXj%qwFsn#wXzL@U@zLxI9=HFk@0>1rNaCQVK23j zDZ_X?o^d6CY)DmP>V9^t1AOR!TiK)l7OrWU8~nvTMBB{*=2GQxfZI7K0D|V3<|xyV z(g?xed8XIvoe&}Ccdsg{91$jhOAO#Ql=&!^Hkww12tARchsaP2V&7#%{tY}Z)r}rS j^V0*6SyP7&9qt4_0=lw&-K=0f00000NkvXXu0mjfgIec@ literal 0 HcmV?d00001 diff --git a/resources/light/icon@1.75x.png b/resources/light/icon@1.75x.png new file mode 100644 index 0000000000000000000000000000000000000000..af510843275ce33adac69d1353baa7a0e86b0f01 GIT binary patch literal 677 zcmV;W0$TlvP)7L z!axv)$6)T1;0{7Muz8%LR1kLn9bhU5t^iyC$sK_^h)bXZa^~UuBN@quUB6hvM%quZ zY-x5a|2vPJHIcz!Fc=Jm`x%eNb83+ewajEPS>YB?i`di>uIu)Dz20YOBAYfMvWBlu4bVme=L1&yKn>7F1gaE=QY^D`TZ3C7oJ$(OABd#&kr$q949c*B z+fiiG!V{=U8&sb~$wBB1*SE-^g(ps@(<=lVi^g<19T&GyWYa=KnSkMN=p*Tm*cgR5 z@h=)c7S%S^wiTt@ARnUTT(| z@T4dUC+>e#3dx<H2z(3F(cm2L_r*$nQB9D<3HA-ID3KoyPHf9Iemp!JhzQ7FFc=I5Lv#KBxf2|P@=<}300000 LNkvXXu0mjf-M=9X literal 0 HcmV?d00001 From ed204dc07232153d76ed716255d89ccc5317c0d8 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 19 Nov 2021 16:27:44 +0300 Subject: [PATCH 29/36] The LICENSE has been updated --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 710abe3f..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2020] [Ascensio System SIA] + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 61516baa4e436d7a133066780c9c878fa4db138d Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Thu, 31 Mar 2022 16:39:43 +0300 Subject: [PATCH 30/36] Changed version format from "x.x" to "x.x.x". --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 0cd67dd8..fa53b396 100644 --- a/config.json +++ b/config.json @@ -7,7 +7,7 @@ "de": "Rede" }, "guid": "asc.{D71C2EF0-F15B-47C7-80E9-86D671F9C595}", - "version" : "1.0", + "version" : "1.0.0", "variations": [ { From edd3040a6d057e80b714a922b52e03b81d551d2d Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Thu, 14 Apr 2022 12:42:20 +0300 Subject: [PATCH 31/36] New plugin version --- 3rd-Party.txt | 9 +- README.md | 14 +- config.json | 14 +- index.html | 7 +- index_about.html | 66 - scripts/settings.js | 107 + scripts/speech.js | 470 +- settings.html | 251 + vendor/guessLanguage/guessLanguage.js | 2 +- vendor/select2-4.0.6-rc.1/LICENSE.md | 21 + vendor/select2-4.0.6-rc.1/README.md | 123 + .../select2-4.0.6-rc.1/dist/css/select2.css | 489 ++ .../dist/css/select2.min.css | 1 + .../dist/js/select2.full.js | 6559 +++++++++++++++++ .../dist/js/select2.full.min.js | 1 + vendor/select2-4.0.6-rc.1/dist/js/select2.js | 5847 +++++++++++++++ .../select2-4.0.6-rc.1/dist/js/select2.min.js | 1 + vendor/select2-4.0.6-rc.1/docs/README.md | 1 + .../docs/announcements-4.0.html | 12 + vendor/select2-4.0.6-rc.1/docs/community.html | 12 + vendor/select2-4.0.6-rc.1/docs/examples.html | 12 + vendor/select2-4.0.6-rc.1/docs/index.html | 12 + .../select2-4.0.6-rc.1/docs/options-old.html | 12 + vendor/select2-4.0.6-rc.1/docs/options.html | 12 + 24 files changed, 13865 insertions(+), 190 deletions(-) delete mode 100644 index_about.html create mode 100644 scripts/settings.js create mode 100644 settings.html create mode 100644 vendor/select2-4.0.6-rc.1/LICENSE.md create mode 100644 vendor/select2-4.0.6-rc.1/README.md create mode 100644 vendor/select2-4.0.6-rc.1/dist/css/select2.css create mode 100644 vendor/select2-4.0.6-rc.1/dist/css/select2.min.css create mode 100644 vendor/select2-4.0.6-rc.1/dist/js/select2.full.js create mode 100644 vendor/select2-4.0.6-rc.1/dist/js/select2.full.min.js create mode 100644 vendor/select2-4.0.6-rc.1/dist/js/select2.js create mode 100644 vendor/select2-4.0.6-rc.1/dist/js/select2.min.js create mode 100644 vendor/select2-4.0.6-rc.1/docs/README.md create mode 100644 vendor/select2-4.0.6-rc.1/docs/announcements-4.0.html create mode 100644 vendor/select2-4.0.6-rc.1/docs/community.html create mode 100644 vendor/select2-4.0.6-rc.1/docs/examples.html create mode 100644 vendor/select2-4.0.6-rc.1/docs/index.html create mode 100644 vendor/select2-4.0.6-rc.1/docs/options-old.html create mode 100644 vendor/select2-4.0.6-rc.1/docs/options.html diff --git a/3rd-Party.txt b/3rd-Party.txt index 01e8ba60..0160dfb3 100644 --- a/3rd-Party.txt +++ b/3rd-Party.txt @@ -1,10 +1,3 @@ This plugin uses code from the following 3rd party projects. - -1. ResponsiveVoice service to read the text out loud. By default, it uses a female voice. (https://responsivevoice.org/) - -License: CC-BY -License File: ResponsiveVoice.license - - -2. guessLanguage to recognize the language. (http://richtr.github.io/guessLanguage.js/) \ No newline at end of file +1. GuessLanguage to recognize the language. (http://richtr.github.io/guessLanguage.js/) \ No newline at end of file diff --git a/README.md b/README.md index 475cb91d..ffef689d 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,19 @@ Convert selected text into speech. -The plugin uses [guessLanguage](http://richtr.github.io/guessLanguage.js/) to recognize the language and the [ResponsiveVoice service](https://responsivevoice.org/) to read the text out loud. By default, it uses a female voice. +The plugin uses [guessLanguage](http://richtr.github.io/guessLanguage.js/) to recognize the language and the SpeechSynthesis - interface of the Web Speech API is the controller interface for the speech service. The Speech plugin is installed by default in cloud and [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) of ONLYOFFICE editors. ## How to use -1. Highlight the phrase you want to hear. -2. Open the Plugins tab and press Speech. +1. Highlight the phrase you want to here. +2. Open the plugin settings to select the language for the voiceover (The default setting is auto-recognition mode). +3. Click on the plugin to sound out the text -If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic +### Note + +Some browsers, e.g. Mozzila, Opera, can only use pre-installed languages on your system for speech generation. +So to use new languages you need to add them to your system. + +If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic \ No newline at end of file diff --git a/config.json b/config.json index fa53b396..747256d3 100644 --- a/config.json +++ b/config.json @@ -76,14 +76,14 @@ "buttons": [] }, { - "description": "About", + "description": "Settings", "descriptionLocale": { - "ru": "Справка", - "fr": "À propos", - "es": "Sobre programa", - "de": "Über" + "ru": "Настройки", + "fr": "Paramètres", + "es": "Configuración", + "de": "Einstellungen" }, - "url": "index_about.html", + "url": "settings.html", "icons": [ "resources/img/icon.png", "resources/img/icon@2x.png", "resources/img/icon2.png", "resources/img/icon2@2x.png" ], "isViewer": false, @@ -105,7 +105,7 @@ } ], - "size": [ 400, 50 ] + "size": [ 300, 150 ] } ] } diff --git a/index.html b/index.html index 926e62a0..221ae79a 100644 --- a/index.html +++ b/index.html @@ -19,11 +19,10 @@ speech - - - + + - + diff --git a/index_about.html b/index_about.html deleted file mode 100644 index beaad8c2..00000000 --- a/index_about.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - About - - - - - - - - -
 
-

Version: 1.0

- - \ No newline at end of file diff --git a/scripts/settings.js b/scripts/settings.js new file mode 100644 index 00000000..25efacc9 --- /dev/null +++ b/scripts/settings.js @@ -0,0 +1,107 @@ +(function(window, undefined) { + var synth = window.speechSynthesis; + var pitch; + var pitchValue; + var rate; + var rateValue; + var voiceSelect; + var pitch_default = 1; + var rate_default = 1; + + $(document).ready(function () { + voiceSelect = document.querySelector('select'); + pitch = document.querySelector('#pitch'); + pitchValue = document.querySelector('.pitch-value'); + rate = document.querySelector('#rate'); + rateValue = document.querySelector('.rate-value'); + voices = []; + function initVoices() { + voices = synth.getVoices().sort(function (a, b) { + const aname = a.name.toUpperCase(), bname = b.name.toUpperCase(); + if ( aname < bname ) return -1; + else if ( aname == bname ) return 0; + else return +1; + }); + + var selectedIndex = voiceSelect.selectedIndex < 0 ? 0 : voiceSelect.selectedIndex; + voiceSelect.innerHTML = ''; + if (voices.length !== 0) { + var option = document.createElement('option'); + option.textContent = 'Auto'; + option.setAttribute('data-lang', 'Auto'); + option.setAttribute('data-name', 'Auto'); + voiceSelect.appendChild(option); + } + for(i = 0; i < voices.length ; i++) { + var option = document.createElement('option'); + option.textContent = voices[i].name + ' (' + voices[i].lang + ')'; + + if(voices[i].default) { + option.textContent += ' -- DEFAULT'; + } + + option.setAttribute('data-lang', voices[i].lang); + option.setAttribute('data-name', voices[i].name); + voiceSelect.appendChild(option); + } + voiceSelect.selectedIndex = selectedIndex; + + if (voices.length !== 0) { + var lang_val_saved = localStorage.getItem("plugin-speech-lang-val"); + if (lang_val_saved) { + $(voiceSelect).val(lang_val_saved); + $(voiceSelect).trigger('change'); + } + } + }; + + initVoices(); + if (speechSynthesis.onvoiceschanged !== undefined) { + speechSynthesis.onvoiceschanged = initVoices; + } + + pitch.onchange = function() { + pitchValue.textContent = pitch.value; + }; + + rate.onchange = function() { + rateValue.textContent = rate.value; + }; + + var saved_pitch = localStorage.getItem("plugin-speech-pitch"); + if (saved_pitch) { + $(pitch).val(saved_pitch); + pitchValue.textContent = saved_pitch; + } + else + pitchValue.textContent = pitch_default; + var saved_rate = localStorage.getItem("plugin-speech-rate"); + if (saved_rate) { + $(rate).val(saved_rate); + rateValue.textContent = saved_rate; + } + else + rateValue.textContent = rate_default; + }); + + window.Asc.plugin.init = function() + { + $('#voice-lang').select2({ + minimumResultsForSearch: Infinity, + width: "100%" + }); + }; + window.Asc.plugin.button = function(id) + { + localStorage.setItem("plugin-speech-pitch", pitch.value); + localStorage.setItem("plugin-speech-rate", rate.value); + localStorage.setItem("plugin-speech-voice-name", voiceSelect.selectedOptions[0].getAttribute('data-name')); + localStorage.setItem("plugin-speech-lang-val", $(voiceSelect).val()); + + this.executeCommand("close", ""); + }; + window.Asc.plugin.onThemeChanged = function(theme) + { + window.Asc.plugin.onThemeChangedBase(theme); + }; +})(window, undefined); diff --git a/scripts/speech.js b/scripts/speech.js index 33db8b13..d55dbfeb 100644 --- a/scripts/speech.js +++ b/scripts/speech.js @@ -17,121 +17,391 @@ */ (function(window, undefined) { - var text_init = ""; - var is_end_callback = false; + function detectChrome(){ + var isChromium = window.chrome; + var winNav = window.navigator; + var vendorName = winNav.vendor; + var isOpera = typeof window.opr !== "undefined"; + var isIEedge = winNav.userAgent.indexOf("Edg") > -1; - window.Asc.plugin.init = function(text) + if (isChromium !== null && + typeof isChromium !== "undefined" && + vendorName === "Google Inc." && + isOpera === false && + isIEedge === false) + return true; + + return false; + }; + + var isChrome = detectChrome(); + var Max_Chars = 32767; // max chars in one sentense + var text_init = ""; + var timer; + var voice_name, oMainVoice; + var curTextIdx = 0; + var allParagraphs = []; + var pitch = 1; + var rate = 1; + var voices = []; + var bDefaultLang = false; + var aAllUtterance = []; + var langsMap = { + "ab": "ab", + "af": "af-ZA", + "ar": "ar-SA", + "az": "az-AZ", + "be": "be-BY", + "bg": "bg-BG", + "bn": "bn-IN", + "bo": "bo-CN", + "br": "br-FR", + "ca": "ca-ES", + "ceb": "ceb", + "cs": "cs-CZ", + "cy": "cy-GB", + "da": "da-DK", + "de": "de-DE", + "el": "el-GR", + "en": "en-GB", + "eo": "eo", + "es": "es-ES", + "et": "et-EE", + "eu": "eu-ES", + "fa": "fa-IR", + "fi": "fi-FI", + "fo": "fo-FO", + "fr": "fr-FR", + "fy": "fy-NL", + "gd": "gd-GB", + "gl": "gl", + "gu": "gu-IN", + "ha": "ha", + "haw": "haw-US", + "he": "he-IL", + "hi": "hi-IN", + "hr": "hr-HR", + "hu": "hu-HU", + "hy": "hy-AM", + "id": "id-ID", + "is": "is-IS", + "it": "it-IT", + "ja": "ja-JP", + "ka": "ka-GE", + "kk": "kk-KZ", + "km": "km-KH", + "kn": "kn", + "ko": "ko-KR", + "ku": "ku", + "ky": "ky-KG", + "la": "la", + "lo": "lo-LA", + "lt": "lt-LT", + "lv": "lv-LV", + "mg": "mg", + "mk": "mk-MK", + "ml": "ml-IN", + "mn": "mn-MN", + "mr": "mr-IN", + "ms": "ms-MY", + "nd": "nd", + "ne": "ne-NP", + "nl": "nl-NL", + "nn": "nn-NO", + "no": "nb-NO", + "nso": "nso-ZA", + "or": "or-IN", + "nr": "nr", + "pa": "pa-PK", + "pl": "pl-PL", + "ps": "ps-AF", + "pt": "pt-PT", + "pt-br": "pt-BR", + "pt-pt": "pt-PT", + "ro": "ro-RO", + "ru": "ru-RU", + "sa": "sa-IN", + "sh": "sh", + "si": "si-LK", + "sk": "sk-SK", + "sl": "sl-SI", + "so": "so-SO", + "sq": "sq-AL", + "sr": "sr-RS", + "ss": "ss", + "st": "st", + "sv": "sv-SE", + "sw": "sw-KE", + "ta": "ta-LK", + "te": "te-IN", + "th": "th-TH", + "tl": "tl", + "tlh": "tlh", + "tn": "tn", + "tr": "tr-TR", + "ts": "ts", + "tw": "tw", + "uk": "uk-UA", + "ur": "ur-PK", + "uz": "uz-UZ", + "ve": "ve", + "vi": "vi-VN", + "xh": "xh", + "zh": "zh", + "zh-TW": "zh-TW", + "zu": "zu-ZA" + } + var cyrilic = ["uk", "kk", "uz", "mn", "sr", "ru", "mk", "bg", "ky"] + window.Asc.plugin.init = function(text) { if ("" == text) { window.Asc.plugin.executeCommand("close", ""); return; } - text_init = text; - function StartCallback() - { - setTimeout(function(){ - if (!is_end_callback && !responsiveVoice.isPlaying()) - { - responsiveVoice.speak(text_init, undefined, {onstart : StartCallback, onend : EndCallback, onerror : EndCallback}); - } - }, 5000); - } - function EndCallback() - { - is_end_callback = true; - window.Asc.plugin.button(-1); - } + if (!window.speechSynthesis || voices.length === 0) + { + window.Asc.plugin.executeCommand("close", ""); + return; + } - function Run(lang) - { - var voicelist = responsiveVoice.getVoices(); - - var _data = []; - var _langs = responsiveVoice.responsivevoices; - - var _map = {}; - _map["en"] = ["gb"]; - _map["ko"] = ["kr"]; - _map["hy"] = ["ar"]; - _map["uk"] = ["ru"]; //ua not supported - _map["zh"] = ["cn"]; - _map["ja"] = ["jp"]; - _map["pt-BR"] = ["br"]; - _map["pt-Pt"] = ["pt"]; - _map["zh-TW"] = ["tw"]; - _map["cs"] = ["cz"]; - _map["da"] = ["dk"]; - _map["et"] = ["ee"]; - _map["el"] = ["gr"]; - _map["va"] = ["la"]; - _map["ne"] = ["np"]; - _map["nn"] = ["no"]; - _map["sl"] = ["sk"]; - _map["ta"] = ["hi"]; - _map["ro"] = ["md"]; - _map["sh"] = ["hr"]; - _map["ca"] = ["catalonia"]; - for (var i = 0; i < _langs.length; i++) - { - if (_langs[i].flag == lang) - { - _data.push({index : i, gender : _langs[i].gender}); - } - else if (_map[lang]) - { - for (var k = 0; k < _map[lang].length; k++) - { - if (_langs[i].flag == _map[lang][k]) - { - _data.push({index : i, gender : _langs[i].gender}); - break; - } - } - } - } - if (!_data.length) { - _data.push({index : 0, gender : "f"}); - } - _data.sort(function(a, b) { return a.gender.charCodeAt(0) - b.gender.charCodeAt(0) }); // family :) - var voiceName = ""; - for (var j = 0; j < _data.length; j++) - { - var nameCandidate = _langs[_data[j].index].name; - for (var k = 0, k_len = voicelist.length; k < k_len; k++) - { - if (voicelist[k].name === nameCandidate) - { - voiceName = nameCandidate; - break; - } - } - if (voiceName !== "") - break; - } - - responsiveVoice.speak(text_init, voiceName, {onstart : StartCallback, onend : EndCallback, onerror : EndCallback}); - } - - responsiveVoice.AddEventListener("OnReady", function() { - setTimeout(function() - { - guessLanguage.info(text_init, function(info) { - //console.log('Detected Language: ' + info[2] + " [" + info[0] + "]" +"_____" +info[1]); - Run(info[0]); - }); - }, 1); - }); + guessLanguage.info(text_init, function(info) { + Run(info[0]); + }); }; + function FindVoice(lang, bSkipGoogle) { + if (!voice_name || voice_name === "Auto") { + for (var i = 0; i < voices.length; i++) { + if (langsMap[lang]) { + if (langsMap[lang].search(voices[i].lang) !== -1) { + if (bSkipGoogle && voices[i].name.search('Google') !== -1) + continue; + + voice_name = voices[i].name; + oMainVoice = voices[i]; + break; + } + } + } + if (!voice_name) { + for (var i = 0; i < voices.length; i++) { + if (langsMap[lang]) { + if (langsMap[lang].split('-')[0] === voices[i].lang.split('-')[0]) { + if (bSkipGoogle && voices[i].name.search('Google') !== -1) + continue; + + voice_name = voices[i].name; + oMainVoice = voices[i]; + break; + } + } + } + } + + if (!oMainVoice && bSkipGoogle) + FindVoice(lang, false); + if (oMainVoice) + return true; + + if ((!voice_name || voice_name === "Auto") && cyrilic.indexOf(lang) !== -1) { + voice_name = langsMap["ru"]; + bSkipGoogle = true; + } + else if (!voice_name || voice_name === "Auto") { + bSkipGoogle = true; + bDefaultLang = true; + voice_name = "en-US"; + } + } + + for(i = 0; i < voices.length ; i++) { + if(voices[i].name === voice_name && !bDefaultLang) { + if (bSkipGoogle && voices[i].name.search('Google') !== -1) + continue; + + oMainVoice = voices[i]; + break; + } + else if (voices[i].lang === voice_name) { + if (bSkipGoogle && voices[i].name.search('Google') !== -1) + continue; + + oMainVoice = voices[i]; + break; + } + } + } + + function Run(lang) + { + FindVoice(lang, true); + if (!oMainVoice) + FindVoice(lang, false); + if (!oMainVoice) { + window.Asc.plugin.executeCommand("close", ""); + return false; + } + + allParagraphs = correctSentLength(text_init.split('\n')); + createAllUtterance(); + speak(); + } + + function initVoices() { + voices = window.speechSynthesis.getVoices().sort(function (a, b) { + const aname = a.name.toUpperCase(), bname = b.name.toUpperCase(); + if ( aname < bname ) return -1; + else if ( aname == bname ) return 0; + else return +1; + }); + } + + function correctSentLength(allSentenses) { + if (isChrome && !oMainVoice.localService) + Max_Chars = 100; + + var aResult = []; + var sCurSentense, nTimes, nTempLength, nTempPos; + var sTemp = ""; + + for (var nSen = 0; nSen < allSentenses.length; nSen++) { + sCurSentense = allSentenses[nSen]; + nTempLength = 0; + if(sCurSentense.length > Max_Chars) { + aSplitSentense = []; + nTimes = Math.floor(sCurSentense.length / Max_Chars) + 1; + + for (var nTime = 0; nTime < nTimes; nTime++) { + nTempPos = -1; + sTemp = sCurSentense.slice(nTempLength, Max_Chars * (nTime + 1)); + if (sTemp === "") + break; + + if (!sTemp[sTemp.length - 1].match(new RegExp(/[.!?,;\r ]/))) { + var aMatches = Array.from(sTemp.matchAll(/[.!?;,\r]/g)); + if (aMatches.length === 0) + aMatches = Array.from(sTemp.matchAll(' ')); + + if (aMatches.length !== 0) + sTemp = sTemp.slice(0, aMatches[aMatches.length - 1].index + 1); + } + + nTempLength += sTemp.length; + sTemp.trim() !== "" && aResult.push(sTemp); + } + } + else + sCurSentense.trim() !== "" && aResult.push(sCurSentense); + } + return aResult; + } + + function resumeInfinity() { + speechSynthesis.pause(); + speechSynthesis.resume(); + timer = setTimeout(function () { + resumeInfinity() + }, 3000) + } + function clear() { clearTimeout(timer) } + + function createAllUtterance() { + var oUtterance; + for (var nTxt = 0; nTxt < allParagraphs.length; nTxt++) { + if (allParagraphs[nTxt].trim() === "") + continue; + + oUtterance = new SpeechSynthesisUtterance(allParagraphs[nTxt]); + oUtterance.voice = oMainVoice; + oUtterance.pitch = pitch; + oUtterance.rate = rate; + oUtterance.onend = onEnd; + oUtterance.onstart = onStart; + oUtterance.onerror = onError; + oUtterance.idx = nTxt; + + aAllUtterance.push(oUtterance); + } + } + + function onStart() { + console.log(this); + } + function onEnd() { + console.log('SpeechSynthesisUtterance.onend'); + if (this.idx === aAllUtterance.length - 1) { + speechSynthesis.cancel(); + window.Asc.plugin.executeCommand("close", ""); + } + else if (this.idx === curTextIdx + 9 && isChrome && !oMainVoice.localService) { + curTextIdx += 10; + clear(); + speak(); + } + } + function onError () { + console.error('SpeechSynthesisUtterance.onerror'); + speechSynthesis.cancel(); + window.Asc.plugin.executeCommand("close", ""); + } + + function speak() { + var utterThis; + speechSynthesis.cancel(); + + if (window.speechSynthesis.speaking) { + console.error('speechSynthesis.speaking'); + speechSynthesis.cancel(); + window.Asc.plugin.executeCommand("close", ""); + return; + } + + console.log(utterThis); + + if (isChrome && !oMainVoice.localService) { + for (var nUtter = curTextIdx; nUtter < curTextIdx + 10 && nUtter < aAllUtterance.length; nUtter++) { + window.speechSynthesis.speak(aAllUtterance[nUtter]); + } + + resumeInfinity(); + } + else { + for (var nUtter = curTextIdx; nUtter < aAllUtterance.length; nUtter++) { + window.speechSynthesis.speak(aAllUtterance[nUtter]); + } + } + } + + $(document).ready(function () { + initVoices(); + if (speechSynthesis.onvoiceschanged !== undefined) { + speechSynthesis.onvoiceschanged = initVoices; + } + + var saved_pitch = localStorage.getItem("plugin-speech-pitch"); + if (saved_pitch) + pitch = saved_pitch; + + var saved_rate = localStorage.getItem("plugin-speech-rate"); + if (saved_rate) + rate = saved_rate; + + var saved_voice = localStorage.getItem("plugin-speech-voice-name"); + if (saved_voice) + voice_name = saved_voice; + }); + window.Asc.plugin.button = function(id) { - if (-1 == id) - responsiveVoice.cancel(); - + speechSynthesis.cancel(); this.executeCommand("close", ""); }; + window.onunload = function() + { + speechSynthesis.cancel(); + }; })(window, undefined); \ No newline at end of file diff --git a/settings.html b/settings.html new file mode 100644 index 00000000..1f2e9050 --- /dev/null +++ b/settings.html @@ -0,0 +1,251 @@ + + + + + + Speech settings + + + + + + + + + + + + +
+
1
+
+ +
+
+
1
+ +
+
+ + \ No newline at end of file diff --git a/vendor/guessLanguage/guessLanguage.js b/vendor/guessLanguage/guessLanguage.js index 00c72cde..5b5a1898 100644 --- a/vendor/guessLanguage/guessLanguage.js +++ b/vendor/guessLanguage/guessLanguage.js @@ -43,7 +43,7 @@ } var MAX_LENGTH = 4096; - var MIN_LENGTH = 20; + var MIN_LENGTH = 1; var MAX_GRAMS = 300; var NAME_MAP = { diff --git a/vendor/select2-4.0.6-rc.1/LICENSE.md b/vendor/select2-4.0.6-rc.1/LICENSE.md new file mode 100644 index 00000000..8cb8a2b1 --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/select2-4.0.6-rc.1/README.md b/vendor/select2-4.0.6-rc.1/README.md new file mode 100644 index 00000000..6ee975d6 --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/README.md @@ -0,0 +1,123 @@ +Select2 +======= +[![Build Status][travis-ci-image]][travis-ci-status] + +Select2 is a jQuery-based replacement for select boxes. It supports searching, +remote data sets, and pagination of results. + +To get started, checkout examples and documentation at +https://select2.org/ + +Use cases +--------- +* Enhancing native selects with search. +* Enhancing native selects with a better multi-select interface. +* Loading data from JavaScript: easily load items via AJAX and have them + searchable. +* Nesting optgroups: native selects only support one level of nesting. Select2 + does not have this restriction. +* Tagging: ability to add new items on the fly. +* Working with large, remote datasets: ability to partially load a dataset based + on the search term. +* Paging of large datasets: easy support for loading more pages when the results + are scrolled to the end. +* Templating: support for custom rendering of results and selections. + +Browser compatibility +--------------------- +* IE 8+ +* Chrome 8+ +* Firefox 10+ +* Safari 3+ +* Opera 10.6+ + +Select2 is automatically tested on the following browsers. + +[![Sauce Labs Test Status][saucelabs-matrix]][saucelabs-status] + +Usage +----- +You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or +[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of +the integrations below. + +Integrations +------------ +Third party developers have created plugins for platforms which allow Select2 to be integrated more natively and quickly. For many platforms, additional plugins are not required because Select2 acts as a standard `' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + var $rendered = decorated.call(this); + + this._transferTabIndex(); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('open', function () { + self.$search.trigger('focus'); + }); + + container.on('close', function () { + self.$search.val(''); + self.$search.removeAttr('aria-activedescendant'); + self.$search.trigger('focus'); + }); + + container.on('enable', function () { + self.$search.prop('disabled', false); + + self._transferTabIndex(); + }); + + container.on('disable', function () { + self.$search.prop('disabled', true); + }); + + container.on('focus', function (evt) { + self.$search.trigger('focus'); + }); + + container.on('results:focus', function (params) { + self.$search.attr('aria-activedescendant', params.id); + }); + + this.$selection.on('focusin', '.select2-search--inline', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('focusout', '.select2-search--inline', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', '.select2-search--inline', function (evt) { + evt.stopPropagation(); + + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + + var key = evt.which; + + if (key === KEYS.BACKSPACE && self.$search.val() === '') { + var $previousChoice = self.$searchContainer + .prev('.select2-selection__choice'); + + if ($previousChoice.length > 0) { + var item = Utils.GetData($previousChoice[0], 'data'); + + self.searchRemoveChoice(item); + + evt.preventDefault(); + } + } + }); + + // Try to detect the IE version should the `documentMode` property that + // is stored on the document. This is only implemented in IE and is + // slightly cleaner than doing a user agent check. + // This property is not available in Edge, but Edge also doesn't have + // this bug. + var msie = document.documentMode; + var disableInputEvents = msie && msie <= 11; + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$selection.on( + 'input.searchcheck', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents) { + self.$selection.off('input.search input.searchcheck'); + return; + } + + // Unbind the duplicated `keyup` event + self.$selection.off('keyup.search'); + } + ); + + this.$selection.on( + 'keyup.search input.search', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents && evt.type === 'input') { + self.$selection.off('input.search input.searchcheck'); + return; + } + + var key = evt.which; + + // We can freely ignore events from modifier keys + if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { + return; + } + + // Tabbing will be handled during the `keydown` phase + if (key == KEYS.TAB) { + return; + } + + self.handleSearch(evt); + } + ); + }; + + /** + * This method will transfer the tabindex attribute from the rendered + * selection to the search box. This allows for the search box to be used as + * the primary focus instead of the selection container. + * + * @private + */ + Search.prototype._transferTabIndex = function (decorated) { + this.$search.attr('tabindex', this.$selection.attr('tabindex')); + this.$selection.attr('tabindex', '-1'); + }; + + Search.prototype.createPlaceholder = function (decorated, placeholder) { + this.$search.attr('placeholder', placeholder.text); + }; + + Search.prototype.update = function (decorated, data) { + var searchHadFocus = this.$search[0] == document.activeElement; + + this.$search.attr('placeholder', ''); + + decorated.call(this, data); + + this.$selection.find('.select2-selection__rendered') + .append(this.$searchContainer); + + this.resizeSearch(); + if (searchHadFocus) { + var isTagInput = this.$element.find('[data-select2-tag]').length; + if (isTagInput) { + // fix IE11 bug where tag input lost focus + this.$element.focus(); + } else { + this.$search.focus(); + } + } + }; + + Search.prototype.handleSearch = function () { + this.resizeSearch(); + + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.searchRemoveChoice = function (decorated, item) { + this.trigger('unselect', { + data: item + }); + + this.$search.val(item.text); + this.handleSearch(); + }; + + Search.prototype.resizeSearch = function () { + this.$search.css('width', '25px'); + + var width = ''; + + if (this.$search.attr('placeholder') !== '') { + width = this.$selection.find('.select2-selection__rendered').innerWidth(); + } else { + var minimumWidth = this.$search.val().length + 1; + + width = (minimumWidth * 0.75) + 'em'; + } + + this.$search.css('width', width); + }; + + return Search; +}); + +S2.define('select2/selection/eventRelay',[ + 'jquery' +], function ($) { + function EventRelay () { } + + EventRelay.prototype.bind = function (decorated, container, $container) { + var self = this; + var relayEvents = [ + 'open', 'opening', + 'close', 'closing', + 'select', 'selecting', + 'unselect', 'unselecting', + 'clear', 'clearing' + ]; + + var preventableEvents = [ + 'opening', 'closing', 'selecting', 'unselecting', 'clearing' + ]; + + decorated.call(this, container, $container); + + container.on('*', function (name, params) { + // Ignore events that should not be relayed + if ($.inArray(name, relayEvents) === -1) { + return; + } + + // The parameters should always be an object + params = params || {}; + + // Generate the jQuery event for the Select2 event + var evt = $.Event('select2:' + name, { + params: params + }); + + self.$element.trigger(evt); + + // Only handle preventable events if it was one + if ($.inArray(name, preventableEvents) === -1) { + return; + } + + params.prevented = evt.isDefaultPrevented(); + }); + }; + + return EventRelay; +}); + +S2.define('select2/translation',[ + 'jquery', + 'require' +], function ($, require) { + function Translation (dict) { + this.dict = dict || {}; + } + + Translation.prototype.all = function () { + return this.dict; + }; + + Translation.prototype.get = function (key) { + return this.dict[key]; + }; + + Translation.prototype.extend = function (translation) { + this.dict = $.extend({}, translation.all(), this.dict); + }; + + // Static functions + + Translation._cache = {}; + + Translation.loadPath = function (path) { + if (!(path in Translation._cache)) { + var translations = require(path); + + Translation._cache[path] = translations; + } + + return new Translation(Translation._cache[path]); + }; + + return Translation; +}); + +S2.define('select2/diacritics',[ + +], function () { + var diacritics = { + '\u24B6': 'A', + '\uFF21': 'A', + '\u00C0': 'A', + '\u00C1': 'A', + '\u00C2': 'A', + '\u1EA6': 'A', + '\u1EA4': 'A', + '\u1EAA': 'A', + '\u1EA8': 'A', + '\u00C3': 'A', + '\u0100': 'A', + '\u0102': 'A', + '\u1EB0': 'A', + '\u1EAE': 'A', + '\u1EB4': 'A', + '\u1EB2': 'A', + '\u0226': 'A', + '\u01E0': 'A', + '\u00C4': 'A', + '\u01DE': 'A', + '\u1EA2': 'A', + '\u00C5': 'A', + '\u01FA': 'A', + '\u01CD': 'A', + '\u0200': 'A', + '\u0202': 'A', + '\u1EA0': 'A', + '\u1EAC': 'A', + '\u1EB6': 'A', + '\u1E00': 'A', + '\u0104': 'A', + '\u023A': 'A', + '\u2C6F': 'A', + '\uA732': 'AA', + '\u00C6': 'AE', + '\u01FC': 'AE', + '\u01E2': 'AE', + '\uA734': 'AO', + '\uA736': 'AU', + '\uA738': 'AV', + '\uA73A': 'AV', + '\uA73C': 'AY', + '\u24B7': 'B', + '\uFF22': 'B', + '\u1E02': 'B', + '\u1E04': 'B', + '\u1E06': 'B', + '\u0243': 'B', + '\u0182': 'B', + '\u0181': 'B', + '\u24B8': 'C', + '\uFF23': 'C', + '\u0106': 'C', + '\u0108': 'C', + '\u010A': 'C', + '\u010C': 'C', + '\u00C7': 'C', + '\u1E08': 'C', + '\u0187': 'C', + '\u023B': 'C', + '\uA73E': 'C', + '\u24B9': 'D', + '\uFF24': 'D', + '\u1E0A': 'D', + '\u010E': 'D', + '\u1E0C': 'D', + '\u1E10': 'D', + '\u1E12': 'D', + '\u1E0E': 'D', + '\u0110': 'D', + '\u018B': 'D', + '\u018A': 'D', + '\u0189': 'D', + '\uA779': 'D', + '\u01F1': 'DZ', + '\u01C4': 'DZ', + '\u01F2': 'Dz', + '\u01C5': 'Dz', + '\u24BA': 'E', + '\uFF25': 'E', + '\u00C8': 'E', + '\u00C9': 'E', + '\u00CA': 'E', + '\u1EC0': 'E', + '\u1EBE': 'E', + '\u1EC4': 'E', + '\u1EC2': 'E', + '\u1EBC': 'E', + '\u0112': 'E', + '\u1E14': 'E', + '\u1E16': 'E', + '\u0114': 'E', + '\u0116': 'E', + '\u00CB': 'E', + '\u1EBA': 'E', + '\u011A': 'E', + '\u0204': 'E', + '\u0206': 'E', + '\u1EB8': 'E', + '\u1EC6': 'E', + '\u0228': 'E', + '\u1E1C': 'E', + '\u0118': 'E', + '\u1E18': 'E', + '\u1E1A': 'E', + '\u0190': 'E', + '\u018E': 'E', + '\u24BB': 'F', + '\uFF26': 'F', + '\u1E1E': 'F', + '\u0191': 'F', + '\uA77B': 'F', + '\u24BC': 'G', + '\uFF27': 'G', + '\u01F4': 'G', + '\u011C': 'G', + '\u1E20': 'G', + '\u011E': 'G', + '\u0120': 'G', + '\u01E6': 'G', + '\u0122': 'G', + '\u01E4': 'G', + '\u0193': 'G', + '\uA7A0': 'G', + '\uA77D': 'G', + '\uA77E': 'G', + '\u24BD': 'H', + '\uFF28': 'H', + '\u0124': 'H', + '\u1E22': 'H', + '\u1E26': 'H', + '\u021E': 'H', + '\u1E24': 'H', + '\u1E28': 'H', + '\u1E2A': 'H', + '\u0126': 'H', + '\u2C67': 'H', + '\u2C75': 'H', + '\uA78D': 'H', + '\u24BE': 'I', + '\uFF29': 'I', + '\u00CC': 'I', + '\u00CD': 'I', + '\u00CE': 'I', + '\u0128': 'I', + '\u012A': 'I', + '\u012C': 'I', + '\u0130': 'I', + '\u00CF': 'I', + '\u1E2E': 'I', + '\u1EC8': 'I', + '\u01CF': 'I', + '\u0208': 'I', + '\u020A': 'I', + '\u1ECA': 'I', + '\u012E': 'I', + '\u1E2C': 'I', + '\u0197': 'I', + '\u24BF': 'J', + '\uFF2A': 'J', + '\u0134': 'J', + '\u0248': 'J', + '\u24C0': 'K', + '\uFF2B': 'K', + '\u1E30': 'K', + '\u01E8': 'K', + '\u1E32': 'K', + '\u0136': 'K', + '\u1E34': 'K', + '\u0198': 'K', + '\u2C69': 'K', + '\uA740': 'K', + '\uA742': 'K', + '\uA744': 'K', + '\uA7A2': 'K', + '\u24C1': 'L', + '\uFF2C': 'L', + '\u013F': 'L', + '\u0139': 'L', + '\u013D': 'L', + '\u1E36': 'L', + '\u1E38': 'L', + '\u013B': 'L', + '\u1E3C': 'L', + '\u1E3A': 'L', + '\u0141': 'L', + '\u023D': 'L', + '\u2C62': 'L', + '\u2C60': 'L', + '\uA748': 'L', + '\uA746': 'L', + '\uA780': 'L', + '\u01C7': 'LJ', + '\u01C8': 'Lj', + '\u24C2': 'M', + '\uFF2D': 'M', + '\u1E3E': 'M', + '\u1E40': 'M', + '\u1E42': 'M', + '\u2C6E': 'M', + '\u019C': 'M', + '\u24C3': 'N', + '\uFF2E': 'N', + '\u01F8': 'N', + '\u0143': 'N', + '\u00D1': 'N', + '\u1E44': 'N', + '\u0147': 'N', + '\u1E46': 'N', + '\u0145': 'N', + '\u1E4A': 'N', + '\u1E48': 'N', + '\u0220': 'N', + '\u019D': 'N', + '\uA790': 'N', + '\uA7A4': 'N', + '\u01CA': 'NJ', + '\u01CB': 'Nj', + '\u24C4': 'O', + '\uFF2F': 'O', + '\u00D2': 'O', + '\u00D3': 'O', + '\u00D4': 'O', + '\u1ED2': 'O', + '\u1ED0': 'O', + '\u1ED6': 'O', + '\u1ED4': 'O', + '\u00D5': 'O', + '\u1E4C': 'O', + '\u022C': 'O', + '\u1E4E': 'O', + '\u014C': 'O', + '\u1E50': 'O', + '\u1E52': 'O', + '\u014E': 'O', + '\u022E': 'O', + '\u0230': 'O', + '\u00D6': 'O', + '\u022A': 'O', + '\u1ECE': 'O', + '\u0150': 'O', + '\u01D1': 'O', + '\u020C': 'O', + '\u020E': 'O', + '\u01A0': 'O', + '\u1EDC': 'O', + '\u1EDA': 'O', + '\u1EE0': 'O', + '\u1EDE': 'O', + '\u1EE2': 'O', + '\u1ECC': 'O', + '\u1ED8': 'O', + '\u01EA': 'O', + '\u01EC': 'O', + '\u00D8': 'O', + '\u01FE': 'O', + '\u0186': 'O', + '\u019F': 'O', + '\uA74A': 'O', + '\uA74C': 'O', + '\u01A2': 'OI', + '\uA74E': 'OO', + '\u0222': 'OU', + '\u24C5': 'P', + '\uFF30': 'P', + '\u1E54': 'P', + '\u1E56': 'P', + '\u01A4': 'P', + '\u2C63': 'P', + '\uA750': 'P', + '\uA752': 'P', + '\uA754': 'P', + '\u24C6': 'Q', + '\uFF31': 'Q', + '\uA756': 'Q', + '\uA758': 'Q', + '\u024A': 'Q', + '\u24C7': 'R', + '\uFF32': 'R', + '\u0154': 'R', + '\u1E58': 'R', + '\u0158': 'R', + '\u0210': 'R', + '\u0212': 'R', + '\u1E5A': 'R', + '\u1E5C': 'R', + '\u0156': 'R', + '\u1E5E': 'R', + '\u024C': 'R', + '\u2C64': 'R', + '\uA75A': 'R', + '\uA7A6': 'R', + '\uA782': 'R', + '\u24C8': 'S', + '\uFF33': 'S', + '\u1E9E': 'S', + '\u015A': 'S', + '\u1E64': 'S', + '\u015C': 'S', + '\u1E60': 'S', + '\u0160': 'S', + '\u1E66': 'S', + '\u1E62': 'S', + '\u1E68': 'S', + '\u0218': 'S', + '\u015E': 'S', + '\u2C7E': 'S', + '\uA7A8': 'S', + '\uA784': 'S', + '\u24C9': 'T', + '\uFF34': 'T', + '\u1E6A': 'T', + '\u0164': 'T', + '\u1E6C': 'T', + '\u021A': 'T', + '\u0162': 'T', + '\u1E70': 'T', + '\u1E6E': 'T', + '\u0166': 'T', + '\u01AC': 'T', + '\u01AE': 'T', + '\u023E': 'T', + '\uA786': 'T', + '\uA728': 'TZ', + '\u24CA': 'U', + '\uFF35': 'U', + '\u00D9': 'U', + '\u00DA': 'U', + '\u00DB': 'U', + '\u0168': 'U', + '\u1E78': 'U', + '\u016A': 'U', + '\u1E7A': 'U', + '\u016C': 'U', + '\u00DC': 'U', + '\u01DB': 'U', + '\u01D7': 'U', + '\u01D5': 'U', + '\u01D9': 'U', + '\u1EE6': 'U', + '\u016E': 'U', + '\u0170': 'U', + '\u01D3': 'U', + '\u0214': 'U', + '\u0216': 'U', + '\u01AF': 'U', + '\u1EEA': 'U', + '\u1EE8': 'U', + '\u1EEE': 'U', + '\u1EEC': 'U', + '\u1EF0': 'U', + '\u1EE4': 'U', + '\u1E72': 'U', + '\u0172': 'U', + '\u1E76': 'U', + '\u1E74': 'U', + '\u0244': 'U', + '\u24CB': 'V', + '\uFF36': 'V', + '\u1E7C': 'V', + '\u1E7E': 'V', + '\u01B2': 'V', + '\uA75E': 'V', + '\u0245': 'V', + '\uA760': 'VY', + '\u24CC': 'W', + '\uFF37': 'W', + '\u1E80': 'W', + '\u1E82': 'W', + '\u0174': 'W', + '\u1E86': 'W', + '\u1E84': 'W', + '\u1E88': 'W', + '\u2C72': 'W', + '\u24CD': 'X', + '\uFF38': 'X', + '\u1E8A': 'X', + '\u1E8C': 'X', + '\u24CE': 'Y', + '\uFF39': 'Y', + '\u1EF2': 'Y', + '\u00DD': 'Y', + '\u0176': 'Y', + '\u1EF8': 'Y', + '\u0232': 'Y', + '\u1E8E': 'Y', + '\u0178': 'Y', + '\u1EF6': 'Y', + '\u1EF4': 'Y', + '\u01B3': 'Y', + '\u024E': 'Y', + '\u1EFE': 'Y', + '\u24CF': 'Z', + '\uFF3A': 'Z', + '\u0179': 'Z', + '\u1E90': 'Z', + '\u017B': 'Z', + '\u017D': 'Z', + '\u1E92': 'Z', + '\u1E94': 'Z', + '\u01B5': 'Z', + '\u0224': 'Z', + '\u2C7F': 'Z', + '\u2C6B': 'Z', + '\uA762': 'Z', + '\u24D0': 'a', + '\uFF41': 'a', + '\u1E9A': 'a', + '\u00E0': 'a', + '\u00E1': 'a', + '\u00E2': 'a', + '\u1EA7': 'a', + '\u1EA5': 'a', + '\u1EAB': 'a', + '\u1EA9': 'a', + '\u00E3': 'a', + '\u0101': 'a', + '\u0103': 'a', + '\u1EB1': 'a', + '\u1EAF': 'a', + '\u1EB5': 'a', + '\u1EB3': 'a', + '\u0227': 'a', + '\u01E1': 'a', + '\u00E4': 'a', + '\u01DF': 'a', + '\u1EA3': 'a', + '\u00E5': 'a', + '\u01FB': 'a', + '\u01CE': 'a', + '\u0201': 'a', + '\u0203': 'a', + '\u1EA1': 'a', + '\u1EAD': 'a', + '\u1EB7': 'a', + '\u1E01': 'a', + '\u0105': 'a', + '\u2C65': 'a', + '\u0250': 'a', + '\uA733': 'aa', + '\u00E6': 'ae', + '\u01FD': 'ae', + '\u01E3': 'ae', + '\uA735': 'ao', + '\uA737': 'au', + '\uA739': 'av', + '\uA73B': 'av', + '\uA73D': 'ay', + '\u24D1': 'b', + '\uFF42': 'b', + '\u1E03': 'b', + '\u1E05': 'b', + '\u1E07': 'b', + '\u0180': 'b', + '\u0183': 'b', + '\u0253': 'b', + '\u24D2': 'c', + '\uFF43': 'c', + '\u0107': 'c', + '\u0109': 'c', + '\u010B': 'c', + '\u010D': 'c', + '\u00E7': 'c', + '\u1E09': 'c', + '\u0188': 'c', + '\u023C': 'c', + '\uA73F': 'c', + '\u2184': 'c', + '\u24D3': 'd', + '\uFF44': 'd', + '\u1E0B': 'd', + '\u010F': 'd', + '\u1E0D': 'd', + '\u1E11': 'd', + '\u1E13': 'd', + '\u1E0F': 'd', + '\u0111': 'd', + '\u018C': 'd', + '\u0256': 'd', + '\u0257': 'd', + '\uA77A': 'd', + '\u01F3': 'dz', + '\u01C6': 'dz', + '\u24D4': 'e', + '\uFF45': 'e', + '\u00E8': 'e', + '\u00E9': 'e', + '\u00EA': 'e', + '\u1EC1': 'e', + '\u1EBF': 'e', + '\u1EC5': 'e', + '\u1EC3': 'e', + '\u1EBD': 'e', + '\u0113': 'e', + '\u1E15': 'e', + '\u1E17': 'e', + '\u0115': 'e', + '\u0117': 'e', + '\u00EB': 'e', + '\u1EBB': 'e', + '\u011B': 'e', + '\u0205': 'e', + '\u0207': 'e', + '\u1EB9': 'e', + '\u1EC7': 'e', + '\u0229': 'e', + '\u1E1D': 'e', + '\u0119': 'e', + '\u1E19': 'e', + '\u1E1B': 'e', + '\u0247': 'e', + '\u025B': 'e', + '\u01DD': 'e', + '\u24D5': 'f', + '\uFF46': 'f', + '\u1E1F': 'f', + '\u0192': 'f', + '\uA77C': 'f', + '\u24D6': 'g', + '\uFF47': 'g', + '\u01F5': 'g', + '\u011D': 'g', + '\u1E21': 'g', + '\u011F': 'g', + '\u0121': 'g', + '\u01E7': 'g', + '\u0123': 'g', + '\u01E5': 'g', + '\u0260': 'g', + '\uA7A1': 'g', + '\u1D79': 'g', + '\uA77F': 'g', + '\u24D7': 'h', + '\uFF48': 'h', + '\u0125': 'h', + '\u1E23': 'h', + '\u1E27': 'h', + '\u021F': 'h', + '\u1E25': 'h', + '\u1E29': 'h', + '\u1E2B': 'h', + '\u1E96': 'h', + '\u0127': 'h', + '\u2C68': 'h', + '\u2C76': 'h', + '\u0265': 'h', + '\u0195': 'hv', + '\u24D8': 'i', + '\uFF49': 'i', + '\u00EC': 'i', + '\u00ED': 'i', + '\u00EE': 'i', + '\u0129': 'i', + '\u012B': 'i', + '\u012D': 'i', + '\u00EF': 'i', + '\u1E2F': 'i', + '\u1EC9': 'i', + '\u01D0': 'i', + '\u0209': 'i', + '\u020B': 'i', + '\u1ECB': 'i', + '\u012F': 'i', + '\u1E2D': 'i', + '\u0268': 'i', + '\u0131': 'i', + '\u24D9': 'j', + '\uFF4A': 'j', + '\u0135': 'j', + '\u01F0': 'j', + '\u0249': 'j', + '\u24DA': 'k', + '\uFF4B': 'k', + '\u1E31': 'k', + '\u01E9': 'k', + '\u1E33': 'k', + '\u0137': 'k', + '\u1E35': 'k', + '\u0199': 'k', + '\u2C6A': 'k', + '\uA741': 'k', + '\uA743': 'k', + '\uA745': 'k', + '\uA7A3': 'k', + '\u24DB': 'l', + '\uFF4C': 'l', + '\u0140': 'l', + '\u013A': 'l', + '\u013E': 'l', + '\u1E37': 'l', + '\u1E39': 'l', + '\u013C': 'l', + '\u1E3D': 'l', + '\u1E3B': 'l', + '\u017F': 'l', + '\u0142': 'l', + '\u019A': 'l', + '\u026B': 'l', + '\u2C61': 'l', + '\uA749': 'l', + '\uA781': 'l', + '\uA747': 'l', + '\u01C9': 'lj', + '\u24DC': 'm', + '\uFF4D': 'm', + '\u1E3F': 'm', + '\u1E41': 'm', + '\u1E43': 'm', + '\u0271': 'm', + '\u026F': 'm', + '\u24DD': 'n', + '\uFF4E': 'n', + '\u01F9': 'n', + '\u0144': 'n', + '\u00F1': 'n', + '\u1E45': 'n', + '\u0148': 'n', + '\u1E47': 'n', + '\u0146': 'n', + '\u1E4B': 'n', + '\u1E49': 'n', + '\u019E': 'n', + '\u0272': 'n', + '\u0149': 'n', + '\uA791': 'n', + '\uA7A5': 'n', + '\u01CC': 'nj', + '\u24DE': 'o', + '\uFF4F': 'o', + '\u00F2': 'o', + '\u00F3': 'o', + '\u00F4': 'o', + '\u1ED3': 'o', + '\u1ED1': 'o', + '\u1ED7': 'o', + '\u1ED5': 'o', + '\u00F5': 'o', + '\u1E4D': 'o', + '\u022D': 'o', + '\u1E4F': 'o', + '\u014D': 'o', + '\u1E51': 'o', + '\u1E53': 'o', + '\u014F': 'o', + '\u022F': 'o', + '\u0231': 'o', + '\u00F6': 'o', + '\u022B': 'o', + '\u1ECF': 'o', + '\u0151': 'o', + '\u01D2': 'o', + '\u020D': 'o', + '\u020F': 'o', + '\u01A1': 'o', + '\u1EDD': 'o', + '\u1EDB': 'o', + '\u1EE1': 'o', + '\u1EDF': 'o', + '\u1EE3': 'o', + '\u1ECD': 'o', + '\u1ED9': 'o', + '\u01EB': 'o', + '\u01ED': 'o', + '\u00F8': 'o', + '\u01FF': 'o', + '\u0254': 'o', + '\uA74B': 'o', + '\uA74D': 'o', + '\u0275': 'o', + '\u01A3': 'oi', + '\u0223': 'ou', + '\uA74F': 'oo', + '\u24DF': 'p', + '\uFF50': 'p', + '\u1E55': 'p', + '\u1E57': 'p', + '\u01A5': 'p', + '\u1D7D': 'p', + '\uA751': 'p', + '\uA753': 'p', + '\uA755': 'p', + '\u24E0': 'q', + '\uFF51': 'q', + '\u024B': 'q', + '\uA757': 'q', + '\uA759': 'q', + '\u24E1': 'r', + '\uFF52': 'r', + '\u0155': 'r', + '\u1E59': 'r', + '\u0159': 'r', + '\u0211': 'r', + '\u0213': 'r', + '\u1E5B': 'r', + '\u1E5D': 'r', + '\u0157': 'r', + '\u1E5F': 'r', + '\u024D': 'r', + '\u027D': 'r', + '\uA75B': 'r', + '\uA7A7': 'r', + '\uA783': 'r', + '\u24E2': 's', + '\uFF53': 's', + '\u00DF': 's', + '\u015B': 's', + '\u1E65': 's', + '\u015D': 's', + '\u1E61': 's', + '\u0161': 's', + '\u1E67': 's', + '\u1E63': 's', + '\u1E69': 's', + '\u0219': 's', + '\u015F': 's', + '\u023F': 's', + '\uA7A9': 's', + '\uA785': 's', + '\u1E9B': 's', + '\u24E3': 't', + '\uFF54': 't', + '\u1E6B': 't', + '\u1E97': 't', + '\u0165': 't', + '\u1E6D': 't', + '\u021B': 't', + '\u0163': 't', + '\u1E71': 't', + '\u1E6F': 't', + '\u0167': 't', + '\u01AD': 't', + '\u0288': 't', + '\u2C66': 't', + '\uA787': 't', + '\uA729': 'tz', + '\u24E4': 'u', + '\uFF55': 'u', + '\u00F9': 'u', + '\u00FA': 'u', + '\u00FB': 'u', + '\u0169': 'u', + '\u1E79': 'u', + '\u016B': 'u', + '\u1E7B': 'u', + '\u016D': 'u', + '\u00FC': 'u', + '\u01DC': 'u', + '\u01D8': 'u', + '\u01D6': 'u', + '\u01DA': 'u', + '\u1EE7': 'u', + '\u016F': 'u', + '\u0171': 'u', + '\u01D4': 'u', + '\u0215': 'u', + '\u0217': 'u', + '\u01B0': 'u', + '\u1EEB': 'u', + '\u1EE9': 'u', + '\u1EEF': 'u', + '\u1EED': 'u', + '\u1EF1': 'u', + '\u1EE5': 'u', + '\u1E73': 'u', + '\u0173': 'u', + '\u1E77': 'u', + '\u1E75': 'u', + '\u0289': 'u', + '\u24E5': 'v', + '\uFF56': 'v', + '\u1E7D': 'v', + '\u1E7F': 'v', + '\u028B': 'v', + '\uA75F': 'v', + '\u028C': 'v', + '\uA761': 'vy', + '\u24E6': 'w', + '\uFF57': 'w', + '\u1E81': 'w', + '\u1E83': 'w', + '\u0175': 'w', + '\u1E87': 'w', + '\u1E85': 'w', + '\u1E98': 'w', + '\u1E89': 'w', + '\u2C73': 'w', + '\u24E7': 'x', + '\uFF58': 'x', + '\u1E8B': 'x', + '\u1E8D': 'x', + '\u24E8': 'y', + '\uFF59': 'y', + '\u1EF3': 'y', + '\u00FD': 'y', + '\u0177': 'y', + '\u1EF9': 'y', + '\u0233': 'y', + '\u1E8F': 'y', + '\u00FF': 'y', + '\u1EF7': 'y', + '\u1E99': 'y', + '\u1EF5': 'y', + '\u01B4': 'y', + '\u024F': 'y', + '\u1EFF': 'y', + '\u24E9': 'z', + '\uFF5A': 'z', + '\u017A': 'z', + '\u1E91': 'z', + '\u017C': 'z', + '\u017E': 'z', + '\u1E93': 'z', + '\u1E95': 'z', + '\u01B6': 'z', + '\u0225': 'z', + '\u0240': 'z', + '\u2C6C': 'z', + '\uA763': 'z', + '\u0386': '\u0391', + '\u0388': '\u0395', + '\u0389': '\u0397', + '\u038A': '\u0399', + '\u03AA': '\u0399', + '\u038C': '\u039F', + '\u038E': '\u03A5', + '\u03AB': '\u03A5', + '\u038F': '\u03A9', + '\u03AC': '\u03B1', + '\u03AD': '\u03B5', + '\u03AE': '\u03B7', + '\u03AF': '\u03B9', + '\u03CA': '\u03B9', + '\u0390': '\u03B9', + '\u03CC': '\u03BF', + '\u03CD': '\u03C5', + '\u03CB': '\u03C5', + '\u03B0': '\u03C5', + '\u03C9': '\u03C9', + '\u03C2': '\u03C3' + }; + + return diacritics; +}); + +S2.define('select2/data/base',[ + '../utils' +], function (Utils) { + function BaseAdapter ($element, options) { + BaseAdapter.__super__.constructor.call(this); + } + + Utils.Extend(BaseAdapter, Utils.Observable); + + BaseAdapter.prototype.current = function (callback) { + throw new Error('The `current` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.query = function (params, callback) { + throw new Error('The `query` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.bind = function (container, $container) { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.destroy = function () { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.generateResultId = function (container, data) { + var id = container.id + '-result-'; + + id += Utils.generateChars(4); + + if (data.id != null) { + id += '-' + data.id.toString(); + } else { + id += '-' + Utils.generateChars(4); + } + return id; + }; + + return BaseAdapter; +}); + +S2.define('select2/data/select',[ + './base', + '../utils', + 'jquery' +], function (BaseAdapter, Utils, $) { + function SelectAdapter ($element, options) { + this.$element = $element; + this.options = options; + + SelectAdapter.__super__.constructor.call(this); + } + + Utils.Extend(SelectAdapter, BaseAdapter); + + SelectAdapter.prototype.current = function (callback) { + var data = []; + var self = this; + + this.$element.find(':selected').each(function () { + var $option = $(this); + + var option = self.item($option); + + data.push(option); + }); + + callback(data); + }; + + SelectAdapter.prototype.select = function (data) { + var self = this; + + data.selected = true; + + // If data.element is a DOM node, use it instead + if ($(data.element).is('option')) { + data.element.selected = true; + + this.$element.trigger('change'); + + return; + } + + if (this.$element.prop('multiple')) { + this.current(function (currentData) { + var val = []; + + data = [data]; + data.push.apply(data, currentData); + + for (var d = 0; d < data.length; d++) { + var id = data[d].id; + + if ($.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + self.$element.trigger('change'); + }); + } else { + var val = data.id; + + this.$element.val(val); + this.$element.trigger('change'); + } + }; + + SelectAdapter.prototype.unselect = function (data) { + var self = this; + + if (!this.$element.prop('multiple')) { + return; + } + + data.selected = false; + + if ($(data.element).is('option')) { + data.element.selected = false; + + this.$element.trigger('change'); + + return; + } + + this.current(function (currentData) { + var val = []; + + for (var d = 0; d < currentData.length; d++) { + var id = currentData[d].id; + + if (id !== data.id && $.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + + self.$element.trigger('change'); + }); + }; + + SelectAdapter.prototype.bind = function (container, $container) { + var self = this; + + this.container = container; + + container.on('select', function (params) { + self.select(params.data); + }); + + container.on('unselect', function (params) { + self.unselect(params.data); + }); + }; + + SelectAdapter.prototype.destroy = function () { + // Remove anything added to child elements + this.$element.find('*').each(function () { + // Remove any custom data set by Select2 + Utils.RemoveData(this); + }); + }; + + SelectAdapter.prototype.query = function (params, callback) { + var data = []; + var self = this; + + var $options = this.$element.children(); + + $options.each(function () { + var $option = $(this); + + if (!$option.is('option') && !$option.is('optgroup')) { + return; + } + + var option = self.item($option); + + var matches = self.matches(params, option); + + if (matches !== null) { + data.push(matches); + } + }); + + callback({ + results: data + }); + }; + + SelectAdapter.prototype.addOptions = function ($options) { + Utils.appendMany(this.$element, $options); + }; + + SelectAdapter.prototype.option = function (data) { + var option; + + if (data.children) { + option = document.createElement('optgroup'); + option.label = data.text; + } else { + option = document.createElement('option'); + + if (option.textContent !== undefined) { + option.textContent = data.text; + } else { + option.innerText = data.text; + } + } + + if (data.id !== undefined) { + option.value = data.id; + } + + if (data.disabled) { + option.disabled = true; + } + + if (data.selected) { + option.selected = true; + } + + if (data.title) { + option.title = data.title; + } + + var $option = $(option); + + var normalizedData = this._normalizeItem(data); + normalizedData.element = option; + + // Override the option's data with the combined data + Utils.StoreData(option, 'data', normalizedData); + + return $option; + }; + + SelectAdapter.prototype.item = function ($option) { + var data = {}; + + data = Utils.GetData($option[0], 'data'); + + if (data != null) { + return data; + } + + if ($option.is('option')) { + data = { + id: $option.val(), + text: $option.text(), + disabled: $option.prop('disabled'), + selected: $option.prop('selected'), + title: $option.prop('title') + }; + } else if ($option.is('optgroup')) { + data = { + text: $option.prop('label'), + children: [], + title: $option.prop('title') + }; + + var $children = $option.children('option'); + var children = []; + + for (var c = 0; c < $children.length; c++) { + var $child = $($children[c]); + + var child = this.item($child); + + children.push(child); + } + + data.children = children; + } + + data = this._normalizeItem(data); + data.element = $option[0]; + + Utils.StoreData($option[0], 'data', data); + + return data; + }; + + SelectAdapter.prototype._normalizeItem = function (item) { + if (item !== Object(item)) { + item = { + id: item, + text: item + }; + } + + item = $.extend({}, { + text: '' + }, item); + + var defaults = { + selected: false, + disabled: false + }; + + if (item.id != null) { + item.id = item.id.toString(); + } + + if (item.text != null) { + item.text = item.text.toString(); + } + + if (item._resultId == null && item.id && this.container != null) { + item._resultId = this.generateResultId(this.container, item); + } + + return $.extend({}, defaults, item); + }; + + SelectAdapter.prototype.matches = function (params, data) { + var matcher = this.options.get('matcher'); + + return matcher(params, data); + }; + + return SelectAdapter; +}); + +S2.define('select2/data/array',[ + './select', + '../utils', + 'jquery' +], function (SelectAdapter, Utils, $) { + function ArrayAdapter ($element, options) { + var data = options.get('data') || []; + + ArrayAdapter.__super__.constructor.call(this, $element, options); + + this.addOptions(this.convertToOptions(data)); + } + + Utils.Extend(ArrayAdapter, SelectAdapter); + + ArrayAdapter.prototype.select = function (data) { + var $option = this.$element.find('option').filter(function (i, elm) { + return elm.value == data.id.toString(); + }); + + if ($option.length === 0) { + $option = this.option(data); + + this.addOptions($option); + } + + ArrayAdapter.__super__.select.call(this, data); + }; + + ArrayAdapter.prototype.convertToOptions = function (data) { + var self = this; + + var $existing = this.$element.find('option'); + var existingIds = $existing.map(function () { + return self.item($(this)).id; + }).get(); + + var $options = []; + + // Filter out all items except for the one passed in the argument + function onlyItem (item) { + return function () { + return $(this).val() == item.id; + }; + } + + for (var d = 0; d < data.length; d++) { + var item = this._normalizeItem(data[d]); + + // Skip items which were pre-loaded, only merge the data + if ($.inArray(item.id, existingIds) >= 0) { + var $existingOption = $existing.filter(onlyItem(item)); + + var existingData = this.item($existingOption); + var newData = $.extend(true, {}, item, existingData); + + var $newOption = this.option(newData); + + $existingOption.replaceWith($newOption); + + continue; + } + + var $option = this.option(item); + + if (item.children) { + var $children = this.convertToOptions(item.children); + + Utils.appendMany($option, $children); + } + + $options.push($option); + } + + return $options; + }; + + return ArrayAdapter; +}); + +S2.define('select2/data/ajax',[ + './array', + '../utils', + 'jquery' +], function (ArrayAdapter, Utils, $) { + function AjaxAdapter ($element, options) { + this.ajaxOptions = this._applyDefaults(options.get('ajax')); + + if (this.ajaxOptions.processResults != null) { + this.processResults = this.ajaxOptions.processResults; + } + + AjaxAdapter.__super__.constructor.call(this, $element, options); + } + + Utils.Extend(AjaxAdapter, ArrayAdapter); + + AjaxAdapter.prototype._applyDefaults = function (options) { + var defaults = { + data: function (params) { + return $.extend({}, params, { + q: params.term + }); + }, + transport: function (params, success, failure) { + var $request = $.ajax(params); + + $request.then(success); + $request.fail(failure); + + return $request; + } + }; + + return $.extend({}, defaults, options, true); + }; + + AjaxAdapter.prototype.processResults = function (results) { + return results; + }; + + AjaxAdapter.prototype.query = function (params, callback) { + var matches = []; + var self = this; + + if (this._request != null) { + // JSONP requests cannot always be aborted + if ($.isFunction(this._request.abort)) { + this._request.abort(); + } + + this._request = null; + } + + var options = $.extend({ + type: 'GET' + }, this.ajaxOptions); + + if (typeof options.url === 'function') { + options.url = options.url.call(this.$element, params); + } + + if (typeof options.data === 'function') { + options.data = options.data.call(this.$element, params); + } + + function request () { + var $request = options.transport(options, function (data) { + var results = self.processResults(data, params); + + if (self.options.get('debug') && window.console && console.error) { + // Check to make sure that the response included a `results` key. + if (!results || !results.results || !$.isArray(results.results)) { + console.error( + 'Select2: The AJAX results did not return an array in the ' + + '`results` key of the response.' + ); + } + } + + callback(results); + }, function () { + // Attempt to detect if a request was aborted + // Only works if the transport exposes a status property + if ('status' in $request && + ($request.status === 0 || $request.status === '0')) { + return; + } + + self.trigger('results:message', { + message: 'errorLoading' + }); + }); + + self._request = $request; + } + + if (this.ajaxOptions.delay && params.term != null) { + if (this._queryTimeout) { + window.clearTimeout(this._queryTimeout); + } + + this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); + } else { + request(); + } + }; + + return AjaxAdapter; +}); + +S2.define('select2/data/tags',[ + 'jquery' +], function ($) { + function Tags (decorated, $element, options) { + var tags = options.get('tags'); + + var createTag = options.get('createTag'); + + if (createTag !== undefined) { + this.createTag = createTag; + } + + var insertTag = options.get('insertTag'); + + if (insertTag !== undefined) { + this.insertTag = insertTag; + } + + decorated.call(this, $element, options); + + if ($.isArray(tags)) { + for (var t = 0; t < tags.length; t++) { + var tag = tags[t]; + var item = this._normalizeItem(tag); + + var $option = this.option(item); + + this.$element.append($option); + } + } + } + + Tags.prototype.query = function (decorated, params, callback) { + var self = this; + + this._removeOldTags(); + + if (params.term == null || params.page != null) { + decorated.call(this, params, callback); + return; + } + + function wrapper (obj, child) { + var data = obj.results; + + for (var i = 0; i < data.length; i++) { + var option = data[i]; + + var checkChildren = ( + option.children != null && + !wrapper({ + results: option.children + }, true) + ); + + var optionText = (option.text || '').toUpperCase(); + var paramsTerm = (params.term || '').toUpperCase(); + + var checkText = optionText === paramsTerm; + + if (checkText || checkChildren) { + if (child) { + return false; + } + + obj.data = data; + callback(obj); + + return; + } + } + + if (child) { + return true; + } + + var tag = self.createTag(params); + + if (tag != null) { + var $option = self.option(tag); + $option.attr('data-select2-tag', true); + + self.addOptions([$option]); + + self.insertTag(data, tag); + } + + obj.results = data; + + callback(obj); + } + + decorated.call(this, params, wrapper); + }; + + Tags.prototype.createTag = function (decorated, params) { + var term = $.trim(params.term); + + if (term === '') { + return null; + } + + return { + id: term, + text: term + }; + }; + + Tags.prototype.insertTag = function (_, data, tag) { + data.unshift(tag); + }; + + Tags.prototype._removeOldTags = function (_) { + var tag = this._lastTag; + + var $options = this.$element.find('option[data-select2-tag]'); + + $options.each(function () { + if (this.selected) { + return; + } + + $(this).remove(); + }); + }; + + return Tags; +}); + +S2.define('select2/data/tokenizer',[ + 'jquery' +], function ($) { + function Tokenizer (decorated, $element, options) { + var tokenizer = options.get('tokenizer'); + + if (tokenizer !== undefined) { + this.tokenizer = tokenizer; + } + + decorated.call(this, $element, options); + } + + Tokenizer.prototype.bind = function (decorated, container, $container) { + decorated.call(this, container, $container); + + this.$search = container.dropdown.$search || container.selection.$search || + $container.find('.select2-search__field'); + }; + + Tokenizer.prototype.query = function (decorated, params, callback) { + var self = this; + + function createAndSelect (data) { + // Normalize the data object so we can use it for checks + var item = self._normalizeItem(data); + + // Check if the data object already exists as a tag + // Select it if it doesn't + var $existingOptions = self.$element.find('option').filter(function () { + return $(this).val() === item.id; + }); + + // If an existing option wasn't found for it, create the option + if (!$existingOptions.length) { + var $option = self.option(item); + $option.attr('data-select2-tag', true); + + self._removeOldTags(); + self.addOptions([$option]); + } + + // Select the item, now that we know there is an option for it + select(item); + } + + function select (data) { + self.trigger('select', { + data: data + }); + } + + params.term = params.term || ''; + + var tokenData = this.tokenizer(params, this.options, createAndSelect); + + if (tokenData.term !== params.term) { + // Replace the search term if we have the search box + if (this.$search.length) { + this.$search.val(tokenData.term); + this.$search.focus(); + } + + params.term = tokenData.term; + } + + decorated.call(this, params, callback); + }; + + Tokenizer.prototype.tokenizer = function (_, params, options, callback) { + var separators = options.get('tokenSeparators') || []; + var term = params.term; + var i = 0; + + var createTag = this.createTag || function (params) { + return { + id: params.term, + text: params.term + }; + }; + + while (i < term.length) { + var termChar = term[i]; + + if ($.inArray(termChar, separators) === -1) { + i++; + + continue; + } + + var part = term.substr(0, i); + var partParams = $.extend({}, params, { + term: part + }); + + var data = createTag(partParams); + + if (data == null) { + i++; + continue; + } + + callback(data); + + // Reset the term to not include the tokenized portion + term = term.substr(i + 1) || ''; + i = 0; + } + + return { + term: term + }; + }; + + return Tokenizer; +}); + +S2.define('select2/data/minimumInputLength',[ + +], function () { + function MinimumInputLength (decorated, $e, options) { + this.minimumInputLength = options.get('minimumInputLength'); + + decorated.call(this, $e, options); + } + + MinimumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (params.term.length < this.minimumInputLength) { + this.trigger('results:message', { + message: 'inputTooShort', + args: { + minimum: this.minimumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MinimumInputLength; +}); + +S2.define('select2/data/maximumInputLength',[ + +], function () { + function MaximumInputLength (decorated, $e, options) { + this.maximumInputLength = options.get('maximumInputLength'); + + decorated.call(this, $e, options); + } + + MaximumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (this.maximumInputLength > 0 && + params.term.length > this.maximumInputLength) { + this.trigger('results:message', { + message: 'inputTooLong', + args: { + maximum: this.maximumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MaximumInputLength; +}); + +S2.define('select2/data/maximumSelectionLength',[ + +], function (){ + function MaximumSelectionLength (decorated, $e, options) { + this.maximumSelectionLength = options.get('maximumSelectionLength'); + + decorated.call(this, $e, options); + } + + MaximumSelectionLength.prototype.query = + function (decorated, params, callback) { + var self = this; + + this.current(function (currentData) { + var count = currentData != null ? currentData.length : 0; + if (self.maximumSelectionLength > 0 && + count >= self.maximumSelectionLength) { + self.trigger('results:message', { + message: 'maximumSelected', + args: { + maximum: self.maximumSelectionLength + } + }); + return; + } + decorated.call(self, params, callback); + }); + }; + + return MaximumSelectionLength; +}); + +S2.define('select2/dropdown',[ + 'jquery', + './utils' +], function ($, Utils) { + function Dropdown ($element, options) { + this.$element = $element; + this.options = options; + + Dropdown.__super__.constructor.call(this); + } + + Utils.Extend(Dropdown, Utils.Observable); + + Dropdown.prototype.render = function () { + var $dropdown = $( + '' + + '' + + '' + ); + + $dropdown.attr('dir', this.options.get('dir')); + + this.$dropdown = $dropdown; + + return $dropdown; + }; + + Dropdown.prototype.bind = function () { + // Should be implemented in subclasses + }; + + Dropdown.prototype.position = function ($dropdown, $container) { + // Should be implmented in subclasses + }; + + Dropdown.prototype.destroy = function () { + // Remove the dropdown from the DOM + this.$dropdown.remove(); + }; + + return Dropdown; +}); + +S2.define('select2/dropdown/search',[ + 'jquery', + '../utils' +], function ($, Utils) { + function Search () { } + + Search.prototype.render = function (decorated) { + var $rendered = decorated.call(this); + + var $search = $( + '' + + '' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + $rendered.prepend($search); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + this.$search.on('keydown', function (evt) { + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + }); + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$search.on('input', function (evt) { + // Unbind the duplicated `keyup` event + $(this).off('keyup'); + }); + + this.$search.on('keyup input', function (evt) { + self.handleSearch(evt); + }); + + container.on('open', function () { + self.$search.attr('tabindex', 0); + + self.$search.focus(); + + window.setTimeout(function () { + self.$search.focus(); + }, 0); + }); + + container.on('close', function () { + self.$search.attr('tabindex', -1); + + self.$search.val(''); + self.$search.blur(); + }); + + container.on('focus', function () { + if (!container.isOpen()) { + self.$search.focus(); + } + }); + + container.on('results:all', function (params) { + if (params.query.term == null || params.query.term === '') { + var showSearch = self.showSearch(params); + + if (showSearch) { + self.$searchContainer.removeClass('select2-search--hide'); + } else { + self.$searchContainer.addClass('select2-search--hide'); + } + } + }); + }; + + Search.prototype.handleSearch = function (evt) { + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.showSearch = function (_, params) { + return true; + }; + + return Search; +}); + +S2.define('select2/dropdown/hidePlaceholder',[ + +], function () { + function HidePlaceholder (decorated, $element, options, dataAdapter) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options, dataAdapter); + } + + HidePlaceholder.prototype.append = function (decorated, data) { + data.results = this.removePlaceholder(data.results); + + decorated.call(this, data); + }; + + HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + HidePlaceholder.prototype.removePlaceholder = function (_, data) { + var modifiedData = data.slice(0); + + for (var d = data.length - 1; d >= 0; d--) { + var item = data[d]; + + if (this.placeholder.id === item.id) { + modifiedData.splice(d, 1); + } + } + + return modifiedData; + }; + + return HidePlaceholder; +}); + +S2.define('select2/dropdown/infiniteScroll',[ + 'jquery' +], function ($) { + function InfiniteScroll (decorated, $element, options, dataAdapter) { + this.lastParams = {}; + + decorated.call(this, $element, options, dataAdapter); + + this.$loadingMore = this.createLoadingMore(); + this.loading = false; + } + + InfiniteScroll.prototype.append = function (decorated, data) { + this.$loadingMore.remove(); + this.loading = false; + + decorated.call(this, data); + + if (this.showLoadingMore(data)) { + this.$results.append(this.$loadingMore); + } + }; + + InfiniteScroll.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('query', function (params) { + self.lastParams = params; + self.loading = true; + }); + + container.on('query:append', function (params) { + self.lastParams = params; + self.loading = true; + }); + + this.$results.on('scroll', function () { + var isLoadMoreVisible = $.contains( + document.documentElement, + self.$loadingMore[0] + ); + + if (self.loading || !isLoadMoreVisible) { + return; + } + + var currentOffset = self.$results.offset().top + + self.$results.outerHeight(false); + var loadingMoreOffset = self.$loadingMore.offset().top + + self.$loadingMore.outerHeight(false); + + if (currentOffset + 50 >= loadingMoreOffset) { + self.loadMore(); + } + }); + }; + + InfiniteScroll.prototype.loadMore = function () { + this.loading = true; + + var params = $.extend({}, {page: 1}, this.lastParams); + + params.page++; + + this.trigger('query:append', params); + }; + + InfiniteScroll.prototype.showLoadingMore = function (_, data) { + return data.pagination && data.pagination.more; + }; + + InfiniteScroll.prototype.createLoadingMore = function () { + var $option = $( + '
  • ' + ); + + var message = this.options.get('translations').get('loadingMore'); + + $option.html(message(this.lastParams)); + + return $option; + }; + + return InfiniteScroll; +}); + +S2.define('select2/dropdown/attachBody',[ + 'jquery', + '../utils' +], function ($, Utils) { + function AttachBody (decorated, $element, options) { + this.$dropdownParent = options.get('dropdownParent') || $(document.body); + + decorated.call(this, $element, options); + } + + AttachBody.prototype.bind = function (decorated, container, $container) { + var self = this; + + var setupResultsEvents = false; + + decorated.call(this, container, $container); + + container.on('open', function () { + self._showDropdown(); + self._attachPositioningHandler(container); + + if (!setupResultsEvents) { + setupResultsEvents = true; + + container.on('results:all', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + + container.on('results:append', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + } + }); + + container.on('close', function () { + self._hideDropdown(); + self._detachPositioningHandler(container); + }); + + this.$dropdownContainer.on('mousedown', function (evt) { + evt.stopPropagation(); + }); + }; + + AttachBody.prototype.destroy = function (decorated) { + decorated.call(this); + + this.$dropdownContainer.remove(); + }; + + AttachBody.prototype.position = function (decorated, $dropdown, $container) { + // Clone all of the container classes + $dropdown.attr('class', $container.attr('class')); + + $dropdown.removeClass('select2'); + $dropdown.addClass('select2-container--open'); + + $dropdown.css({ + position: 'absolute', + top: -999999 + }); + + this.$container = $container; + }; + + AttachBody.prototype.render = function (decorated) { + var $container = $(''); + + var $dropdown = decorated.call(this); + $container.append($dropdown); + + this.$dropdownContainer = $container; + + return $container; + }; + + AttachBody.prototype._hideDropdown = function (decorated) { + this.$dropdownContainer.detach(); + }; + + AttachBody.prototype._attachPositioningHandler = + function (decorated, container) { + var self = this; + + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.each(function () { + Utils.StoreData(this, 'select2-scroll-position', { + x: $(this).scrollLeft(), + y: $(this).scrollTop() + }); + }); + + $watchers.on(scrollEvent, function (ev) { + var position = Utils.GetData(this, 'select2-scroll-position'); + $(this).scrollTop(position.y); + }); + + $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, + function (e) { + self._positionDropdown(); + self._resizeDropdown(); + }); + }; + + AttachBody.prototype._detachPositioningHandler = + function (decorated, container) { + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.off(scrollEvent); + + $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); + }; + + AttachBody.prototype._positionDropdown = function () { + var $window = $(window); + + var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); + var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); + + var newDirection = null; + + var offset = this.$container.offset(); + + offset.bottom = offset.top + this.$container.outerHeight(false); + + var container = { + height: this.$container.outerHeight(false) + }; + + container.top = offset.top; + container.bottom = offset.top + container.height; + + var dropdown = { + height: this.$dropdown.outerHeight(false) + }; + + var viewport = { + top: $window.scrollTop(), + bottom: $window.scrollTop() + $window.height() + }; + + var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); + var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); + + var css = { + left: offset.left, + top: container.bottom + }; + + // Determine what the parent element is to use for calciulating the offset + var $offsetParent = this.$dropdownParent; + + // For statically positoned elements, we need to get the element + // that is determining the offset + if ($offsetParent.css('position') === 'static') { + $offsetParent = $offsetParent.offsetParent(); + } + + var parentOffset = $offsetParent.offset(); + + css.top -= parentOffset.top; + css.left -= parentOffset.left; + + if (!isCurrentlyAbove && !isCurrentlyBelow) { + newDirection = 'below'; + } + + if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { + newDirection = 'above'; + } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { + newDirection = 'below'; + } + + if (newDirection == 'above' || + (isCurrentlyAbove && newDirection !== 'below')) { + css.top = container.top - parentOffset.top - dropdown.height; + } + + if (newDirection != null) { + this.$dropdown + .removeClass('select2-dropdown--below select2-dropdown--above') + .addClass('select2-dropdown--' + newDirection); + this.$container + .removeClass('select2-container--below select2-container--above') + .addClass('select2-container--' + newDirection); + } + + this.$dropdownContainer.css(css); + }; + + AttachBody.prototype._resizeDropdown = function () { + var css = { + width: this.$container.outerWidth(false) + 'px' + }; + + if (this.options.get('dropdownAutoWidth')) { + css.minWidth = css.width; + css.position = 'relative'; + css.width = 'auto'; + } + + this.$dropdown.css(css); + }; + + AttachBody.prototype._showDropdown = function (decorated) { + this.$dropdownContainer.appendTo(this.$dropdownParent); + + this._positionDropdown(); + this._resizeDropdown(); + }; + + return AttachBody; +}); + +S2.define('select2/dropdown/minimumResultsForSearch',[ + +], function () { + function countResults (data) { + var count = 0; + + for (var d = 0; d < data.length; d++) { + var item = data[d]; + + if (item.children) { + count += countResults(item.children); + } else { + count++; + } + } + + return count; + } + + function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { + this.minimumResultsForSearch = options.get('minimumResultsForSearch'); + + if (this.minimumResultsForSearch < 0) { + this.minimumResultsForSearch = Infinity; + } + + decorated.call(this, $element, options, dataAdapter); + } + + MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { + if (countResults(params.data.results) < this.minimumResultsForSearch) { + return false; + } + + return decorated.call(this, params); + }; + + return MinimumResultsForSearch; +}); + +S2.define('select2/dropdown/selectOnClose',[ + '../utils' +], function (Utils) { + function SelectOnClose () { } + + SelectOnClose.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('close', function (params) { + self._handleSelectOnClose(params); + }); + }; + + SelectOnClose.prototype._handleSelectOnClose = function (_, params) { + if (params && params.originalSelect2Event != null) { + var event = params.originalSelect2Event; + + // Don't select an item if the close event was triggered from a select or + // unselect event + if (event._type === 'select' || event._type === 'unselect') { + return; + } + } + + var $highlightedResults = this.getHighlightedResults(); + + // Only select highlighted results + if ($highlightedResults.length < 1) { + return; + } + + var data = Utils.GetData($highlightedResults[0], 'data'); + + // Don't re-select already selected resulte + if ( + (data.element != null && data.element.selected) || + (data.element == null && data.selected) + ) { + return; + } + + this.trigger('select', { + data: data + }); + }; + + return SelectOnClose; +}); + +S2.define('select2/dropdown/closeOnSelect',[ + +], function () { + function CloseOnSelect () { } + + CloseOnSelect.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('select', function (evt) { + self._selectTriggered(evt); + }); + + container.on('unselect', function (evt) { + self._selectTriggered(evt); + }); + }; + + CloseOnSelect.prototype._selectTriggered = function (_, evt) { + var originalEvent = evt.originalEvent; + + // Don't close if the control key is being held + if (originalEvent && originalEvent.ctrlKey) { + return; + } + + this.trigger('close', { + originalEvent: originalEvent, + originalSelect2Event: evt + }); + }; + + return CloseOnSelect; +}); + +S2.define('select2/i18n/en',[],function () { + // English + return { + errorLoading: function () { + return 'The results could not be loaded.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Please delete ' + overChars + ' character'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Please enter ' + remainingChars + ' or more characters'; + + return message; + }, + loadingMore: function () { + return 'Loading more results…'; + }, + maximumSelected: function (args) { + var message = 'You can only select ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No results found'; + }, + searching: function () { + return 'Searching…'; + } + }; +}); + +S2.define('select2/defaults',[ + 'jquery', + 'require', + + './results', + + './selection/single', + './selection/multiple', + './selection/placeholder', + './selection/allowClear', + './selection/search', + './selection/eventRelay', + + './utils', + './translation', + './diacritics', + + './data/select', + './data/array', + './data/ajax', + './data/tags', + './data/tokenizer', + './data/minimumInputLength', + './data/maximumInputLength', + './data/maximumSelectionLength', + + './dropdown', + './dropdown/search', + './dropdown/hidePlaceholder', + './dropdown/infiniteScroll', + './dropdown/attachBody', + './dropdown/minimumResultsForSearch', + './dropdown/selectOnClose', + './dropdown/closeOnSelect', + + './i18n/en' +], function ($, require, + + ResultsList, + + SingleSelection, MultipleSelection, Placeholder, AllowClear, + SelectionSearch, EventRelay, + + Utils, Translation, DIACRITICS, + + SelectData, ArrayData, AjaxData, Tags, Tokenizer, + MinimumInputLength, MaximumInputLength, MaximumSelectionLength, + + Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, + AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, + + EnglishTranslation) { + function Defaults () { + this.reset(); + } + + Defaults.prototype.apply = function (options) { + options = $.extend(true, {}, this.defaults, options); + + if (options.dataAdapter == null) { + if (options.ajax != null) { + options.dataAdapter = AjaxData; + } else if (options.data != null) { + options.dataAdapter = ArrayData; + } else { + options.dataAdapter = SelectData; + } + + if (options.minimumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MinimumInputLength + ); + } + + if (options.maximumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumInputLength + ); + } + + if (options.maximumSelectionLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumSelectionLength + ); + } + + if (options.tags) { + options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); + } + + if (options.tokenSeparators != null || options.tokenizer != null) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Tokenizer + ); + } + + if (options.query != null) { + var Query = require(options.amdBase + 'compat/query'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Query + ); + } + + if (options.initSelection != null) { + var InitSelection = require(options.amdBase + 'compat/initSelection'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + InitSelection + ); + } + } + + if (options.resultsAdapter == null) { + options.resultsAdapter = ResultsList; + + if (options.ajax != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + InfiniteScroll + ); + } + + if (options.placeholder != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + HidePlaceholder + ); + } + + if (options.selectOnClose) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + SelectOnClose + ); + } + } + + if (options.dropdownAdapter == null) { + if (options.multiple) { + options.dropdownAdapter = Dropdown; + } else { + var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); + + options.dropdownAdapter = SearchableDropdown; + } + + if (options.minimumResultsForSearch !== 0) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + MinimumResultsForSearch + ); + } + + if (options.closeOnSelect) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + CloseOnSelect + ); + } + + if ( + options.dropdownCssClass != null || + options.dropdownCss != null || + options.adaptDropdownCssClass != null + ) { + var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + DropdownCSS + ); + } + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + AttachBody + ); + } + + if (options.selectionAdapter == null) { + if (options.multiple) { + options.selectionAdapter = MultipleSelection; + } else { + options.selectionAdapter = SingleSelection; + } + + // Add the placeholder mixin if a placeholder was specified + if (options.placeholder != null) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + Placeholder + ); + } + + if (options.allowClear) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + AllowClear + ); + } + + if (options.multiple) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + SelectionSearch + ); + } + + if ( + options.containerCssClass != null || + options.containerCss != null || + options.adaptContainerCssClass != null + ) { + var ContainerCSS = require(options.amdBase + 'compat/containerCss'); + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + ContainerCSS + ); + } + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + EventRelay + ); + } + + if (typeof options.language === 'string') { + // Check if the language is specified with a region + if (options.language.indexOf('-') > 0) { + // Extract the region information if it is included + var languageParts = options.language.split('-'); + var baseLanguage = languageParts[0]; + + options.language = [options.language, baseLanguage]; + } else { + options.language = [options.language]; + } + } + + if ($.isArray(options.language)) { + var languages = new Translation(); + options.language.push('en'); + + var languageNames = options.language; + + for (var l = 0; l < languageNames.length; l++) { + var name = languageNames[l]; + var language = {}; + + try { + // Try to load it with the original name + language = Translation.loadPath(name); + } catch (e) { + try { + // If we couldn't load it, check if it wasn't the full path + name = this.defaults.amdLanguageBase + name; + language = Translation.loadPath(name); + } catch (ex) { + // The translation could not be loaded at all. Sometimes this is + // because of a configuration problem, other times this can be + // because of how Select2 helps load all possible translation files. + if (options.debug && window.console && console.warn) { + console.warn( + 'Select2: The language file for "' + name + '" could not be ' + + 'automatically loaded. A fallback will be used instead.' + ); + } + + continue; + } + } + + languages.extend(language); + } + + options.translations = languages; + } else { + var baseTranslation = Translation.loadPath( + this.defaults.amdLanguageBase + 'en' + ); + var customTranslation = new Translation(options.language); + + customTranslation.extend(baseTranslation); + + options.translations = customTranslation; + } + + return options; + }; + + Defaults.prototype.reset = function () { + function stripDiacritics (text) { + // Used 'uni range + named function' from http://jsperf.com/diacritics/18 + function match(a) { + return DIACRITICS[a] || a; + } + + return text.replace(/[^\u0000-\u007E]/g, match); + } + + function matcher (params, data) { + // Always return the object if there is nothing to compare + if ($.trim(params.term) === '') { + return data; + } + + // Do a recursive check for options with children + if (data.children && data.children.length > 0) { + // Clone the data object if there are children + // This is required as we modify the object to remove any non-matches + var match = $.extend(true, {}, data); + + // Check each child of the option + for (var c = data.children.length - 1; c >= 0; c--) { + var child = data.children[c]; + + var matches = matcher(params, child); + + // If there wasn't a match, remove the object in the array + if (matches == null) { + match.children.splice(c, 1); + } + } + + // If any children matched, return the new object + if (match.children.length > 0) { + return match; + } + + // If there were no matching children, check just the plain object + return matcher(params, match); + } + + var original = stripDiacritics(data.text).toUpperCase(); + var term = stripDiacritics(params.term).toUpperCase(); + + // Check if the text contains the term + if (original.indexOf(term) > -1) { + return data; + } + + // If it doesn't contain the term, don't return anything + return null; + } + + this.defaults = { + amdBase: './', + amdLanguageBase: './i18n/', + closeOnSelect: true, + debug: false, + dropdownAutoWidth: false, + escapeMarkup: Utils.escapeMarkup, + language: EnglishTranslation, + matcher: matcher, + minimumInputLength: 0, + maximumInputLength: 0, + maximumSelectionLength: 0, + minimumResultsForSearch: 0, + selectOnClose: false, + sorter: function (data) { + return data; + }, + templateResult: function (result) { + return result.text; + }, + templateSelection: function (selection) { + return selection.text; + }, + theme: 'default', + width: 'resolve' + }; + }; + + Defaults.prototype.set = function (key, value) { + var camelKey = $.camelCase(key); + + var data = {}; + data[camelKey] = value; + + var convertedData = Utils._convertData(data); + + $.extend(true, this.defaults, convertedData); + }; + + var defaults = new Defaults(); + + return defaults; +}); + +S2.define('select2/options',[ + 'require', + 'jquery', + './defaults', + './utils' +], function (require, $, Defaults, Utils) { + function Options (options, $element) { + this.options = options; + + if ($element != null) { + this.fromElement($element); + } + + this.options = Defaults.apply(this.options); + + if ($element && $element.is('input')) { + var InputCompat = require(this.get('amdBase') + 'compat/inputData'); + + this.options.dataAdapter = Utils.Decorate( + this.options.dataAdapter, + InputCompat + ); + } + } + + Options.prototype.fromElement = function ($e) { + var excludedData = ['select2']; + + if (this.options.multiple == null) { + this.options.multiple = $e.prop('multiple'); + } + + if (this.options.disabled == null) { + this.options.disabled = $e.prop('disabled'); + } + + if (this.options.language == null) { + if ($e.prop('lang')) { + this.options.language = $e.prop('lang').toLowerCase(); + } else if ($e.closest('[lang]').prop('lang')) { + this.options.language = $e.closest('[lang]').prop('lang'); + } + } + + if (this.options.dir == null) { + if ($e.prop('dir')) { + this.options.dir = $e.prop('dir'); + } else if ($e.closest('[dir]').prop('dir')) { + this.options.dir = $e.closest('[dir]').prop('dir'); + } else { + this.options.dir = 'ltr'; + } + } + + $e.prop('disabled', this.options.disabled); + $e.prop('multiple', this.options.multiple); + + if (Utils.GetData($e[0], 'select2Tags')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-select2-tags` attribute has been changed to ' + + 'use the `data-data` and `data-tags="true"` attributes and will be ' + + 'removed in future versions of Select2.' + ); + } + + Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); + Utils.StoreData($e[0], 'tags', true); + } + + if (Utils.GetData($e[0], 'ajaxUrl')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-ajax-url` attribute has been changed to ' + + '`data-ajax--url` and support for the old attribute will be removed' + + ' in future versions of Select2.' + ); + } + + $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl')); + Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); + + } + + var dataset = {}; + + // Prefer the element's `dataset` attribute if it exists + // jQuery 1.x does not correctly handle data attributes with multiple dashes + if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { + dataset = $.extend(true, {}, $e[0].dataset, Utils.GetData($e[0])); + } else { + dataset = Utils.GetData($e[0]); + } + + var data = $.extend(true, {}, dataset); + + data = Utils._convertData(data); + + for (var key in data) { + if ($.inArray(key, excludedData) > -1) { + continue; + } + + if ($.isPlainObject(this.options[key])) { + $.extend(this.options[key], data[key]); + } else { + this.options[key] = data[key]; + } + } + + return this; + }; + + Options.prototype.get = function (key) { + return this.options[key]; + }; + + Options.prototype.set = function (key, val) { + this.options[key] = val; + }; + + return Options; +}); + +S2.define('select2/core',[ + 'jquery', + './options', + './utils', + './keys' +], function ($, Options, Utils, KEYS) { + var Select2 = function ($element, options) { + if (Utils.GetData($element[0], 'select2') != null) { + Utils.GetData($element[0], 'select2').destroy(); + } + + this.$element = $element; + + this.id = this._generateId($element); + + options = options || {}; + + this.options = new Options(options, $element); + + Select2.__super__.constructor.call(this); + + // Set up the tabindex + + var tabindex = $element.attr('tabindex') || 0; + Utils.StoreData($element[0], 'old-tabindex', tabindex); + $element.attr('tabindex', '-1'); + + // Set up containers and adapters + + var DataAdapter = this.options.get('dataAdapter'); + this.dataAdapter = new DataAdapter($element, this.options); + + var $container = this.render(); + + this._placeContainer($container); + + var SelectionAdapter = this.options.get('selectionAdapter'); + this.selection = new SelectionAdapter($element, this.options); + this.$selection = this.selection.render(); + + this.selection.position(this.$selection, $container); + + var DropdownAdapter = this.options.get('dropdownAdapter'); + this.dropdown = new DropdownAdapter($element, this.options); + this.$dropdown = this.dropdown.render(); + + this.dropdown.position(this.$dropdown, $container); + + var ResultsAdapter = this.options.get('resultsAdapter'); + this.results = new ResultsAdapter($element, this.options, this.dataAdapter); + this.$results = this.results.render(); + + this.results.position(this.$results, this.$dropdown); + + // Bind events + + var self = this; + + // Bind the container to all of the adapters + this._bindAdapters(); + + // Register any DOM event handlers + this._registerDomEvents(); + + // Register any internal event handlers + this._registerDataEvents(); + this._registerSelectionEvents(); + this._registerDropdownEvents(); + this._registerResultsEvents(); + this._registerEvents(); + + // Set the initial state + this.dataAdapter.current(function (initialData) { + self.trigger('selection:update', { + data: initialData + }); + }); + + // Hide the original select + $element.addClass('select2-hidden-accessible'); + $element.attr('aria-hidden', 'true'); + + // Synchronize any monitored attributes + this._syncAttributes(); + + Utils.StoreData($element[0], 'select2', this); + + // Ensure backwards compatibility with $element.data('select2'). + $element.data('select2', this); + }; + + Utils.Extend(Select2, Utils.Observable); + + Select2.prototype._generateId = function ($element) { + var id = ''; + + if ($element.attr('id') != null) { + id = $element.attr('id'); + } else if ($element.attr('name') != null) { + id = $element.attr('name') + '-' + Utils.generateChars(2); + } else { + id = Utils.generateChars(4); + } + + id = id.replace(/(:|\.|\[|\]|,)/g, ''); + id = 'select2-' + id; + + return id; + }; + + Select2.prototype._placeContainer = function ($container) { + $container.insertAfter(this.$element); + + var width = this._resolveWidth(this.$element, this.options.get('width')); + + if (width != null) { + $container.css('width', width); + } + }; + + Select2.prototype._resolveWidth = function ($element, method) { + var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; + + if (method == 'resolve') { + var styleWidth = this._resolveWidth($element, 'style'); + + if (styleWidth != null) { + return styleWidth; + } + + return this._resolveWidth($element, 'element'); + } + + if (method == 'element') { + var elementWidth = $element.outerWidth(false); + + if (elementWidth <= 0) { + return 'auto'; + } + + return elementWidth + 'px'; + } + + if (method == 'style') { + var style = $element.attr('style'); + + if (typeof(style) !== 'string') { + return null; + } + + var attrs = style.split(';'); + + for (var i = 0, l = attrs.length; i < l; i = i + 1) { + var attr = attrs[i].replace(/\s/g, ''); + var matches = attr.match(WIDTH); + + if (matches !== null && matches.length >= 1) { + return matches[1]; + } + } + + return null; + } + + return method; + }; + + Select2.prototype._bindAdapters = function () { + this.dataAdapter.bind(this, this.$container); + this.selection.bind(this, this.$container); + + this.dropdown.bind(this, this.$container); + this.results.bind(this, this.$container); + }; + + Select2.prototype._registerDomEvents = function () { + var self = this; + + this.$element.on('change.select2', function () { + self.dataAdapter.current(function (data) { + self.trigger('selection:update', { + data: data + }); + }); + }); + + this.$element.on('focus.select2', function (evt) { + self.trigger('focus', evt); + }); + + this._syncA = Utils.bind(this._syncAttributes, this); + this._syncS = Utils.bind(this._syncSubtree, this); + + if (this.$element[0].attachEvent) { + this.$element[0].attachEvent('onpropertychange', this._syncA); + } + + var observer = window.MutationObserver || + window.WebKitMutationObserver || + window.MozMutationObserver + ; + + if (observer != null) { + this._observer = new observer(function (mutations) { + $.each(mutations, self._syncA); + $.each(mutations, self._syncS); + }); + this._observer.observe(this.$element[0], { + attributes: true, + childList: true, + subtree: false + }); + } else if (this.$element[0].addEventListener) { + this.$element[0].addEventListener( + 'DOMAttrModified', + self._syncA, + false + ); + this.$element[0].addEventListener( + 'DOMNodeInserted', + self._syncS, + false + ); + this.$element[0].addEventListener( + 'DOMNodeRemoved', + self._syncS, + false + ); + } + }; + + Select2.prototype._registerDataEvents = function () { + var self = this; + + this.dataAdapter.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerSelectionEvents = function () { + var self = this; + var nonRelayEvents = ['toggle', 'focus']; + + this.selection.on('toggle', function () { + self.toggleDropdown(); + }); + + this.selection.on('focus', function (params) { + self.focus(params); + }); + + this.selection.on('*', function (name, params) { + if ($.inArray(name, nonRelayEvents) !== -1) { + return; + } + + self.trigger(name, params); + }); + }; + + Select2.prototype._registerDropdownEvents = function () { + var self = this; + + this.dropdown.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerResultsEvents = function () { + var self = this; + + this.results.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerEvents = function () { + var self = this; + + this.on('open', function () { + self.$container.addClass('select2-container--open'); + }); + + this.on('close', function () { + self.$container.removeClass('select2-container--open'); + }); + + this.on('enable', function () { + self.$container.removeClass('select2-container--disabled'); + }); + + this.on('disable', function () { + self.$container.addClass('select2-container--disabled'); + }); + + this.on('blur', function () { + self.$container.removeClass('select2-container--focus'); + }); + + this.on('query', function (params) { + if (!self.isOpen()) { + self.trigger('open', {}); + } + + this.dataAdapter.query(params, function (data) { + self.trigger('results:all', { + data: data, + query: params + }); + }); + }); + + this.on('query:append', function (params) { + this.dataAdapter.query(params, function (data) { + self.trigger('results:append', { + data: data, + query: params + }); + }); + }); + + this.on('keypress', function (evt) { + var key = evt.which; + + if (self.isOpen()) { + if (key === KEYS.ESC || key === KEYS.TAB || + (key === KEYS.UP && evt.altKey)) { + self.close(); + + evt.preventDefault(); + } else if (key === KEYS.ENTER) { + self.trigger('results:select', {}); + + evt.preventDefault(); + } else if ((key === KEYS.SPACE && evt.ctrlKey)) { + self.trigger('results:toggle', {}); + + evt.preventDefault(); + } else if (key === KEYS.UP) { + self.trigger('results:previous', {}); + + evt.preventDefault(); + } else if (key === KEYS.DOWN) { + self.trigger('results:next', {}); + + evt.preventDefault(); + } + } else { + if (key === KEYS.ENTER || key === KEYS.SPACE || + (key === KEYS.DOWN && evt.altKey)) { + self.open(); + + evt.preventDefault(); + } + } + }); + }; + + Select2.prototype._syncAttributes = function () { + this.options.set('disabled', this.$element.prop('disabled')); + + if (this.options.get('disabled')) { + if (this.isOpen()) { + this.close(); + } + + this.trigger('disable', {}); + } else { + this.trigger('enable', {}); + } + }; + + Select2.prototype._syncSubtree = function (evt, mutations) { + var changed = false; + var self = this; + + // Ignore any mutation events raised for elements that aren't options or + // optgroups. This handles the case when the select element is destroyed + if ( + evt && evt.target && ( + evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' + ) + ) { + return; + } + + if (!mutations) { + // If mutation events aren't supported, then we can only assume that the + // change affected the selections + changed = true; + } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { + for (var n = 0; n < mutations.addedNodes.length; n++) { + var node = mutations.addedNodes[n]; + + if (node.selected) { + changed = true; + } + } + } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { + changed = true; + } + + // Only re-pull the data if we think there is a change + if (changed) { + this.dataAdapter.current(function (currentData) { + self.trigger('selection:update', { + data: currentData + }); + }); + } + }; + + /** + * Override the trigger method to automatically trigger pre-events when + * there are events that can be prevented. + */ + Select2.prototype.trigger = function (name, args) { + var actualTrigger = Select2.__super__.trigger; + var preTriggerMap = { + 'open': 'opening', + 'close': 'closing', + 'select': 'selecting', + 'unselect': 'unselecting', + 'clear': 'clearing' + }; + + if (args === undefined) { + args = {}; + } + + if (name in preTriggerMap) { + var preTriggerName = preTriggerMap[name]; + var preTriggerArgs = { + prevented: false, + name: name, + args: args + }; + + actualTrigger.call(this, preTriggerName, preTriggerArgs); + + if (preTriggerArgs.prevented) { + args.prevented = true; + + return; + } + } + + actualTrigger.call(this, name, args); + }; + + Select2.prototype.toggleDropdown = function () { + if (this.options.get('disabled')) { + return; + } + + if (this.isOpen()) { + this.close(); + } else { + this.open(); + } + }; + + Select2.prototype.open = function () { + if (this.isOpen()) { + return; + } + + this.trigger('query', {}); + }; + + Select2.prototype.close = function () { + if (!this.isOpen()) { + return; + } + + this.trigger('close', {}); + }; + + Select2.prototype.isOpen = function () { + return this.$container.hasClass('select2-container--open'); + }; + + Select2.prototype.hasFocus = function () { + return this.$container.hasClass('select2-container--focus'); + }; + + Select2.prototype.focus = function (data) { + // No need to re-trigger focus events if we are already focused + if (this.hasFocus()) { + return; + } + + this.$container.addClass('select2-container--focus'); + this.trigger('focus', {}); + }; + + Select2.prototype.enable = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("enable")` method has been deprecated and will' + + ' be removed in later Select2 versions. Use $element.prop("disabled")' + + ' instead.' + ); + } + + if (args == null || args.length === 0) { + args = [true]; + } + + var disabled = !args[0]; + + this.$element.prop('disabled', disabled); + }; + + Select2.prototype.data = function () { + if (this.options.get('debug') && + arguments.length > 0 && window.console && console.warn) { + console.warn( + 'Select2: Data can no longer be set using `select2("data")`. You ' + + 'should consider setting the value instead using `$element.val()`.' + ); + } + + var data = []; + + this.dataAdapter.current(function (currentData) { + data = currentData; + }); + + return data; + }; + + Select2.prototype.val = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("val")` method has been deprecated and will be' + + ' removed in later Select2 versions. Use $element.val() instead.' + ); + } + + if (args == null || args.length === 0) { + return this.$element.val(); + } + + var newVal = args[0]; + + if ($.isArray(newVal)) { + newVal = $.map(newVal, function (obj) { + return obj.toString(); + }); + } + + this.$element.val(newVal).trigger('change'); + }; + + Select2.prototype.destroy = function () { + this.$container.remove(); + + if (this.$element[0].detachEvent) { + this.$element[0].detachEvent('onpropertychange', this._syncA); + } + + if (this._observer != null) { + this._observer.disconnect(); + this._observer = null; + } else if (this.$element[0].removeEventListener) { + this.$element[0] + .removeEventListener('DOMAttrModified', this._syncA, false); + this.$element[0] + .removeEventListener('DOMNodeInserted', this._syncS, false); + this.$element[0] + .removeEventListener('DOMNodeRemoved', this._syncS, false); + } + + this._syncA = null; + this._syncS = null; + + this.$element.off('.select2'); + this.$element.attr('tabindex', + Utils.GetData(this.$element[0], 'old-tabindex')); + + this.$element.removeClass('select2-hidden-accessible'); + this.$element.attr('aria-hidden', 'false'); + Utils.RemoveData(this.$element[0]); + this.$element.removeData('select2'); + + this.dataAdapter.destroy(); + this.selection.destroy(); + this.dropdown.destroy(); + this.results.destroy(); + + this.dataAdapter = null; + this.selection = null; + this.dropdown = null; + this.results = null; + }; + + Select2.prototype.render = function () { + var $container = $( + '' + + '' + + '' + + '' + ); + + $container.attr('dir', this.options.get('dir')); + + this.$container = $container; + + this.$container.addClass('select2-container--' + this.options.get('theme')); + + Utils.StoreData($container[0], 'element', this.$element); + + return $container; + }; + + return Select2; +}); + +S2.define('select2/compat/utils',[ + 'jquery' +], function ($) { + function syncCssClasses ($dest, $src, adapter) { + var classes, replacements = [], adapted; + + classes = $.trim($dest.attr('class')); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each(function () { + // Save all Select2 classes + if (this.indexOf('select2-') === 0) { + replacements.push(this); + } + }); + } + + classes = $.trim($src.attr('class')); + + if (classes) { + classes = '' + classes; // for IE which returns object + + $(classes.split(/\s+/)).each(function () { + // Only adapt non-Select2 classes + if (this.indexOf('select2-') !== 0) { + adapted = adapter(this); + + if (adapted != null) { + replacements.push(adapted); + } + } + }); + } + + $dest.attr('class', replacements.join(' ')); + } + + return { + syncCssClasses: syncCssClasses + }; +}); + +S2.define('select2/compat/containerCss',[ + 'jquery', + './utils' +], function ($, CompatUtils) { + // No-op CSS adapter that discards all classes by default + function _containerAdapter (clazz) { + return null; + } + + function ContainerCSS () { } + + ContainerCSS.prototype.render = function (decorated) { + var $container = decorated.call(this); + + var containerCssClass = this.options.get('containerCssClass') || ''; + + if ($.isFunction(containerCssClass)) { + containerCssClass = containerCssClass(this.$element); + } + + var containerCssAdapter = this.options.get('adaptContainerCssClass'); + containerCssAdapter = containerCssAdapter || _containerAdapter; + + if (containerCssClass.indexOf(':all:') !== -1) { + containerCssClass = containerCssClass.replace(':all:', ''); + + var _cssAdapter = containerCssAdapter; + + containerCssAdapter = function (clazz) { + var adapted = _cssAdapter(clazz); + + if (adapted != null) { + // Append the old one along with the adapted one + return adapted + ' ' + clazz; + } + + return clazz; + }; + } + + var containerCss = this.options.get('containerCss') || {}; + + if ($.isFunction(containerCss)) { + containerCss = containerCss(this.$element); + } + + CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter); + + $container.css(containerCss); + $container.addClass(containerCssClass); + + return $container; + }; + + return ContainerCSS; +}); + +S2.define('select2/compat/dropdownCss',[ + 'jquery', + './utils' +], function ($, CompatUtils) { + // No-op CSS adapter that discards all classes by default + function _dropdownAdapter (clazz) { + return null; + } + + function DropdownCSS () { } + + DropdownCSS.prototype.render = function (decorated) { + var $dropdown = decorated.call(this); + + var dropdownCssClass = this.options.get('dropdownCssClass') || ''; + + if ($.isFunction(dropdownCssClass)) { + dropdownCssClass = dropdownCssClass(this.$element); + } + + var dropdownCssAdapter = this.options.get('adaptDropdownCssClass'); + dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter; + + if (dropdownCssClass.indexOf(':all:') !== -1) { + dropdownCssClass = dropdownCssClass.replace(':all:', ''); + + var _cssAdapter = dropdownCssAdapter; + + dropdownCssAdapter = function (clazz) { + var adapted = _cssAdapter(clazz); + + if (adapted != null) { + // Append the old one along with the adapted one + return adapted + ' ' + clazz; + } + + return clazz; + }; + } + + var dropdownCss = this.options.get('dropdownCss') || {}; + + if ($.isFunction(dropdownCss)) { + dropdownCss = dropdownCss(this.$element); + } + + CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter); + + $dropdown.css(dropdownCss); + $dropdown.addClass(dropdownCssClass); + + return $dropdown; + }; + + return DropdownCSS; +}); + +S2.define('select2/compat/initSelection',[ + 'jquery' +], function ($) { + function InitSelection (decorated, $element, options) { + if (options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `initSelection` option has been deprecated in favor' + + ' of a custom data adapter that overrides the `current` method. ' + + 'This method is now called multiple times instead of a single ' + + 'time when the instance is initialized. Support will be removed ' + + 'for the `initSelection` option in future versions of Select2' + ); + } + + this.initSelection = options.get('initSelection'); + this._isInitialized = false; + + decorated.call(this, $element, options); + } + + InitSelection.prototype.current = function (decorated, callback) { + var self = this; + + if (this._isInitialized) { + decorated.call(this, callback); + + return; + } + + this.initSelection.call(null, this.$element, function (data) { + self._isInitialized = true; + + if (!$.isArray(data)) { + data = [data]; + } + + callback(data); + }); + }; + + return InitSelection; +}); + +S2.define('select2/compat/inputData',[ + 'jquery', + '../utils' +], function ($, Utils) { + function InputData (decorated, $element, options) { + this._currentData = []; + this._valueSeparator = options.get('valueSeparator') || ','; + + if ($element.prop('type') === 'hidden') { + if (options.get('debug') && console && console.warn) { + console.warn( + 'Select2: Using a hidden input with Select2 is no longer ' + + 'supported and may stop working in the future. It is recommended ' + + 'to use a `');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;if(this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c){this.$element.find("[data-select2-tag]").length?this.$element.focus():this.$search.focus()}},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
  • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery","../utils"],function(a,b){function c(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + var $rendered = decorated.call(this); + + this._transferTabIndex(); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('open', function () { + self.$search.trigger('focus'); + }); + + container.on('close', function () { + self.$search.val(''); + self.$search.removeAttr('aria-activedescendant'); + self.$search.trigger('focus'); + }); + + container.on('enable', function () { + self.$search.prop('disabled', false); + + self._transferTabIndex(); + }); + + container.on('disable', function () { + self.$search.prop('disabled', true); + }); + + container.on('focus', function (evt) { + self.$search.trigger('focus'); + }); + + container.on('results:focus', function (params) { + self.$search.attr('aria-activedescendant', params.id); + }); + + this.$selection.on('focusin', '.select2-search--inline', function (evt) { + self.trigger('focus', evt); + }); + + this.$selection.on('focusout', '.select2-search--inline', function (evt) { + self._handleBlur(evt); + }); + + this.$selection.on('keydown', '.select2-search--inline', function (evt) { + evt.stopPropagation(); + + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + + var key = evt.which; + + if (key === KEYS.BACKSPACE && self.$search.val() === '') { + var $previousChoice = self.$searchContainer + .prev('.select2-selection__choice'); + + if ($previousChoice.length > 0) { + var item = Utils.GetData($previousChoice[0], 'data'); + + self.searchRemoveChoice(item); + + evt.preventDefault(); + } + } + }); + + // Try to detect the IE version should the `documentMode` property that + // is stored on the document. This is only implemented in IE and is + // slightly cleaner than doing a user agent check. + // This property is not available in Edge, but Edge also doesn't have + // this bug. + var msie = document.documentMode; + var disableInputEvents = msie && msie <= 11; + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$selection.on( + 'input.searchcheck', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents) { + self.$selection.off('input.search input.searchcheck'); + return; + } + + // Unbind the duplicated `keyup` event + self.$selection.off('keyup.search'); + } + ); + + this.$selection.on( + 'keyup.search input.search', + '.select2-search--inline', + function (evt) { + // IE will trigger the `input` event when a placeholder is used on a + // search box. To get around this issue, we are forced to ignore all + // `input` events in IE and keep using `keyup`. + if (disableInputEvents && evt.type === 'input') { + self.$selection.off('input.search input.searchcheck'); + return; + } + + var key = evt.which; + + // We can freely ignore events from modifier keys + if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) { + return; + } + + // Tabbing will be handled during the `keydown` phase + if (key == KEYS.TAB) { + return; + } + + self.handleSearch(evt); + } + ); + }; + + /** + * This method will transfer the tabindex attribute from the rendered + * selection to the search box. This allows for the search box to be used as + * the primary focus instead of the selection container. + * + * @private + */ + Search.prototype._transferTabIndex = function (decorated) { + this.$search.attr('tabindex', this.$selection.attr('tabindex')); + this.$selection.attr('tabindex', '-1'); + }; + + Search.prototype.createPlaceholder = function (decorated, placeholder) { + this.$search.attr('placeholder', placeholder.text); + }; + + Search.prototype.update = function (decorated, data) { + var searchHadFocus = this.$search[0] == document.activeElement; + + this.$search.attr('placeholder', ''); + + decorated.call(this, data); + + this.$selection.find('.select2-selection__rendered') + .append(this.$searchContainer); + + this.resizeSearch(); + if (searchHadFocus) { + var isTagInput = this.$element.find('[data-select2-tag]').length; + if (isTagInput) { + // fix IE11 bug where tag input lost focus + this.$element.focus(); + } else { + this.$search.focus(); + } + } + }; + + Search.prototype.handleSearch = function () { + this.resizeSearch(); + + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.searchRemoveChoice = function (decorated, item) { + this.trigger('unselect', { + data: item + }); + + this.$search.val(item.text); + this.handleSearch(); + }; + + Search.prototype.resizeSearch = function () { + this.$search.css('width', '25px'); + + var width = ''; + + if (this.$search.attr('placeholder') !== '') { + width = this.$selection.find('.select2-selection__rendered').innerWidth(); + } else { + var minimumWidth = this.$search.val().length + 1; + + width = (minimumWidth * 0.75) + 'em'; + } + + this.$search.css('width', width); + }; + + return Search; +}); + +S2.define('select2/selection/eventRelay',[ + 'jquery' +], function ($) { + function EventRelay () { } + + EventRelay.prototype.bind = function (decorated, container, $container) { + var self = this; + var relayEvents = [ + 'open', 'opening', + 'close', 'closing', + 'select', 'selecting', + 'unselect', 'unselecting', + 'clear', 'clearing' + ]; + + var preventableEvents = [ + 'opening', 'closing', 'selecting', 'unselecting', 'clearing' + ]; + + decorated.call(this, container, $container); + + container.on('*', function (name, params) { + // Ignore events that should not be relayed + if ($.inArray(name, relayEvents) === -1) { + return; + } + + // The parameters should always be an object + params = params || {}; + + // Generate the jQuery event for the Select2 event + var evt = $.Event('select2:' + name, { + params: params + }); + + self.$element.trigger(evt); + + // Only handle preventable events if it was one + if ($.inArray(name, preventableEvents) === -1) { + return; + } + + params.prevented = evt.isDefaultPrevented(); + }); + }; + + return EventRelay; +}); + +S2.define('select2/translation',[ + 'jquery', + 'require' +], function ($, require) { + function Translation (dict) { + this.dict = dict || {}; + } + + Translation.prototype.all = function () { + return this.dict; + }; + + Translation.prototype.get = function (key) { + return this.dict[key]; + }; + + Translation.prototype.extend = function (translation) { + this.dict = $.extend({}, translation.all(), this.dict); + }; + + // Static functions + + Translation._cache = {}; + + Translation.loadPath = function (path) { + if (!(path in Translation._cache)) { + var translations = require(path); + + Translation._cache[path] = translations; + } + + return new Translation(Translation._cache[path]); + }; + + return Translation; +}); + +S2.define('select2/diacritics',[ + +], function () { + var diacritics = { + '\u24B6': 'A', + '\uFF21': 'A', + '\u00C0': 'A', + '\u00C1': 'A', + '\u00C2': 'A', + '\u1EA6': 'A', + '\u1EA4': 'A', + '\u1EAA': 'A', + '\u1EA8': 'A', + '\u00C3': 'A', + '\u0100': 'A', + '\u0102': 'A', + '\u1EB0': 'A', + '\u1EAE': 'A', + '\u1EB4': 'A', + '\u1EB2': 'A', + '\u0226': 'A', + '\u01E0': 'A', + '\u00C4': 'A', + '\u01DE': 'A', + '\u1EA2': 'A', + '\u00C5': 'A', + '\u01FA': 'A', + '\u01CD': 'A', + '\u0200': 'A', + '\u0202': 'A', + '\u1EA0': 'A', + '\u1EAC': 'A', + '\u1EB6': 'A', + '\u1E00': 'A', + '\u0104': 'A', + '\u023A': 'A', + '\u2C6F': 'A', + '\uA732': 'AA', + '\u00C6': 'AE', + '\u01FC': 'AE', + '\u01E2': 'AE', + '\uA734': 'AO', + '\uA736': 'AU', + '\uA738': 'AV', + '\uA73A': 'AV', + '\uA73C': 'AY', + '\u24B7': 'B', + '\uFF22': 'B', + '\u1E02': 'B', + '\u1E04': 'B', + '\u1E06': 'B', + '\u0243': 'B', + '\u0182': 'B', + '\u0181': 'B', + '\u24B8': 'C', + '\uFF23': 'C', + '\u0106': 'C', + '\u0108': 'C', + '\u010A': 'C', + '\u010C': 'C', + '\u00C7': 'C', + '\u1E08': 'C', + '\u0187': 'C', + '\u023B': 'C', + '\uA73E': 'C', + '\u24B9': 'D', + '\uFF24': 'D', + '\u1E0A': 'D', + '\u010E': 'D', + '\u1E0C': 'D', + '\u1E10': 'D', + '\u1E12': 'D', + '\u1E0E': 'D', + '\u0110': 'D', + '\u018B': 'D', + '\u018A': 'D', + '\u0189': 'D', + '\uA779': 'D', + '\u01F1': 'DZ', + '\u01C4': 'DZ', + '\u01F2': 'Dz', + '\u01C5': 'Dz', + '\u24BA': 'E', + '\uFF25': 'E', + '\u00C8': 'E', + '\u00C9': 'E', + '\u00CA': 'E', + '\u1EC0': 'E', + '\u1EBE': 'E', + '\u1EC4': 'E', + '\u1EC2': 'E', + '\u1EBC': 'E', + '\u0112': 'E', + '\u1E14': 'E', + '\u1E16': 'E', + '\u0114': 'E', + '\u0116': 'E', + '\u00CB': 'E', + '\u1EBA': 'E', + '\u011A': 'E', + '\u0204': 'E', + '\u0206': 'E', + '\u1EB8': 'E', + '\u1EC6': 'E', + '\u0228': 'E', + '\u1E1C': 'E', + '\u0118': 'E', + '\u1E18': 'E', + '\u1E1A': 'E', + '\u0190': 'E', + '\u018E': 'E', + '\u24BB': 'F', + '\uFF26': 'F', + '\u1E1E': 'F', + '\u0191': 'F', + '\uA77B': 'F', + '\u24BC': 'G', + '\uFF27': 'G', + '\u01F4': 'G', + '\u011C': 'G', + '\u1E20': 'G', + '\u011E': 'G', + '\u0120': 'G', + '\u01E6': 'G', + '\u0122': 'G', + '\u01E4': 'G', + '\u0193': 'G', + '\uA7A0': 'G', + '\uA77D': 'G', + '\uA77E': 'G', + '\u24BD': 'H', + '\uFF28': 'H', + '\u0124': 'H', + '\u1E22': 'H', + '\u1E26': 'H', + '\u021E': 'H', + '\u1E24': 'H', + '\u1E28': 'H', + '\u1E2A': 'H', + '\u0126': 'H', + '\u2C67': 'H', + '\u2C75': 'H', + '\uA78D': 'H', + '\u24BE': 'I', + '\uFF29': 'I', + '\u00CC': 'I', + '\u00CD': 'I', + '\u00CE': 'I', + '\u0128': 'I', + '\u012A': 'I', + '\u012C': 'I', + '\u0130': 'I', + '\u00CF': 'I', + '\u1E2E': 'I', + '\u1EC8': 'I', + '\u01CF': 'I', + '\u0208': 'I', + '\u020A': 'I', + '\u1ECA': 'I', + '\u012E': 'I', + '\u1E2C': 'I', + '\u0197': 'I', + '\u24BF': 'J', + '\uFF2A': 'J', + '\u0134': 'J', + '\u0248': 'J', + '\u24C0': 'K', + '\uFF2B': 'K', + '\u1E30': 'K', + '\u01E8': 'K', + '\u1E32': 'K', + '\u0136': 'K', + '\u1E34': 'K', + '\u0198': 'K', + '\u2C69': 'K', + '\uA740': 'K', + '\uA742': 'K', + '\uA744': 'K', + '\uA7A2': 'K', + '\u24C1': 'L', + '\uFF2C': 'L', + '\u013F': 'L', + '\u0139': 'L', + '\u013D': 'L', + '\u1E36': 'L', + '\u1E38': 'L', + '\u013B': 'L', + '\u1E3C': 'L', + '\u1E3A': 'L', + '\u0141': 'L', + '\u023D': 'L', + '\u2C62': 'L', + '\u2C60': 'L', + '\uA748': 'L', + '\uA746': 'L', + '\uA780': 'L', + '\u01C7': 'LJ', + '\u01C8': 'Lj', + '\u24C2': 'M', + '\uFF2D': 'M', + '\u1E3E': 'M', + '\u1E40': 'M', + '\u1E42': 'M', + '\u2C6E': 'M', + '\u019C': 'M', + '\u24C3': 'N', + '\uFF2E': 'N', + '\u01F8': 'N', + '\u0143': 'N', + '\u00D1': 'N', + '\u1E44': 'N', + '\u0147': 'N', + '\u1E46': 'N', + '\u0145': 'N', + '\u1E4A': 'N', + '\u1E48': 'N', + '\u0220': 'N', + '\u019D': 'N', + '\uA790': 'N', + '\uA7A4': 'N', + '\u01CA': 'NJ', + '\u01CB': 'Nj', + '\u24C4': 'O', + '\uFF2F': 'O', + '\u00D2': 'O', + '\u00D3': 'O', + '\u00D4': 'O', + '\u1ED2': 'O', + '\u1ED0': 'O', + '\u1ED6': 'O', + '\u1ED4': 'O', + '\u00D5': 'O', + '\u1E4C': 'O', + '\u022C': 'O', + '\u1E4E': 'O', + '\u014C': 'O', + '\u1E50': 'O', + '\u1E52': 'O', + '\u014E': 'O', + '\u022E': 'O', + '\u0230': 'O', + '\u00D6': 'O', + '\u022A': 'O', + '\u1ECE': 'O', + '\u0150': 'O', + '\u01D1': 'O', + '\u020C': 'O', + '\u020E': 'O', + '\u01A0': 'O', + '\u1EDC': 'O', + '\u1EDA': 'O', + '\u1EE0': 'O', + '\u1EDE': 'O', + '\u1EE2': 'O', + '\u1ECC': 'O', + '\u1ED8': 'O', + '\u01EA': 'O', + '\u01EC': 'O', + '\u00D8': 'O', + '\u01FE': 'O', + '\u0186': 'O', + '\u019F': 'O', + '\uA74A': 'O', + '\uA74C': 'O', + '\u01A2': 'OI', + '\uA74E': 'OO', + '\u0222': 'OU', + '\u24C5': 'P', + '\uFF30': 'P', + '\u1E54': 'P', + '\u1E56': 'P', + '\u01A4': 'P', + '\u2C63': 'P', + '\uA750': 'P', + '\uA752': 'P', + '\uA754': 'P', + '\u24C6': 'Q', + '\uFF31': 'Q', + '\uA756': 'Q', + '\uA758': 'Q', + '\u024A': 'Q', + '\u24C7': 'R', + '\uFF32': 'R', + '\u0154': 'R', + '\u1E58': 'R', + '\u0158': 'R', + '\u0210': 'R', + '\u0212': 'R', + '\u1E5A': 'R', + '\u1E5C': 'R', + '\u0156': 'R', + '\u1E5E': 'R', + '\u024C': 'R', + '\u2C64': 'R', + '\uA75A': 'R', + '\uA7A6': 'R', + '\uA782': 'R', + '\u24C8': 'S', + '\uFF33': 'S', + '\u1E9E': 'S', + '\u015A': 'S', + '\u1E64': 'S', + '\u015C': 'S', + '\u1E60': 'S', + '\u0160': 'S', + '\u1E66': 'S', + '\u1E62': 'S', + '\u1E68': 'S', + '\u0218': 'S', + '\u015E': 'S', + '\u2C7E': 'S', + '\uA7A8': 'S', + '\uA784': 'S', + '\u24C9': 'T', + '\uFF34': 'T', + '\u1E6A': 'T', + '\u0164': 'T', + '\u1E6C': 'T', + '\u021A': 'T', + '\u0162': 'T', + '\u1E70': 'T', + '\u1E6E': 'T', + '\u0166': 'T', + '\u01AC': 'T', + '\u01AE': 'T', + '\u023E': 'T', + '\uA786': 'T', + '\uA728': 'TZ', + '\u24CA': 'U', + '\uFF35': 'U', + '\u00D9': 'U', + '\u00DA': 'U', + '\u00DB': 'U', + '\u0168': 'U', + '\u1E78': 'U', + '\u016A': 'U', + '\u1E7A': 'U', + '\u016C': 'U', + '\u00DC': 'U', + '\u01DB': 'U', + '\u01D7': 'U', + '\u01D5': 'U', + '\u01D9': 'U', + '\u1EE6': 'U', + '\u016E': 'U', + '\u0170': 'U', + '\u01D3': 'U', + '\u0214': 'U', + '\u0216': 'U', + '\u01AF': 'U', + '\u1EEA': 'U', + '\u1EE8': 'U', + '\u1EEE': 'U', + '\u1EEC': 'U', + '\u1EF0': 'U', + '\u1EE4': 'U', + '\u1E72': 'U', + '\u0172': 'U', + '\u1E76': 'U', + '\u1E74': 'U', + '\u0244': 'U', + '\u24CB': 'V', + '\uFF36': 'V', + '\u1E7C': 'V', + '\u1E7E': 'V', + '\u01B2': 'V', + '\uA75E': 'V', + '\u0245': 'V', + '\uA760': 'VY', + '\u24CC': 'W', + '\uFF37': 'W', + '\u1E80': 'W', + '\u1E82': 'W', + '\u0174': 'W', + '\u1E86': 'W', + '\u1E84': 'W', + '\u1E88': 'W', + '\u2C72': 'W', + '\u24CD': 'X', + '\uFF38': 'X', + '\u1E8A': 'X', + '\u1E8C': 'X', + '\u24CE': 'Y', + '\uFF39': 'Y', + '\u1EF2': 'Y', + '\u00DD': 'Y', + '\u0176': 'Y', + '\u1EF8': 'Y', + '\u0232': 'Y', + '\u1E8E': 'Y', + '\u0178': 'Y', + '\u1EF6': 'Y', + '\u1EF4': 'Y', + '\u01B3': 'Y', + '\u024E': 'Y', + '\u1EFE': 'Y', + '\u24CF': 'Z', + '\uFF3A': 'Z', + '\u0179': 'Z', + '\u1E90': 'Z', + '\u017B': 'Z', + '\u017D': 'Z', + '\u1E92': 'Z', + '\u1E94': 'Z', + '\u01B5': 'Z', + '\u0224': 'Z', + '\u2C7F': 'Z', + '\u2C6B': 'Z', + '\uA762': 'Z', + '\u24D0': 'a', + '\uFF41': 'a', + '\u1E9A': 'a', + '\u00E0': 'a', + '\u00E1': 'a', + '\u00E2': 'a', + '\u1EA7': 'a', + '\u1EA5': 'a', + '\u1EAB': 'a', + '\u1EA9': 'a', + '\u00E3': 'a', + '\u0101': 'a', + '\u0103': 'a', + '\u1EB1': 'a', + '\u1EAF': 'a', + '\u1EB5': 'a', + '\u1EB3': 'a', + '\u0227': 'a', + '\u01E1': 'a', + '\u00E4': 'a', + '\u01DF': 'a', + '\u1EA3': 'a', + '\u00E5': 'a', + '\u01FB': 'a', + '\u01CE': 'a', + '\u0201': 'a', + '\u0203': 'a', + '\u1EA1': 'a', + '\u1EAD': 'a', + '\u1EB7': 'a', + '\u1E01': 'a', + '\u0105': 'a', + '\u2C65': 'a', + '\u0250': 'a', + '\uA733': 'aa', + '\u00E6': 'ae', + '\u01FD': 'ae', + '\u01E3': 'ae', + '\uA735': 'ao', + '\uA737': 'au', + '\uA739': 'av', + '\uA73B': 'av', + '\uA73D': 'ay', + '\u24D1': 'b', + '\uFF42': 'b', + '\u1E03': 'b', + '\u1E05': 'b', + '\u1E07': 'b', + '\u0180': 'b', + '\u0183': 'b', + '\u0253': 'b', + '\u24D2': 'c', + '\uFF43': 'c', + '\u0107': 'c', + '\u0109': 'c', + '\u010B': 'c', + '\u010D': 'c', + '\u00E7': 'c', + '\u1E09': 'c', + '\u0188': 'c', + '\u023C': 'c', + '\uA73F': 'c', + '\u2184': 'c', + '\u24D3': 'd', + '\uFF44': 'd', + '\u1E0B': 'd', + '\u010F': 'd', + '\u1E0D': 'd', + '\u1E11': 'd', + '\u1E13': 'd', + '\u1E0F': 'd', + '\u0111': 'd', + '\u018C': 'd', + '\u0256': 'd', + '\u0257': 'd', + '\uA77A': 'd', + '\u01F3': 'dz', + '\u01C6': 'dz', + '\u24D4': 'e', + '\uFF45': 'e', + '\u00E8': 'e', + '\u00E9': 'e', + '\u00EA': 'e', + '\u1EC1': 'e', + '\u1EBF': 'e', + '\u1EC5': 'e', + '\u1EC3': 'e', + '\u1EBD': 'e', + '\u0113': 'e', + '\u1E15': 'e', + '\u1E17': 'e', + '\u0115': 'e', + '\u0117': 'e', + '\u00EB': 'e', + '\u1EBB': 'e', + '\u011B': 'e', + '\u0205': 'e', + '\u0207': 'e', + '\u1EB9': 'e', + '\u1EC7': 'e', + '\u0229': 'e', + '\u1E1D': 'e', + '\u0119': 'e', + '\u1E19': 'e', + '\u1E1B': 'e', + '\u0247': 'e', + '\u025B': 'e', + '\u01DD': 'e', + '\u24D5': 'f', + '\uFF46': 'f', + '\u1E1F': 'f', + '\u0192': 'f', + '\uA77C': 'f', + '\u24D6': 'g', + '\uFF47': 'g', + '\u01F5': 'g', + '\u011D': 'g', + '\u1E21': 'g', + '\u011F': 'g', + '\u0121': 'g', + '\u01E7': 'g', + '\u0123': 'g', + '\u01E5': 'g', + '\u0260': 'g', + '\uA7A1': 'g', + '\u1D79': 'g', + '\uA77F': 'g', + '\u24D7': 'h', + '\uFF48': 'h', + '\u0125': 'h', + '\u1E23': 'h', + '\u1E27': 'h', + '\u021F': 'h', + '\u1E25': 'h', + '\u1E29': 'h', + '\u1E2B': 'h', + '\u1E96': 'h', + '\u0127': 'h', + '\u2C68': 'h', + '\u2C76': 'h', + '\u0265': 'h', + '\u0195': 'hv', + '\u24D8': 'i', + '\uFF49': 'i', + '\u00EC': 'i', + '\u00ED': 'i', + '\u00EE': 'i', + '\u0129': 'i', + '\u012B': 'i', + '\u012D': 'i', + '\u00EF': 'i', + '\u1E2F': 'i', + '\u1EC9': 'i', + '\u01D0': 'i', + '\u0209': 'i', + '\u020B': 'i', + '\u1ECB': 'i', + '\u012F': 'i', + '\u1E2D': 'i', + '\u0268': 'i', + '\u0131': 'i', + '\u24D9': 'j', + '\uFF4A': 'j', + '\u0135': 'j', + '\u01F0': 'j', + '\u0249': 'j', + '\u24DA': 'k', + '\uFF4B': 'k', + '\u1E31': 'k', + '\u01E9': 'k', + '\u1E33': 'k', + '\u0137': 'k', + '\u1E35': 'k', + '\u0199': 'k', + '\u2C6A': 'k', + '\uA741': 'k', + '\uA743': 'k', + '\uA745': 'k', + '\uA7A3': 'k', + '\u24DB': 'l', + '\uFF4C': 'l', + '\u0140': 'l', + '\u013A': 'l', + '\u013E': 'l', + '\u1E37': 'l', + '\u1E39': 'l', + '\u013C': 'l', + '\u1E3D': 'l', + '\u1E3B': 'l', + '\u017F': 'l', + '\u0142': 'l', + '\u019A': 'l', + '\u026B': 'l', + '\u2C61': 'l', + '\uA749': 'l', + '\uA781': 'l', + '\uA747': 'l', + '\u01C9': 'lj', + '\u24DC': 'm', + '\uFF4D': 'm', + '\u1E3F': 'm', + '\u1E41': 'm', + '\u1E43': 'm', + '\u0271': 'm', + '\u026F': 'm', + '\u24DD': 'n', + '\uFF4E': 'n', + '\u01F9': 'n', + '\u0144': 'n', + '\u00F1': 'n', + '\u1E45': 'n', + '\u0148': 'n', + '\u1E47': 'n', + '\u0146': 'n', + '\u1E4B': 'n', + '\u1E49': 'n', + '\u019E': 'n', + '\u0272': 'n', + '\u0149': 'n', + '\uA791': 'n', + '\uA7A5': 'n', + '\u01CC': 'nj', + '\u24DE': 'o', + '\uFF4F': 'o', + '\u00F2': 'o', + '\u00F3': 'o', + '\u00F4': 'o', + '\u1ED3': 'o', + '\u1ED1': 'o', + '\u1ED7': 'o', + '\u1ED5': 'o', + '\u00F5': 'o', + '\u1E4D': 'o', + '\u022D': 'o', + '\u1E4F': 'o', + '\u014D': 'o', + '\u1E51': 'o', + '\u1E53': 'o', + '\u014F': 'o', + '\u022F': 'o', + '\u0231': 'o', + '\u00F6': 'o', + '\u022B': 'o', + '\u1ECF': 'o', + '\u0151': 'o', + '\u01D2': 'o', + '\u020D': 'o', + '\u020F': 'o', + '\u01A1': 'o', + '\u1EDD': 'o', + '\u1EDB': 'o', + '\u1EE1': 'o', + '\u1EDF': 'o', + '\u1EE3': 'o', + '\u1ECD': 'o', + '\u1ED9': 'o', + '\u01EB': 'o', + '\u01ED': 'o', + '\u00F8': 'o', + '\u01FF': 'o', + '\u0254': 'o', + '\uA74B': 'o', + '\uA74D': 'o', + '\u0275': 'o', + '\u01A3': 'oi', + '\u0223': 'ou', + '\uA74F': 'oo', + '\u24DF': 'p', + '\uFF50': 'p', + '\u1E55': 'p', + '\u1E57': 'p', + '\u01A5': 'p', + '\u1D7D': 'p', + '\uA751': 'p', + '\uA753': 'p', + '\uA755': 'p', + '\u24E0': 'q', + '\uFF51': 'q', + '\u024B': 'q', + '\uA757': 'q', + '\uA759': 'q', + '\u24E1': 'r', + '\uFF52': 'r', + '\u0155': 'r', + '\u1E59': 'r', + '\u0159': 'r', + '\u0211': 'r', + '\u0213': 'r', + '\u1E5B': 'r', + '\u1E5D': 'r', + '\u0157': 'r', + '\u1E5F': 'r', + '\u024D': 'r', + '\u027D': 'r', + '\uA75B': 'r', + '\uA7A7': 'r', + '\uA783': 'r', + '\u24E2': 's', + '\uFF53': 's', + '\u00DF': 's', + '\u015B': 's', + '\u1E65': 's', + '\u015D': 's', + '\u1E61': 's', + '\u0161': 's', + '\u1E67': 's', + '\u1E63': 's', + '\u1E69': 's', + '\u0219': 's', + '\u015F': 's', + '\u023F': 's', + '\uA7A9': 's', + '\uA785': 's', + '\u1E9B': 's', + '\u24E3': 't', + '\uFF54': 't', + '\u1E6B': 't', + '\u1E97': 't', + '\u0165': 't', + '\u1E6D': 't', + '\u021B': 't', + '\u0163': 't', + '\u1E71': 't', + '\u1E6F': 't', + '\u0167': 't', + '\u01AD': 't', + '\u0288': 't', + '\u2C66': 't', + '\uA787': 't', + '\uA729': 'tz', + '\u24E4': 'u', + '\uFF55': 'u', + '\u00F9': 'u', + '\u00FA': 'u', + '\u00FB': 'u', + '\u0169': 'u', + '\u1E79': 'u', + '\u016B': 'u', + '\u1E7B': 'u', + '\u016D': 'u', + '\u00FC': 'u', + '\u01DC': 'u', + '\u01D8': 'u', + '\u01D6': 'u', + '\u01DA': 'u', + '\u1EE7': 'u', + '\u016F': 'u', + '\u0171': 'u', + '\u01D4': 'u', + '\u0215': 'u', + '\u0217': 'u', + '\u01B0': 'u', + '\u1EEB': 'u', + '\u1EE9': 'u', + '\u1EEF': 'u', + '\u1EED': 'u', + '\u1EF1': 'u', + '\u1EE5': 'u', + '\u1E73': 'u', + '\u0173': 'u', + '\u1E77': 'u', + '\u1E75': 'u', + '\u0289': 'u', + '\u24E5': 'v', + '\uFF56': 'v', + '\u1E7D': 'v', + '\u1E7F': 'v', + '\u028B': 'v', + '\uA75F': 'v', + '\u028C': 'v', + '\uA761': 'vy', + '\u24E6': 'w', + '\uFF57': 'w', + '\u1E81': 'w', + '\u1E83': 'w', + '\u0175': 'w', + '\u1E87': 'w', + '\u1E85': 'w', + '\u1E98': 'w', + '\u1E89': 'w', + '\u2C73': 'w', + '\u24E7': 'x', + '\uFF58': 'x', + '\u1E8B': 'x', + '\u1E8D': 'x', + '\u24E8': 'y', + '\uFF59': 'y', + '\u1EF3': 'y', + '\u00FD': 'y', + '\u0177': 'y', + '\u1EF9': 'y', + '\u0233': 'y', + '\u1E8F': 'y', + '\u00FF': 'y', + '\u1EF7': 'y', + '\u1E99': 'y', + '\u1EF5': 'y', + '\u01B4': 'y', + '\u024F': 'y', + '\u1EFF': 'y', + '\u24E9': 'z', + '\uFF5A': 'z', + '\u017A': 'z', + '\u1E91': 'z', + '\u017C': 'z', + '\u017E': 'z', + '\u1E93': 'z', + '\u1E95': 'z', + '\u01B6': 'z', + '\u0225': 'z', + '\u0240': 'z', + '\u2C6C': 'z', + '\uA763': 'z', + '\u0386': '\u0391', + '\u0388': '\u0395', + '\u0389': '\u0397', + '\u038A': '\u0399', + '\u03AA': '\u0399', + '\u038C': '\u039F', + '\u038E': '\u03A5', + '\u03AB': '\u03A5', + '\u038F': '\u03A9', + '\u03AC': '\u03B1', + '\u03AD': '\u03B5', + '\u03AE': '\u03B7', + '\u03AF': '\u03B9', + '\u03CA': '\u03B9', + '\u0390': '\u03B9', + '\u03CC': '\u03BF', + '\u03CD': '\u03C5', + '\u03CB': '\u03C5', + '\u03B0': '\u03C5', + '\u03C9': '\u03C9', + '\u03C2': '\u03C3' + }; + + return diacritics; +}); + +S2.define('select2/data/base',[ + '../utils' +], function (Utils) { + function BaseAdapter ($element, options) { + BaseAdapter.__super__.constructor.call(this); + } + + Utils.Extend(BaseAdapter, Utils.Observable); + + BaseAdapter.prototype.current = function (callback) { + throw new Error('The `current` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.query = function (params, callback) { + throw new Error('The `query` method must be defined in child classes.'); + }; + + BaseAdapter.prototype.bind = function (container, $container) { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.destroy = function () { + // Can be implemented in subclasses + }; + + BaseAdapter.prototype.generateResultId = function (container, data) { + var id = container.id + '-result-'; + + id += Utils.generateChars(4); + + if (data.id != null) { + id += '-' + data.id.toString(); + } else { + id += '-' + Utils.generateChars(4); + } + return id; + }; + + return BaseAdapter; +}); + +S2.define('select2/data/select',[ + './base', + '../utils', + 'jquery' +], function (BaseAdapter, Utils, $) { + function SelectAdapter ($element, options) { + this.$element = $element; + this.options = options; + + SelectAdapter.__super__.constructor.call(this); + } + + Utils.Extend(SelectAdapter, BaseAdapter); + + SelectAdapter.prototype.current = function (callback) { + var data = []; + var self = this; + + this.$element.find(':selected').each(function () { + var $option = $(this); + + var option = self.item($option); + + data.push(option); + }); + + callback(data); + }; + + SelectAdapter.prototype.select = function (data) { + var self = this; + + data.selected = true; + + // If data.element is a DOM node, use it instead + if ($(data.element).is('option')) { + data.element.selected = true; + + this.$element.trigger('change'); + + return; + } + + if (this.$element.prop('multiple')) { + this.current(function (currentData) { + var val = []; + + data = [data]; + data.push.apply(data, currentData); + + for (var d = 0; d < data.length; d++) { + var id = data[d].id; + + if ($.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + self.$element.trigger('change'); + }); + } else { + var val = data.id; + + this.$element.val(val); + this.$element.trigger('change'); + } + }; + + SelectAdapter.prototype.unselect = function (data) { + var self = this; + + if (!this.$element.prop('multiple')) { + return; + } + + data.selected = false; + + if ($(data.element).is('option')) { + data.element.selected = false; + + this.$element.trigger('change'); + + return; + } + + this.current(function (currentData) { + var val = []; + + for (var d = 0; d < currentData.length; d++) { + var id = currentData[d].id; + + if (id !== data.id && $.inArray(id, val) === -1) { + val.push(id); + } + } + + self.$element.val(val); + + self.$element.trigger('change'); + }); + }; + + SelectAdapter.prototype.bind = function (container, $container) { + var self = this; + + this.container = container; + + container.on('select', function (params) { + self.select(params.data); + }); + + container.on('unselect', function (params) { + self.unselect(params.data); + }); + }; + + SelectAdapter.prototype.destroy = function () { + // Remove anything added to child elements + this.$element.find('*').each(function () { + // Remove any custom data set by Select2 + Utils.RemoveData(this); + }); + }; + + SelectAdapter.prototype.query = function (params, callback) { + var data = []; + var self = this; + + var $options = this.$element.children(); + + $options.each(function () { + var $option = $(this); + + if (!$option.is('option') && !$option.is('optgroup')) { + return; + } + + var option = self.item($option); + + var matches = self.matches(params, option); + + if (matches !== null) { + data.push(matches); + } + }); + + callback({ + results: data + }); + }; + + SelectAdapter.prototype.addOptions = function ($options) { + Utils.appendMany(this.$element, $options); + }; + + SelectAdapter.prototype.option = function (data) { + var option; + + if (data.children) { + option = document.createElement('optgroup'); + option.label = data.text; + } else { + option = document.createElement('option'); + + if (option.textContent !== undefined) { + option.textContent = data.text; + } else { + option.innerText = data.text; + } + } + + if (data.id !== undefined) { + option.value = data.id; + } + + if (data.disabled) { + option.disabled = true; + } + + if (data.selected) { + option.selected = true; + } + + if (data.title) { + option.title = data.title; + } + + var $option = $(option); + + var normalizedData = this._normalizeItem(data); + normalizedData.element = option; + + // Override the option's data with the combined data + Utils.StoreData(option, 'data', normalizedData); + + return $option; + }; + + SelectAdapter.prototype.item = function ($option) { + var data = {}; + + data = Utils.GetData($option[0], 'data'); + + if (data != null) { + return data; + } + + if ($option.is('option')) { + data = { + id: $option.val(), + text: $option.text(), + disabled: $option.prop('disabled'), + selected: $option.prop('selected'), + title: $option.prop('title') + }; + } else if ($option.is('optgroup')) { + data = { + text: $option.prop('label'), + children: [], + title: $option.prop('title') + }; + + var $children = $option.children('option'); + var children = []; + + for (var c = 0; c < $children.length; c++) { + var $child = $($children[c]); + + var child = this.item($child); + + children.push(child); + } + + data.children = children; + } + + data = this._normalizeItem(data); + data.element = $option[0]; + + Utils.StoreData($option[0], 'data', data); + + return data; + }; + + SelectAdapter.prototype._normalizeItem = function (item) { + if (item !== Object(item)) { + item = { + id: item, + text: item + }; + } + + item = $.extend({}, { + text: '' + }, item); + + var defaults = { + selected: false, + disabled: false + }; + + if (item.id != null) { + item.id = item.id.toString(); + } + + if (item.text != null) { + item.text = item.text.toString(); + } + + if (item._resultId == null && item.id && this.container != null) { + item._resultId = this.generateResultId(this.container, item); + } + + return $.extend({}, defaults, item); + }; + + SelectAdapter.prototype.matches = function (params, data) { + var matcher = this.options.get('matcher'); + + return matcher(params, data); + }; + + return SelectAdapter; +}); + +S2.define('select2/data/array',[ + './select', + '../utils', + 'jquery' +], function (SelectAdapter, Utils, $) { + function ArrayAdapter ($element, options) { + var data = options.get('data') || []; + + ArrayAdapter.__super__.constructor.call(this, $element, options); + + this.addOptions(this.convertToOptions(data)); + } + + Utils.Extend(ArrayAdapter, SelectAdapter); + + ArrayAdapter.prototype.select = function (data) { + var $option = this.$element.find('option').filter(function (i, elm) { + return elm.value == data.id.toString(); + }); + + if ($option.length === 0) { + $option = this.option(data); + + this.addOptions($option); + } + + ArrayAdapter.__super__.select.call(this, data); + }; + + ArrayAdapter.prototype.convertToOptions = function (data) { + var self = this; + + var $existing = this.$element.find('option'); + var existingIds = $existing.map(function () { + return self.item($(this)).id; + }).get(); + + var $options = []; + + // Filter out all items except for the one passed in the argument + function onlyItem (item) { + return function () { + return $(this).val() == item.id; + }; + } + + for (var d = 0; d < data.length; d++) { + var item = this._normalizeItem(data[d]); + + // Skip items which were pre-loaded, only merge the data + if ($.inArray(item.id, existingIds) >= 0) { + var $existingOption = $existing.filter(onlyItem(item)); + + var existingData = this.item($existingOption); + var newData = $.extend(true, {}, item, existingData); + + var $newOption = this.option(newData); + + $existingOption.replaceWith($newOption); + + continue; + } + + var $option = this.option(item); + + if (item.children) { + var $children = this.convertToOptions(item.children); + + Utils.appendMany($option, $children); + } + + $options.push($option); + } + + return $options; + }; + + return ArrayAdapter; +}); + +S2.define('select2/data/ajax',[ + './array', + '../utils', + 'jquery' +], function (ArrayAdapter, Utils, $) { + function AjaxAdapter ($element, options) { + this.ajaxOptions = this._applyDefaults(options.get('ajax')); + + if (this.ajaxOptions.processResults != null) { + this.processResults = this.ajaxOptions.processResults; + } + + AjaxAdapter.__super__.constructor.call(this, $element, options); + } + + Utils.Extend(AjaxAdapter, ArrayAdapter); + + AjaxAdapter.prototype._applyDefaults = function (options) { + var defaults = { + data: function (params) { + return $.extend({}, params, { + q: params.term + }); + }, + transport: function (params, success, failure) { + var $request = $.ajax(params); + + $request.then(success); + $request.fail(failure); + + return $request; + } + }; + + return $.extend({}, defaults, options, true); + }; + + AjaxAdapter.prototype.processResults = function (results) { + return results; + }; + + AjaxAdapter.prototype.query = function (params, callback) { + var matches = []; + var self = this; + + if (this._request != null) { + // JSONP requests cannot always be aborted + if ($.isFunction(this._request.abort)) { + this._request.abort(); + } + + this._request = null; + } + + var options = $.extend({ + type: 'GET' + }, this.ajaxOptions); + + if (typeof options.url === 'function') { + options.url = options.url.call(this.$element, params); + } + + if (typeof options.data === 'function') { + options.data = options.data.call(this.$element, params); + } + + function request () { + var $request = options.transport(options, function (data) { + var results = self.processResults(data, params); + + if (self.options.get('debug') && window.console && console.error) { + // Check to make sure that the response included a `results` key. + if (!results || !results.results || !$.isArray(results.results)) { + console.error( + 'Select2: The AJAX results did not return an array in the ' + + '`results` key of the response.' + ); + } + } + + callback(results); + }, function () { + // Attempt to detect if a request was aborted + // Only works if the transport exposes a status property + if ('status' in $request && + ($request.status === 0 || $request.status === '0')) { + return; + } + + self.trigger('results:message', { + message: 'errorLoading' + }); + }); + + self._request = $request; + } + + if (this.ajaxOptions.delay && params.term != null) { + if (this._queryTimeout) { + window.clearTimeout(this._queryTimeout); + } + + this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay); + } else { + request(); + } + }; + + return AjaxAdapter; +}); + +S2.define('select2/data/tags',[ + 'jquery' +], function ($) { + function Tags (decorated, $element, options) { + var tags = options.get('tags'); + + var createTag = options.get('createTag'); + + if (createTag !== undefined) { + this.createTag = createTag; + } + + var insertTag = options.get('insertTag'); + + if (insertTag !== undefined) { + this.insertTag = insertTag; + } + + decorated.call(this, $element, options); + + if ($.isArray(tags)) { + for (var t = 0; t < tags.length; t++) { + var tag = tags[t]; + var item = this._normalizeItem(tag); + + var $option = this.option(item); + + this.$element.append($option); + } + } + } + + Tags.prototype.query = function (decorated, params, callback) { + var self = this; + + this._removeOldTags(); + + if (params.term == null || params.page != null) { + decorated.call(this, params, callback); + return; + } + + function wrapper (obj, child) { + var data = obj.results; + + for (var i = 0; i < data.length; i++) { + var option = data[i]; + + var checkChildren = ( + option.children != null && + !wrapper({ + results: option.children + }, true) + ); + + var optionText = (option.text || '').toUpperCase(); + var paramsTerm = (params.term || '').toUpperCase(); + + var checkText = optionText === paramsTerm; + + if (checkText || checkChildren) { + if (child) { + return false; + } + + obj.data = data; + callback(obj); + + return; + } + } + + if (child) { + return true; + } + + var tag = self.createTag(params); + + if (tag != null) { + var $option = self.option(tag); + $option.attr('data-select2-tag', true); + + self.addOptions([$option]); + + self.insertTag(data, tag); + } + + obj.results = data; + + callback(obj); + } + + decorated.call(this, params, wrapper); + }; + + Tags.prototype.createTag = function (decorated, params) { + var term = $.trim(params.term); + + if (term === '') { + return null; + } + + return { + id: term, + text: term + }; + }; + + Tags.prototype.insertTag = function (_, data, tag) { + data.unshift(tag); + }; + + Tags.prototype._removeOldTags = function (_) { + var tag = this._lastTag; + + var $options = this.$element.find('option[data-select2-tag]'); + + $options.each(function () { + if (this.selected) { + return; + } + + $(this).remove(); + }); + }; + + return Tags; +}); + +S2.define('select2/data/tokenizer',[ + 'jquery' +], function ($) { + function Tokenizer (decorated, $element, options) { + var tokenizer = options.get('tokenizer'); + + if (tokenizer !== undefined) { + this.tokenizer = tokenizer; + } + + decorated.call(this, $element, options); + } + + Tokenizer.prototype.bind = function (decorated, container, $container) { + decorated.call(this, container, $container); + + this.$search = container.dropdown.$search || container.selection.$search || + $container.find('.select2-search__field'); + }; + + Tokenizer.prototype.query = function (decorated, params, callback) { + var self = this; + + function createAndSelect (data) { + // Normalize the data object so we can use it for checks + var item = self._normalizeItem(data); + + // Check if the data object already exists as a tag + // Select it if it doesn't + var $existingOptions = self.$element.find('option').filter(function () { + return $(this).val() === item.id; + }); + + // If an existing option wasn't found for it, create the option + if (!$existingOptions.length) { + var $option = self.option(item); + $option.attr('data-select2-tag', true); + + self._removeOldTags(); + self.addOptions([$option]); + } + + // Select the item, now that we know there is an option for it + select(item); + } + + function select (data) { + self.trigger('select', { + data: data + }); + } + + params.term = params.term || ''; + + var tokenData = this.tokenizer(params, this.options, createAndSelect); + + if (tokenData.term !== params.term) { + // Replace the search term if we have the search box + if (this.$search.length) { + this.$search.val(tokenData.term); + this.$search.focus(); + } + + params.term = tokenData.term; + } + + decorated.call(this, params, callback); + }; + + Tokenizer.prototype.tokenizer = function (_, params, options, callback) { + var separators = options.get('tokenSeparators') || []; + var term = params.term; + var i = 0; + + var createTag = this.createTag || function (params) { + return { + id: params.term, + text: params.term + }; + }; + + while (i < term.length) { + var termChar = term[i]; + + if ($.inArray(termChar, separators) === -1) { + i++; + + continue; + } + + var part = term.substr(0, i); + var partParams = $.extend({}, params, { + term: part + }); + + var data = createTag(partParams); + + if (data == null) { + i++; + continue; + } + + callback(data); + + // Reset the term to not include the tokenized portion + term = term.substr(i + 1) || ''; + i = 0; + } + + return { + term: term + }; + }; + + return Tokenizer; +}); + +S2.define('select2/data/minimumInputLength',[ + +], function () { + function MinimumInputLength (decorated, $e, options) { + this.minimumInputLength = options.get('minimumInputLength'); + + decorated.call(this, $e, options); + } + + MinimumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (params.term.length < this.minimumInputLength) { + this.trigger('results:message', { + message: 'inputTooShort', + args: { + minimum: this.minimumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MinimumInputLength; +}); + +S2.define('select2/data/maximumInputLength',[ + +], function () { + function MaximumInputLength (decorated, $e, options) { + this.maximumInputLength = options.get('maximumInputLength'); + + decorated.call(this, $e, options); + } + + MaximumInputLength.prototype.query = function (decorated, params, callback) { + params.term = params.term || ''; + + if (this.maximumInputLength > 0 && + params.term.length > this.maximumInputLength) { + this.trigger('results:message', { + message: 'inputTooLong', + args: { + maximum: this.maximumInputLength, + input: params.term, + params: params + } + }); + + return; + } + + decorated.call(this, params, callback); + }; + + return MaximumInputLength; +}); + +S2.define('select2/data/maximumSelectionLength',[ + +], function (){ + function MaximumSelectionLength (decorated, $e, options) { + this.maximumSelectionLength = options.get('maximumSelectionLength'); + + decorated.call(this, $e, options); + } + + MaximumSelectionLength.prototype.query = + function (decorated, params, callback) { + var self = this; + + this.current(function (currentData) { + var count = currentData != null ? currentData.length : 0; + if (self.maximumSelectionLength > 0 && + count >= self.maximumSelectionLength) { + self.trigger('results:message', { + message: 'maximumSelected', + args: { + maximum: self.maximumSelectionLength + } + }); + return; + } + decorated.call(self, params, callback); + }); + }; + + return MaximumSelectionLength; +}); + +S2.define('select2/dropdown',[ + 'jquery', + './utils' +], function ($, Utils) { + function Dropdown ($element, options) { + this.$element = $element; + this.options = options; + + Dropdown.__super__.constructor.call(this); + } + + Utils.Extend(Dropdown, Utils.Observable); + + Dropdown.prototype.render = function () { + var $dropdown = $( + '' + + '' + + '' + ); + + $dropdown.attr('dir', this.options.get('dir')); + + this.$dropdown = $dropdown; + + return $dropdown; + }; + + Dropdown.prototype.bind = function () { + // Should be implemented in subclasses + }; + + Dropdown.prototype.position = function ($dropdown, $container) { + // Should be implmented in subclasses + }; + + Dropdown.prototype.destroy = function () { + // Remove the dropdown from the DOM + this.$dropdown.remove(); + }; + + return Dropdown; +}); + +S2.define('select2/dropdown/search',[ + 'jquery', + '../utils' +], function ($, Utils) { + function Search () { } + + Search.prototype.render = function (decorated) { + var $rendered = decorated.call(this); + + var $search = $( + '' + + '' + + '' + ); + + this.$searchContainer = $search; + this.$search = $search.find('input'); + + $rendered.prepend($search); + + return $rendered; + }; + + Search.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + this.$search.on('keydown', function (evt) { + self.trigger('keypress', evt); + + self._keyUpPrevented = evt.isDefaultPrevented(); + }); + + // Workaround for browsers which do not support the `input` event + // This will prevent double-triggering of events for browsers which support + // both the `keyup` and `input` events. + this.$search.on('input', function (evt) { + // Unbind the duplicated `keyup` event + $(this).off('keyup'); + }); + + this.$search.on('keyup input', function (evt) { + self.handleSearch(evt); + }); + + container.on('open', function () { + self.$search.attr('tabindex', 0); + + self.$search.focus(); + + window.setTimeout(function () { + self.$search.focus(); + }, 0); + }); + + container.on('close', function () { + self.$search.attr('tabindex', -1); + + self.$search.val(''); + self.$search.blur(); + }); + + container.on('focus', function () { + if (!container.isOpen()) { + self.$search.focus(); + } + }); + + container.on('results:all', function (params) { + if (params.query.term == null || params.query.term === '') { + var showSearch = self.showSearch(params); + + if (showSearch) { + self.$searchContainer.removeClass('select2-search--hide'); + } else { + self.$searchContainer.addClass('select2-search--hide'); + } + } + }); + }; + + Search.prototype.handleSearch = function (evt) { + if (!this._keyUpPrevented) { + var input = this.$search.val(); + + this.trigger('query', { + term: input + }); + } + + this._keyUpPrevented = false; + }; + + Search.prototype.showSearch = function (_, params) { + return true; + }; + + return Search; +}); + +S2.define('select2/dropdown/hidePlaceholder',[ + +], function () { + function HidePlaceholder (decorated, $element, options, dataAdapter) { + this.placeholder = this.normalizePlaceholder(options.get('placeholder')); + + decorated.call(this, $element, options, dataAdapter); + } + + HidePlaceholder.prototype.append = function (decorated, data) { + data.results = this.removePlaceholder(data.results); + + decorated.call(this, data); + }; + + HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) { + if (typeof placeholder === 'string') { + placeholder = { + id: '', + text: placeholder + }; + } + + return placeholder; + }; + + HidePlaceholder.prototype.removePlaceholder = function (_, data) { + var modifiedData = data.slice(0); + + for (var d = data.length - 1; d >= 0; d--) { + var item = data[d]; + + if (this.placeholder.id === item.id) { + modifiedData.splice(d, 1); + } + } + + return modifiedData; + }; + + return HidePlaceholder; +}); + +S2.define('select2/dropdown/infiniteScroll',[ + 'jquery' +], function ($) { + function InfiniteScroll (decorated, $element, options, dataAdapter) { + this.lastParams = {}; + + decorated.call(this, $element, options, dataAdapter); + + this.$loadingMore = this.createLoadingMore(); + this.loading = false; + } + + InfiniteScroll.prototype.append = function (decorated, data) { + this.$loadingMore.remove(); + this.loading = false; + + decorated.call(this, data); + + if (this.showLoadingMore(data)) { + this.$results.append(this.$loadingMore); + } + }; + + InfiniteScroll.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('query', function (params) { + self.lastParams = params; + self.loading = true; + }); + + container.on('query:append', function (params) { + self.lastParams = params; + self.loading = true; + }); + + this.$results.on('scroll', function () { + var isLoadMoreVisible = $.contains( + document.documentElement, + self.$loadingMore[0] + ); + + if (self.loading || !isLoadMoreVisible) { + return; + } + + var currentOffset = self.$results.offset().top + + self.$results.outerHeight(false); + var loadingMoreOffset = self.$loadingMore.offset().top + + self.$loadingMore.outerHeight(false); + + if (currentOffset + 50 >= loadingMoreOffset) { + self.loadMore(); + } + }); + }; + + InfiniteScroll.prototype.loadMore = function () { + this.loading = true; + + var params = $.extend({}, {page: 1}, this.lastParams); + + params.page++; + + this.trigger('query:append', params); + }; + + InfiniteScroll.prototype.showLoadingMore = function (_, data) { + return data.pagination && data.pagination.more; + }; + + InfiniteScroll.prototype.createLoadingMore = function () { + var $option = $( + '
  • ' + ); + + var message = this.options.get('translations').get('loadingMore'); + + $option.html(message(this.lastParams)); + + return $option; + }; + + return InfiniteScroll; +}); + +S2.define('select2/dropdown/attachBody',[ + 'jquery', + '../utils' +], function ($, Utils) { + function AttachBody (decorated, $element, options) { + this.$dropdownParent = options.get('dropdownParent') || $(document.body); + + decorated.call(this, $element, options); + } + + AttachBody.prototype.bind = function (decorated, container, $container) { + var self = this; + + var setupResultsEvents = false; + + decorated.call(this, container, $container); + + container.on('open', function () { + self._showDropdown(); + self._attachPositioningHandler(container); + + if (!setupResultsEvents) { + setupResultsEvents = true; + + container.on('results:all', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + + container.on('results:append', function () { + self._positionDropdown(); + self._resizeDropdown(); + }); + } + }); + + container.on('close', function () { + self._hideDropdown(); + self._detachPositioningHandler(container); + }); + + this.$dropdownContainer.on('mousedown', function (evt) { + evt.stopPropagation(); + }); + }; + + AttachBody.prototype.destroy = function (decorated) { + decorated.call(this); + + this.$dropdownContainer.remove(); + }; + + AttachBody.prototype.position = function (decorated, $dropdown, $container) { + // Clone all of the container classes + $dropdown.attr('class', $container.attr('class')); + + $dropdown.removeClass('select2'); + $dropdown.addClass('select2-container--open'); + + $dropdown.css({ + position: 'absolute', + top: -999999 + }); + + this.$container = $container; + }; + + AttachBody.prototype.render = function (decorated) { + var $container = $(''); + + var $dropdown = decorated.call(this); + $container.append($dropdown); + + this.$dropdownContainer = $container; + + return $container; + }; + + AttachBody.prototype._hideDropdown = function (decorated) { + this.$dropdownContainer.detach(); + }; + + AttachBody.prototype._attachPositioningHandler = + function (decorated, container) { + var self = this; + + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.each(function () { + Utils.StoreData(this, 'select2-scroll-position', { + x: $(this).scrollLeft(), + y: $(this).scrollTop() + }); + }); + + $watchers.on(scrollEvent, function (ev) { + var position = Utils.GetData(this, 'select2-scroll-position'); + $(this).scrollTop(position.y); + }); + + $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent, + function (e) { + self._positionDropdown(); + self._resizeDropdown(); + }); + }; + + AttachBody.prototype._detachPositioningHandler = + function (decorated, container) { + var scrollEvent = 'scroll.select2.' + container.id; + var resizeEvent = 'resize.select2.' + container.id; + var orientationEvent = 'orientationchange.select2.' + container.id; + + var $watchers = this.$container.parents().filter(Utils.hasScroll); + $watchers.off(scrollEvent); + + $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent); + }; + + AttachBody.prototype._positionDropdown = function () { + var $window = $(window); + + var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above'); + var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below'); + + var newDirection = null; + + var offset = this.$container.offset(); + + offset.bottom = offset.top + this.$container.outerHeight(false); + + var container = { + height: this.$container.outerHeight(false) + }; + + container.top = offset.top; + container.bottom = offset.top + container.height; + + var dropdown = { + height: this.$dropdown.outerHeight(false) + }; + + var viewport = { + top: $window.scrollTop(), + bottom: $window.scrollTop() + $window.height() + }; + + var enoughRoomAbove = viewport.top < (offset.top - dropdown.height); + var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height); + + var css = { + left: offset.left, + top: container.bottom + }; + + // Determine what the parent element is to use for calciulating the offset + var $offsetParent = this.$dropdownParent; + + // For statically positoned elements, we need to get the element + // that is determining the offset + if ($offsetParent.css('position') === 'static') { + $offsetParent = $offsetParent.offsetParent(); + } + + var parentOffset = $offsetParent.offset(); + + css.top -= parentOffset.top; + css.left -= parentOffset.left; + + if (!isCurrentlyAbove && !isCurrentlyBelow) { + newDirection = 'below'; + } + + if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) { + newDirection = 'above'; + } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) { + newDirection = 'below'; + } + + if (newDirection == 'above' || + (isCurrentlyAbove && newDirection !== 'below')) { + css.top = container.top - parentOffset.top - dropdown.height; + } + + if (newDirection != null) { + this.$dropdown + .removeClass('select2-dropdown--below select2-dropdown--above') + .addClass('select2-dropdown--' + newDirection); + this.$container + .removeClass('select2-container--below select2-container--above') + .addClass('select2-container--' + newDirection); + } + + this.$dropdownContainer.css(css); + }; + + AttachBody.prototype._resizeDropdown = function () { + var css = { + width: this.$container.outerWidth(false) + 'px' + }; + + if (this.options.get('dropdownAutoWidth')) { + css.minWidth = css.width; + css.position = 'relative'; + css.width = 'auto'; + } + + this.$dropdown.css(css); + }; + + AttachBody.prototype._showDropdown = function (decorated) { + this.$dropdownContainer.appendTo(this.$dropdownParent); + + this._positionDropdown(); + this._resizeDropdown(); + }; + + return AttachBody; +}); + +S2.define('select2/dropdown/minimumResultsForSearch',[ + +], function () { + function countResults (data) { + var count = 0; + + for (var d = 0; d < data.length; d++) { + var item = data[d]; + + if (item.children) { + count += countResults(item.children); + } else { + count++; + } + } + + return count; + } + + function MinimumResultsForSearch (decorated, $element, options, dataAdapter) { + this.minimumResultsForSearch = options.get('minimumResultsForSearch'); + + if (this.minimumResultsForSearch < 0) { + this.minimumResultsForSearch = Infinity; + } + + decorated.call(this, $element, options, dataAdapter); + } + + MinimumResultsForSearch.prototype.showSearch = function (decorated, params) { + if (countResults(params.data.results) < this.minimumResultsForSearch) { + return false; + } + + return decorated.call(this, params); + }; + + return MinimumResultsForSearch; +}); + +S2.define('select2/dropdown/selectOnClose',[ + '../utils' +], function (Utils) { + function SelectOnClose () { } + + SelectOnClose.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('close', function (params) { + self._handleSelectOnClose(params); + }); + }; + + SelectOnClose.prototype._handleSelectOnClose = function (_, params) { + if (params && params.originalSelect2Event != null) { + var event = params.originalSelect2Event; + + // Don't select an item if the close event was triggered from a select or + // unselect event + if (event._type === 'select' || event._type === 'unselect') { + return; + } + } + + var $highlightedResults = this.getHighlightedResults(); + + // Only select highlighted results + if ($highlightedResults.length < 1) { + return; + } + + var data = Utils.GetData($highlightedResults[0], 'data'); + + // Don't re-select already selected resulte + if ( + (data.element != null && data.element.selected) || + (data.element == null && data.selected) + ) { + return; + } + + this.trigger('select', { + data: data + }); + }; + + return SelectOnClose; +}); + +S2.define('select2/dropdown/closeOnSelect',[ + +], function () { + function CloseOnSelect () { } + + CloseOnSelect.prototype.bind = function (decorated, container, $container) { + var self = this; + + decorated.call(this, container, $container); + + container.on('select', function (evt) { + self._selectTriggered(evt); + }); + + container.on('unselect', function (evt) { + self._selectTriggered(evt); + }); + }; + + CloseOnSelect.prototype._selectTriggered = function (_, evt) { + var originalEvent = evt.originalEvent; + + // Don't close if the control key is being held + if (originalEvent && originalEvent.ctrlKey) { + return; + } + + this.trigger('close', { + originalEvent: originalEvent, + originalSelect2Event: evt + }); + }; + + return CloseOnSelect; +}); + +S2.define('select2/i18n/en',[],function () { + // English + return { + errorLoading: function () { + return 'The results could not be loaded.'; + }, + inputTooLong: function (args) { + var overChars = args.input.length - args.maximum; + + var message = 'Please delete ' + overChars + ' character'; + + if (overChars != 1) { + message += 's'; + } + + return message; + }, + inputTooShort: function (args) { + var remainingChars = args.minimum - args.input.length; + + var message = 'Please enter ' + remainingChars + ' or more characters'; + + return message; + }, + loadingMore: function () { + return 'Loading more results…'; + }, + maximumSelected: function (args) { + var message = 'You can only select ' + args.maximum + ' item'; + + if (args.maximum != 1) { + message += 's'; + } + + return message; + }, + noResults: function () { + return 'No results found'; + }, + searching: function () { + return 'Searching…'; + } + }; +}); + +S2.define('select2/defaults',[ + 'jquery', + 'require', + + './results', + + './selection/single', + './selection/multiple', + './selection/placeholder', + './selection/allowClear', + './selection/search', + './selection/eventRelay', + + './utils', + './translation', + './diacritics', + + './data/select', + './data/array', + './data/ajax', + './data/tags', + './data/tokenizer', + './data/minimumInputLength', + './data/maximumInputLength', + './data/maximumSelectionLength', + + './dropdown', + './dropdown/search', + './dropdown/hidePlaceholder', + './dropdown/infiniteScroll', + './dropdown/attachBody', + './dropdown/minimumResultsForSearch', + './dropdown/selectOnClose', + './dropdown/closeOnSelect', + + './i18n/en' +], function ($, require, + + ResultsList, + + SingleSelection, MultipleSelection, Placeholder, AllowClear, + SelectionSearch, EventRelay, + + Utils, Translation, DIACRITICS, + + SelectData, ArrayData, AjaxData, Tags, Tokenizer, + MinimumInputLength, MaximumInputLength, MaximumSelectionLength, + + Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll, + AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect, + + EnglishTranslation) { + function Defaults () { + this.reset(); + } + + Defaults.prototype.apply = function (options) { + options = $.extend(true, {}, this.defaults, options); + + if (options.dataAdapter == null) { + if (options.ajax != null) { + options.dataAdapter = AjaxData; + } else if (options.data != null) { + options.dataAdapter = ArrayData; + } else { + options.dataAdapter = SelectData; + } + + if (options.minimumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MinimumInputLength + ); + } + + if (options.maximumInputLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumInputLength + ); + } + + if (options.maximumSelectionLength > 0) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + MaximumSelectionLength + ); + } + + if (options.tags) { + options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags); + } + + if (options.tokenSeparators != null || options.tokenizer != null) { + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Tokenizer + ); + } + + if (options.query != null) { + var Query = require(options.amdBase + 'compat/query'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + Query + ); + } + + if (options.initSelection != null) { + var InitSelection = require(options.amdBase + 'compat/initSelection'); + + options.dataAdapter = Utils.Decorate( + options.dataAdapter, + InitSelection + ); + } + } + + if (options.resultsAdapter == null) { + options.resultsAdapter = ResultsList; + + if (options.ajax != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + InfiniteScroll + ); + } + + if (options.placeholder != null) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + HidePlaceholder + ); + } + + if (options.selectOnClose) { + options.resultsAdapter = Utils.Decorate( + options.resultsAdapter, + SelectOnClose + ); + } + } + + if (options.dropdownAdapter == null) { + if (options.multiple) { + options.dropdownAdapter = Dropdown; + } else { + var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch); + + options.dropdownAdapter = SearchableDropdown; + } + + if (options.minimumResultsForSearch !== 0) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + MinimumResultsForSearch + ); + } + + if (options.closeOnSelect) { + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + CloseOnSelect + ); + } + + if ( + options.dropdownCssClass != null || + options.dropdownCss != null || + options.adaptDropdownCssClass != null + ) { + var DropdownCSS = require(options.amdBase + 'compat/dropdownCss'); + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + DropdownCSS + ); + } + + options.dropdownAdapter = Utils.Decorate( + options.dropdownAdapter, + AttachBody + ); + } + + if (options.selectionAdapter == null) { + if (options.multiple) { + options.selectionAdapter = MultipleSelection; + } else { + options.selectionAdapter = SingleSelection; + } + + // Add the placeholder mixin if a placeholder was specified + if (options.placeholder != null) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + Placeholder + ); + } + + if (options.allowClear) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + AllowClear + ); + } + + if (options.multiple) { + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + SelectionSearch + ); + } + + if ( + options.containerCssClass != null || + options.containerCss != null || + options.adaptContainerCssClass != null + ) { + var ContainerCSS = require(options.amdBase + 'compat/containerCss'); + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + ContainerCSS + ); + } + + options.selectionAdapter = Utils.Decorate( + options.selectionAdapter, + EventRelay + ); + } + + if (typeof options.language === 'string') { + // Check if the language is specified with a region + if (options.language.indexOf('-') > 0) { + // Extract the region information if it is included + var languageParts = options.language.split('-'); + var baseLanguage = languageParts[0]; + + options.language = [options.language, baseLanguage]; + } else { + options.language = [options.language]; + } + } + + if ($.isArray(options.language)) { + var languages = new Translation(); + options.language.push('en'); + + var languageNames = options.language; + + for (var l = 0; l < languageNames.length; l++) { + var name = languageNames[l]; + var language = {}; + + try { + // Try to load it with the original name + language = Translation.loadPath(name); + } catch (e) { + try { + // If we couldn't load it, check if it wasn't the full path + name = this.defaults.amdLanguageBase + name; + language = Translation.loadPath(name); + } catch (ex) { + // The translation could not be loaded at all. Sometimes this is + // because of a configuration problem, other times this can be + // because of how Select2 helps load all possible translation files. + if (options.debug && window.console && console.warn) { + console.warn( + 'Select2: The language file for "' + name + '" could not be ' + + 'automatically loaded. A fallback will be used instead.' + ); + } + + continue; + } + } + + languages.extend(language); + } + + options.translations = languages; + } else { + var baseTranslation = Translation.loadPath( + this.defaults.amdLanguageBase + 'en' + ); + var customTranslation = new Translation(options.language); + + customTranslation.extend(baseTranslation); + + options.translations = customTranslation; + } + + return options; + }; + + Defaults.prototype.reset = function () { + function stripDiacritics (text) { + // Used 'uni range + named function' from http://jsperf.com/diacritics/18 + function match(a) { + return DIACRITICS[a] || a; + } + + return text.replace(/[^\u0000-\u007E]/g, match); + } + + function matcher (params, data) { + // Always return the object if there is nothing to compare + if ($.trim(params.term) === '') { + return data; + } + + // Do a recursive check for options with children + if (data.children && data.children.length > 0) { + // Clone the data object if there are children + // This is required as we modify the object to remove any non-matches + var match = $.extend(true, {}, data); + + // Check each child of the option + for (var c = data.children.length - 1; c >= 0; c--) { + var child = data.children[c]; + + var matches = matcher(params, child); + + // If there wasn't a match, remove the object in the array + if (matches == null) { + match.children.splice(c, 1); + } + } + + // If any children matched, return the new object + if (match.children.length > 0) { + return match; + } + + // If there were no matching children, check just the plain object + return matcher(params, match); + } + + var original = stripDiacritics(data.text).toUpperCase(); + var term = stripDiacritics(params.term).toUpperCase(); + + // Check if the text contains the term + if (original.indexOf(term) > -1) { + return data; + } + + // If it doesn't contain the term, don't return anything + return null; + } + + this.defaults = { + amdBase: './', + amdLanguageBase: './i18n/', + closeOnSelect: true, + debug: false, + dropdownAutoWidth: false, + escapeMarkup: Utils.escapeMarkup, + language: EnglishTranslation, + matcher: matcher, + minimumInputLength: 0, + maximumInputLength: 0, + maximumSelectionLength: 0, + minimumResultsForSearch: 0, + selectOnClose: false, + sorter: function (data) { + return data; + }, + templateResult: function (result) { + return result.text; + }, + templateSelection: function (selection) { + return selection.text; + }, + theme: 'default', + width: 'resolve' + }; + }; + + Defaults.prototype.set = function (key, value) { + var camelKey = $.camelCase(key); + + var data = {}; + data[camelKey] = value; + + var convertedData = Utils._convertData(data); + + $.extend(true, this.defaults, convertedData); + }; + + var defaults = new Defaults(); + + return defaults; +}); + +S2.define('select2/options',[ + 'require', + 'jquery', + './defaults', + './utils' +], function (require, $, Defaults, Utils) { + function Options (options, $element) { + this.options = options; + + if ($element != null) { + this.fromElement($element); + } + + this.options = Defaults.apply(this.options); + + if ($element && $element.is('input')) { + var InputCompat = require(this.get('amdBase') + 'compat/inputData'); + + this.options.dataAdapter = Utils.Decorate( + this.options.dataAdapter, + InputCompat + ); + } + } + + Options.prototype.fromElement = function ($e) { + var excludedData = ['select2']; + + if (this.options.multiple == null) { + this.options.multiple = $e.prop('multiple'); + } + + if (this.options.disabled == null) { + this.options.disabled = $e.prop('disabled'); + } + + if (this.options.language == null) { + if ($e.prop('lang')) { + this.options.language = $e.prop('lang').toLowerCase(); + } else if ($e.closest('[lang]').prop('lang')) { + this.options.language = $e.closest('[lang]').prop('lang'); + } + } + + if (this.options.dir == null) { + if ($e.prop('dir')) { + this.options.dir = $e.prop('dir'); + } else if ($e.closest('[dir]').prop('dir')) { + this.options.dir = $e.closest('[dir]').prop('dir'); + } else { + this.options.dir = 'ltr'; + } + } + + $e.prop('disabled', this.options.disabled); + $e.prop('multiple', this.options.multiple); + + if (Utils.GetData($e[0], 'select2Tags')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-select2-tags` attribute has been changed to ' + + 'use the `data-data` and `data-tags="true"` attributes and will be ' + + 'removed in future versions of Select2.' + ); + } + + Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags')); + Utils.StoreData($e[0], 'tags', true); + } + + if (Utils.GetData($e[0], 'ajaxUrl')) { + if (this.options.debug && window.console && console.warn) { + console.warn( + 'Select2: The `data-ajax-url` attribute has been changed to ' + + '`data-ajax--url` and support for the old attribute will be removed' + + ' in future versions of Select2.' + ); + } + + $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl')); + Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl')); + + } + + var dataset = {}; + + // Prefer the element's `dataset` attribute if it exists + // jQuery 1.x does not correctly handle data attributes with multiple dashes + if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) { + dataset = $.extend(true, {}, $e[0].dataset, Utils.GetData($e[0])); + } else { + dataset = Utils.GetData($e[0]); + } + + var data = $.extend(true, {}, dataset); + + data = Utils._convertData(data); + + for (var key in data) { + if ($.inArray(key, excludedData) > -1) { + continue; + } + + if ($.isPlainObject(this.options[key])) { + $.extend(this.options[key], data[key]); + } else { + this.options[key] = data[key]; + } + } + + return this; + }; + + Options.prototype.get = function (key) { + return this.options[key]; + }; + + Options.prototype.set = function (key, val) { + this.options[key] = val; + }; + + return Options; +}); + +S2.define('select2/core',[ + 'jquery', + './options', + './utils', + './keys' +], function ($, Options, Utils, KEYS) { + var Select2 = function ($element, options) { + if (Utils.GetData($element[0], 'select2') != null) { + Utils.GetData($element[0], 'select2').destroy(); + } + + this.$element = $element; + + this.id = this._generateId($element); + + options = options || {}; + + this.options = new Options(options, $element); + + Select2.__super__.constructor.call(this); + + // Set up the tabindex + + var tabindex = $element.attr('tabindex') || 0; + Utils.StoreData($element[0], 'old-tabindex', tabindex); + $element.attr('tabindex', '-1'); + + // Set up containers and adapters + + var DataAdapter = this.options.get('dataAdapter'); + this.dataAdapter = new DataAdapter($element, this.options); + + var $container = this.render(); + + this._placeContainer($container); + + var SelectionAdapter = this.options.get('selectionAdapter'); + this.selection = new SelectionAdapter($element, this.options); + this.$selection = this.selection.render(); + + this.selection.position(this.$selection, $container); + + var DropdownAdapter = this.options.get('dropdownAdapter'); + this.dropdown = new DropdownAdapter($element, this.options); + this.$dropdown = this.dropdown.render(); + + this.dropdown.position(this.$dropdown, $container); + + var ResultsAdapter = this.options.get('resultsAdapter'); + this.results = new ResultsAdapter($element, this.options, this.dataAdapter); + this.$results = this.results.render(); + + this.results.position(this.$results, this.$dropdown); + + // Bind events + + var self = this; + + // Bind the container to all of the adapters + this._bindAdapters(); + + // Register any DOM event handlers + this._registerDomEvents(); + + // Register any internal event handlers + this._registerDataEvents(); + this._registerSelectionEvents(); + this._registerDropdownEvents(); + this._registerResultsEvents(); + this._registerEvents(); + + // Set the initial state + this.dataAdapter.current(function (initialData) { + self.trigger('selection:update', { + data: initialData + }); + }); + + // Hide the original select + $element.addClass('select2-hidden-accessible'); + $element.attr('aria-hidden', 'true'); + + // Synchronize any monitored attributes + this._syncAttributes(); + + Utils.StoreData($element[0], 'select2', this); + + // Ensure backwards compatibility with $element.data('select2'). + $element.data('select2', this); + }; + + Utils.Extend(Select2, Utils.Observable); + + Select2.prototype._generateId = function ($element) { + var id = ''; + + if ($element.attr('id') != null) { + id = $element.attr('id'); + } else if ($element.attr('name') != null) { + id = $element.attr('name') + '-' + Utils.generateChars(2); + } else { + id = Utils.generateChars(4); + } + + id = id.replace(/(:|\.|\[|\]|,)/g, ''); + id = 'select2-' + id; + + return id; + }; + + Select2.prototype._placeContainer = function ($container) { + $container.insertAfter(this.$element); + + var width = this._resolveWidth(this.$element, this.options.get('width')); + + if (width != null) { + $container.css('width', width); + } + }; + + Select2.prototype._resolveWidth = function ($element, method) { + var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i; + + if (method == 'resolve') { + var styleWidth = this._resolveWidth($element, 'style'); + + if (styleWidth != null) { + return styleWidth; + } + + return this._resolveWidth($element, 'element'); + } + + if (method == 'element') { + var elementWidth = $element.outerWidth(false); + + if (elementWidth <= 0) { + return 'auto'; + } + + return elementWidth + 'px'; + } + + if (method == 'style') { + var style = $element.attr('style'); + + if (typeof(style) !== 'string') { + return null; + } + + var attrs = style.split(';'); + + for (var i = 0, l = attrs.length; i < l; i = i + 1) { + var attr = attrs[i].replace(/\s/g, ''); + var matches = attr.match(WIDTH); + + if (matches !== null && matches.length >= 1) { + return matches[1]; + } + } + + return null; + } + + return method; + }; + + Select2.prototype._bindAdapters = function () { + this.dataAdapter.bind(this, this.$container); + this.selection.bind(this, this.$container); + + this.dropdown.bind(this, this.$container); + this.results.bind(this, this.$container); + }; + + Select2.prototype._registerDomEvents = function () { + var self = this; + + this.$element.on('change.select2', function () { + self.dataAdapter.current(function (data) { + self.trigger('selection:update', { + data: data + }); + }); + }); + + this.$element.on('focus.select2', function (evt) { + self.trigger('focus', evt); + }); + + this._syncA = Utils.bind(this._syncAttributes, this); + this._syncS = Utils.bind(this._syncSubtree, this); + + if (this.$element[0].attachEvent) { + this.$element[0].attachEvent('onpropertychange', this._syncA); + } + + var observer = window.MutationObserver || + window.WebKitMutationObserver || + window.MozMutationObserver + ; + + if (observer != null) { + this._observer = new observer(function (mutations) { + $.each(mutations, self._syncA); + $.each(mutations, self._syncS); + }); + this._observer.observe(this.$element[0], { + attributes: true, + childList: true, + subtree: false + }); + } else if (this.$element[0].addEventListener) { + this.$element[0].addEventListener( + 'DOMAttrModified', + self._syncA, + false + ); + this.$element[0].addEventListener( + 'DOMNodeInserted', + self._syncS, + false + ); + this.$element[0].addEventListener( + 'DOMNodeRemoved', + self._syncS, + false + ); + } + }; + + Select2.prototype._registerDataEvents = function () { + var self = this; + + this.dataAdapter.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerSelectionEvents = function () { + var self = this; + var nonRelayEvents = ['toggle', 'focus']; + + this.selection.on('toggle', function () { + self.toggleDropdown(); + }); + + this.selection.on('focus', function (params) { + self.focus(params); + }); + + this.selection.on('*', function (name, params) { + if ($.inArray(name, nonRelayEvents) !== -1) { + return; + } + + self.trigger(name, params); + }); + }; + + Select2.prototype._registerDropdownEvents = function () { + var self = this; + + this.dropdown.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerResultsEvents = function () { + var self = this; + + this.results.on('*', function (name, params) { + self.trigger(name, params); + }); + }; + + Select2.prototype._registerEvents = function () { + var self = this; + + this.on('open', function () { + self.$container.addClass('select2-container--open'); + }); + + this.on('close', function () { + self.$container.removeClass('select2-container--open'); + }); + + this.on('enable', function () { + self.$container.removeClass('select2-container--disabled'); + }); + + this.on('disable', function () { + self.$container.addClass('select2-container--disabled'); + }); + + this.on('blur', function () { + self.$container.removeClass('select2-container--focus'); + }); + + this.on('query', function (params) { + if (!self.isOpen()) { + self.trigger('open', {}); + } + + this.dataAdapter.query(params, function (data) { + self.trigger('results:all', { + data: data, + query: params + }); + }); + }); + + this.on('query:append', function (params) { + this.dataAdapter.query(params, function (data) { + self.trigger('results:append', { + data: data, + query: params + }); + }); + }); + + this.on('keypress', function (evt) { + var key = evt.which; + + if (self.isOpen()) { + if (key === KEYS.ESC || key === KEYS.TAB || + (key === KEYS.UP && evt.altKey)) { + self.close(); + + evt.preventDefault(); + } else if (key === KEYS.ENTER) { + self.trigger('results:select', {}); + + evt.preventDefault(); + } else if ((key === KEYS.SPACE && evt.ctrlKey)) { + self.trigger('results:toggle', {}); + + evt.preventDefault(); + } else if (key === KEYS.UP) { + self.trigger('results:previous', {}); + + evt.preventDefault(); + } else if (key === KEYS.DOWN) { + self.trigger('results:next', {}); + + evt.preventDefault(); + } + } else { + if (key === KEYS.ENTER || key === KEYS.SPACE || + (key === KEYS.DOWN && evt.altKey)) { + self.open(); + + evt.preventDefault(); + } + } + }); + }; + + Select2.prototype._syncAttributes = function () { + this.options.set('disabled', this.$element.prop('disabled')); + + if (this.options.get('disabled')) { + if (this.isOpen()) { + this.close(); + } + + this.trigger('disable', {}); + } else { + this.trigger('enable', {}); + } + }; + + Select2.prototype._syncSubtree = function (evt, mutations) { + var changed = false; + var self = this; + + // Ignore any mutation events raised for elements that aren't options or + // optgroups. This handles the case when the select element is destroyed + if ( + evt && evt.target && ( + evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP' + ) + ) { + return; + } + + if (!mutations) { + // If mutation events aren't supported, then we can only assume that the + // change affected the selections + changed = true; + } else if (mutations.addedNodes && mutations.addedNodes.length > 0) { + for (var n = 0; n < mutations.addedNodes.length; n++) { + var node = mutations.addedNodes[n]; + + if (node.selected) { + changed = true; + } + } + } else if (mutations.removedNodes && mutations.removedNodes.length > 0) { + changed = true; + } + + // Only re-pull the data if we think there is a change + if (changed) { + this.dataAdapter.current(function (currentData) { + self.trigger('selection:update', { + data: currentData + }); + }); + } + }; + + /** + * Override the trigger method to automatically trigger pre-events when + * there are events that can be prevented. + */ + Select2.prototype.trigger = function (name, args) { + var actualTrigger = Select2.__super__.trigger; + var preTriggerMap = { + 'open': 'opening', + 'close': 'closing', + 'select': 'selecting', + 'unselect': 'unselecting', + 'clear': 'clearing' + }; + + if (args === undefined) { + args = {}; + } + + if (name in preTriggerMap) { + var preTriggerName = preTriggerMap[name]; + var preTriggerArgs = { + prevented: false, + name: name, + args: args + }; + + actualTrigger.call(this, preTriggerName, preTriggerArgs); + + if (preTriggerArgs.prevented) { + args.prevented = true; + + return; + } + } + + actualTrigger.call(this, name, args); + }; + + Select2.prototype.toggleDropdown = function () { + if (this.options.get('disabled')) { + return; + } + + if (this.isOpen()) { + this.close(); + } else { + this.open(); + } + }; + + Select2.prototype.open = function () { + if (this.isOpen()) { + return; + } + + this.trigger('query', {}); + }; + + Select2.prototype.close = function () { + if (!this.isOpen()) { + return; + } + + this.trigger('close', {}); + }; + + Select2.prototype.isOpen = function () { + return this.$container.hasClass('select2-container--open'); + }; + + Select2.prototype.hasFocus = function () { + return this.$container.hasClass('select2-container--focus'); + }; + + Select2.prototype.focus = function (data) { + // No need to re-trigger focus events if we are already focused + if (this.hasFocus()) { + return; + } + + this.$container.addClass('select2-container--focus'); + this.trigger('focus', {}); + }; + + Select2.prototype.enable = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("enable")` method has been deprecated and will' + + ' be removed in later Select2 versions. Use $element.prop("disabled")' + + ' instead.' + ); + } + + if (args == null || args.length === 0) { + args = [true]; + } + + var disabled = !args[0]; + + this.$element.prop('disabled', disabled); + }; + + Select2.prototype.data = function () { + if (this.options.get('debug') && + arguments.length > 0 && window.console && console.warn) { + console.warn( + 'Select2: Data can no longer be set using `select2("data")`. You ' + + 'should consider setting the value instead using `$element.val()`.' + ); + } + + var data = []; + + this.dataAdapter.current(function (currentData) { + data = currentData; + }); + + return data; + }; + + Select2.prototype.val = function (args) { + if (this.options.get('debug') && window.console && console.warn) { + console.warn( + 'Select2: The `select2("val")` method has been deprecated and will be' + + ' removed in later Select2 versions. Use $element.val() instead.' + ); + } + + if (args == null || args.length === 0) { + return this.$element.val(); + } + + var newVal = args[0]; + + if ($.isArray(newVal)) { + newVal = $.map(newVal, function (obj) { + return obj.toString(); + }); + } + + this.$element.val(newVal).trigger('change'); + }; + + Select2.prototype.destroy = function () { + this.$container.remove(); + + if (this.$element[0].detachEvent) { + this.$element[0].detachEvent('onpropertychange', this._syncA); + } + + if (this._observer != null) { + this._observer.disconnect(); + this._observer = null; + } else if (this.$element[0].removeEventListener) { + this.$element[0] + .removeEventListener('DOMAttrModified', this._syncA, false); + this.$element[0] + .removeEventListener('DOMNodeInserted', this._syncS, false); + this.$element[0] + .removeEventListener('DOMNodeRemoved', this._syncS, false); + } + + this._syncA = null; + this._syncS = null; + + this.$element.off('.select2'); + this.$element.attr('tabindex', + Utils.GetData(this.$element[0], 'old-tabindex')); + + this.$element.removeClass('select2-hidden-accessible'); + this.$element.attr('aria-hidden', 'false'); + Utils.RemoveData(this.$element[0]); + this.$element.removeData('select2'); + + this.dataAdapter.destroy(); + this.selection.destroy(); + this.dropdown.destroy(); + this.results.destroy(); + + this.dataAdapter = null; + this.selection = null; + this.dropdown = null; + this.results = null; + }; + + Select2.prototype.render = function () { + var $container = $( + '' + + '' + + '' + + '' + ); + + $container.attr('dir', this.options.get('dir')); + + this.$container = $container; + + this.$container.addClass('select2-container--' + this.options.get('theme')); + + Utils.StoreData($container[0], 'element', this.$element); + + return $container; + }; + + return Select2; +}); + +S2.define('jquery-mousewheel',[ + 'jquery' +], function ($) { + // Used to shim jQuery.mousewheel for non-full builds. + return $; +}); + +S2.define('jquery.select2',[ + 'jquery', + 'jquery-mousewheel', + + './select2/core', + './select2/defaults', + './select2/utils' +], function ($, _, Select2, Defaults, Utils) { + if ($.fn.select2 == null) { + // All methods that should return the element + var thisMethods = ['open', 'close', 'destroy']; + + $.fn.select2 = function (options) { + options = options || {}; + + if (typeof options === 'object') { + this.each(function () { + var instanceOptions = $.extend(true, {}, options); + + var instance = new Select2($(this), instanceOptions); + }); + + return this; + } else if (typeof options === 'string') { + var ret; + var args = Array.prototype.slice.call(arguments, 1); + + this.each(function () { + var instance = Utils.GetData(this, 'select2'); + + if (instance == null && window.console && console.error) { + console.error( + 'The select2(\'' + options + '\') method was called on an ' + + 'element that is not using Select2.' + ); + } + + ret = instance[options].apply(instance, args); + }); + + // Check if we should be returning `this` + if ($.inArray(options, thisMethods) > -1) { + return this; + } + + return ret; + } else { + throw new Error('Invalid arguments for Select2: ' + options); + } + }; + } + + if ($.fn.select2.defaults == null) { + $.fn.select2.defaults = Defaults; + } + + return Select2; +}); + + // Return the AMD loader configuration so it can be used outside of this file + return { + define: S2.define, + require: S2.require + }; +}()); + + // Autoload the jQuery bindings + // We know that all of the modules exist above this, so we're safe + var select2 = S2.require('jquery.select2'); + + // Hold the AMD module references on the jQuery function that was just loaded + // This allows Select2 to use the internal loader outside of this file, such + // as in the language files. + jQuery.fn.select2.amd = S2; + + // Return the Select2 instance for anyone who is importing it. + return select2; +})); diff --git a/vendor/select2-4.0.6-rc.1/dist/js/select2.min.js b/vendor/select2-4.0.6-rc.1/dist/js/select2.min.js new file mode 100644 index 00000000..e5052902 --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/dist/js/select2.min.js @@ -0,0 +1 @@ +/*! Select2 4.0.6-rc.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.__cache={};var e=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null==b&&(a.id?(b=a.id,a.setAttribute("data-select2-id",b)):(a.setAttribute("data-select2-id",++e),b=e.toString())),b},c.StoreData=function(a,b,d){var e=c.GetUniqueElementId(a);c.__cache[e]||(c.__cache[e]={}),c.__cache[e][b]=d},c.GetData=function(b,d){var e=c.GetUniqueElementId(b);return d?c.__cache[e]&&null!=c.__cache[e][d]?c.__cache[e][d]:a(b).data(d):c.__cache[e]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b]},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
      ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
    • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(d){var e=a.map(d,function(a){return a.id.toString()});c.$results.find(".select2-results__option[aria-selected]").each(function(){var c=a(this),d=b.GetData(this,"data"),f=""+d.id;null!=d.element&&d.element.selected||null==d.element&&a.inArray(f,e)>-1?c.attr("aria-selected","true"):c.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var d=document.createElement("li");d.className="select2-results__option";var e={role:"treeitem","aria-selected":"false"};c.disabled&&(delete e["aria-selected"],e["aria-disabled"]="true"),null==c.id&&delete e["aria-selected"],null!=c._resultId&&(d.id=c._resultId),c.title&&(d.title=c.title),c.children&&(e.role="group",e["aria-label"]=c.text,delete e["aria-selected"]);for(var f in e){var g=e[f];d.setAttribute(f,g)}if(c.children){var h=a(d),i=document.createElement("strong");i.className="select2-results__group";a(i);this.template(c,i);for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested"});n.append(j),h.append(i),h.append(n)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var e=this,f=c.id+"-results";this.$results.attr("id",f),c.on("results:all",function(a){e.clear(),e.append(a.data),c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("results:append",function(a){e.append(a.data),c.isOpen()&&e.setClasses()}),c.on("query",function(a){e.hideMessages(),e.showLoading(a)}),c.on("select",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("unselect",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("open",function(){e.$results.attr("aria-expanded","true"),e.$results.attr("aria-hidden","false"),e.setClasses(),e.ensureHighlightVisible()}),c.on("close",function(){e.$results.attr("aria-expanded","false"),e.$results.attr("aria-hidden","true"),e.$results.removeAttr("aria-activedescendant")}),c.on("results:toggle",function(){var a=e.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),c.on("results:select",function(){var a=e.getHighlightedResults();if(0!==a.length){var c=b.GetData(a[0],"data");"true"==a.attr("aria-selected")?e.trigger("close",{}):e.trigger("select",{data:c})}}),c.on("results:previous",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a);if(!(c<=0)){var d=c-1;0===a.length&&(d=0);var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top,h=f.offset().top,i=e.$results.scrollTop()+(h-g);0===d?e.$results.scrollTop(0):h-g<0&&e.$results.scrollTop(i)}}),c.on("results:next",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a),d=c+1;if(!(d>=b.length)){var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top+e.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=e.$results.scrollTop()+h-g;0===d?e.$results.scrollTop(0):h>g&&e.$results.scrollTop(i)}}),c.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),c.on("results:message",function(a){e.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=e.$results.scrollTop(),c=e.$results.get(0).scrollHeight-b+a.deltaY,d=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=e.$results.height();d?(e.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(e.$results.scrollTop(e.$results.get(0).scrollHeight-e.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(c){var d=a(this),f=b.GetData(this,"data");if("true"===d.attr("aria-selected"))return void(e.options.get("multiple")?e.trigger("unselect",{originalEvent:c,data:f}):e.trigger("close",{}));e.trigger("select",{originalEvent:c,data:f})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(c){var d=b.GetData(this,"data");e.getHighlightedResults().removeClass("select2-results__option--highlighted"),e.trigger("results:focus",{data:d,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),this.$selection=c,c},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),window.setTimeout(function(){d.$selection.focus()},0),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target),e=d.closest(".select2");a(".select2.select2-container--open").each(function(){a(this),this!=e[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()})},e.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.attr("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
        '),a},d.prototype.bind=function(b,e){var f=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){f.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!f.options.get("disabled")){var d=a(this),e=d.parent(),g=c.GetData(e[0],"data");f.trigger("unselect",{originalEvent:b,data:g})}})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
      • ×
      • ')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var d=this.$selection.find(".select2-selection__clear");if(0!==d.length){b.stopPropagation();var e=c.GetData(d[0],"data"),f=this.$element.val();this.$element.val(this.placeholder.id);var g={data:e};if(this.trigger("clear",g),g.prevented)return void this.$element.val(f);for(var h=0;h0||0===d.length)){var e=a('×');c.StoreData(e[0],"data",d),this.$selection.find(".select2-selection__rendered").prepend(e)}},d}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;if(this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c){this.$element.find("[data-select2-tag]").length?this.$element.focus():this.$search.focus()}},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
      • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(a,b,c,d,e){if(null==a.fn.select2){var f=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,g=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=a[b].apply(a,g)}),a.inArray(b,f)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); \ No newline at end of file diff --git a/vendor/select2-4.0.6-rc.1/docs/README.md b/vendor/select2-4.0.6-rc.1/docs/README.md new file mode 100644 index 00000000..06d589d8 --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/README.md @@ -0,0 +1 @@ +Effective beginning September 10, 2017, the Select2 documentation repository is now available at [`select2/docs`](https://github.com/select2/docs). diff --git a/vendor/select2-4.0.6-rc.1/docs/announcements-4.0.html b/vendor/select2-4.0.6-rc.1/docs/announcements-4.0.html new file mode 100644 index 00000000..bc85b4c1 --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/announcements-4.0.html @@ -0,0 +1,12 @@ + + + + + select2 + + + + + \ No newline at end of file diff --git a/vendor/select2-4.0.6-rc.1/docs/community.html b/vendor/select2-4.0.6-rc.1/docs/community.html new file mode 100644 index 00000000..ffe8f83f --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/community.html @@ -0,0 +1,12 @@ + + + + + select2 + + + + + \ No newline at end of file diff --git a/vendor/select2-4.0.6-rc.1/docs/examples.html b/vendor/select2-4.0.6-rc.1/docs/examples.html new file mode 100644 index 00000000..a463e84a --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/examples.html @@ -0,0 +1,12 @@ + + + + + select2 + + + + + \ No newline at end of file diff --git a/vendor/select2-4.0.6-rc.1/docs/index.html b/vendor/select2-4.0.6-rc.1/docs/index.html new file mode 100644 index 00000000..ea8214d6 --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/index.html @@ -0,0 +1,12 @@ + + + + + select2 + + + + + \ No newline at end of file diff --git a/vendor/select2-4.0.6-rc.1/docs/options-old.html b/vendor/select2-4.0.6-rc.1/docs/options-old.html new file mode 100644 index 00000000..4920b76b --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/options-old.html @@ -0,0 +1,12 @@ + + + + + select2 + + + + + \ No newline at end of file diff --git a/vendor/select2-4.0.6-rc.1/docs/options.html b/vendor/select2-4.0.6-rc.1/docs/options.html new file mode 100644 index 00000000..4920b76b --- /dev/null +++ b/vendor/select2-4.0.6-rc.1/docs/options.html @@ -0,0 +1,12 @@ + + + + + select2 + + + + + \ No newline at end of file From 1e438d21f837ad9768f83f77ea0fff9eb2333904 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Mon, 25 Apr 2022 12:06:04 +0300 Subject: [PATCH 32/36] Add known issues --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ffef689d..438eebc3 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,8 @@ The Speech plugin is installed by default in cloud and [self-hosted](https://git Some browsers, e.g. Mozzila, Opera, can only use pre-installed languages on your system for speech generation. So to use new languages you need to add them to your system. -If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic \ No newline at end of file +### Known issues + +* The plugin doesn't work on Safari 15.3 (17612.4.9.1.8). Problem fixed on Safari 15.4 (17614.1.7.7) + +If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic From b8f55132ef4d0f92e91a38308f2c4fb12f5fc4bb Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Mon, 25 Apr 2022 12:16:04 +0300 Subject: [PATCH 33/36] Changed plugin version to 2.0.0 in config.json Added error output to console. --- config.json | 2 +- scripts/speech.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 747256d3..a5ce5280 100644 --- a/config.json +++ b/config.json @@ -7,7 +7,7 @@ "de": "Rede" }, "guid": "asc.{D71C2EF0-F15B-47C7-80E9-86D671F9C595}", - "version" : "1.0.0", + "version" : "2.0.0", "variations": [ { diff --git a/scripts/speech.js b/scripts/speech.js index d55dbfeb..fecd184e 100644 --- a/scripts/speech.js +++ b/scripts/speech.js @@ -342,8 +342,9 @@ speak(); } } - function onError () { + function onError (oError) { console.error('SpeechSynthesisUtterance.onerror'); + console.log(oError); speechSynthesis.cancel(); window.Asc.plugin.executeCommand("close", ""); } From 0f00855c7afb9c0c188119de5a2bc88b41b07b2f Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Mon, 25 Apr 2022 16:30:05 +0300 Subject: [PATCH 34/36] Update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 438eebc3..bb096616 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Convert selected text into speech. -The plugin uses [guessLanguage](http://richtr.github.io/guessLanguage.js/) to recognize the language and the SpeechSynthesis - interface of the Web Speech API is the controller interface for the speech service. +The plugin uses [guessLanguage][1] to recognize the language and [the SpeechSynthesis][2] interface of [the Web Speech API][3]. -The Speech plugin is installed by default in cloud and [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) of ONLYOFFICE editors. +The Speech plugin is installed by default in cloud and [self-hosted][4] of ONLYOFFICE editors. ## How to use @@ -22,3 +22,8 @@ So to use new languages you need to add them to your system. * The plugin doesn't work on Safari 15.3 (17612.4.9.1.8). Problem fixed on Safari 15.4 (17614.1.7.7) If you need more information about how to use or write your own plugin, please see this https://api.onlyoffice.com/plugin/basic + + [1]: https://richtr.github.io/guessLanguage.js/ + [2]: https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis + [3]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API + [4]: https://github.com/ONLYOFFICE/DocumentServer From 5148c9e8d0db67a810a97018b9a7a59226dbf125 Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Mon, 25 Apr 2022 16:38:59 +0300 Subject: [PATCH 35/36] Added licenses. --- 3rd-Party.txt | 15 +- licenses/ResponsiveVoice.license | 395 ------------------------------- licenses/Select2.license | 21 ++ licenses/jQuery.license | 20 ++ 4 files changed, 55 insertions(+), 396 deletions(-) delete mode 100644 licenses/ResponsiveVoice.license create mode 100644 licenses/Select2.license create mode 100644 licenses/jQuery.license diff --git a/3rd-Party.txt b/3rd-Party.txt index 0160dfb3..2d6deedb 100644 --- a/3rd-Party.txt +++ b/3rd-Party.txt @@ -1,3 +1,16 @@ This plugin uses code from the following 3rd party projects. -1. GuessLanguage to recognize the language. (http://richtr.github.io/guessLanguage.js/) \ No newline at end of file +1. GuessLanguage to recognize the language. (http://richtr.github.io/guessLanguage.js/) + + +2. jQuery - Query is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. (http://jquery.com/) + +License: MIT License +License File: jQuery.license + + +3. Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options. (https://select2.org/) + +License: MIT +License File: Select2.license + diff --git a/licenses/ResponsiveVoice.license b/licenses/ResponsiveVoice.license deleted file mode 100644 index 52bd1459..00000000 --- a/licenses/ResponsiveVoice.license +++ /dev/null @@ -1,395 +0,0 @@ -Attribution 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution 4.0 International Public License ("Public License"). To the -extent this Public License may be interpreted as a contract, You are -granted the Licensed Rights in consideration of Your acceptance of -these terms and conditions, and the Licensor grants You such rights in -consideration of benefits the Licensor receives from making the -Licensed Material available under these terms and conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - d. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - e. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - f. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - g. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - h. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - i. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - j. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - k. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - 4. If You Share Adapted Material You produce, the Adapter's - License You apply must not prevent recipients of the Adapted - Material from complying with this Public License. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material; and - - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public -licenses. Notwithstanding, Creative Commons may elect to apply one of -its public licenses to material it publishes and in those instances -will be considered the “Licensor.” The text of the Creative Commons -public licenses is dedicated to the public domain under the CC0 Public -Domain Dedication. Except for the limited purpose of indicating that -material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the -public licenses. - -Creative Commons may be contacted at creativecommons.org. \ No newline at end of file diff --git a/licenses/Select2.license b/licenses/Select2.license new file mode 100644 index 00000000..8cb8a2b1 --- /dev/null +++ b/licenses/Select2.license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/licenses/jQuery.license b/licenses/jQuery.license new file mode 100644 index 00000000..1e8b433d --- /dev/null +++ b/licenses/jQuery.license @@ -0,0 +1,20 @@ +Copyright (c) 2009 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file From 4bfb80ec81cc32b52cdea37e1918d141c8a803ff Mon Sep 17 00:00:00 2001 From: Danil Titarenko <77471369+danilapog@users.noreply.github.com> Date: Thu, 2 Jun 2022 12:54:03 +0300 Subject: [PATCH 36/36] Add plugin release workflow (#57) --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..2bf63320 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,11 @@ +name: Release + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + release: + uses: ONLYOFFICE/onlyoffice.github.io/.github/workflows/release.yml@master