!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=536)}({227:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=n(46);!function(){var t="search-history",n=15,i=o.getStorage(),s={1:"タイトル",2:"キーワード",4:"作家名",8:"表紙コメント",16:"あらすじ"},a={1:"更新中",2:"完結"},c={1:"短編",2:"中編",4:"長編"},h=function(){function e(t,n,r,o,i,s,a,c,h,u,l,d){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.timestamp=t,this.search_word=void 0===n||null===n?"":n,this.exclude_word=void 0===r||null===r?"":r,this.search_targets=void 0===o||null===o||0===o.length?[1,2,4]:o,this.genre=void 0===i||null===i?{}:i,this.feeling=void 0===s||null===s?{}:s,this.finished=void 0===a||null===a?0:a,this.lengths=void 0===c||null===c?[]:c,this.contests=void 0===h||null===h?[]:h,this.has_video=void 0===u||null===u?0:u,this.has_comic=void 0===l||null===l?0:l,this.exclude_bookmark=void 0===d||null===d?0:d}return r(e,[{key:"getDispMonthAndDate",value:function(){var e=new Date(this.timestamp);return(e.getMonth()+1).toString().padStart(2,"0")+"/"+e.getDate().toString().padStart(2,"0")}},{key:"getDispCondition",value:function(){var e=[];if(""!==this.search_word&&e.push(this.search_word),""!==this.exclude_word&&e.push("- "+this.exclude_word),(""!==this.search_word||""!==this.exclude_word)&&this.search_targets.length){var t=[];this.search_targets.forEach(function(e){t.push(s[e])}),e.push("対象："+t.join(","))}if(this.genre.disp_name){var n=this.genre.disp_name;"ファンタジー(異世界)"===n&&(n="異世界ファンタジー"),e.push(n)}if(this.feeling.disp_name&&e.push(this.feeling.disp_name),0!==parseInt(this.finished)&&e.push(a[this.finished]),this.lengths.length){var r=[];this.lengths.forEach(function(e){r.push(c[e])}),e.push(r.join(","))}if(this.contests.length){var o=[];this.contests.forEach(function(e){o.push(e.disp_name)}),e.push(o.join(","))}return 0!==this.has_video&&e.push("動画あり"),0!==this.has_comic&&e.push("コミックあり"),0!==this.exclude_bookmark&&e.push("本棚の作品を除外"),e.length>0?e.join(" | "):"条件なし"}},{key:"getSearchResultUrl",value:function(){var e=[];return""!==this.search_word&&e.push("word="+encodeURIComponent(this.search_word)),""!==this.exclude_word&&e.push("exclude_word="+encodeURIComponent(this.exclude_word)),this.search_targets.length&&this.search_targets.forEach(function(t){e.push("search_targets[]="+encodeURIComponent(t))}),this.genre.value&&e.push("genre="+encodeURIComponent(this.genre.value)),this.feeling.value&&e.push("feeling="+encodeURIComponent(this.feeling.value)),0!==this.finished&&e.push("finished="+encodeURIComponent(this.finished)),this.lengths.length&&this.lengths.forEach(function(t){e.push("length[]="+t)}),this.contests.length&&this.contests.forEach(function(t){e.push("contest_ids[]="+encodeURIComponent(t.value))}),0!==this.has_video&&e.push("has_video=1"),0!==this.has_comic&&e.push("has_comic=1"),0!==this.exclude_bookmark&&e.push("exclude_bookmark=1"),location.protocol+"//"+document.domain+"/search/book?"+e.join("&")}}]),e}();function u(){var e=i.getItem(t);try{e=JSON.parse(e)}catch(t){e=null,console.log(t)}return Array.isArray(e)?e:[]}e.exports={SearchHistory:h,storeSearchHistory:function(e){var r=u().filter(function(t){var n=!1;n=t.search_word!==e.search_word||n,n=t.exclude_word!==e.exclude_word||n,n=t.search_targets.sort().toString()!==e.search_targets.sort().toString()||n,n=t.genre.value!==e.genre.value||n,n=t.feeling.value!==e.feeling.value||n,n=t.finished!==e.finished||n,n=t.lengths.sort().toString()!==e.lengths.sort().toString()||n;var r=t.contests.map(function(e){return e.value}),o=t.contests.map(function(e){return e.value});return n=r.sort().toString()!==o.sort().toString()||n,n=t.has_video!==e.has_video||n,n=t.has_comic!==e.has_comic||n,n=t.exclude_bookmark!==e.exclude_bookmark||n});r.push(e),r.sort(function(e,t){return e.timestamp-t.timestamp}),r.length>n&&r.splice(0,1),i.setItem(t,JSON.stringify(r))},getSearchHistory:u,replaceSearchHistory:function(e){var n=e.map(function(e){return new h(e.timestamp,e.search_word,e.exclude_word,e.search_targets,e.genre,e.feeling,e.finished,e.lengths,e.contests,e.has_video,e.has_comic,e.exclude_bookmark)});return n.sort(function(e,t){return e.timestamp-t.timestamp}),i.setItem(t,JSON.stringify(n)),!0}}}()},46:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStorage=function(){return r};var r=new function(){(function(){var e=void 0;try{e=window.localStorage;var t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==e.length}})()?(this.setItem=function(e,t){return localStorage.setItem(e,t)},this.getItem=function(e){return localStorage.getItem(e)},this.removeItem=function(e){return localStorage.removeItem(e)}):(this.setItem=function(){},this.getItem=function(){return null},this.removeItem=function(){})}},536:function(e,t,n){e.exports=n(537)},537:function(e,t,n){"use strict";var r,o,i,s=n(227),a=s.SearchHistory,c=s.storeSearchHistory;r=jQuery,o="search-history-register",i=!1,r(document).on("submit","form."+o,function(e){if(i)e.preventDefault();else{i=!0,setTimeout(function(){i=!1},3e3);var t=r("form."+o+" input[name=word]").val(),n=r("form."+o+" input[name=exclude_word]").val(),s=r("form."+o+" input[name='search_targets[]']:checked").map(function(){return parseInt(r(this).val())}).get(),h={},u=r("form."+o+" [name=genre] option:selected"),l=parseInt(u.val());0===l||isNaN(l)||(h={disp_name:u.text(),value:l});var d={},m=r("form."+o+" [name=feeling] option:selected"),f=parseInt(m.val());0===f||isNaN(f)||(d={disp_name:m.text(),value:f});var p=r("form."+o+" input[name=finished]:checked").val(),v=r("form."+o+" input[name='length[]']:checked").map(function(){return parseInt(r(this).val())}).get(),g=[];r("form."+o+" input[name='contest_ids[]']:checked").each(function(){var e={},t=r(this);e.value=parseInt(t.val()),e.disp_name=t.parent("label").text(),g.push(e)});var _=0;void 0!==r("form."+o+" input[name='has_video']:checked").val()&&(_=1);var k=0;void 0!==r("form."+o+" input[name='has_comic']:checked").val()&&(k=1);var w=0;void 0!==r("form."+o+" input[name='exclude_bookmark']:checked").val()&&(w=1);var x=Date.now(),I=new a(x,t,n,s,h,d,p,v,g,_,k,w);c(I)}}),r(document).on("change",":checkbox#exclude_bookmark",function(e){var t=new URL(location.href).searchParams,n=t.get("word");n&&r("form."+o+" input[name=word]").val(n);var i=t.get("exclude_word");i&&r("form."+o+" input[name=exclude_word]").val(i);var s=t.getAll("search_targets[]");s.length>0&&r("form."+o+" input[name='search_targets[]']").val(s);var a=t.get("genre");a&&r("form."+o+" [name=genre]").val(a);var c=t.get("feeling");c&&r("form."+o+" [name=feeling]").val(c);var h=t.get("finished");h&&r("form."+o+" input[name=finished]").val([h]);var u=t.getAll("length[]");u.length>0&&r("form."+o+" input[name='length[]']").val(u);var l=t.getAll("contest_ids[]");l.length>0&&r("form."+o+" input[name='contest_ids[]']").val(l);var d=t.get("has_video");1===parseInt(d)&&r("form."+o+" input[name='has_video']").prop("checked",!0);var m=t.get("has_comic");1===parseInt(m)&&r("form."+o+" input[name='has_comic']").prop("checked",!0);var f=r(":checkbox#exclude_bookmark").prop("checked");r("form."+o+" input[name='exclude_bookmark']").prop("checked",f),r("form."+o).submit()})}});