1/* Compressed with https://javascript-minifier.com/ 2* 3* Viet IME Extension for jQuery, v1.2 4* 08/2014, by Trung Nguyen <[email protected]> 5* 6* Usage: see http://www.chunom.org/media/js/ime.readme.txt 7*/ 8var CACHEVERSION="2021-11-03";function splitChars(t){for(var e=[],i="",n=0,r=t.length;n<r;n++){var a=t[n];code=a.charCodeAt(0),code>=55296&&code<=56319?i=a:(e.push(i+a),i="")}return e}!function(t){function e(t){return document.all||document.getElementById?(this.lookback=30,this.defaultmode=1,this.method=null==t||null==t?this.defaultmode:t,this):(alert("Xin loi, trinh duyet web cua ban khong cho phep dung VietTyping."),!1)}function i(){return this.value="",this.charMap=new r,this.ctrlChar="-",this.changed=0,this}function n(){return this.vietChars=null,this.length=149,this.chrCache=new Array(20),this.indCache=new Array(20),this.cptr=0,this.caching=function(t,e){this.chrCache[this.cptr]=t,this.indCache[this.cptr++]=e,this.cptr%=20},this.vmap=[[7,7,7,8,8,8,9,10,11,15],[0,3,6,0,6,9,0,3,6,0],[1,4,7,2,8,10,1,4,7,1]],this}function r(){var t=new n;return t.vietChars=new Array("UNICODE",97,226,259,101,234,105,111,244,417,117,432,121,65,194,258,69,202,73,79,212,416,85,431,89,225,7845,7855,233,7871,237,243,7889,7899,250,7913,253,193,7844,7854,201,7870,205,211,7888,7898,218,7912,221,224,7847,7857,232,7873,236,242,7891,7901,249,7915,7923,192,7846,7856,200,7872,204,210,7890,7900,217,7914,7922,7841,7853,7863,7865,7879,7883,7885,7897,7907,7909,7921,7925,7840,7852,7862,7864,7878,7882,7884,7896,7906,7908,7920,7924,7843,7849,7859,7867,7875,7881,7887,7893,7903,7911,7917,7927,7842,7848,7858,7866,7874,7880,7886,7892,7902,7910,7916,7926,227,7851,7861,7869,7877,297,245,7895,7905,361,7919,7929,195,7850,7860,7868,7876,296,213,7894,7904,360,7918,7928,100,273,68,272),t}function a(){return this.getAction=function(t){var e=this.keys.indexOf(t.ctrlChar.toLowerCase());e>=0&&t.compose(this.actions[e])},this}function s(){return this.off=!0,this.getAction=function(t){},this}function o(){var t=new a;return t.keys="sfjrxzaeowd",t.actions=[1,2,3,4,5,6,9,10,11,8,15],t}function h(){var t=new a;return t.keys="sfjrxzd",t.actions=[1,2,3,4,5,6,15],t}function c(){var t=new a;return t.keys="0123456789",t.actions=[6,1,2,4,5,3,7,8,8,15],t}function l(){var t=new a;return t.keys="´/'â`.?~-^(*+d",t.actions=[1,1,1,1,2,3,4,5,6,7,8,8,8,15],t}function d(){var t=new a;return t.keys="sfjrxzaeowd0123456789´/'`.?~-^(*+d",t.actions=[1,2,3,4,5,6,9,10,11,8,15,6,1,2,4,5,3,7,8,8,15,1,1,1,2,3,4,5,6,7,8,8,8,15],t}e.prototype.setMethod=function(t){this.method=t,this.typer&&(this.typer.keyMode=this.initKeys())},e.prototype.initKeys=function(){switch(this.method){case 1:return this.telexKeys||(this.telexKeys=new o),this.telexKeys;case 2:return this.vniKeys||(this.vniKeys=new c),this.vniKeys;case 3:return this.viqrKeys||(this.viqrKeys=new l),this.viqrKeys;case 4:return this.allKeys||(this.allKeys=new d),this.allKeys;case 5:return this.compoundTelexKeys||(this.compoundTelexKeys=new h),this.compoundTelexKeys;default:return this.vkOff||(this.vkOff=new s),this.vkOff}}
8,e.prototype.initTyper=function(t){if(t){this.typer||(this.typer=new i,this.typer.keyMode=this.initKeys());var n=this;if(t.attachEvent)t.attachEvent("onkeypress",function(i){return e.vietTyping(i,n,t)});else if(t.addEventListener)t.addEventListener("keypress",function(i){return e.vietTyping(i,n,t)},!0);else if(t.onkeypress){var r=t.onkeypress;t.onkeypress="function"!=typeof r?function(i){return e.vietTyping(i,n,t)}:function(i){return!!r(i)&&e.vietTyping(i,n,t)}}}},e.vietTyping=function(t,e,i){if(!e||e.typer.keyMode.off)return!0;t||(t=event);var n=document.all?t.keyCode:t.which||t.charCode;if(n<49&&16!=n&&20!=n)return!0;var r,a=e.getCurrentWord(i);return!!(null==a||(r=a.length)<1||a.match(/\s+$/))||(e.typer.value=a,n>32&&e.typer.typing(n)&&((a=e.typer.value).length==r+1&&n==a.charCodeAt(r)&&(e.typer.value=a.substr(0,r),r=0),e.replaceWord(i,e.typer.value),r>0)?(void 0!==t.cancelBubble&&(t.cancelBubble=!0),t.stopPropagation&&(t.preventDefault(),t.stopPropagation()),!1):!t.cancelBubble)},e.prototype.getCurrentWord=function(t,e){if(null==e&&(e=this.lookback),document.selection&&!t.createRange){var i,n=t.selection?t.selection.createRange():t.document.selection.createRange();if(n.text)return null;try{(i=n.duplicate()).moveStart("word",-1)}catch(t){var r=-e;do{(i=n.duplicate()).moveStart("character",r++)}while(!i.text&&r<0)}return t.curWord=i.duplicate(),i.text}if(t.setSelectionRange){var a=t.selectionStart;return a!=(h=t.selectionEnd)?null:(a=Math.max(0,h-e),t.pos1=a,t.pos2=h,t.value.substr(a,h-a))}if(window.getSelection){var s=t.defaultView.getSelection(),o=s.getRangeAt(s.rangeCount-1).cloneRange();if(o.toString())return null;var h=o.startOffset,c=o.endContainer;o.setEnd(c,h),o.setStart(c,Math.max(0,h-e)),t.rng1=o,t.nod1=c,t.pos1=o.startOffset,t.pos2=h;var l=o.toString();return o.setStart(c,h),l}return void 0!==t.value?t.value:null},e.prototype.replaceWord=function(t,e){if(document.selection&&!t.createRange&&t.curWord)t.curWord.text=e,t.curWord.collapse(!1);else if(t.setSelectionRange){var i=t.pos1,n=t.pos2,r=t.value;t.value=r.substr(0,i)+e+r.substr(n),t.setSelectionRange(i+e.length,i+e.length)}else window.getSelection&&t.nod1&&t.nod1.insertData?(t.rng1.setStart(t.nod1,t.pos1),t.nod1.insertData(t.pos1,e),t.nod1.deleteData(t.pos1+e.length,t.pos2-t.pos1),t.rng1.setEnd(t.nod1,t.pos2),t.rng1.setStart(t.nod1,t.pos2)):void 0!==t.value&&(t.value=e)},i.prototype.typing=function(t){return this.changed=0,this.ctrlChar=String.fromCharCode(t),this.keyMode.getAction(this),this.correct(),this.changed},i.prototype.compose=function(t){if(this.value){var e,i=this.findCharToChange(t);if(i&&i[0])e="\\"==i[0]?[1,this.ctrlChar,1]:t>6?this.charMap.getAEOWD(i[0],t,i[3]):this.charMap.getDau(i[0],t),(this.changed=e[0])&&(this.value=this.value.substr(0,i[1])+e[1]+this.value.substr(i[1]+i[2]),e[2]||(this.value+=this.ctrlChar))}},i.prototype.correct=function(){var t=this.value;"nNcC".indexOf(this.ctrlChar)>=0&&(t+=this.ctrlChar);var e=/[^\x01-\x7f](gn)$/i.exec(t);if(e)this.value=t.substr(0,t.length-2)+e[1].charAt(1)+e[1].charAt(0),this.changed=1;else if(!this.changed)return 0},i.prototype.findCharToChange=function(t){var e=this.charMap.lastCharsOf(this.value,5),i=0,n=e[0][0],r=0;if("\\"==n)return[n,this.value.length-1,1];if(15==t){if(!(r=this.charMap.isVD(n)))return null}else for(;"cghmnptCGHMNPT".indexOf(n)>=0;)if(n<"A"||i>=3||!(n=e[++i][0]))return null;n=e[0][0].toLowerCase();var a=e[1][0].toLowerCase(),s=e[2][0].toLowerCase(),o=e[3][0].toLowerCase();if(i>0&&t>8)return null;if(i>0?"h"==n&&this.charMap.isUO(o,s)?i+=1:"h"==n&&this.charMap.isAyhAuhUuhUahUihOih(s,a)?(i+=1,r=this.charMap.isVowel(s)):this.charMap.isAeEiOu(s,a)&&(i+=1,r=this.charMap.isVowel(s)):0==i&&15!=t&&(this.charMap.isAeEiOu(s,a)?(i+=2,r=this.charMap.isVowel(s)):this.charMap.isAeEiOu(a,n)?i++:(r=this.charMap.isVowel(e[1][0]))&&"uyoia".indexOf(n)>=0&&!this.charMap.isUO(a,n)&&!("o"==a&&"a"==n||"u"==a&&"y"==n)&&!("q"==s&&"u"==a||"g"==s&&"i"==a)&&i++,"a"!=n||9!=t&&7!=t||(i=0)),n=e[i][0],0!=i&&0!=r||15==t||(r=this.charMap.isVowel(n)),!r)return null;var h=e[i][1],c=0;i>0&&(7==t||8==t||11==t)&&(c=this.charMap.isUO(e[i+1][0],n))&&(r=c,h+=e[++i][1],c=1);for(var l=this.value.length,d=0;d<=i;d++)l-=e[d][1];return[r,l,h,c]},n.prototype.charAt=function(t){var e=this.vietChars[t];return e?String.fromCharCode(e):null},n.prototype.isVowel=function(t){for(var e=0;e<20&&t!=this.chrCache[e];)e++;if(e<20)return this.indCache[e];for(e=this.length-5;t!=this.charAt(e)&&e;)e--;return this.caching(t,e),e},n.prototype.isVD=function(t){for(var e=this.length-5;t!=this.charAt(e)&&e<this.length;)e++;return e<this.length?e:0},n.prototype.isAyhAuhUuhUahUihOih=function(t,e){if(!t||!e)return 0;var i=this.isVowel(t),n=(i-1)%12,r=this.isVowel(e),a=(r-1)%12;
8return 0==n&&9==a||0==n&&11==a||9==n&&9==a||9==n&&0==a||9==n&&5==a||6==n&&5==a?[i,r]:0},n.prototype.isAeEiOu=function(t,e){if(!t||!e)return 0;var i=this.isVowel(t),n=(i-1)%12,r=this.isVowel(e),a=(r-1)%12;return 0==n&&3==a||3==n&&5==a||6==n&&9==a?[i,r]:0},n.prototype.isUO=function(t,e){if(!t||!e)return 0;var i=this.isVowel(t),n=(i-1)%12;if(9!=n&&10!=n)return 0;var r=this.isVowel(e);return 6!=(n=(r-1)%12)&&7!=n&&8!=n?0:[i,r]},n.prototype.getDau=function(t,e){var i=(t-1)%24+1;if(6==e&&!(t<25?0:1))return[0];var n=24*(6==e?0:e)+i;n==t&&(n=i);var r=this.charAt(n);return r||(r=this.lowerCaseOf(0,n)),[1,r,n>24||6==e]},n.prototype.getAEOWD=function(t,e,i){var n=0,r=i?t[0]:t,a=15==e?(r-1)%2:(r-1)%12;if(i){var s=t[1]-(t[1]-1)%12;return 7==e||11==e?n=this.charAt(r-a+9)+this.charAt(s+7):8==e&&(n=this.charAt(r-a+10)+this.charAt(s+8)),[0!=n,n,1]}for(var o=-1,h=0,c=0;0==h&&++o<this.vmap[0].length;)this.vmap[0][o]==e&&(this.vmap[1][o]==a?h=this.vmap[2][o]-a:this.vmap[2][o]==a&&(h=this.vmap[1][o]-a));0==h?(7!=e||2!=a&&8!=a?9==e&&2==a||11==e&&8==a?h=-1:8!=e||1!=a&&7!=a||(h=1):h=-1,c=1):c=h>0,r+=h;var l=this.charAt(r);return r<145&&this.caching(l,r),l||(l=this.lowerCaseOf(0,r)),[0!=h,l,c]},n.prototype.lastCharsOf=function(t,e){if(!e)return[t.charAt(t.length-1),1];for(var i=new Array(e),n=0;n<e;n++)i[n]=[t.charAt(t.length-n-1),1];return i};new e;var u={},p='|-_ideographicHyphen:ï¼|&_ideographicAmpersand:ï¼|"_ideographicQuoteEnd:ã|"_ideographicQuoteStart:ã|"_ideographicDoubleQuote:ï¼|<_ideographicBracket:ã|>_ideographicBracket:ã|<_ideographicBracket:ã|>_ideographicBracket:ã|[_ideographicBracket:ã|]_ideographicBracket:ã|(_ideographicBracket:ï¼|)_ideographicBracket:ï¼';p+="|__ideographicSpace:ã|._ideographicDot:ã|,_ideographicList:ã|?_ideographicQuestionMark:ï¼|!_ideographicExclamationMark:ï¼|=_unknownCharacterSymbol:ã|;_ideographicSemicolon:ï¼|*_ideographicAsterisk:ï¼|/_ideographicSlash:ï¼",p+="|:_ideographicColon:ï¼",p+="|__backslash:\\|__iterationMark:ã,ã¶,ã»,ã,ã
|__unknownSymbol:ã|__nhayMark:𡿨",p+="|\\_plus:+|\\_iterationMark:ã,ã¶,ã»,ã,ã
|\\_unknownSymbol:ã|\\_nhayMark:𡿨",p+="|\\_idsSymbol:â¿°,⿱,â¿»,â¿´,⿺,⿸,⿹,⿵,â¿·,â¿¶,⿳,⿲",p+="|__idsSymbol:â¿°,⿱,â¿»,â¿´,⿺,⿸,⿹,⿵,â¿·,â¿¶,⿳,⿲",p+="|%_idsSymbol:â¿°,⿱,â¿»,â¿´,⿺,⿸,⿹,⿵,â¿·,â¿¶,⿳,⿲",p+="|idsSymbol:â¿°,⿱,â¿»,â¿´,⿺,⿸,⿹,⿵,â¿·,â¿¶,⿳,⿲",p+="|nháy:𡿨,å£,äº,å¶",p+="|nhayMark:𡿨,å£,äº,å¶",p+="|geta:ã";for(var f,g=(p+="|iteration:ã,ã¶,ã»,ã,ã
").toLowerCase(),m=window.localStorage?window.localStorage:{},v=m||{},y="",_=new Array("UNICODE",97,226,259,101,234,105,111,244,417,117,432,121,65,194,258,69,202,73,79,212,416,85,431,89,225,7845,7855,233,7871,237,243,7889,7899,250,7913,253,193,7844,7854,201,7870,205,211,7888,7898,218,7912,221,224,7847,7857,232,7873,236,242,7891,7901,249,7915,7923,192,7846,7856,200,7872,204,210,7890,7900,217,7914,7922,7841,7853,7863,7865,7879,7883,7885,7897,7907,7909,7921,7925,7840,7852,7862,7864,7878,7882,7884,7896,7906,7908,7920,7924,7843,7849,7859,7867,7875,7881,7887,7893,7903,7911,7917,7927,7842,7848,7858,7866,7874,7880,7886,7892,7902,7910,7916,7926,227,7851,7861,7869,7877,297,245,7895,7905,361,7919,7929,195,7850,7860,7868,7876,296,213,7894,7904,360,7918,7928,100,273,68,272),b=1;b<_.length;b++)y+=String.fromCharCode(_[b]);var C="";for(_=["UNICODE",65,194,258,69,202,73,79,212,416,85,431,89,193,7844,7854,201,7870,205,211,7888,7898,218,7912,221,192,7846,7856,200,7872,204,210,7890,7900,217,7914,7922,7840,7852,7862,7864,7878,7882,7884,7896,7906,7908,7920,7924,7842,7848,7858,7866,7874,7880,7886,7892,7902,7910,7916,7926,195,7850,7860,7868,7876,296,213,7894,7904,360,7918,7928,68,272],b=1;b<_.length;b++)C+=String.fromCharCode(_[b]);function w(t,e){if(null!=t&&""!=t){if("|"!=t.substr(0,1)&&(t="|"+t),e){parts=t.substr(1).split("|");var i="";for(var n in parts){var r=parts[n].split(":");if(r[1]){if(r[1].length>1){var a=r[0].search(f),s=r[1].charAt(0);((o=r[1].charCodeAt(0))>=55296&&o<=56319||o>=56320&&o<=57343)&&(s+=r[1].charAt(1)),i+="|"+(s+r[0].substr(a)+":"+r[1])}if(r[1].length>2){var o;a=r[0].search(f),s=r[1].charAt(0);
8((o=r[1].charCodeAt(0))>=55296&&o<=56319||o>=56320&&o<=57343)&&(s+=r[1].charAt(1));var h=r[0].search(f,a+1),c=r[1].charAt(1),l=r[1].charCodeAt(1);(l>=55296&&l<=56319||l>=56320&&l<=57343)&&(c+=r[1].charAt(2)),i+="|"+(s+c+r[0].substr(h)+":"+r[1])}}}t+=i}p+=t,g+=t.toLowerCase()}}function A(t){w(t,!0)}function x(i,n){this.id=ID++;var r=0==location.href.indexOf("file://")?"http://":"//";this.settings=t.extend({defer:!1,return_select:!1,space_select:!1,cached_dictionary:r+"chunom.org/entry/base_chars/",dictionaries:[r+"chunom.org/entry/generated_chars/"],show_defaults:!1,show_definitions:!0,list_changed:null,candidate_selected:null,font_list:"",match_fonts:!0,background:"#eeeeee",glyph_color:null,text_color:"#000000",autocomplete_color:"#0000ff",border:"2px solid #000000",grid_color:"#333333",padding:2,position:"bottom",offsetX:0,offsetY:0,method:!0,candidate_list:!1},n),this.node=i,this.vUni=new e,this.selectEntry=function(t,e){return this.settings.candidate_selected?this.settings.candidate_selected.apply(this,[t,e]):t},this.updateCandidates=function(e,i,n,r,a){(function(e,i,n,r,a){var s=t(".ime-candidate-list-container");0==s.length&&(s=t("<div class='ime-candidate-list-container'></div>"),t("body").append(s)),s.hide().html("").append(e);var o=t(this.node),h=o.offset(),c=parseInt(h?h.left:0),l=parseInt(h?h.top:0),d=this.settings.offsetX,u=this.settings.offsetY,p=this.settings.position;if("float"==p){console.log(p);try{var f=o.getCaretPosition("x");l+=-o.height()+f.top+u,(c+=f.left+d)+s.outerWidth()>t(window).innerWidth()-5&&(c=t(window).outerWidth()-s.outerWidth()-5),c<0&&(c=0),console.log("top",l)}catch(t){(c+=o.outerWidth()-s.outerWidth())<0&&(c=0)}}"bottom"==p?(l+=o.outerHeight()+u,c+=d):"right"==p?(l+=u,c+=o.outerWidth()):"left"==p?(l+=u,c-=s.outerWidth()):"left"==p?(l+=u,c-=s.outerWidth()):"top"==p?(l-=s.outerHeight(),c+=d):(l+=o.outerHeight()+u,c+=d),s.css({top:l,left:c}),""==s.text()?s.hide():s.show()}).apply(this,[e,i,n,r,a]),this.settings.list_changed&&this.settings.list_changed.apply(this,[e,i,n,r,a])},this.initialize(!0)}f=RegExp("([A-Z"+C+"])","g"),URL_LOADED={},A("nôm:å"),ID=0,x.prototype.showWord=function(t){this.buildCandidates(t,!1,!1),this.showCandidates(0)},x.prototype.replace=function(t,e){this.vUni.getCurrentWord(this.node,t),this.vUni.replaceWord(this.node,e)},x.prototype.sendKey=function(t,e){if(this.settings.candidate_list){null==t&&(t=event);var i,n="number"==typeof t?t:"string"==typeof t?(t+" ").charAt(0):document.all?t.keyCode:t.which||t.charCode,r=this.vUni.getCurrentWord(this.node);"number"==typeof t&&(r+=String.fromCharCode(n));var a=null!=e?e:"",s="",o="";if("+"==r.charAt(r.length-1)&&(r.length<2||" "!=r.charAt(r.length-2)))return r=r.substr(0,r.length-1),this.vUni.replaceWord(this.node,r),void this.showCandidates(1,!0);if(" "==r.charAt(r.length-1)&&(r=r.substr(0,r.length-1)),0==n&&(n=r.charCodeAt(r.length-1)),this.settings.return_select&&13==n||this.settings.space_select&&32==n||null!=r&&"0123456789".indexOf(r.charAt(r.length-1))>-1&&(0==n||String.fromCharCode(n).match(/[0-9]/)))i=r.charAt(r.length-1),i=13==n||32==n?1:parseInt(i)||10,"0123456789 ".indexOf(r.charAt(r.length-1))>-1&&(r=r.substr(0,r.length-1));else{if(33==n||34==n)return this.showCandidates(33==n?-1:1),!1;8==n&&(l=r.charCodeAt(r.length-1))>=55296&&l<=56319&&this.vUni.replaceWord(this.node,r.substr(0,r.length-1))}if(""==a){var h;if(null!=r)for(h=r.length-1;h>-1;h--){var c=r.charAt(h);if(!(y.indexOf(c)>=0||c.match(/[a-zA-Z0-9]/)||" "==c&&h==r.length-1))break;a=c+a}if(""==(a=a.toLowerCase())&&null!=r&&""!=r.charAt(h)&&" \\`^°-_.,:;?!/+*#=<>(){}[]'\"&~%|".indexOf(r.charAt(h))>=0&&(a=r.charAt(h),h--),this.settings.compounds){if(""!=a&&null!=r&&(" "==r.charAt(h)||"-"==r.charAt(h))&&h>0){for(h--;h>-1;h--){c=r.charAt(h);if(y.indexOf(c)<0&&!c.match(/[a-zA-Z0-9]/))break;" "==c&&(c="-"),s=c+s}s=s.replace(/^\-+/,"").toLowerCase()}else if(""!=a){var l=r.charCodeAt(h),d=String.fromCharCode(l);if(--h>0&&l>=55296&&l<=56319||l>=56320&&l<=57343)(l=r.charCodeAt(h))>0&&(d=String.fromCharCode(l)+d);s=d}if(""!=s&&null!=r&&(" "==r.charAt(h)||"-"==r.charAt(h))&&h>0){for(h--;h>-1;h--){c=r.charAt(h);if(y.indexOf(c)<0&&!c.match(/[a-zA-Z0-9]/))break;" "==c&&(c="-"),o=c+o}o=o.replace(/^\-+/,"").toLowerCase()}else if(""!=s){l=r.charCodeAt(h),d=String.fromCharCode(l);if(--h>0&&l>=55296&&l<=56319||l>=56320&&l<=57343)(l=r.charCodeAt(h))>0&&(d=String.fromCharCode(l)+d);o=d}}}if(i)if(this.vUni.candidateList){var u=10*this.vUni.candidateList.page+i-1;u>=this.vUni.candidateList.items.length&&(u=this.vUni.candidateList.items.length-1);var p=this.vUni.candidateList.items[u];if(p){var f=p[0];if("\n"==f){null!=(m=this.selectEntry(f,r+"\n"))&&this.vUni.replaceWord(this.node,m)}else{var g=(p[1]+p[2]).toLowerCase();""!=o&&f.length>=3&&0==g.indexOf(o+s+a)?a=o+" "+s+" "+a:""!=s&&f.length>
8=2&&0==g.indexOf(s+a)&&(a=s.charCodeAt(0)>8192?s+a:s+" "+a);var m,_="-"==r.substr(0,1)?"-":"";if(null!=(m=this.selectEntry(f,a))){var b=r.substr(0,r.length-a.length)+_+m;this.vUni.replaceWord(this.node,b)}this.hide(),v[f]=(parseInt(v[f])||0)+1}}}else console.log("No candidate selected"),this.selectEntry(null,a);else{var C="-"==a.charAt(a.length-1);a=a.replace(/[\-']/g,""),this.buildCandidates(a,C,!1);if(""!=a&&""!=s&&"\0"!=s&&(w=(s+a).replace(/[\-']/g,""),this.buildCandidates(w,C,!0)),""!=a&&""!=o&&"\0"!=o){var w=(o+s+a).replace(/[\-']/g,"");this.buildCandidates(w,C,!0)}if(""!=a&&this.vUni.candidateList&&this.settings.process_list){var A=this.vUni.candidateList.items;this.settings.process_list(a,A,function(t,e,i){i>A.length?i=A.length:i<0&&(i=A.length+i+1),this.splice(i||0,0,[t,e,"",0,0,0])}.bind(A)),this.vUni.candidateList.items=A,this.vUni.candidateList.pages=parseInt((A.length+9)/10)}this.showCandidates(0)}}else this.hide()},x.prototype.initialize=function(e){var i=this.settings,n=t(this.node);(function(e){t("#ime-styles-"+this.id).length>0&&t("#ime-styles-"+this.id).remove();var i=this.settings.font_list;i&&"string"!=typeof i||(i=i?i.split(/\s*,\s*/):[]);var n=i.concat(["sans-serif","han-nom gothic","han-nom gothic supplement","Heiti TC","Heiti SC","nom na tong","nom na tong supplement","hanaminb","hanamina","MingLiU-ExtB","PMingLiU-ExtB","SimSun-ExtB"]).join(",").replace(/ /g,"\\000020"),r=this.settings,a="#ime-id-"+this.id;t("#ime-styles-"+this.id).remove(),t("<style id='ime-styles-"+this.id+"'>").prependTo(),t("html").prepend(t("<style id='ime-styles-"+this.id+"'>.ime-candidate-list-container { z-index: 999999999999; position: absolute; min-width: 14em; width: auto }"+a+".ime-candidate-list { background: "+r.background+"; color: "+r.text_color+"; border: "+r.border+"; width: 100%; max-width: 28em; font-family: sans-serif }"+a+" .ime-number,"+a+" .ime-glyph,"+a+" .ime-definition,.ime-text { line-height: 30px }"+a+" .ime-candidate:first-child { border-top: none }"+a+" .ime-candidate { cursor: pointer; padding: "+parseInt(r.padding)+"px 0; padding-left: 10px; border-top: 1px solid "+r.grid_color+"; white-space: nowrap; overflow: hidden }"+a+" .ime-candidate:hover { background-color: rgba(10, 120, 255, .4); transition: background-color 0.3s }"+a+" .ime-number { float: left; display: inline-block; font-style: normal; margin-left: 0.25em; margin-right: .5em }"+a+" .ime-definition { font-size: 0.7em; float: right; display: inline-block; margin-left: 1em; width: 8em; overflow: hidden; white-space: nowrap; opacity: 0.8; color: "+r.text_color+"; text-decoration: none; text-align: left }"+a+" .ime-definition:hover em { display: none }"+a+" .ime-definition:hover span { background-color: white; padding: 0.42em; padding-right: 0; border-radius: 0.2em; border: 1px solid gray; transition: background-color 1.8s }"+a+" .ime-definition-arrow { width: 20px; font-weight: bold }"+a+" .ime-glyph { float: left; color: "+(r.glyph_color||r.text_color)+"; display: inline-block; font-size:1.5em; padding: 0 0.1em; font-family: "+n+"}"+a+" .ime-candidate:hover .ime-glyph { background-color: white; border-radius: 0.2em }"+a+" .ime-text { display: inline-block; float: left; margin-left: 1em; font-family: sans-serif }"+a+" .ime-text-head { color: "+r.text_color+" }
8"+a+" .ime-text-remainder { color: "+r.autocomplete_color+" }"+a+" .ime-text-hyphen { color: "+r.text_color+"; opacity: 0.5 }</style>")),this.settings.match_fonts&&this.settings.candidate_list?t(this.node).css({fontFamily:n}):e||t(this.node).css({fontFamily:""})}).apply(this,[e]),e||n.unbind(".ime"),e&&i.candidate_list&&(i.dictionaries||i.cached_dictionaries)&&function(e){var i=function(e,i){if(!e.__loading_started__){e.__loading_started__=!0;var n=e.settings.dictionaries;"object"==typeof n&&"[object Object]"==Object.prototype.toString.call(n)&&(n=[n]);var r=!1;e.settings.cached_dictionary&&(n.push(e.settings.cached_dictionary),r=!0),e._loadStack=0,e._finishFn=i;for(var a=0,s=n.length;a<s;a++){var o,h=n[a];"string"==typeof h?r&&a==s-1&&null!=m["__dictionary_cache_"+CACHEVERSION+"__"+e.settings.cached_dictionary]?(console.log("Loading dictionary from cache"),(o=t.parseJSON(m["__dictionary_cache_"+CACHEVERSION+"__"+e.settings.cached_dictionary]))&&o.dict&&A(o.dict),o&&o.defs&&t.extend(u,o.defs)):URL_LOADED[h]||(URL_LOADED[h]=1,r&&a==s-1?(console.log("Loading dictionary to cache: "+h),e._loadStack++,t.ajax({url:h,success:function(e){0==--this._loadStack&&this._finishFn&&(this._finishFn(),this._finishFn=null),m["__dictionary_cache_"+CACHEVERSION+"__"+this.settings.cached_dictionary]=e,(e=t.parseJSON(e))&&e.dict&&A(e.dict),e&&e.defs&&t.extend(u,e.defs)}.bind(e)})):(console.log("Loading dictionary "+h),e._loadStack++,t.ajax({url:h,success:function(e){0==--this._loadStack&&this._finishFn&&(this._finishFn(),this._finishFn=null),(e=t.parseJSON(e))&&e.dict&&A(e.dict),e&&e.defs&&t.extend(u,e.defs)}.bind(e)}))):(console.log("Loading dictionary object",h),(o=h)&&o.dict&&A(o.dict),o&&o.defs&&t.extend(u,o.defs))}0==e._loadStack&&e._finishFn&&(e._finishFn(),e._finishFn=null)}};if(e.settings.defer){console.log("Set trigger...");var n=function(){if(!this.__loading_started__){var n=t('<div class="ime-starting-indicator">â</div>').css({position:"absolute",background:"black",color:"black",lineHeight:"1.5em",width:"1.5em",textAlign:"center",opacity:.6,borderRadius:"100px",fontFamily:"serif"}),r=t(this.node).attr("readonly","wait"==e.settings.defer).before(n).position();n.css({top:r.top,left:r.left,transition:"1.25s transform",transform:"rotate(360deg)"}),console.log("Loading..."),i(this,function(e){console.log("Done..."),t(this.node).attr("readonly",!1),t(".ime-starting-indicator").hide()}.bind(this,n))}}.bind(e);t(e.node).bind("keydown.ime-loader",n).bind("focus.ime-loader",n)}else i(e)}(this);var r=this.vUni;e&&r.initTyper(this.node),!0===i.method?r.setMethod(i.candidate_list?1:4):"telex"==i.method?r.setMethod(1):i.method&&"off"!=i.method?i.candidate_list&&i.method?r.setMethod(1):"vni"==i.method?r.setMethod(2):r.setMethod(i.method):r.setMethod(0),n.attr("autocomplete","off"),n.bind("blur.ime",function(e){t(this).data("ime").hide()}),n.bind("keyup.ime",function(e){var i=t(e.target).data("ime");if(i){var n=document.all?e.keyCode:e.which||e.charCode;return!(!e.shiftKey&&!e.ctrlKey||32!=n&&13!=n)||(27==n?(i.hide(),!1):i.sendKey(e))}}),n.bind("mouseup.ime",function(e){t(this).trigger("keyup")}),n.bind("keydown.ime",function(e){var i=t(e.target).data("ime");if(i){var n=document.all?e.keyCode:e.which||e.charCode;if((e.shiftKey||e.ctrlKey)&&(32==n||13==n))return!0;if(33==n||34==n)return!1;var a=r.candidateList;if(a&&a.items&&a.items.length>0){if(13==n&&i.settings.return_select)return!1;if(32==n&&i.settings.space_select)return!1}}})},x.prototype.buildCandidates=function(t,e,i){var n=this.vUni;if(""==t)return this.settings.show_defaults?n.candidateList={items:[["\n","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ã»","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["â¹","","",0,0,0],["ã
","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ã","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["ï¼","","",0,0,0],["â ","","",0,0,0],["â¡","","",0,0,0],["â¢","","",0,0,0],["â£","","",0,0,0],["â¤","","",0,0,0],["â¥","","",0,0,0],["â¦","","",0,0,0],["â§","","",0,0,0],["â¨","","",0,0,0],["â©","","",0,0,0],["âª","","",0,0,0],["â«","","",0,0,0],["â¬","","",0,0,0],["â","","",0,0,0],["â®","","",0,0,0],["â¯","","",0,0,0],["â°","","",0,0,0],["â±","","",0,0,0],["â²","","",0,0,0],["â³","","",0,0,0],["â¿°","","",0,0,0],["⿱","","",0,0,0],["⿲","","",0,0,0],["⿳","","",0,0,0],["â¿´","","",0,0,0],["⿵","","",0,0,0],["â¿¶","","",0,0,0],["â¿·","","",0,0,0],["⿸","","",0,0,0],["⿹","","",0,0,0],["⿺","","",0,0,0],["â¿»","","",0,0,0]],pages:8,page:0}:void this.hide();for(var r=[],a={},s=0;(s=g.indexOf("|"+t+(t.length>0?"":":"),s)+1)&&s>-1;){var o=p.substr(s,t.length),h=(x=(p.substr(s+t.length,100)+"|##").replace(/\|.*?##/g,"").replace(/[\r\n]/g,"").split(":",2))[0];if(!e||""!=h&&h.match(f)){for(var c=null!=x[1]?x[1].split(","):[],l=0,d=0,m=c.length;d<m;d++){for(var y=c[d],_="",b=0,C=y.length;b<C;b++){var w=y.charCodeAt(b);w>55296&&w<56319?l=w:(_+=(l?String.fromCharCode(l):"")+String.fromCharCode(w),l=0)}if(!a[_]){for(var A=0,x=0;x<h.length;
8x++)A=1e4*A+h.charCodeAt(x)%1e4;var S=parseInt(v[_]||0);if(u[o+h+_]&&(S=2*(S+1)),r.push([_,o,h,A,S,h.length]),a[_]=1,100==r.length)break}}if(100==r.length)break}}r.sort(function(t,e){return t[5]<e[5]?-1:t[5]>e[5]?1:e[4]-t[4]||t[3]-e[3]});var k=n.candidateList;i&&k&&k.items&&(r=r.concat(k.items));var L=parseInt((r.length+9)/10);return n.candidateList={items:r,pages:L,page:0},!0},x.prototype.showCandidates=function(e,i){var n=t("<div></div>"),r=this.vUni.candidateList;if(r&&r.items){var a=r.items;r.page=e?r.page+e:0,r.page>=r.pages&&(r.page=i?0:r.pages-1),r.page<0&&(r.page=0);var s=r.page,o=10*s+10;o>a.length&&(o=a.length);for(var h=this,c=0,l=10*s;l<o&&a[l];l++){c++;var d=a[l][1],p=a[l][2];is_punctuation=!1,"_"==p.charAt(0)&&(is_punctuation=!0,d=p.substr(1),p=""),d=d.replace(f,"<tt class='ime-text-hyphen'>-</tt>$1").toLowerCase(),p=p.replace(f,"<tt class='ime-text-hyphen'>-</tt>$1").toLowerCase();var g="";this.settings.show_definitions&&(g=null==(g=u[a[l][1]+a[l][2]+a[l][0]])?"":"<a class='ime-definition' title=\""+g.replace('"',"''")+"\" target='_blank'><em class='ime-definition-arrow'>→</em> <span>"+g+"</span></a>");var m=(l+1)%10+".";m=is_punctuation&&1==o&&this.settings.return_select?" ":'<em class="ime-number">'+m+"</em>";var v=a[l][0],y=t("<div class='ime-candidate ime-candidate-"+c+"'>"+g+m+" <span class='ime-glyph'>"+v+"</span><span class='ime-text'><i class='ime-text-head'>"+d+"</i><b class='ime-text-remainder'>"+p+"</b></span></div>");y.bind("touchend click",function(e){var i=t(e.target).closest(".ime-candidate").attr("class").split("-").pop();return h.sendKey(i.charCodeAt(i.length-1)),t(h.node).focus(),e.stopPropagation(),!1}).bind("touchend mousedown",function(){},!1),n.append(y)}var _=t("<div class='ime-candidate-list'></div>").attr("id","ime-id-"+this.id).append(n);this.updateCandidates(_,a.length,r.page+1,r.pages,a)}},x.prototype.show=function(){t(this.node).trigger("keyup")},x.prototype.hide=function(){this.vUni.candidateList={items:[],pages:0,page:0},t("#ime-id-"+this.id).hide(),this.settings.list_changed&&this.settings.list_changed(null,0,0,0)},t.fn.ime=function(e,i){if("string"==typeof e){if("instance"==e){for(var n=[],r=0,a=this.length;r<a;r++)n.push(t(this[r]).data("ime"));return n}return"update"==e?this.each(function(){var e=t(this).data("ime");return t.extend(e.settings,i),e.initialize(!1),this}):this.each(function(){var n=t(this).data("ime");return n.settings[e]=i,n.initialize(!1),n.show(),this})}return this.each(function(){var i=t(this).data("ime");return i||(i=new x(this,e),t(this).data("ime",i)),this})},t.fn.ime.dict=w,t.fn.ime.dict_compounds=A}(jQuery),function(t,e,i,n){t(function(){var e={primaryStyles:["fontFamily","fontSize","fontWeight","fontVariant","fontStyle","textDecoration","paddingLeft","paddingTop","paddingBottom","paddingRight","textAlign","marginLeft","marginTop","marginBottom","marginRight","borderLeftColor","borderTopColor","borderBottomColor","borderRightColor","borderLeftStyle","borderTopStyle","borderBottomStyle","borderRightStyle","borderLeftWidth","borderTopWidth","borderBottomWidth","borderRightWidth","line-height","outline","borderRadius","white-space"],specificStyle:{"word-wrap":"break-word","overflow-x":"hidden","overflow-y":"auto"},simulator:t('<div id="textarea_simulator" contenteditable="true"/>').css({position:"absolute",top:0,left:0,visibility:"hidden"}).appendTo(i.body),toHtml:function(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>").replace(/(\s)/g,'<span style="white-space:pre-wrap;display:inline-block">$1</span>')},getCaretPosition:function(n){var r=e,a=this,s=a[0],o=a.offset();if("INPUT"==s.tagName&&t(s).css("white-space","nowrap"),"Microsoft Internet Explorer"==navigator.appName){s.focus();var h=i.selection.createRange();return{left:h.boundingLeft-o.left,top:parseInt(h.boundingTop)-o.top+s.scrollTop+i.documentElement.scrollTop+parseInt(a.getComputedStyle("fontSize"))}}r.simulator.empty(),t.each(r.primaryStyles,function(t,e){a.cloneStyle(r.simulator,e)}),r.simulator.css(t.extend({width:a.width(),height:a.height()},r.specificStyle));var c=a.val(),l=a.getCursorPosition(),d=c.substring(0,l),u=(c.substring(l),t('<span class="before"/>').html(r.toHtml(d))),p=t('<span class="focus" style="display:inline-block"/>'),f=t('<span class="after" style="display:inline-block"/>').html(""==n||null==n?" i":" "+n);r.simulator.append(u).append(p).append(f);var g=p.offset(),m=r.simulator.offset(),v=g.top-m.top-s.scrollTop+(/[mM]ozilla/.test(navigator.userAgent)?0:parseInt(a.getComputedStyle("fontSize"))),y=p[0].offsetLeft-r.simulator[0].offsetLeft-s.scrollLeft;
8return{top:v,bottom:v+f.height(),left:y-f.width(),right:y}}};t.fn.extend({getComputedStyle:function(t){if(0!=this.length){var e=this[0],n=this.css(t);return n=n||("Microsoft Internet Explorer"==navigator.appName?e.currentStyle[t]:i.defaultView.getComputedStyle(e,null)[t])}},cloneStyle:function(e,i){var n=this.getComputedStyle(i);n&&t(e).css(i,n)},cloneAllStyle:function(t,e){var i=this[0];for(var n in i.style){var r=i.style[n];("string"==typeof r||"number"==typeof r)&&this.cloneStyle(t,n)}},getCursorPosition:function(){var t=this[0],e=0;if("selectionStart"in t)e=t.selectionStart;else if("selection"in i){var n=i.selection.createRange();if(null==i.selection||!n||!n.moveStart||"function"!=typeof n.moveStart){var r=i.body.createTextRange();for(r.moveToElementText(t);r.compareEndPoints("StartToStart",n)<0;e++)r.moveStart("character",1);for(var a=0;a<=e;a++)"\n"==t.value.charAt(a)&&e++;return e-=t.value.split("\n").length-1}t.focus();var s=i.selection.createRange().text.length;n.moveStart("character",-t.value.length),e=n.text.length-s}return e},getCaretPosition:e.getCaretPosition})})}(jQuery,window,document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.