EPUBJS.reader.search={},EPUBJS.reader.search.SERVER="https://pacific-cliffs-3579.herokuapp.com",EPUBJS.reader.search.request=function(t,i){var a=$.ajax({dataType:"json",url:EPUBJS.reader.search.SERVER+"/search?q="+encodeURIComponent(t)});a.fail(function(e){console.error(e)}),a.done(function(e){i(e)})},EPUBJS.reader.plugins.SearchController=function(t){var i=this,a=$("#searchBox"),e=$("#searchResults"),h=$("#searchView"),r,s=!1,p=function(){v(),s=!0,h.addClass("shown")},u=function(){s=!1,h.removeClass("shown")},v=function(){var n=a.val();n!=""&&(e.empty(),e.append("
Searching...
No Results Found
"+o.highlight+"
");d.on("click",function(g){var S=$(this),m=S.data("cfi");g.preventDefault(),t.gotoCfi(m+"/1:0"),t.on("renderer:chapterDisplayed",function(){r=$("#viewer iframe")[0].contentDocument,$(r).find("body").highlight(n,{element:"span"})})}),f.append(d),e.append(f)})}))};return a.on("search",function(n){var c=a.val();if(c==""){e.empty(),i.SidebarController.getActivePanel()=="Search"&&i.SidebarController.changePanelTo("Toc"),$(r).find("body").unhighlight(),r=!1;return}i.SidebarController.changePanelTo("Search"),n.preventDefault()}),{show:p,hide:u}};