(function(b){var a=function(d){this._options={checkOnLoad:false,resetOnEnd:false,loopCheckTime:50,loopMaxNumber:5,baitClass:"pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",baitStyle:"width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;",debug:false};this._var={version:"3.2.1",bait:null,checking:false,loop:null,loopNumber:0,event:{detected:[],notDetected:[]}};if(d!==undefined){this.setOption(d)}var c=this;var e=function(){setTimeout(function(){if(c._options.checkOnLoad===true){if(c._options.debug===true){c._log("onload->eventCallback","A check loading is launched")}if(c._var.bait===null){c._creatBait()}setTimeout(function(){c.check()},1)}},1)};if(b.addEventListener!==undefined){b.addEventListener("load",e,false)}else{b.attachEvent("onload",e)}};a.prototype._options=null;a.prototype._var=null;a.prototype._bait=null;a.prototype._log=function(d,c){console.log("[BlockAdBlock]["+d+"] "+c)};a.prototype.setOption=function(c,f){if(f!==undefined){var d=c;c={};c[d]=f}for(var e in c){this._options[e]=c[e];if(this._options.debug===true){this._log("setOption",'The option "'+e+'" he was assigned to "'+c[e]+'"')}}return this};a.prototype._creatBait=function(){var c=document.createElement("div");c.setAttribute("class",this._options.baitClass);c.setAttribute("style",this._options.baitStyle);this._var.bait=b.document.body.appendChild(c);this._var.bait.offsetParent;this._var.bait.offsetHeight;this._var.bait.offsetLeft;this._var.bait.offsetTop;this._var.bait.offsetWidth;this._var.bait.clientHeight;this._var.bait.clientWidth;if(this._options.debug===true){this._log("_creatBait","Bait has been created")}};a.prototype._destroyBait=function(){b.document.body.removeChild(this._var.bait);this._var.bait=null;if(this._options.debug===true){this._log("_destroyBait","Bait has been removed")}};a.prototype.check=function(c){if(c===undefined){c=true}if(this._options.debug===true){this._log("check","An audit was requested "+(c===true?"with a":"without")+" loop")}if(this._var.checking===true){if(this._options.debug===true){this._log("check","A check was canceled because there is already an ongoing")}return false}this._var.checking=true;if(this._var.bait===null){this._creatBait()}var d=this;this._var.loopNumber=0;if(c===true){this._var.loop=setInterval(function(){d._checkBait(c)},this._options.loopCheckTime)}setTimeout(function(){d._checkBait(c)},1);if(this._options.debug===true){this._log("check","A check is in progress ...")}return true};a.prototype._checkBait=function(c){var d=false;if(this._var.bait===null){this._creatBait()}if(b.document.body.getAttribute("abp")!==null||this._var.bait.offsetParent===null||this._var.bait.offsetHeight==0||this._var.bait.offsetLeft==0||this._var.bait.offsetTop==0||this._var.bait.offsetWidth==0||this._var.bait.clientHeight==0||this._var.bait.clientWidth==0){d=true}if(b.getComputedStyle!==undefined){var e=b.getComputedStyle(this._var.bait,null);if(e&&(e.getPropertyValue("display")=="none"||e.getPropertyValue("visibility")=="hidden")){d=true}}if(this._options.debug===true){this._log("_checkBait","A check ("+(this._var.loopNumber+1)+"/"+this._options.loopMaxNumber+" ~"+(1+this._var.loopNumber*this._options.loopCheckTime)+"ms) was conducted and detection is "+(d===true?"positive":"negative"))}if(c===true){this._var.loopNumber++;if(this._var.loopNumber>=this._options.loopMaxNumber){this._stopLoop()}}if(d===true){this._stopLoop();this._destroyBait();this.emitEvent(true);if(c===true){this._var.checking=false}}else{if(this._var.loop===null||c===false){this._destroyBait();this.emitEvent(false);if(c===true){this._var.checking=false}}}};a.prototype._stopLoop=function(c){clearInterval(this._var.loop);this._var.loop=null;this._var.loopNumber=0;if(this._options.debug===true){this._log("_stopLoop","A loop has been stopped")}};a.prototype.emitEvent=function(c){if(this._options.debug===true){this._log("emitEvent","An event with a "+(c===true?"positive":"negative")+" detection was called")}var e=this._var.event[(c===true?"detected":"notDetected")];for(var d in e){if(this._options.debug===true){this._log("emitEvent","Call function "+(parseInt(d)+1)+"/"+e.length)}if(e.hasOwnProperty(d)){e[d]()}}if(this._options.resetOnEnd===true){this.clearEvent()}return this};a.prototype.clearEvent=function(){this._var.event.detected=[];this._var.event.notDetected=[];if(this._options.debug===true){this._log("clearEvent","The event list has been cleared")}};a.prototype.on=function(c,d){this._var.event[(c===true?"detected":"notDetected")].push(d);if(this._options.debug===true){this._log("on",'A type of event "'+(c===true?"detected":"notDetected")+'" was added')}return this};a.prototype.onDetected=function(c){return this.on(true,c)};a.prototype.onNotDetected=function(c){return this.on(false,c)};b.BlockAdBlock=a;if(b.blockAdBlock===undefined){b.blockAdBlock=new a({checkOnLoad:true,resetOnEnd:true})}})(window);RealKana=function(){var u,p,i,L,H=-1,l,R,f,Q,y,B,J,P,S,m,w,O,N=-1,x,j,D={し:"_si_",ち:"_ti_",つ:"_tu_",ふ:"_hu_",を:"_wo_",じ:"_zi_",ぢ:"_di_",づ:"_du_",シ:"_si_",チ:"_ti_",ツ:"_tu_",フ:"_hu_",ヲ:"_wo_",ジ:"_zi_",ヂ:"_di_",ヅ:"_du_",しゃ:"_sya_",しゅ:"_syu_",しょ:"_syo_",ちゃ:"_tya_",ちゅ:"_tyu_",ちょ:"_tyo_",じゃ:"_zya_jya_",じゅ:"_zyu_jyu_",じょ:"_zyo_jyo_",ぢゃ:"_zya_dya_",ぢゅ:"_zyu_dyu_",ぢょ:"_zyo_dyo_",シャ:"_sya_",シュ:"_syu_",ショ:"_syo_",チャ:"_tya_",チュ:"_tyu_",チョ:"_tyo_",ジャ:"_zya_jya_",ジュ:"_zyu_jyu_",ジョ:"_zyo_jyo_",ヂャ:"_zya_dya_",ヂュ:"_zyu_dyu_",ヂョ:"_zyo_dyo_"},C={1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:"a",11:"b",12:"c",13:"d",14:"e",15:"f",16:"g",17:"h",18:"i"},h={あ:[0,0],い:[1,0],う:[2,0],え:[3,0],お:[4,0],か:[5,0],が:[6,0],き:[7,0],ぎ:[8,0],く:[9,0],ぐ:[0,1],け:[1,1],げ:[2,1],こ:[3,1],ご:[4,1],さ:[5,1],ざ:[6,1],し:[7,1],じ:[8,1],す:[9,1],ず:[0,2],せ:[1,2],ぜ:[2,2],そ:[3,2],ぞ:[4,2],た:[5,2],だ:[6,2],ち:[7,2],ぢ:[8,2],つ:[9,2],づ:[0,3],て:[1,3],で:[2,3],と:[3,3],ど:[4,3],な:[5,3],に:[6,3],ぬ:[7,3],ね:[8,3],の:[9,3],は:[0,4],ば:[1,4],ぱ:[2,4],ひ:[3,4],び:[4,4],ぴ:[5,4],ふ:[6,4],ぶ:[7,4],ぷ:[8,4],へ:[9,4],べ:[0,5],ぺ:[1,5],ほ:[2,5],ぼ:[3,5],ぽ:[4,5],ま:[5,5],み:[6,5],む:[7,5],め:[8,5],も:[9,5],ゃ:[0,6],や:[1,6],ゅ:[2,6],ゆ:[3,6],ょ:[4,6],よ:[5,6],ら:[6,6],り:[7,6],る:[8,6],れ:[9,6],ろ:[0,7],わ:[1,7],を:[2,7],ん:[3,7],ァ:[4,7],ア:[5,7],ィ:[6,7],イ:[7,7],ゥ:[8,7],ウ:[9,7],ェ:[0,8],エ:[1,8],ォ:[2,8],オ:[3,8],カ:[4,8],ガ:[5,8],キ:[6,8],ギ:[7,8],ク:[8,8],グ:[9,8],ケ:[0,9],ゲ:[1,9],コ:[2,9],ゴ:[3,9],サ:[4,9],ザ:[5,9],シ:[6,9],ジ:[7,9],ス:[8,9],ズ:[9,9],セ:[0,10],ゼ:[1,10],ソ:[2,10],ゾ:[3,10],タ:[4,10],ダ:[5,10],チ:[6,10],ヂ:[7,10],ツ:[8,10],ヅ:[9,10],テ:[0,11],デ:[1,11],ト:[2,11],ド:[3,11],ナ:[4,11],ニ:[5,11],ヌ:[6,11],ネ:[7,11],ノ:[8,11],ハ:[9,11],バ:[0,12],パ:[1,12],ヒ:[2,12],ビ:[3,12],ピ:[4,12],フ:[5,12],ブ:[6,12],プ:[7,12],ヘ:[8,12],ベ:[9,12],ペ:[0,13],ホ:[1,13],ボ:[2,13],ポ:[3,13],マ:[4,13],ミ:[5,13],ム:[6,13],メ:[7,13],モ:[8,13],ャ:[9,13],ヤ:[0,14],ュ:[1,14],ユ:[2,14],ョ:[3,14],ヨ:[4,14],ラ:[5,14],リ:[6,14],ル:[7,14],レ:[8,14],ロ:[9,14],ワ:[0,15],ヲ:[1,15],ン:[2,15],ヴ:[3,15]},q=[[["あ","a"],["い","i"],["う","u"],["え","e"],["お","o"]],[["か","ka"],["き","ki"],["く","ku"],["け","ke"],["こ","ko"]],[["さ","sa"],["し","shi"],["す","su"],["せ","se"],["そ","so"]],[["た","ta"],["ち","chi"],["つ","tsu"],["て","te"],["と","to"]],[["な","na"],["に","ni"],["ぬ","nu"],["ね","ne"],["の","no"]],[["は","ha"],["ひ","hi"],["ふ","fu"],["へ","he"],["ほ","ho"]],[["ま","ma"],["み","mi"],["む","mu"],["め","me"],["も","mo"]],[["や","ya"],["ゆ","yu"],["よ","yo"]],[["ら","ra"],["り","ri"],["る","ru"],["れ","re"],["ろ","ro"]],[["わ","wa"],["を","o"]],[["ん","n"]],[["が","ga"],["ぎ","gi"],["ぐ","gu"],["げ","ge"],["ご","go"]],[["ざ","za"],["じ","ji"],["ず","zu"],["ぜ","ze"],["ぞ","zo"]],[["だ","da"],["ぢ","ji"],["づ","zu"],["で","de"],["ど","do"]],[["ば","ba"],["び","bi"],["ぶ","bu"],["べ","be"],["ぼ","bo"]],[["ぱ","pa"],["ぴ","pi"],["ぷ","pu"],["ぺ","pe"],["ぽ","po"]],[["きゃ","kya"],["きゅ","kyu"],["きょ","kyo"]],[["しゃ","sha"],["しゅ","shu"],["しょ","sho"]],[["ちゃ","cha"],["ちゅ","chu"],["ちょ","cho"]],[["にゃ","nya"],["にゅ","nyu"],["にょ","nyo"]],[["ひゃ","hya"],["ひゅ","hyu"],["ひょ","hyo"]],[["みゃ","mya"],["みゅ","myu"],["みょ","myo"]],[["りゃ","rya"],["りゅ","ryu"],["りょ","ryo"]],[["ぎゃ","gya"],["ぎゅ","gyu"],["ぎょ","gyo"]],[["じゃ","ja"],["じゅ","ju"],["じょ","jo"]],[["ぢゃ","ja"],["ぢゅ","ju"],["ぢょ","jo"]],[["びゃ","bya"],["びゅ","byu"],["びょ","byo"]],[["ぴゃ","pya"],["ぴゅ","pyu"],["ぴょ","pyo"]],[["ア","a"],["イ","i"],["ウ","u"],["エ","e"],["オ","o"]],[["カ","ka"],["キ","ki"],["ク","ku"],["ケ","ke"],["コ","ko"]],[["サ","sa"],["シ","shi"],["ス","su"],["セ","se"],["ソ","so"]],[["タ","ta"],["チ","chi"],["ツ","tsu"],["テ","te"],["ト","to"]],[["ナ","na"],["ニ","ni"],["ヌ","nu"],["ネ","ne"],["ノ","no"]],[["ハ","ha"],["ヒ","hi"],["フ","fu"],["ヘ","he"],["ホ","ho"]],[["マ","ma"],["ミ","mi"],["ム","mu"],["メ","me"],["モ","mo"]],[["ヤ","ya"],["ユ","yu"],["ヨ","yo"]],[["ラ","ra"],["リ","ri"],["ル","ru"],["レ","re"],["ロ","ro"]],[["ワ","wa"],["ヲ","o"]],[["ン","n"]],[["ガ","ga"],["ギ","gi"],["グ","gu"],["ゲ","ge"],["ゴ","go"]],[["ザ","za"],["ジ","ji"],["ズ","zu"],["ゼ","ze"],["ゾ","zo"]],[["ダ","da"],["ヂ","ji"],["ヅ","zu"],["デ","de"],["ド","do"]],[["バ","ba"],["ビ","bi"],["ブ","bu"],["ベ","be"],["ボ","bo"]],[["パ","pa"],["ピ","pi"],["プ","pu"],["ペ","pe"],["ポ","po"]],[["キャ","kya"],["キュ","kyu"],["キョ","kyo"]],[["シャ","sha"],["シュ","shu"],["ショ","sho"]],[["チャ","cha"],["チュ","chu"],["チョ","cho"]],[["ニャ","nya"],["ニュ","nyu"],["ニョ","nyo"]],[["ヒャ","hya"],["ヒュ","hyu"],["ヒョ","hyo"]],[["ミャ","mya"],["ミュ","myu"],["ミョ","myo"]],[["リャ","rya"],["リュ","ryu"],["リョ","ryo"]],[["ギャ","gya"],["ギュ","gyu"],["ギョ","gyo"]],[["ジャ","ja"],["ジュ","ju"],["ジョ","jo"]],[["ヂャ","ja"],["ヂュ","ju"],["ヂョ","jo"]],[["ビャ","bya"],["ビュ","byu"],["ビョ","byo"]],[["ピャ","pya"],["ピュ","pyu"],["ピョ","pyo"]],[["イェ","ye"]],[["ウィ","wi"],["ウェ","we"],["ウォ","wo"]],[["ヴァ","va"],["ヴィ","vi"],["ヴ","vu"],["ヴェ","ve"],["ヴォ","vo"]],[["シェ","she"]],[["ジェ","je"]],[["チェ","che"]],[["ティ","ti"],["トゥ","tu"]],[["ディ","di"],["ドゥ","du"]],[["ツァ","tsa"],["ツィ","tsi"],["ツェ","tse"],["ツォ","tso"]],[["ファ","fa"],["フィ","fi"],["フェ","fe"],["フォ","fo"]],[["ヴャ","vya"],["ヴュ","vyu"],["ヴョ","vyo"]],[["テュ","tyu"]],[["デュ","dyu"]],[["フュ","fyu"]]],k={h:{columns:16,offset:0},hd:{columns:12,offset:16},k:{columns:16,offset:28},kd:{columns:12,offset:44},ke:{columns:14,offset:56}},n={78:1,110:1},s={Enter:13,"U+0020":32,"U+0041":97,"U+0045":101,"U+0049":105,"U+004E":110,"U+004F":111,"U+0055":117},b={32:1},v={13:1,32:1},c={65:1,69:1,73:1,79:1,85:1,97:1,101:1,105:1,111:1,117:1};function M(){var T=$("#b td").index($(this).parent())+1;$("#all").removeClass("b-1 b-2 b-3 b-4 b-5 b-6 b-7 b-8 b-9 b-a b-b b-c b-d b-e b-f b-g b-h b-i").addClass("b-"+C[T]);L=L.replace(/b./,("b"+C[T]));I()}function o(){var T=$("#preview td").index($(this).parent())+1;L=L.replace(/p\d/,("p"+T));I();e()}function K(T){var V,U=(T.which==229);l.val(l.val().trim());V=l.val();if(U){T.which=s[T.originalEvent.keyIdentifier]}if(b[T.which]){T.preventDefault()}if(O&&(c[T.which]||((p.text()=="n")&&n[T.which]))){if(!U){V+=String.fromCharCode(T.which)}T.which=13}V=V.toLowerCase();if(v[T.which]){if(p.is(":visible")){d()}else{if((V==p.text())||(D[y[0]]&&D[y[0]].match("_"+V+"_"))){T.preventDefault();if(!Q){S.text(S.text()-0+1)}$("#bottom, #tabs #front a, #top").fadeTo(200,$("#all").data("opacity")-0);$("#intro, #site").fadeOut(200);$("#top").addClass("fade");d()}else{if(V==Q){j.hide();p.fadeIn(200)}else{Q=V;j.fadeIn(200)}}}}else{if(T.which==27){G()}}}function F(){var W,V,T,U;if($("body").hasClass("kana")){e();T=new RegExp(f+"(\\d+)");L.match(T);U=RegExp.$1;W=k[f].columns;while(W){if(U>=(V=Math.pow(2,--W))){U-=V;$("#kana input").eq(W).prop("checked",true)}}$("#kana td").click(function(){$("#kana input").eq($(this).siblings().andSelf().index($(this))).click()});$("#kana input").click(A);$("#preview td > span").click(o);$("#bottom ul:first-child a").click(function(){$("#kana input").prop("checked",$(this).parent().is(":first-child"));A()})}}function t(){var V,U,T;if(f=="o"){$("#b span").click(M);L.match(/t(\d+)/);T=RegExp.$1;V=9;while(V){if(T>=(U=Math.pow(2,--V))){T-=U;$("#t input").eq(V).prop("checked",true)}}$("#t span").click(function(){$("#t input").eq($("#t td").index($(this).parent())).click()});$("#t input").click(A);$("#continuous input").click(function(){L=L.replace(/c./,this.checked?"c1":"c0");I()});$("#random input").click(function(){L=L.replace(/r./,this.checked?"r1":"r0");I()});$("#speed input").click(function(){L=L.replace(/s./,this.checked?"s1":"s0");I()})}}function z(){if(f=="p"){if(!window._local){ga("send","event","interaction","blocked")}localStorage.setItem("blocked","true");$("#circle, #intro, #question").remove();$("#tab input").hide();$("#top").append('<div id="blocked"><p>Please turn off your ad blocker to use Real Kana.</p><p>I am a solo developer and rely upon advertising to support the site.</p><p>Thank you for your understanding.</p><p>Feedback: <a href="mailto:info@realkana.com">info@realkana.com</a></p></div>')}else{$("#ad-left").replaceWith('<a href="http://zig.iffy.studio/" id="zig-left" target="_blank"></a>');$("#ad-right").replaceWith('<a href="http://zig.iffy.studio/" id="zig-right" target="_blank"></a>')}}function r(){if(localStorage.getItem("blocked")){if(!window._local){ga("send","event","interaction","unblocked")}localStorage.removeItem("blocked")}}function a(){var Z,T,aa,W,V,X,Y,U,ab;if(f=="p"){i=L.match(/c1/);J=L.match(/r1/);O=L.match(/s1/);$(document).keydown(K);if(L.search(/h0hd0k0kd0ke0/)!=-1){L=L.replace(/h0/,"h1");I()}if(L.search(/t0/)!=-1){L=L.replace(/t0/,"t64");I()}p=$("#answer");l=$("#tab input");B=$("#question");S=$("#right span");m=$("#right, #shown");w=$("#shown span");j=$("#x");B.on("mouseover","span",G);u=0;R=x=[];T=L.match(/(h\d+)(hd\d+)(k\d+)(kd\d+)(ke\d+)/);T.shift();for(W=4;W>=0;W--){X=T[W].match(/([dehk]+)(\d+)/);X.shift();X[1]-=0;if(X[1]){V=k[X[0]].columns;while(V){if(X[1]>=(Y=Math.pow(2,--V))){X[1]-=Y;R=q[V+k[X[0]].offset].concat(R)}}}}if(U=localStorage.getItem("state")){U=JSON.parse(U);if(J){do{if(R.length==1){break}E(R)}while(R[0][0]==U.kana)}N=U.typeface;localStorage.removeItem("state")}else{if(J){E(R)}}L.match(/t(\d+)/);ab=RegExp.$1;W=9;while(W){if(ab>=(Y=Math.pow(2,--W))){ab-=Y;x.push(W+1)}}d()}}function d(){var T,U,V;if((!i)&&m.hasClass("finished")){m.removeClass("finished");S.text(S.text()-P);w.text(1)}else{w.text(w.text()-0+1);if(w.text()=="1"){$("#download, #facebook").fadeOut(200);m.fadeIn(200)}}if((!i)&&m.is(":visible")&&!(w.text()%R.length)){m.addClass("finished");P=S.text()-0}Q="";l.attr("name","g-"+Math.floor(Math.random()*1000000000)).val("").blur(function(){$(this).addClass("blur")}).focus(function(){$(this).removeClass("blur")});if(!window._ipad){l.focus()}p.hide();j.hide();if(++H==R.length){H=0;if((!window._ipad)&&(u>24)){if(!window._local){ga("send","event","interaction","refresh")}L=L.replace(/$/,"r"+S.text()+"s"+(w.text()-1));I();g();return}if(J){U=R[R.length-1][0];do{if(R.length==1){break}E(R)}while(R[0][0]==U)}}y=R[H];T=-1;do{T=Math.floor(Math.random()*x.length);if(x.length==1){break}}while(T==N);N=T;V=x[N]-1;B.empty();u++;for(_i=0;_i<y[0].length;_i++){_char=y[0].charAt(_i);_glyph=$("<span>").css("background-position",("-"+((h[_char][0]*50)+(V*500))+"px -"+(h[_char][1]*50)+"px"));B.append(_glyph)}p.text(y[1]);if(!window._local){ga("send","event","interaction","show")}}function g(){var T={kana:R[R.length-1][0],typeface:N};localStorage.setItem("state",JSON.stringify(T));location.href="/practice/"}function e(){var T,U;L.match(/p(\d)/);U=RegExp.$1-1;$("#kana span").each(function(){T=h[$(this).text()];$(this).css("background-position",("-"+((T[0]*19)+(U*190))+"px -"+(T[1]*19)+"px"))});$("#kana span").css("visibility","visible")}function A(U){var X,W,T,V;if(U){U.stopPropagation()}X=V=0;$("table input").each(function(){if($(this).prop("checked")){V+=Math.pow(2,X)}X++});W=((f=="o")?"t":f);T=new RegExp(W+"\\d+");L=L.replace(T,W+V);I()}function G(){j.hide();p.fadeIn(200)}function E(U){var W,V,T;for(W=U.length-1;W>0;W--){V=Math.floor(Math.random()*(W+1));T=U[W];U[W]=U[V];U[V]=T}}function I(){document.cookie=("a="+L+"; expires=Mon, 27-Apr-2026 14:52:49 GMT; path=/")}return{init:function(){f=$("body").attr("id");if(document.cookie.search(/a=(b[1-9a-i]c[01]h\d+hd\d+k\d+kd\d+ke\d+p\dr[01]s[01]t\d+)/)!=-1){L=RegExp.$1}else{L="bhc1h1hd0k0kd0ke0p7r1s0t64"}if(window.devicePixelRatio>1){$("<img>")[0].src="/img/k/19/kana@2x.png";$("<img>")[0].src="/img/k/50/kana@2x.png"}else{$("<img>")[0].src="/img/k/19/kana.png";$("<img>")[0].src="/img/k/50/kana.png"}F();t();a();if(typeof blockAdBlock=="undefined"){z()}else{blockAdBlock.onDetected(z);blockAdBlock.onNotDetected(r)}}}}();$(RealKana.init);