epubjs
Version:
Parse and Render Epubs
1 lines • 228 kB
JavaScript
(function(I,M){'object'==typeof exports&&'object'==typeof module?module.exports=M(function(){try{return require('JSZip')}catch(W){}}(),require('xmldom')):'function'==typeof define&&define.amd?define(['JSZip','xmldom'],M):'object'==typeof exports?exports.ePub=M(function(){try{return require('JSZip')}catch(W){}}(),require('xmldom')):I.ePub=M(I.JSZip,I.xmldom)})(this,function(N,I){return function(M){function U(H){if(W[H])return W[H].exports;var Y=W[H]={i:H,l:!1,exports:{}};return M[H].call(Y.exports,Y,Y.exports,U),Y.l=!0,Y.exports}var W={};return U.m=M,U.c=W,U.i=function(H){return H},U.d=function(H,Y,G){Object.defineProperty(H,Y,{configurable:!1,enumerable:!0,get:G})},U.n=function(H){var Y=H&&H.__esModule?function(){return H['default']}:function(){return H};return U.d(Y,'a',Y),Y},U.o=function(H,Y){return Object.prototype.hasOwnProperty.call(H,Y)},U.p='/dist/',U(U.s=347)}([function(M,U,W){var H=W(2),Y=W(26),G=W(13),X=W(14),$=W(27),J='prototype',Z=function(Q,ee,te){var ne=Q&Z.F,ae=Q&Z.G,ie=Q&Z.S,oe=Q&Z.P,se=Q&Z.B,le=ae?H:ie?H[ee]||(H[ee]={}):(H[ee]||{})[J],de=ae?Y:Y[ee]||(Y[ee]={}),ue=de[J]||(de[J]={}),pe,ce,fe,ge;for(pe in ae&&(te=ee),te)ce=!ne&&le&&void 0!==le[pe],fe=(ce?le:te)[pe],ge=se&&ce?$(fe,H):oe&&'function'==typeof fe?$(Function.call,fe):fe,le&&X(le,pe,fe,Q&Z.U),de[pe]!=fe&&G(de,pe,ge),oe&&ue[pe]!=fe&&(ue[pe]=fe)};H.core=Y,Z.F=1,Z.G=2,Z.S=4,Z.P=8,Z.B=16,Z.W=32,Z.U=64,Z.R=128,M.exports=Z},function(M,U,W){var H=W(4);M.exports=function(Y){if(!H(Y))throw TypeError(Y+' is not an object!');return Y}},function(M){var U=M.exports='undefined'!=typeof window&&window.Math==Math?window:'undefined'!=typeof self&&self.Math==Math?self:Function('return this')();'number'==typeof __g&&(__g=U)},function(M){M.exports=function(U){try{return!!U()}catch(W){return!0}}},function(M){M.exports=function(U){return'object'==typeof U?null!==U:'function'==typeof U}},function(M,U,W){var H=W(62)('wks'),Y=W(41),G=W(2).Symbol,X='function'==typeof G,$=M.exports=function(J){return H[J]||(H[J]=X&&G[J]||(X?G:Y)('Symbol.'+J))};$.store=H},function(M,U,W){M.exports=!W(3)(function(){return 7!=Object.defineProperty({},'a',{get:function(){return 7}}).a})},function(M,U,W){var H=W(1),Y=W(108),G=W(25),X=Object.defineProperty;U.f=W(6)?Object.defineProperty:function(J,Z,Q){if(H(J),Z=G(Z,!0),H(Q),Y)try{return X(J,Z,Q)}catch(ee){}if('get'in Q||'set'in Q)throw TypeError('Accessors not supported!');return'value'in Q&&(J[Z]=Q.value),J}},function(M,U,W){'use strict';'use strict';function H(){var Q=new Date().getTime(),ee='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(te){var ne=0|(Q+16*Math.random())%16;return Q=Math.floor(Q/16),('x'==te?ne:8|7&ne).toString(16)});return ee}function Y(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function G(Q,ee,te,ne,ae){var ie=ne||0,oe=ae||ee.length,se=parseInt(ie+(oe-ie)/2),le;return(te||(te=function(ue,pe){return ue>pe?1:ue<pe?-1:ue==pe?0:void 0}),0>=oe-ie)?se:(le=te(ee[se],Q),1==oe-ie?0<le?se:se+1:0===le?se:-1===le?G(Q,ee,te,se,oe):G(Q,ee,te,ie,se))}function X(Q,ee,te,ne,ae){var ie=ne||0,oe=ae||ee.length,se=parseInt(ie+(oe-ie)/2),le;return(te||(te=function(ue,pe){return ue>pe?1:ue<pe?-1:ue==pe?0:void 0}),0>=oe-ie)?-1:(le=te(ee[se],Q),1==oe-ie?0===le?se:-1:0===le?se:-1===le?X(Q,ee,te,se,oe):X(Q,ee,te,ie,se))}function $(Q,ee){return'undefined'==typeof Q.querySelector?Q.getElementsByTagName(ee):Q.querySelectorAll(ee)}function J(Q,ee,te){for(var ne=document.createTreeWalker(Q,te,null,!1),ae=void 0;ae=ne.nextNode();)ee(ae)}function Z(Q,ee){if(ee(Q))return!0;if(Q=Q.firstChild,Q)do{var te=Z(Q,ee);if(te)return!0;Q=Q.nextSibling}while(Q)}Object.defineProperty(U,'__esModule',{value:!0}),U.isElement=function(ee){return!!(ee&&1==ee.nodeType)},U.uuid=H,U.documentHeight=function(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)},U.isNumber=Y,U.isFloat=function(ee){return Y(ee)&&Math.floor(ee)!==ee},U.prefixed=function(ee){var te=['Webkit','Moz','O','ms'],ne=ee[0].toUpperCase()+ee.slice(1),ae=te.length;if('undefined'==typeof document||'undefined'!=typeof document.body.style[ee])return ee;for(var ie=0;ie<ae;ie++)if('undefined'!=typeof document.body.style[te[ie]+ne])return te[ie]+ne;return ee},U.defaults=function(ee){for(var te=1,ne=arguments.length;te<ne;te++){var ae=arguments[te];for(var ie in ae)void 0===ee[ie]&&(ee[ie]=ae[ie])}return ee},U.extend=function(ee){var te=[].slice.call(arguments,1);return te.forEach(function(ne){ne&&Object.getOwnPropertyNames(ne).forEach(function(ae){Object.defineProperty(ee,ae,Object.getOwnPropertyDescriptor(ne,ae))})}),ee},U.insert=function(ee,te,ne){var ae=G(ee,te,ne);return te.splice(ae,0,ee),ae},U.locationOf=G,U.indexOfSorted=X,U.bounds=function(ee){var te=window.getComputedStyle(ee),ne=0,ae=0;return['width','paddingRight','paddingLeft','marginRight','marginLeft','borderRightWidth','borderLeftWidth'].forEach(function(ie){ne+=parseFloat(te[ie])||0}),['height','paddingTop','paddingBottom','marginTop','marginBottom','borderTopWidth','borderBottomWidth'].forEach(function(ie){ae+=parseFloat(te[ie])||0}),{height:ae,width:ne}},U.borders=function(ee){var te=window.getComputedStyle(ee),ne=0,ae=0;return['paddingRight','paddingLeft','marginRight','marginLeft','borderRightWidth','borderLeftWidth'].forEach(function(ie){ne+=parseFloat(te[ie])||0}),['paddingTop','paddingBottom','marginTop','marginBottom','borderTopWidth','borderBottomWidth'].forEach(function(ie){ae+=parseFloat(te[ie])||0}),{height:ae,width:ne}},U.windowBounds=function(){var ee=window.innerWidth,te=window.innerHeight;return{top:0,left:0,right:ee,bottom:te,width:ee,height:te}},U.cleanStringForXpath=function(ee){var te=ee.match(/[^'"]+|['"]/g);return te=te.map(function(ne){return'\''===ne?'"\'"':'"'===ne?'\'"\'':'\''+ne+'\''}),'concat(\'\','+te.join(',')+')'},U.indexOfTextNode=function(ee){var te=ee.parentNode,ne=te.childNodes,ae,ie=-1;for(var oe=0;oe<ne.length&&(ae=ne[oe],ae.nodeType===Node.TEXT_NODE&&ie++,ae!=ee);oe++);return ie},U.isXml=function(ee){return-1<['xml','opf','ncx'].indexOf(ee)},U.createBlob=function(ee,te){return new Blob([ee],{type:te})},U.createBlobUrl=function(ee,te){var ne=window.URL||window.webkitURL||window.mozURL,ie=this.createBlob(ee,te),ae;return ae=ne.createObjectURL(ie),ae},U.createBase64Url=function(ee,te){var ne,ae;if('string'==typeof ee)return ne=btoa(ee),ae='data:'+te+';base64,'+ne,ae},U.type=function(ee){return Object.prototype.toString.call(ee).slice(8,-1)},U.parse=function(ee,te,ne){var ae,ie;return ie='undefined'==typeof DOMParser||ne?W(129).DOMParser:DOMParser,ae=new ie().parseFromString(ee,te),ae},U.qs=function(ee,te){var ne;if(!ee)throw new Error('No Element Provided');return'undefined'==typeof ee.querySelector?(ne=ee.getElementsByTagName(te),ne.length)?ne[0]:void 0:ee.querySelector(te)},U.qsa=$,U.qsp=function(ee,te,ne){var ae,ie;if('undefined'!=typeof ee.querySelector){for(var oe in te+='[',ne)te+=oe+'=\''+ne[oe]+'\'';return te+=']',ee.querySelector(te)}return(ae=ee.getElementsByTagName(te),ie=Array.prototype.slice.call(ae,0).filter(function(se){for(var le in ne)if(se.getAttribute(le)===ne[le])return!0;return!1}),ie)?ie[0]:void 0},U.sprint=function(ee,te){var ne=ee.ownerDocument||ee;'undefined'==typeof ne.createTreeWalker?Z(ee,function(ae){ae&&3===ae.nodeType&&te(ae)},!0):J(ee,te,NodeFilter.SHOW_TEXT)},U.treeWalker=J,U.walk=Z,U.blob2base64=function(ee,te){var ne=new FileReader;ne.readAsDataURL(ee),ne.onloadend=function(){te(ne.result)}},U.defer=function(){var ee=this;this.resolve=null,this.reject=null,this.id=H(),this.promise=new Promise(function(te,ne){ee.resolve=te,ee.reject=ne}),Object.freeze(this)},U.querySelectorByType=function(ee,te,ne){var ae;if('undefined'!=typeof ee.querySelector&&(ae=ee.querySelector(te+'[*|type="'+ne+'"]')),!ae||0===ae.length){ae=$(ee,te);for(var ie=0;ie<ae.length;ie++)if(ae[ie].getAttributeNS('http://www.idpf.org/2007/ops','type')===ne)return ae[ie]}else return ae},U.findChildren=function(ee){var te=[],ne=ee.parentNode.childNodes;for(var ae=0;ae<ne.length;ae++){var ie=ne[ae];1===ie.nodeType&&te.push(ie)}return te},U.requestAnimationFrame='undefined'!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame)},function(M,U,W){var H=W(32),Y=Math.min;M.exports=function(G){return 0<G?Y(H(G),9007199254740991):0}},function(M,U,W){var H=W(20);M.exports=function(Y){return Object(H(Y))}},function(M){var U={}.hasOwnProperty;M.exports=function(W,H){return U.call(W,H)}},function(M){M.exports=function(U){if('function'!=typeof U)throw TypeError(U+' is not a function!');return U}},function(M,U,W){var H=W(7),Y=W(31);M.exports=W(6)?function(G,X,$){return H.f(G,X,Y(1,$))}:function(G,X,$){return G[X]=$,G}},function(M,U,W){var H=W(2),Y=W(13),G=W(11),X=W(41)('src'),$='toString',J=Function[$],Z=(''+J).split($);W(26).inspectSource=function(Q){return J.call(Q)},(M.exports=function(Q,ee,te,ne){var ae='function'==typeof te;ae&&(G(te,'name')||Y(te,'name',ee)),Q[ee]===te||(ae&&(G(te,X)||Y(te,X,Q[ee]?''+Q[ee]:Z.join(ee+''))),Q===H?Q[ee]=te:ne?Q[ee]?Q[ee]=te:Y(Q,ee,te):(delete Q[ee],Y(Q,ee,te)))})(Function.prototype,$,function(){return'function'==typeof this&&this[X]||J.call(this)})},function(M,U,W){var H=W(0),Y=W(3),G=W(20),X=/"/g,$=function(J,Z,Q,ee){var te=G(J)+'',ne='<'+Z;return''!==Q&&(ne+=' '+Q+'="'+(ee+'').replace(X,'"')+'"'),ne+'>'+te+'</'+Z+'>'};M.exports=function(J,Z){var Q={};Q[J]=Z($),H(H.P+H.F*Y(function(){var ee=''[J]('"');return ee!==ee.toLowerCase()||3<ee.split('"').length}),'String',Q)}},function(M,U,W){var H=W(50),Y=W(20);M.exports=function(G){return H(Y(G))}},function(M,U,W){var H=W(51),Y=W(31),G=W(16),X=W(25),$=W(11),J=W(108),Z=Object.getOwnPropertyDescriptor;U.f=W(6)?Z:function(ee,te){if(ee=G(ee),te=X(te,!0),J)try{return Z(ee,te)}catch(ne){}return $(ee,te)?Y(!H.f.call(ee,te),ee[te]):void 0}},function(M,U,W){var H=W(11),Y=W(10),G=W(86)('IE_PROTO'),X=Object.prototype;M.exports=Object.getPrototypeOf||function($){return $=Y($),H($,G)?$[G]:'function'==typeof $.constructor&&$ instanceof $.constructor?$.constructor.prototype:$ instanceof Object?X:null}},function(M){var U={}.toString;M.exports=function(W){return U.call(W).slice(8,-1)}},function(M){M.exports=function(U){if(U==void 0)throw TypeError('Can\'t call method on '+U);return U}},function(M,U,W){var H=W(3);M.exports=function(Y,G){return!!Y&&H(function(){G?Y.call(null,function(){},1):Y.call(null)})}},function(M,U,W){'use strict';'use strict';function H(Q,ee){if(!(Q instanceof ee))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(U,'__esModule',{value:!0});var Y='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(Q){return typeof Q}:function(Q){return Q&&'function'==typeof Symbol&&Q.constructor===Symbol&&Q!==Symbol.prototype?'symbol':typeof Q},G=function(){function Q(ee,te){for(var ne=0;ne<te.length;ne++){var ae=te[ne];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,'value'in ae&&(ae.writable=!0),Object.defineProperty(ee,ae.key,ae)}}return function(ee,te,ne){return te&&Q(ee.prototype,te),ne&&Q(ee,ne),ee}}(),X=W(8),$=1,J=3,Z=function(){function Q(ee,te,ne){H(this,Q);var ae;if(this.str='',this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof Q))return new Q(ee,te,ne);if('string'==typeof te?this.base=this.parseComponent(te):'object'===('undefined'==typeof te?'undefined':Y(te))&&te.steps&&(this.base=te),ae=this.checkType(ee),'string'===ae)return this.str=ee,(0,X.extend)(this,this.parse(ee));if('range'===ae)return(0,X.extend)(this,this.fromRange(ee,this.base,ne));if('node'===ae)return(0,X.extend)(this,this.fromNode(ee,this.base,ne));if('EpubCFI'===ae&&ee.path)return ee;if(!ee)return this;throw new TypeError('not a valid argument for EpubCFI')}return G(Q,[{key:'checkType',value:function(te){return this.isCfiString(te)?'string':'object'===('undefined'==typeof te?'undefined':Y(te))&&('Range'===(0,X.type)(te)||'undefined'!=typeof te.startContainer)?'range':'object'===('undefined'==typeof te?'undefined':Y(te))&&'undefined'!=typeof te.nodeType?'node':'object'===('undefined'==typeof te?'undefined':Y(te))&&te instanceof Q&&'EpubCFI'}},{key:'parse',value:function(te){var ne={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},ae,ie,oe;return'string'==typeof te?(0===te.indexOf('epubcfi(')&&')'===te[te.length-1]&&(te=te.slice(8,te.length-1)),ae=this.getChapterComponent(te),!ae)?{spinePos:-1}:(ne.base=this.parseComponent(ae),ie=this.getPathComponent(te),ne.path=this.parseComponent(ie),oe=this.getRange(te),oe&&(ne.range=!0,ne.start=this.parseComponent(oe[0]),ne.end=this.parseComponent(oe[1])),ne.spinePos=ne.base.steps[1].index,ne):{spinePos:-1}}},{key:'parseComponent',value:function(te){var ne={steps:[],terminal:{offset:null,assertion:null}},ae=te.split(':'),ie=ae[0].split('/'),oe;return 1<ae.length&&(oe=ae[1],ne.terminal=this.parseTerminal(oe)),''===ie[0]&&ie.shift(),ne.steps=ie.map(function(se){return this.parseStep(se)}.bind(this)),ne}},{key:'parseStep',value:function(te){var ne,ae,ie,oe,se;if(oe=te.match(/\[(.*)\]/),oe&&oe[1]&&(se=oe[1]),ae=parseInt(te),!isNaN(ae))return 0==ae%2?(ne='element',ie=ae/2-1):(ne='text',ie=(ae-1)/2),{type:ne,index:ie,id:se||null}}},{key:'parseTerminal',value:function(te){var ie=te.match(/\[(.*)\]/),ne,ae;return ie&&ie[1]?(ne=parseInt(te.split('[')[0])||null,ae=ie[1]):ne=parseInt(te)||null,{offset:ne,assertion:ae}}},{key:'getChapterComponent',value:function(te){var ne=te.split('!');return ne[0]}},{key:'getPathComponent',value:function(te){var ne=te.split('!');if(ne[1]){var ae=ne[1].split(',');return ae[0]}}},{key:'getRange',value:function(te){var ne=te.split(',');return 3===ne.length&&[ne[1],ne[2]]}},{key:'getCharecterOffsetComponent',value:function(te){var ne=te.split(':');return ne[1]||''}},{key:'joinSteps',value:function(te){return te?te.map(function(ne){var ae='';return'element'===ne.type&&(ae+=2*(ne.index+1)),'text'===ne.type&&(ae+=1+2*ne.index),ne.id&&(ae+='['+ne.id+']'),ae}).join('/'):''}},{key:'segmentString',value:function(te){var ee='/';return ee+=this.joinSteps(te.steps),te.terminal&&null!=te.terminal.offset&&(ee+=':'+te.terminal.offset),te.terminal&&null!=te.terminal.assertion&&(ee+='['+te.terminal.assertion+']'),ee}},{key:'toString',value:function(){var te='epubcfi(';return te+=this.segmentString(this.base),te+='!',te+=this.segmentString(this.path),this.start&&(te+=',',te+=this.segmentString(this.start)),this.end&&(te+=',',te+=this.segmentString(this.end)),te+=')',te}},{key:'compare',value:function(te,ne){var ae,ie,oe,se;if('string'==typeof te&&(te=new Q(te)),'string'==typeof ne&&(ne=new Q(ne)),te.spinePos>ne.spinePos)return 1;if(te.spinePos<ne.spinePos)return-1;te.range?(ae=te.path.steps.concat(te.start.steps),oe=te.start.terminal):(ae=te.path.steps,oe=te.path.terminal),ne.range?(ie=ne.path.steps.concat(ne.start.steps),se=ne.start.terminal):(ie=ne.path.steps,se=ne.path.terminal);for(var le=0;le<ae.length;le++){if(!ae[le])return-1;if(!ie[le])return 1;if(ae[le].index>ie[le].index)return 1;if(ae[le].index<ie[le].index)return-1}return ae.length<ie.length?1:oe.offset>se.offset?1:oe.offset<se.offset?-1:0}},{key:'step',value:function(te){var ne=te.nodeType===J?'text':'element';return{id:te.id,tagName:te.tagName,type:ne,index:this.position(te)}}},{key:'filteredStep',value:function(te,ne){var ae=this.filter(te,ne),ie;if(ae)return ie=ae.nodeType===J?'text':'element',{id:ae.id,tagName:ae.tagName,type:ie,index:this.filteredPosition(ae,ne)}}},{key:'pathTo',value:function(te,ne,ae){for(var ie={steps:[],terminal:{offset:null,assertion:null}},oe=te,se;oe&&oe.parentNode&&9!=oe.parentNode.nodeType;)se=ae?this.filteredStep(oe,ae):this.step(oe),se&&ie.steps.unshift(se),oe=oe.parentNode;return null!=ne&&0<=ne&&(ie.terminal.offset=ne,'text'!=ie.steps[ie.steps.length-1].type&&ie.steps.push({type:'text',index:0})),ie}},{key:'equalStep',value:function(te,ne){return te&&ne&&te.index===ne.index&&te.id===ne.id&&te.type===ne.type}},{key:'fromRange',value:function(te,ne,ae){var ie={range:!1,base:{},path:{},start:null,end:null},oe=te.startContainer,se=te.endContainer,le=te.startOffset,de=te.endOffset,ue=!1;if(ae&&(ue=null!=oe.ownerDocument.querySelector('.'+ae)),'string'==typeof ne?(ie.base=this.parseComponent(ne),ie.spinePos=ie.base.steps[1].index):'object'===('undefined'==typeof ne?'undefined':Y(ne))&&(ie.base=ne),te.collapsed)ue&&(le=this.patchOffset(oe,le,ae)),ie.path=this.pathTo(oe,le,ae);else{ie.range=!0,ue&&(le=this.patchOffset(oe,le,ae)),ie.start=this.pathTo(oe,le,ae),ue&&(de=this.patchOffset(se,de,ae)),ie.end=this.pathTo(se,de,ae),ie.path={steps:[],terminal:null};var pe=ie.start.steps.length,ce;for(ce=0;ce<pe&&this.equalStep(ie.start.steps[ce],ie.end.steps[ce]);ce++)ce===pe-1?ie.start.terminal===ie.end.terminal&&(ie.path.steps.push(ie.start.steps[ce]),ie.range=!1):ie.path.steps.push(ie.start.steps[ce]);ie.start.steps=ie.start.steps.slice(ie.path.steps.length),ie.end.steps=ie.end.steps.slice(ie.path.steps.length)}return ie}},{key:'fromNode',value:function(te,ne,ae){var ie={range:!1,base:{},path:{},start:null,end:null};return'string'==typeof ne?(ie.base=this.parseComponent(ne),ie.spinePos=ie.base.steps[1].index):'object'===('undefined'==typeof ne?'undefined':Y(ne))&&(ie.base=ne),ie.path=this.pathTo(te,null,ae),ie}},{key:'filter',value:function(te,ne){var de=!1,ae,ie,oe,se,le;return(te.nodeType===J?(de=!0,oe=te.parentNode,ae=te.parentNode.classList.contains(ne)):(de=!1,ae=te.classList.contains(ne)),ae&&de)?(se=oe.previousSibling,le=oe.nextSibling,se&&se.nodeType===J?ie=se:le&&le.nodeType===J&&(ie=le),ie)?ie:te:ae&&!de?!1:te}},{key:'patchOffset',value:function(te,ne,ae){if(te.nodeType!=J)throw new Error('Anchor must be a text node');var ie=te,oe=ne;for(te.parentNode.classList.contains(ae)&&(ie=te.parentNode);ie.previousSibling;){if(ie.previousSibling.nodeType!==$)oe+=ie.previousSibling.textContent.length;else if(ie.previousSibling.classList.contains(ae))oe+=ie.previousSibling.textContent.length;else break;ie=ie.previousSibling}return oe}},{key:'normalizedMap',value:function(te,ne,ae){var ie={},oe=-1,le=te.length,se,de,ue;for(se=0;se<le;se++)de=te[se].nodeType,de===$&&te[se].classList.contains(ae)&&(de=J),0<se&&de===J&&ue===J?ie[se]=oe:ne===de&&(oe=oe+1,ie[se]=oe),ue=de;return ie}},{key:'position',value:function(te){var ne,ae;return te.nodeType===$?(ne=te.parentNode.children,!ne&&(ne=(0,X.findChildren)(te.parentNode)),ae=Array.prototype.indexOf.call(ne,te)):(ne=this.textNodes(te.parentNode),ae=ne.indexOf(te)),ae}},{key:'filteredPosition',value:function(te,ne){var ae,ie,oe;return te.nodeType===$?(ae=te.parentNode.children,oe=this.normalizedMap(ae,$,ne)):(ae=te.parentNode.childNodes,te.parentNode.classList.contains(ne)&&(te=te.parentNode,ae=te.parentNode.childNodes),oe=this.normalizedMap(ae,J,ne)),ie=Array.prototype.indexOf.call(ae,te),oe[ie]}},{key:'stepsToXpath',value:function(te){var ne=['.','*'];return te.forEach(function(ae){var ie=ae.index+1;ae.id?ne.push('*[position()='+ie+' and @id=\''+ae.id+'\']'):'text'===ae.type?ne.push('text()['+ie+']'):ne.push('*['+ie+']')}),ne.join('/')}},{key:'stepsToQuerySelector',value:function(te){var ne=['html'];return te.forEach(function(ae){var ie=ae.index+1;ae.id?ne.push('#'+ae.id):'text'!==ae.type&&ne.push('*:nth-child('+ie+')')}),ne.join('>')}},{key:'textNodes',value:function(te,ne){return Array.prototype.slice.call(te.childNodes).filter(function(ae){return ae.nodeType===J||ne&&ae.classList.contains(ne)})}},{key:'walkToNode',value:function(te,ne,ae){var ie=ne||document,oe=ie.documentElement,le=te.length,se,de;for(de=0;de<le;de++)se=te[de],'element'===se.type?oe=oe.children[se.index]:'text'===se.type&&(oe=this.textNodes(oe,ae)[se.index]);return oe}},{key:'findNode',value:function(te,ne,ae){var ie=ne||document,oe,se;return ae||'undefined'==typeof ie.evaluate?ae?oe=this.walkToNode(te,ie,ae):oe=this.walkToNode(te,ie):(se=this.stepsToXpath(te),oe=ie.evaluate(se,ie,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue),oe}},{key:'fixMiss',value:function(te,ne,ae,ie){var oe=this.findNode(te.slice(0,-1),ae,ie),se=oe.childNodes,le=this.normalizedMap(se,J,ie),pe=te[te.length-1].index,de,ue;for(var ce in le){if(!le.hasOwnProperty(ce))return;if(le[ce]===pe)if(de=se[ce],ue=de.textContent.length,ne>ue)ne=ne-ue;else{oe=de.nodeType===$?de.childNodes[0]:de;break}}return{container:oe,offset:ne}}},{key:'toRange',value:function(te,ne){var ae=te||document,ie=ae.createRange(),ue=this,fe=!!ne&&null!=ae.querySelector('.'+ne),oe,se,le,de,pe,ce,ge;if(ue.range?(oe=ue.start,pe=ue.path.steps.concat(oe.steps),le=this.findNode(pe,ae,fe?ne:null),se=ue.end,ce=ue.path.steps.concat(se.steps),de=this.findNode(ce,ae,fe?ne:null)):(oe=ue.path,pe=ue.path.steps,le=this.findNode(ue.path.steps,ae,fe?ne:null)),le)try{null==oe.terminal.offset?ie.setStart(le,0):ie.setStart(le,oe.terminal.offset)}catch(he){ge=this.fixMiss(pe,oe.terminal.offset,ae,fe?ne:null),ie.setStart(ge.container,ge.offset)}else return null;if(de)try{null==se.terminal.offset?ie.setEnd(de,0):ie.setEnd(de,se.terminal.offset)}catch(he){ge=this.fixMiss(ce,ue.end.terminal.offset,ae,fe?ne:null),ie.setEnd(ge.container,ge.offset)}return ie}},{key:'isCfiString',value:function(te){return'string'==typeof te&&0===te.indexOf('epubcfi(')&&')'===te[te.length-1]}},{key:'generateChapterComponent',value:function(te,ne,ae){var ie=parseInt(ne),oe='/'+(te+1)+'/';return oe+=2*(ie+1),ae&&(oe+='['+ae+']'),oe}}]),Q}();U.default=Z,M.exports=U['default']},function(M,U,W){var H=W(27),Y=W(50),G=W(10),X=W(9),$=W(152);M.exports=function(J,Z){var Q=1==J,ee=4==J,te=6==J,ne=Z||$;return function(ae,ie,oe){for(var se=G(ae),le=Y(se),de=H(ie,oe,3),ue=X(le.length),pe=0,ce=Q?ne(ae,ue):2==J?ne(ae,0):void 0,fe,ge;ue>pe;pe++)if((5==J||te||pe in le)&&(fe=le[pe],ge=de(fe,pe,se),J))if(Q)ce[pe]=ge;else if(ge)switch(J){case 3:return!0;case 5:return fe;case 6:return pe;case 2:ce.push(fe);}else if(ee)return!1;return te?-1:3==J||ee?ee:ce}}},function(M,U,W){var H=W(0),Y=W(26),G=W(3);M.exports=function(X,$){var J=(Y.Object||{})[X]||Object[X],Z={};Z[X]=$(J),H(H.S+H.F*G(function(){J(1)}),'Object',Z)}},function(M,U,W){var H=W(4);M.exports=function(Y,G){if(!H(Y))return Y;var X,$;if(G&&'function'==typeof(X=Y.toString)&&!H($=X.call(Y)))return $;if('function'==typeof(X=Y.valueOf)&&!H($=X.call(Y)))return $;if(!G&&'function'==typeof(X=Y.toString)&&!H($=X.call(Y)))return $;throw TypeError('Can\'t convert object to primitive value')}},function(M){var U=M.exports={version:'2.4.0'};'number'==typeof __e&&(__e=U)},function(M,U,W){var H=W(12);M.exports=function(Y,G,X){return(H(Y),void 0===G)?Y:1===X?function($){return Y.call(G,$)}:2===X?function($,J){return Y.call(G,$,J)}:3===X?function($,J,Z){return Y.call(G,$,J,Z)}:function(){return Y.apply(G,arguments)}}},function(M,U,W){var H=W(124),Y=W(0),G=W(62)('metadata'),X=G.store||(G.store=new(W(127))),$=function(J,Z,Q){var ee=X.get(J);if(!ee){if(!Q)return void 0;X.set(J,ee=new H)}var te=ee.get(Z);if(!te){if(!Q)return void 0;ee.set(Z,te=new H)}return te};M.exports={store:X,map:$,has:function(J,Z,Q){var ee=$(Z,Q,!1);return ee!==void 0&&ee.has(J)},get:function(J,Z,Q){var ee=$(Z,Q,!1);return ee===void 0?void 0:ee.get(J)},set:function(J,Z,Q,ee){$(Q,ee,!0).set(J,Z)},keys:function(J,Z){var Q=$(J,Z,!1),ee=[];return Q&&Q.forEach(function(te,ne){ee.push(ne)}),ee},key:function(J){return J===void 0||'symbol'==typeof J?J:J+''},exp:function(J){Y(Y.S,'Reflect',J)}}},function(M,U,W){'use strict';'use strict';if(W(6)){var H=W(34),Y=W(2),G=W(3),X=W(0),$=W(63),J=W(93),Z=W(27),Q=W(33),ee=W(31),te=W(13),ne=W(38),ae=W(32),ie=W(9),oe=W(40),se=W(25),le=W(11),de=W(121),ue=W(49),pe=W(4),ce=W(10),fe=W(78),ge=W(35),he=W(18),ye=W(36).f,me=W(95),ve=W(41),be=W(5),xe=W(23),_e=W(53),ke=W(87),we=W(96),Se=W(44),Ee=W(59),Pe=W(39),Te=W(71),Ce=W(101),Re=W(7),Oe=W(17),Le=Re.f,Ne=Oe.f,Ae=Y.RangeError,Ie=Y.TypeError,Fe=Y.Uint8Array,ze='ArrayBuffer',qe='Shared'+ze,Me='BYTES_PER_ELEMENT',je='prototype',Be=Array[je],De=J.ArrayBuffer,Ue=J.DataView,We=xe(0),He=xe(2),Ye=xe(3),Ve=xe(4),Ge=xe(5),Xe=xe(6),Ke=_e(!0),$e=_e(!1),Je=we.values,Ze=we.keys,Qe=we.entries,et=Be.lastIndexOf,tt=Be.reduce,nt=Be.reduceRight,ot=Be.join,st=Be.sort,dt=Be.slice,ut=Be.toString,pt=Be.toLocaleString,ct=be('iterator'),ft=be('toStringTag'),ht=ve('typed_constructor'),yt=ve('def_constructor'),mt=$.CONSTR,vt=$.TYPED,bt=$.VIEW,xt='Wrong length!',_t=xe(1,function(Wt,Ht){return Tt(ke(Wt,Wt[yt]),Ht)}),kt=G(function(){return 1===new Fe(new Uint16Array([1]).buffer)[0]}),wt=!!Fe&&!!Fe[je].set&&G(function(){new Fe(1).set({})}),St=function(Wt,Ht){if(Wt===void 0)throw Ie(xt);var Yt=ie(Wt);if(Ht&&!de(+Wt,Yt))throw Ae(xt);return Yt},Et=function(Wt,Ht){var Yt=ae(Wt);if(0>Yt||Yt%Ht)throw Ae('Wrong offset!');return Yt},Pt=function(Wt){if(pe(Wt)&&vt in Wt)return Wt;throw Ie(Wt+' is not a typed array!')},Tt=function(Wt,Ht){if(!(pe(Wt)&&ht in Wt))throw Ie('It is not a typed array constructor!');return new Wt(Ht)},Ct=function(Wt,Ht){return Rt(ke(Wt,Wt[yt]),Ht)},Rt=function(Wt,Ht){for(var Yt=0,Vt=Ht.length,Gt=Tt(Wt,Vt);Vt>Yt;)Gt[Yt]=Ht[Yt++];return Gt},Ot=function(Wt,Ht,Yt){Le(Wt,Ht,{get:function(){return this._d[Yt]}})},Lt=function(Ht){var Yt=ce(Ht),Vt=arguments.length,Gt=1<Vt?arguments[1]:void 0,Xt=Gt!==void 0,Kt=me(Yt),$t,Jt,Zt,Qt,en,tn;if(Kt!=void 0&&!fe(Kt)){for(tn=Kt.call(Yt),Zt=[],$t=0;!(en=tn.next()).done;$t++)Zt.push(en.value);Yt=Zt}for(Xt&&2<Vt&&(Gt=Z(Gt,arguments[2],2)),$t=0,Jt=ie(Yt.length),Qt=Tt(this,Jt);Jt>$t;$t++)Qt[$t]=Xt?Gt(Yt[$t],$t):Yt[$t];return Qt},Nt=function(){for(var Ht=0,Yt=arguments.length,Vt=Tt(this,Yt);Yt>Ht;)Vt[Ht]=arguments[Ht++];return Vt},At=!!Fe&&G(function(){pt.call(new Fe(1))}),It=function(){return pt.apply(At?dt.call(Pt(this)):Pt(this),arguments)},Ft={copyWithin:function(Ht,Yt){return Ce.call(Pt(this),Ht,Yt,2<arguments.length?arguments[2]:void 0)},every:function(Ht){return Ve(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},fill:function(){return Te.apply(Pt(this),arguments)},filter:function(Ht){return Ct(this,He(Pt(this),Ht,1<arguments.length?arguments[1]:void 0))},find:function(Ht){return Ge(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},findIndex:function(Ht){return Xe(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},forEach:function(Ht){We(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},indexOf:function(Ht){return $e(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},includes:function(Ht){return Ke(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},join:function(){return ot.apply(Pt(this),arguments)},lastIndexOf:function(){return et.apply(Pt(this),arguments)},map:function(Ht){return _t(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},reduce:function(){return tt.apply(Pt(this),arguments)},reduceRight:function(){return nt.apply(Pt(this),arguments)},reverse:function(){for(var Ht=this,Yt=Pt(Ht).length,Vt=Math.floor(Yt/2),Gt=0,Xt;Gt<Vt;)Xt=Ht[Gt],Ht[Gt++]=Ht[--Yt],Ht[Yt]=Xt;return Ht},some:function(Ht){return Ye(Pt(this),Ht,1<arguments.length?arguments[1]:void 0)},sort:function(Ht){return st.call(Pt(this),Ht)},subarray:function(Ht,Yt){var Vt=Pt(this),Gt=Vt.length,Xt=oe(Ht,Gt);return new(ke(Vt,Vt[yt]))(Vt.buffer,Vt.byteOffset+Xt*Vt.BYTES_PER_ELEMENT,ie((Yt===void 0?Gt:oe(Yt,Gt))-Xt))}},zt=function(Ht,Yt){return Ct(this,dt.call(Pt(this),Ht,Yt))},qt=function(Ht){Pt(this);var Yt=Et(arguments[1],1),Vt=this.length,Gt=ce(Ht),Xt=ie(Gt.length),Kt=0;if(Xt+Yt>Vt)throw Ae(xt);for(;Kt<Xt;)this[Yt+Kt]=Gt[Kt++]},Mt={entries:function(){return Qe.call(Pt(this))},keys:function(){return Ze.call(Pt(this))},values:function(){return Je.call(Pt(this))}},jt=function(Wt,Ht){return pe(Wt)&&Wt[vt]&&'symbol'!=typeof Ht&&Ht in Wt&&+Ht+''==Ht+''},Bt=function(Ht,Yt){return jt(Ht,Yt=se(Yt,!0))?ee(2,Ht[Yt]):Ne(Ht,Yt)},Dt=function(Ht,Yt,Vt){return jt(Ht,Yt=se(Yt,!0))&&pe(Vt)&&le(Vt,'value')&&!le(Vt,'get')&&!le(Vt,'set')&&!Vt.configurable&&(!le(Vt,'writable')||Vt.writable)&&(!le(Vt,'enumerable')||Vt.enumerable)?(Ht[Yt]=Vt.value,Ht):Le(Ht,Yt,Vt)};mt||(Oe.f=Bt,Re.f=Dt),X(X.S+X.F*!mt,'Object',{getOwnPropertyDescriptor:Bt,defineProperty:Dt}),G(function(){ut.call({})})&&(ut=pt=function(){return ot.call(this)});var Ut=ne({},Ft);ne(Ut,Mt),te(Ut,ct,Mt.values),ne(Ut,{slice:zt,set:qt,constructor:function(){},toString:ut,toLocaleString:It}),Ot(Ut,'buffer','b'),Ot(Ut,'byteOffset','o'),Ot(Ut,'byteLength','l'),Ot(Ut,'length','e'),Le(Ut,ft,{get:function(){return this[vt]}}),M.exports=function(Wt,Ht,Yt,Vt){Vt=!!Vt;var Gt=Wt+(Vt?'Clamped':'')+'Array',Xt=Y[Gt],Kt=Xt||{},$t=Xt&&he(Xt),Jt=!Xt||!$.ABV,Zt={},Qt=Xt&&Xt[je],en=function(ln,dn){var pn=ln._d;return pn.v['get'+Wt](dn*Ht+pn.o,kt)},tn=function(ln,dn,pn){var cn=ln._d;Vt&&(pn=0>(pn=Math.round(pn))?0:255<pn?255:255&pn),cn.v['set'+Wt](dn*Ht+cn.o,pn,kt)},nn=function(ln,dn){Le(ln,dn,{get:function(){return en(this,dn)},set:function(pn){return tn(this,dn,pn)},enumerable:!0})};Jt?(Xt=Yt(function(ln,dn,pn,cn){Q(ln,Xt,Gt,'_d');var gn=0,hn=0,mn,vn,bn,_n;if(!pe(dn))bn=St(dn,!0),vn=bn*Ht,mn=new De(vn);else if(dn instanceof De||(_n=ue(dn))==ze||_n==qe){mn=dn,hn=Et(pn,Ht);var kn=dn.byteLength;if(void 0===cn){if(kn%Ht)throw Ae(xt);if(vn=kn-hn,0>vn)throw Ae(xt)}else if(vn=ie(cn)*Ht,vn+hn>kn)throw Ae(xt);bn=vn/Ht}else{if(vt in dn)return Rt(Xt,dn);return Lt.call(Xt,dn)}for(te(ln,'_d',{b:mn,o:hn,l:vn,e:bn,v:new Ue(mn)});gn<bn;)nn(ln,gn++)}),Qt=Xt[je]=ge(Ut),te(Qt,'constructor',Xt)):!Ee(function(ln){new Xt(null),new Xt(ln)},!0)&&(Xt=Yt(function(ln,dn,pn,cn){Q(ln,Xt,Gt);var gn;return pe(dn)?dn instanceof De||(gn=ue(dn))==ze||gn==qe?void 0===cn?void 0===pn?new Kt(dn):new Kt(dn,Et(pn,Ht)):new Kt(dn,Et(pn,Ht),cn):vt in dn?Rt(Xt,dn):Lt.call(Xt,dn):new Kt(St(dn,'Uint8Array'!=Gt))}),We($t===Function.prototype?ye(Kt):ye(Kt).concat(ye($t)),function(ln){ln in Xt||te(Xt,ln,Kt[ln])}),Xt[je]=Qt,!H&&(Qt.constructor=Xt));var an=Qt[ct],rn=!!an&&('values'==an.name||an.name==void 0),sn=Mt.values;te(Xt,ht,!0),te(Qt,vt,Gt),te(Qt,bt,!0),te(Qt,yt,Xt),(Vt?new Xt(1)[ft]!=Gt:!(ft in Qt))&&Le(Qt,ft,{get:function(){return Gt}}),Zt[Gt]=Xt,X(X.G+X.W+X.F*(Xt!=Kt),Zt),X(X.S,Gt,{BYTES_PER_ELEMENT:Ht,from:Lt,of:Nt}),Me in Qt||te(Qt,Me,Ht),X(X.P,Gt,Ft),Pe(Gt),X(X.P+X.F*wt,Gt,{set:qt}),X(X.P+X.F*!rn,Gt,Mt),X(X.P+X.F*(Qt.toString!=ut),Gt,{toString:ut}),X(X.P+X.F*G(function(){new Xt(1).slice()}),Gt,{slice:zt}),X(X.P+X.F*(G(function(){return[1,2].toLocaleString()!=new Xt([1,2]).toLocaleString()})||!G(function(){Qt.toLocaleString.call([1,2])})),Gt,{toLocaleString:It}),Se[Gt]=rn?an:sn,H||rn||te(Qt,ct,sn)}}else M.exports=function(){}},function(M,U,W){var H=W(41)('meta'),Y=W(4),G=W(11),X=W(7).f,$=0,J=Object.isExtensible||function(){return!0},Z=!W(3)(function(){return J(Object.preventExtensions({}))}),Q=function(te){X(te,H,{value:{i:'O'+ ++$,w:{}}})},ee=M.exports={KEY:H,NEED:!1,fastKey:function(te,ne){if(!Y(te))return'symbol'==typeof te?te:('string'==typeof te?'S':'P')+te;if(!G(te,H)){if(!J(te))return'F';if(!ne)return'E';Q(te)}return te[H].i},getWeak:function(te,ne){if(!G(te,H)){if(!J(te))return!0;if(!ne)return!1;Q(te)}return te[H].w},onFreeze:function(te){return Z&&ee.NEED&&J(te)&&!G(te,H)&&Q(te),te}}},function(M){M.exports=function(U,W){return{enumerable:!(1&U),configurable:!(2&U),writable:!(4&U),value:W}}},function(M){var U=Math.ceil,W=Math.floor;M.exports=function(H){return isNaN(H=+H)?0:(0<H?W:U)(H)}},function(M){M.exports=function(U,W,H,Y){if(!(U instanceof W)||Y!==void 0&&Y in U)throw TypeError(H+': incorrect invocation!');return U}},function(M){M.exports=!1},function(M,U,W){var H=W(1),Y=W(114),G=W(74),X=W(86)('IE_PROTO'),$=function(){},J='prototype',Z=function(){var Q=W(73)('iframe'),ee=G.length,te='<',ne='>',ae;for(Q.style.display='none',W(76).appendChild(Q),Q.src='javascript:',ae=Q.contentWindow.document,ae.open(),ae.write(te+'script'+ne+'document.F=Object'+te+'/script'+ne),ae.close(),Z=ae.F;ee--;)delete Z[J][G[ee]];return Z()};M.exports=Object.create||function(ee,te){var ne;return null===ee?ne=Z():($[J]=H(ee),ne=new $,$[J]=null,ne[X]=ee),void 0===te?ne:Y(ne,te)}},function(M,U,W){var H=W(116),Y=W(74).concat('length','prototype');U.f=Object.getOwnPropertyNames||function(X){return H(X,Y)}},function(M,U,W){var H=W(116),Y=W(74);M.exports=Object.keys||function(X){return H(X,Y)}},function(M,U,W){var H=W(14);M.exports=function(Y,G,X){for(var $ in G)H(Y,$,G[$],X);return Y}},function(M,U,W){'use strict';'use strict';var H=W(2),Y=W(7),G=W(6),X=W(5)('species');M.exports=function($){var J=H[$];G&&J&&!J[X]&&Y.f(J,X,{configurable:!0,get:function(){return this}})}},function(M,U,W){var H=W(32),Y=Math.max,G=Math.min;M.exports=function(X,$){return X=H(X),0>X?Y(X+$,0):G(X,$)}},function(M){var U=0,W=Math.random();M.exports=function(H){return'Symbol('.concat(H===void 0?'':H,')_',(++U+W).toString(36))}},function(M,U,W){var H=W(5)('unscopables'),Y=Array.prototype;Y[H]==void 0&&W(13)(Y,H,{}),M.exports=function(G){Y[H][G]=!0}},function(M,U,W){var H=W(27),Y=W(110),G=W(78),X=W(1),$=W(9),J=W(95),Z={},Q={},U=M.exports=function(ee,te,ne,ae,ie){var oe=ie?function(){return ee}:J(ee),se=H(ne,ae,te?2:1),le=0,de,ue,pe,ce;if('function'!=typeof oe)throw TypeError(ee+' is not iterable!');if(G(oe)){for(de=$(ee.length);de>le;le++)if(ce=te?se(X(ue=ee[le])[0],ue[1]):se(ee[le]),ce===Z||ce===Q)return ce;}else for(pe=oe.call(ee);!(ue=pe.next()).done;)if(ce=Y(pe,se,ue.value,te),ce===Z||ce===Q)return ce};U.BREAK=Z,U.RETURN=Q},function(M){M.exports={}},function(M,U,W){var H=W(7).f,Y=W(11),G=W(5)('toStringTag');M.exports=function(X,$,J){X&&!Y(X=J?X:X.prototype,G)&&H(X,G,{configurable:!0,value:$})}},function(M,U,W){var H=W(0),Y=W(20),G=W(3),X=W(91),$='['+X+']',J='\u200B\x85',Z=RegExp('^'+$+$+'*'),Q=RegExp($+$+'*$'),ee=function(ne,ae,ie){var oe={},se=G(function(){return!!X[ne]()||J[ne]()!=J}),le=oe[ne]=se?ae(te):X[ne];ie&&(oe[ie]=le),H(H.P+H.F*se,'String',oe)},te=ee.trim=function(ne,ae){return ne=Y(ne)+'',1&ae&&(ne=ne.replace(Z,'')),2&ae&&(ne=ne.replace(Q,'')),ne};M.exports=ee},function(M,U,W){'use strict';'use strict';var H=W(331),Y=W(340),G=Function.prototype.apply,X=Function.prototype.call,$=Object.create,J=Object.defineProperty,Z=Object.defineProperties,Q=Object.prototype.hasOwnProperty,ee={configurable:!0,enumerable:!1,writable:!0},te,ne,ae,ie,oe,se,le;te=function(de,ue){var pe;return Y(ue),Q.call(this,'__ee__')?pe=this.__ee__:(pe=ee.value=$(null),J(this,'__ee__',ee),ee.value=null),pe[de]?'object'==typeof pe[de]?pe[de].push(ue):pe[de]=[pe[de],ue]:pe[de]=ue,this},ne=function(de,ue){var pe,ce;return Y(ue),ce=this,te.call(this,de,pe=function(){ae.call(ce,de,pe),G.call(ue,this,arguments)}),pe.__eeOnceListener__=ue,this},ae=function(de,ue){var pe,ce,fe,ge;if(Y(ue),!Q.call(this,'__ee__'))return this;if(pe=this.__ee__,!pe[de])return this;if(ce=pe[de],'object'==typeof ce)for(ge=0;fe=ce[ge];++ge)(fe===ue||fe.__eeOnceListener__===ue)&&(2===ce.length?pe[de]=ce[ge?0:1]:ce.splice(ge,1));else(ce===ue||ce.__eeOnceListener__===ue)&&delete pe[de];return this},ie=function(de){var ue,pe,ce,fe,ge;if(Q.call(this,'__ee__')&&(fe=this.__ee__[de],fe))if('object'==typeof fe){for(pe=arguments.length,ge=Array(pe-1),ue=1;ue<pe;++ue)ge[ue-1]=arguments[ue];for(fe=fe.slice(),ue=0;ce=fe[ue];++ue)G.call(ce,this,ge)}else switch(arguments.length){case 1:X.call(fe,this);break;case 2:X.call(fe,this,arguments[1]);break;case 3:X.call(fe,this,arguments[1],arguments[2]);break;default:for(pe=arguments.length,ge=Array(pe-1),ue=1;ue<pe;++ue)ge[ue-1]=arguments[ue];G.call(fe,this,ge);}},oe={on:te,once:ne,off:ae,emit:ie},se={on:H(te),once:H(ne),off:H(ae),emit:H(ie)},le=Z({},se),M.exports=U=function(de){return null==de?$(le):Z(Object(de),se)},U.methods=oe},function(M,U,W){'use strict';'use strict';function H(J,Z){if(!(J instanceof Z))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(U,'__esModule',{value:!0});var Y=function(){function J(Z,Q){for(var ee=0;ee<Q.length;ee++){var te=Q[ee];te.enumerable=te.enumerable||!1,te.configurable=!0,'value'in te&&(te.writable=!0),Object.defineProperty(Z,te.key,te)}}return function(Z,Q,ee){return Q&&J(Z.prototype,Q),ee&&J(Z,ee),Z}}(),G=W(64),X=function(Z){return Z&&Z.__esModule?Z:{default:Z}}(G),$=function(){function J(Z){H(this,J);var Q,ee;Q=Z.indexOf('://'),-1<Q&&(Z=new URL(Z).pathname),ee=this.parse(Z),this.path=Z,this.directory=this.isDirectory(Z)?Z:ee.dir+'/',this.filename=ee.base,this.extension=ee.ext.slice(1)}return Y(J,[{key:'parse',value:function(Q){return X.default.parse(Q)}},{key:'isAbsolute',value:function(Q){return X.default.isAbsolute(Q||this.path)}},{key:'isDirectory',value:function(Q){return'/'===Q.charAt(Q.length-1)}},{key:'resolve',value:function(Q){return X.default.resolve(this.directory,Q)}},{key:'relative',value:function(Q){return X.default.relative(this.directory,Q)}},{key:'splitPath',value:function(Q){return this.splitPathRe.exec(Q).slice(1)}},{key:'toString',value:function(){return this.path}}]),J}();U.default=$,M.exports=U['default']},function(M,U,W){var H=W(19),Y=W(5)('toStringTag'),G='Arguments'==H(function(){return arguments}()),X=function($,J){try{return $[J]}catch(Z){}};M.exports=function($){var J,Z,Q;return $===void 0?'Undefined':null===$?'Null':'string'==typeof(Z=X(J=Object($),Y))?Z:G?H(J):'Object'==(Q=H(J))&&'function'==typeof J.callee?'Arguments':Q}},function(M,U,W){var H=W(19);M.exports=Object('z').propertyIsEnumerable(0)?Object:function(Y){return'String'==H(Y)?Y.split(''):Object(Y)}},function(M,U){U.f={}.propertyIsEnumerable},function(M,U,W){'use strict';'use strict';Object.defineProperty(U,'__esModule',{value:!0}),U.replaceBase=function($,J){var Z,Q;$&&(Q=(0,H.qs)($,'head'),Z=(0,H.qs)(Q,'base'),!Z&&(Z=$.createElement('base'),Q.insertBefore(Z,Q.firstChild)),Z.setAttribute('href',J.url))},U.replaceCanonical=function($,J){var Z,Q,ee=J.url;$&&(Z=(0,H.qs)($,'head'),Q=(0,H.qs)(Z,'link[rel=\'canonical\']'),Q?Q.setAttribute('href',ee):(Q=$.createElement('link'),Q.setAttribute('rel','canonical'),Q.setAttribute('href',ee),Z.appendChild(Q)))},U.replaceLinks=function($,J){var Z=$.querySelectorAll('a[href]'),Q=(0,H.qs)($.ownerDocument,'base'),ee=Q?Q.href:void 0,te=function(ae){var ie=ae.getAttribute('href');if(0!==ie.indexOf('mailto:')){var oe=-1<ie.indexOf('://'),se=new G.default(ie,ee);oe?ae.setAttribute('target','_blank'):ae.onclick=function(){return se&&se.hash?J(se.Path.path+se.hash):se?J(se.Path.path):J(ie),!1}}}.bind(this);for(var ne=0;ne<Z.length;ne++)te(Z[ne])},U.substitute=function($,J,Z){return J.forEach(function(Q,ee){Q&&Z[ee]&&($=$.replace(new RegExp(Q,'g'),Z[ee]))}),$};var H=W(8),Y=W(70),G=function($){return $&&$.__esModule?$:{default:$}}(Y)},function(M,U,W){var H=W(16),Y=W(9),G=W(40);M.exports=function(X){return function($,J,Z){var Q=H($),ee=Y(Q.length),te=G(Z,ee),ne;if(X&&J!=J){for(;ee>te;)if(ne=Q[te++],ne!=ne)return!0;}else for(;ee>te;te++)if((X||te in Q)&&Q[te]===J)return X||te||0;return!X&&-1}}},function(M,U,W){'use strict';'use strict';var H=W(2),Y=W(0),G=W(14),X=W(38),$=W(30),J=W(43),Z=W(33),Q=W(4),ee=W(3),te=W(59),ne=W(45),ae=W(77);M.exports=function(ie,oe,se,le,de,ue){var pe=H[ie],ce=pe,fe=de?'set':'add',ge=ce&&ce.prototype,he={},ye=function(ke){var we=ge[ke];G(ge,ke,'delete'==ke?function(Se){return ue&&!Q(Se)?!1:we.call(this,0===Se?0:Se)}:'has'==ke?function(Ee){return ue&&!Q(Ee)?!1:we.call(this,0===Ee?0:Ee)}:'get'==ke?function(Ee){return ue&&!Q(Ee)?void 0:we.call(this,0===Ee?0:Ee)}:'add'==ke?function(Ee){return we.call(this,0===Ee?0:Ee),this}:function(Ee,Pe){return we.call(this,0===Ee?0:Ee,Pe),this})};if('function'!=typeof ce||!(ue||ge.forEach&&!ee(function(){new ce().entries().next()})))ce=le.getConstructor(oe,ie,de,fe),X(ce.prototype,se),$.NEED=!0;else{var me=new ce,ve=me[fe](ue?{}:-0,1)!=me,be=ee(function(){me.has(1)}),xe=te(function(ke){new ce(ke)}),_e=!ue&&ee(function(){for(var ke=new ce,we=5;we--;)ke[fe](we,we);return!ke.has(-0)});xe||(ce=oe(function(ke,we){Z(ke,ce,ie);var Se=ae(new pe,ke,ce);return void 0!=we&&J(we,de,Se[fe],Se),Se}),ce.prototype=ge,ge.constructor=ce),(be||_e)&&(ye('delete'),ye('has'),de&&ye('get')),(_e||ve)&&ye(fe),ue&&ge.clear&&delete ge.clear}return ne(ce,ie),he[ie]=ce,Y(Y.G+Y.W+Y.F*(ce!=pe),he),ue||le.setStrong(ce,ie,de),ce}},function(M,U,W){'use strict';'use strict';var H=W(13),Y=W(14),G=W(3),X=W(20),$=W(5);M.exports=function(J,Z,Q){var ee=$(J),te=Q(X,ee,''[J]),ne=te[0],ae=te[1];G(function(){var ie={};return ie[ee]=function(){return 7},7!=''[J](ie)})&&(Y(String.prototype,J,ne),H(RegExp.prototype,ee,2==Z?function(ie,oe){return ae.call(ie,this,oe)}:function(ie){return ae.call(ie,this)}))}},function(M,U,W){'use strict';'use strict';var H=W(1);M.exports=function(){var Y=H(this),G='';return Y.global&&(G+='g'),Y.ignoreCase&&(G+='i'),Y.multiline&&(G+='m'),Y.unicode&&(G+='u'),Y.sticky&&(G+='y'),G}},function(M){M.exports=function(U,W,H){var Y=H===void 0;switch(W.length){case 0:return Y?U():U.call(H);case 1:return Y?U(W[0]):U.call(H,W[0]);case 2:return Y?U(W[0],W[1]):U.call(H,W[0],W[1]);case 3:return Y?U(W[0],W[1],W[2]):U.call(H,W[0],W[1],W[2]);case 4:return Y?U(W[0],W[1],W[2],W[3]):U.call(H,W[0],W[1],W[2],W[3]);}return U.apply(H,W)}},function(M,U,W){var H=W(4),Y=W(19),G=W(5)('match');M.exports=function(X){var $;return H(X)&&(($=X[G])===void 0?'RegExp'==Y(X):!!$)}},function(M,U,W){var H=W(5)('iterator'),Y=!1;try{var G=[7][H]();G['return']=function(){Y=!0},Array.from(G,function(){throw 2})}catch(X){}M.exports=function(X,$){if(!$&&!Y)return!1;var J=!1;try{var Z=[7],Q=Z[H]();Q.next=function(){return{done:J=!0}},Z[H]=function(){return Q},X(Z)}catch(ee){}return J}},function(M,U,W){M.exports=W(34)||!W(3)(function(){var H=Math.random();__defineSetter__.call(null,H,function(){}),delete W(2)[H]})},function(M,U){U.f=Object.getOwnPropertySymbols},function(M,U,W){var H=W(2),Y='__core-js_shared__',G=H[Y]||(H[Y]={});M.exports=function(X){return G[X]||(G[X]={})}},function(M,U,W){for(var H=W(2),Y=W(13),G=W(41),X=G('typed_array'),$=G('view'),J=!!(H.ArrayBuffer&&H.DataView),Z=J,Q=0,te='Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'.split(','),ee;9>Q;)(ee=H[te[Q++]])?(Y(ee.prototype,X,!0),Y(ee.prototype,$,!0)):Z=!1;M.exports={ABV:J,CONSTR:Z,TYPED:X,VIEW:$}},function(M,U,W){'use strict';(function(H){'use strict';function Y(J){if('string'!=typeof J)throw new TypeError('Path must be a string. Received '+J)}function G(J,Z){var Q='',ee=-1,te=0,ne;for(var ae=0;ae<=J.length;++ae){if(ae<J.length)ne=J.charCodeAt(ae);else if(47===ne)break;else ne=47;if(47===ne){if(ee==ae-1||1==te);else if(ee!=ae-1&&2==te){if(2>Q.length||46!==Q.charCodeAt(Q.length-1)||46!==Q.charCodeAt(Q.length-2))if(2<Q.length){for(var ie=Q.length-1,oe=ie;0<=oe&&47!==Q.charCodeAt(oe);--oe);if(oe!==ie){Q=-1===oe?'':Q.slice(0,oe),ee=ae,te=0;continue}}else if(2===Q.length||1===Q.length){Q='',ee=ae,te=0;continue}Z&&(0<Q.length?Q+='/..':Q='..')}else 0<Q.length?Q+='/'+J.slice(ee+1,ae):Q=J.slice(ee+1,ae);ee=ae,te=0}else 46===ne&&-1!=te?++te:te=-1}return Q}function X(J,Z){var Q=Z.dir||Z.root,ee=Z.base||(Z.name||'')+(Z.ext||'');return Q?Q===Z.root?Q+ee:Q+J+ee:ee}var $={resolve:function(){var Z='',Q=!1,ee;for(var te=arguments.length-1;-1<=te&&!Q;te--){var ne;(0<=te?ne=arguments[te]:(void 0==ee&&(ee=H.cwd()),ne=ee),Y(ne),0!==ne.length)&&(Z=ne+'/'+Z,Q=47===ne.charCodeAt(0))}return(Z=G(Z,!Q),Q)?0<Z.length?'/'+Z:'/':0<Z.length?Z:'.'},normalize:function(Z){if(Y(Z),0===Z.length)return'.';var Q=47===Z.charCodeAt(0),ee=47===Z.charCodeAt(Z.length-1);return Z=G(Z,!Q),0!==Z.length||Q||(Z='.'),0<Z.length&&ee&&(Z+='/'),Q?'/'+Z:Z},isAbsolute:function(Z){return Y(Z),0<Z.length&&47===Z.charCodeAt(0)},join:function(){if(0===arguments.length)return'.';var Z;for(var Q=0;Q<arguments.length;++Q){var ee=arguments[Q];Y(ee),0<ee.length&&(Z==void 0?Z=ee:Z+='/'+ee)}return void 0===Z?'.':$.normalize(Z)},relative:function(Z,Q){if(Y(Z),Y(Q),Z===Q)return'';if(Z=$.resolve(Z),Q=$.resolve(Q),Z===Q)return'';for(var ee=1;ee<Z.length&&47===Z.charCodeAt(ee);++ee);for(var te=Z.length,ne=te-ee,ae=1;ae<Q.length&&47===Q.charCodeAt(ae);++ae);for(var ie=Q.length,oe=ie-ae,se=ne<oe?ne:oe,le=-1,de=0;de<=se;++de){if(de===se){if(oe>se){if(47===Q.charCodeAt(ae+de))return Q.slice(ae+de+1);if(0==de)return Q.slice(ae+de)}else ne>se&&(47===Z.charCodeAt(ee+de)?le=de:0===de&&(le=0));break}var ue=Z.charCodeAt(ee+de),pe=Q.charCodeAt(ae+de);if(ue!==pe)break;else 47===ue&&(le=de)}var ce='';for(de=ee+le+1;de<=te;++de)(de===te||47===Z.charCodeAt(de))&&(ce+=0===ce.length?'..':'/..');return 0<ce.length?ce+Q.slice(ae+le):(ae+=le,47===Q.charCodeAt(ae)&&++ae,Q.slice(ae))},_makeLong:function(Z){return Z},dirname:function(Z){if(Y(Z),0===Z.length)return'.';var Q=Z.charCodeAt(0),ee=47===Q,te=-1,ne=!0;for(var ae=Z.length-1;1<=ae;--ae)if(Q=Z.charCodeAt(ae),47!==Q)ne=!1;else if(!ne){te=ae;break}return-1===te?ee?'/':'.':ee&&1===te?'//':Z.slice(0,te)},basename:function(Z,Q){if(Q!==void 0&&'string'!=typeof Q)throw new TypeError('"ext" argument must be a string');Y(Z);var ee=0,te=-1,ne=!0,ae;if(void 0!==Q&&0<Q.length&&Q.length<=Z.length){if(Q.length===Z.length&&Q===Z)return'';var ie=Q.length-1,oe=-1;for(ae=Z.length-1;0<=ae;--ae){var se=Z.charCodeAt(ae);if(47!==se)-1==oe&&(ne=!1,oe=ae+1),0<=ie&&(se===Q.charCodeAt(ie)?-1==--ie&&(te=ae):(ie=-1,te=oe));else if(!ne){ee=ae+1;break}}return ee===te?te=oe:-1===te&&(te=Z.length),Z.slice(ee,te)}for(ae=Z.length-1;0<=ae;--ae)if(47!==Z.charCodeAt(ae))-1==te&&(ne=!1,te=ae+1);else if(!ne){ee=ae+1;break}return-1===te?'':Z.slice(ee,te)},extname:function(Z){Y(Z);var Q=-1,ee=0,te=-1,ne=!0,ae=0;for(var ie=Z.length-1;0<=ie;--ie){var oe=Z.charCodeAt(ie);if(47===oe){if(!ne){ee=ie+1;break}continue}-1==te&&(ne=!1,te=ie+1),46===oe?-1==Q?Q=ie:1!=ae&&(ae=1):-1!=Q&&(ae=-1)}return-1===Q||-1===te||0==ae||1==ae&&Q===te-1&&Q===ee+1?'':Z.slice(Q,te)},format:function(Z){if(null===Z||'object'!=typeof Z)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof Z);return X('/',Z)},parse:function(Z){Y(Z);var Q={root:'',dir:'',base:'',ext:'',name:''};if(0===Z.length)return Q;var ee=Z.charCodeAt(0),te=47===ee,ne;te?(Q.root='/',ne=1):ne=0;for(var ae=-1,ie=0,oe=-1,se=!0,le=Z.length-1,de=0;le>=ne;--le){if(ee=Z.charCodeAt(le),47===ee){if(!se){ie=le+1;break}continue}-1==oe&&(se=!1,oe=le+1),46===ee?-1==ae?ae=le:1!=de&&(de=1):-1!=ae&&(de=-1)}return-1==ae||-1==oe||0==de||1==de&&ae==oe-1&&ae==ie+1?-1!=oe&&(0==ie&&te?Q.base=Q.name=Z.slice(1,oe):Q.base=Q.name=Z.slice(ie,oe)):(0==ie&&te?(Q.name=Z.slice(1,ae),Q.base=Z.slice(1,oe)):(Q.name=Z.slice(ie,ae),Q.base=Z.slice(ie,oe)),Q.ext=Z.slice(ae,oe)),0<ie?Q.dir=Z.slice(0,ie-1):te&&(Q.dir='/'),Q},sep:'/',delimiter:':',posix:null};M.exports=$}).call(U,W(128))},function(M,U,W){'use strict';'use strict';function H(oe){return oe&&oe.__esModule?oe:{default:oe}}function Y(oe,se){if(!(oe instanceof se))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(U,'__esModule',{value:!0});var G=function(){function oe(se,le){for(var de=0;de<le.length;de++){var ue=le[de];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,'value'in ue&&(ue.writable=!0),Object.defineProperty(se,ue.key,ue)}}return function(se,le,de){return le&&oe(se.prototype,le),de&&oe(se,de),se}}(),X=W(47),$=H(X),J=W(8),Z=W(22),Q=H(Z),ee=W(66),te=H(ee),ne=W(52),ae=['keydown','keyup','keypressed','mouseup','mousedown','click','touchend','touchstart'],ie=function(){function oe(se,le,de){Y(this,oe),this.epubcfi=new Q.default,this.document=se,this.documentElement=this.document.documentElement,this.content=le||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.cfiBase=de||'',this.listeners()}return G(oe,[{key:'width',value:function(le){var de=this.content;return le&&(0,J.isNumber)(le)&&(le=le+'px'),le&&(de.style.width=le),this.window.getComputedStyle(de).width}},{key:'height',value:function(le){var de=this.content;return le&&(0,J.isNumber)(le)&&(le=le+'px'),le&&(de.style.height=le),this.window.getComputedStyle(de).height}},{key:'contentWidth',value:function(le){var de=this.content||this.document.body;return le&&(0,J.isNumber)(le)&&(le=le+'px'),le&&(de.style.width=le),this.window.getComputedStyle(de).width}},{key:'contentHeight',value:function(le){var de=this.content||this.document.body;return le&&(0,J.isNumber)(le)&&(le=le+'px'),le&&(de.style.height=le),this.window.getComputedStyle(de).height}},{key:'textWidth',value:function(){var de=this.document.createRange(),ue=this.content||this.document.body,le;return de.selectNodeContents(ue),le=de.getBoundingClientRect().width,le}},{key:'textHeight',value:function(){var de=this.document.createRange(),ue=this.content||this.document.body,le;return de.selectNodeContents(ue),le=de.getBoundingClientRect().height,le}},{key:'scrollWidth',value:function(){var le=this.documentElement.scrollWidth;return le}},{key:'scrollHeight',value:function(){var le=this.documentElement.scrollHeight;return le}},{key:'overflow',value:function(le){return le&&(this.documentElement.style.overflow=le),this.window.getComputedStyle(this.documentElement).overflow}},{key:'overflowX',value:function(le){return le&&(this.documentElement.style.overflowX=le),this.window.getComputedStyle(this.documentElement).overflowX}},{key:'overflowY',value:function(le){return le&&(this.documentElement.style.overflowY=le),this.window.getComputedStyle(this.documentElement).overflowY}},{key:'css',value:function(le,de){var ue=this.content||this.document.body;return de&&(ue.style[le]=de),this.window.getComputedStyle(ue)[le]}},{key:'viewport',value:function(le){var fe=this.document.querySelector('meta[name=\'viewport\']'),ge='',de,ue,pe,ce;if(fe&&fe.hasAttribute('content')){var he=fe.getAttribute('content'),ye=he.split(/\s*,\s*/);ye[0]&&(de=ye[0].replace('width=','').trim()),ye[1]&&(ue=ye[1].replace('height=','').trim()),ye[2]&&(pe=ye[2].replace('initial-scale=','').trim()),ye[3]&&(ce=ye[3].replace('user-scalable=','').trim())}return le&&(ge+='width='+(le.width||de),ge+=', height='+(le.height||ue),(le.scale||pe)&&(ge+=', initial-scale='+(le.scale||pe)),(le.scalable||ce)&&(ge+=', user-scalable='+(le.scalable||ce)),!fe&&(fe=this.document.createElement('meta'),fe.setAttribute('name','viewport'),this.document.querySelector('head').appendChild(fe)),fe.setAttri