"use strict";let Reader,App;function enable_swipes(){$(window).off("swipeleft swiperight"),$(window).on("swipeleft",(function(){Reader.Page.next()})),$(window).on("swiperight",(function(){Reader.Page.prev()}))}$(document).ready((function(){Reader=parent.__get_reader(),App=parent.__get_app(),$(window).on("doubletap",(function(){getSelection().toString().trim().match(/^$/)&&Reader.toggleFullscreen()})),$(window).on("click tap",(function(e){if(0==e.button){if($(".modal").is(":visible"))return;"undefined"!=typeof EpubeApp?EpubeApp.toggleActionBar():Reader.showUI(!0)}})),$(window).on("touchstart",(function(){enable_swipes()})),$(window).on("mousedown",(function(){$(window).off("swipeleft swiperight")})),$(window).on("wheel",(function(e){e.originalEvent.deltaY>0?Reader.Page.next():e.originalEvent.deltaY<0&&Reader.Page.prev()})),$(window).on("mouseup touchend",(function(){if(!App.onLine)return;const e=getSelection().toString().trim();e.match(/^[\w­]+$/)&&Reader.lookupWord(e,(function(){"undefined"!=typeof EpubeApp&&EpubeApp.showActionBar(!1),getSelection().removeAllRanges()}))})),enable_swipes()}));