���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/drive.rickard.co/customizablesMYs/plugins/epub_reader/js/epub.min.js
���ѧ٧ѧ�
(function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("xmldom"),require("JSZip")):"function"==typeof define&&define.amd?define(["xmldom","JSZip"],t):"object"==typeof exports?exports.ePub=t(require("xmldom"),require("JSZip")):e.ePub=t(e.xmldom,e.JSZip)})(window,function(e,t){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(i,o,function(t){return e[t]}.bind(null,o));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=86)}([function(e,t,n){"use strict";function i(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=0|(e+16*Math.random())%16;return e=Math.floor(e/16),("x"==t?n:8|7&n).toString(16)});return t}function o(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function r(e){return!!(e&&1==e.nodeType)}function s(e){return!isNaN(parseFloat(e))&&isFinite(e)}function a(e){let t=parseFloat(e);return!1!==s(e)&&(!!("string"==typeof e&&-1<e.indexOf("."))||Math.floor(t)!==t)}function l(e){var t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],n=e.toLowerCase(),o=["Webkit","webkit","Moz","O","ms"].length;if("undefined"==typeof document||"undefined"!=typeof document.body.style[n])return e;for(var r=0;r<o;r++)if("undefined"!=typeof document.body.style[t[r]+n])return t[r]+n;return e}function d(e){for(var t=1,n=arguments.length,o;t<n;t++)for(var r in o=arguments[t],o)void 0===e[r]&&(e[r]=o[r]);return e}function c(e){var t=[].slice.call(arguments,1);return t.forEach(function(t){t&&Object.getOwnPropertyNames(t).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}),e}function p(e,t,n){var i=h(e,t,n);return t.splice(i,0,e),i}function h(e,t,n,i,o){var r=i||0,s=o||t.length,a=parseInt(r+(s-r)/2),l;return(n||(n=function(e,t){return e>t?1:e<t?-1:e==t?0:void 0}),0>=s-r)?a:(l=n(t[a],e),1==s-r?0<=l?a:a+1:0===l?a:-1===l?h(e,t,n,a,s):h(e,t,n,r,a))}function u(e,t,n,i,o){var r=i||0,s=o||t.length,a=parseInt(r+(s-r)/2),l;return(n||(n=function(e,t){return e>t?1:e<t?-1:e==t?0:void 0}),0>=s-r)?-1:(l=n(t[a],e),1==s-r?0===l?a:-1:0===l?a:-1===l?u(e,t,n,a,s):u(e,t,n,r,a))}function g(e){var t=window.getComputedStyle(e),n=0,i=0;return["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach(function(e){n+=parseFloat(t[e])||0}),["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach(function(e){i+=parseFloat(t[e])||0}),{height:i,width:n}}function m(e){var t=window.getComputedStyle(e),n=0,i=0;return["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach(function(e){n+=parseFloat(t[e])||0}),["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach(function(e){i+=parseFloat(t[e])||0}),{height:i,width:n}}function f(e){let t=e.ownerDocument,n;if(e.nodeType==Node.TEXT_NODE){let i=t.createRange();i.selectNodeContents(e),n=i.getBoundingClientRect()}else n=e.getBoundingClientRect();return n}function y(){var e=window.innerWidth,t=window.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function b(e,t){for(var n=e.parentNode,o=n.childNodes,r=-1,s=0,a;s<o.length&&(a=o[s],a.nodeType===t&&r++,a!=e);s++);return r}function v(e){return b(e,J)}function x(e){return b(e,Z)}function E(e){return-1<["xml","opf","ncx"].indexOf(e)}function _(e,t){return new Blob([e],{type:t})}function w(e,t){var n=_(e,t),i;return i=Q.createObjectURL(n),i}function S(e){return Q.revokeObjectURL(e)}function C(e,t){var n,i;if("string"==typeof e)return n=btoa(encodeURIComponent(e)),i="data:"+t+";base64,"+n,i}function T(e){return Object.prototype.toString.call(e).slice(8,-1)}function k(e,t,n){var i,o;return o="undefined"==typeof DOMParser||n?X.DOMParser:DOMParser,65279===e.charCodeAt(0)&&(e=e.slice(1)),i=new o().parseFromString(e,t),i}function R(e,t){var n;if(!e)throw new Error("No Element Provided");return"undefined"==typeof e.querySelector?(n=e.getElementsByTagName(t),n.length)?n[0]:void 0:e.querySelector(t)}function I(e,t){return"undefined"==typeof e.querySelector?e.getElementsByTagName(t):e.querySelectorAll(t)}function N(e,t,n){var i,o;if("undefined"!=typeof e.querySelector){for(var r in t+="[",n)t+=r+"~='"+n[r]+"'";return t+="]",e.querySelector(t)}return(i=e.getElementsByTagName(t),o=Array.prototype.slice.call(i,0).filter(function(e){for(var t in n)if(e.getAttribute(t)===n[t])return!0;return!1}),o)?o[0]:void 0}function L(e,t){var n=e.ownerDocument||e;"undefined"==typeof n.createTreeWalker?O(e,function(e){e&&3===e.nodeType&&t(e)},!0):A(e,t,NodeFilter.SHOW_TEXT)}function A(e,t,n){var i=document.createTreeWalker(e,n,null,!1);for(let o;o=i.nextNode();)t(o)}function O(e,t){if(t(e))return!0;if(e=e.firstChild,e)do{let n=O(e,t);if(n)return!0;e=e.nextSibling}while(e)}function P(e){return new Promise(function(t){var n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){t(n.result)}})}function D(){this.resolve=null,this.reject=null,this.id=i(),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}),Object.freeze(this)}function z(e,t,n){var o;if("undefined"!=typeof e.querySelector&&(o=e.querySelector(`${t}[*|type="${n}"]`)),!o||0===o.length){o=I(e,t);for(var r=0;r<o.length;r++)if(o[r].getAttributeNS("http://www.idpf.org/2007/ops","type")===n||o[r].getAttribute("epub:type")===n)return o[r]}else return o}function q(e){for(var t=[],n=e.childNodes,o=0;o<n.length;o++){let e=n[o];1===e.nodeType&&t.push(e)}return t}function B(e){for(var t=[e];e;e=e.parentNode)t.unshift(e);return t}function j(e,t,n){for(var o=[],r=e.childNodes,s=0;s<r.length;s++){let e=r[s];if(1===e.nodeType&&e.nodeName.toLowerCase()===t){if(n)return e;o.push(e)}}if(!n)return o}function M(e,t){let n;if(null!==e&&""!==t)for(n=e.parentNode;1===n.nodeType;){if(n.tagName.toLowerCase()===t)return n;n=n.parentNode}}n.r(t),n.d(t,"requestAnimationFrame",function(){return K}),n.d(t,"uuid",function(){return i}),n.d(t,"documentHeight",function(){return o}),n.d(t,"isElement",function(){return r}),n.d(t,"isNumber",function(){return s}),n.d(t,"isFloat",function(){return a}),n.d(t,"prefixed",function(){return l}),n.d(t,"defaults",function(){return d}),n.d(t,"extend",function(){return c}),n.d(t,"insert",function(){return p}),n.d(t,"locationOf",function(){return h}),n.d(t,"indexOfSorted",function(){return u}),n.d(t,"bounds",function(){return g}),n.d(t,"borders",function(){return m}),n.d(t,"nodeBounds",function(){return f}),n.d(t,"windowBounds",function(){return y}),n.d(t,"indexOfNode",function(){return b}),n.d(t,"indexOfTextNode",function(){return v}),n.d(t,"indexOfElementNode",function(){return x}),n.d(t,"isXml",function(){return E}),n.d(t,"createBlob",function(){return _}),n.d(t,"createBlobUrl",function(){return w}),n.d(t,"revokeBlobUrl",function(){return S}),n.d(t,"createBase64Url",function(){return C}),n.d(t,"type",function(){return T}),n.d(t,"parse",function(){return k}),n.d(t,"qs",function(){return R}),n.d(t,"qsa",function(){return I}),n.d(t,"qsp",function(){return N}),n.d(t,"sprint",function(){return L}),n.d(t,"treeWalker",function(){return A}),n.d(t,"walk",function(){return O}),n.d(t,"blob2base64",function(){return P}),n.d(t,"defer",function(){return D}),n.d(t,"querySelectorByType",function(){return z}),n.d(t,"findChildren",function(){return q}),n.d(t,"parents",function(){return B}),n.d(t,"filterChildren",function(){return j}),n.d(t,"getParentByTagName",function(){return M}),n.d(t,"RangeObject",function(){return $});var U=n(24),W=n.n(U),F=n(14),H=n.n(F),V=n(20),G=n.n(V),X=n(38),Y=n.n(X);const K="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),Z=1,J=3,Q="undefined"==typeof URL?"undefined"==typeof window?void 0:window.URL||window.webkitURL||window.mozURL:URL;class ${constructor(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}setStart(e,t){this.startContainer=e,this.startOffset=t,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}setEnd(e,t){this.endContainer=e,this.endOffset=t,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}collapse(e){this.collapsed=!0,e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}selectNode(e){let t=e.parentNode,n=Array.prototype.indexOf.call(t.childNodes,e);this.setStart(t,n),this.setEnd(t,n+1)}selectNodeContents(e){let t=e.childNodes[e.childNodes-1],n=3===e.nodeType?e.textContent.length:parent.childNodes.length;this.setStart(e,0),this.setEnd(e,n)}_commonAncestorContainer(e,t){var n=B(e||this.startContainer),o=B(t||this.endContainer);if(n[0]==o[0])for(var r=0;r<n.length;r++)if(n[r]!=o[r])return n[r-1]}_checkCollapsed(){this.collapsed=!(this.startContainer!==this.endContainer||this.startOffset!==this.endOffset)}toString(){}}},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return o}),n.d(t,"c",function(){return r});const i="0.3",o=["keydown","keyup","keypressed","mouseup","mousedown","click","touchend","touchstart","touchmove"],r={BOOK:{OPEN_FAILED:"openFailed"},CONTENTS:{EXPAND:"expand",RESIZE:"resize",SELECTED:"selected",SELECTED_RANGE:"selectedRange",LINK_CLICKED:"linkClicked"},LOCATIONS:{CHANGED:"changed"},MANAGERS:{RESIZE:"resize",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",ADDED:"added",SCROLL:"scroll",SCROLLED:"scrolled",REMOVED:"removed"},VIEWS:{AXIS:"axis",WRITING_MODE:"writingMode",LOAD_ERROR:"loaderror",RENDERED:"rendered",RESIZED:"resized",DISPLAYED:"displayed",SHOWN:"shown",HIDDEN:"hidden",MARK_CLICKED:"markClicked"},RENDITION:{STARTED:"started",ATTACHED:"attached",DISPLAYED:"displayed",DISPLAY_ERROR:"displayerror",RENDERED:"rendered",REMOVED:"removed",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",LOCATION_CHANGED:"locationChanged",RELOCATED:"relocated",MARK_CLICKED:"markClicked",SELECTED:"selected",LAYOUT:"layout"},LAYOUT:{UPDATED:"updated"},ANNOTATION:{ATTACH:"attach",DETACH:"detach"}}},function(e,t,n){"use strict";var o=n(0);const r=1,s=3;class a{constructor(e,t,n){var i;if(this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof a))return new a(e,t,n);if("string"==typeof t?this.base=this.parseComponent(t):"object"==typeof t&&t.steps&&(this.base=t),i=this.checkType(e),"string"===i)return this.str=e,Object(o.extend)(this,this.parse(e));if("range"===i)return Object(o.extend)(this,this.fromRange(e,this.base,n));if("node"===i)return Object(o.extend)(this,this.fromNode(e,this.base,n));if("EpubCFI"===i&&e.path)return e;if(!e)return this;throw new TypeError("not a valid argument for EpubCFI")}checkType(e){return this.isCfiString(e)?"string":e&&"object"==typeof e&&("Range"===Object(o.type)(e)||"undefined"!=typeof e.startContainer)?"range":e&&"object"==typeof e&&"undefined"!=typeof e.nodeType?"node":!!(e&&"object"==typeof e&&e instanceof a)&&"EpubCFI"}parse(e){var t={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},n,i,o;return"string"==typeof e?(0===e.indexOf("epubcfi(")&&")"===e[e.length-1]&&(e=e.slice(8,e.length-1)),n=this.getChapterComponent(e),!n)?{spinePos:-1}:(t.base=this.parseComponent(n),i=this.getPathComponent(e),t.path=this.parseComponent(i),o=this.getRange(e),o&&(t.range=!0,t.start=this.parseComponent(o[0]),t.end=this.parseComponent(o[1])),t.spinePos=t.base.steps[1].index,t):{spinePos:-1}}parseComponent(e){var t={steps:[],terminal:{offset:null,assertion:null}},n=e.split(":"),i=n[0].split("/"),o;return 1<n.length&&(o=n[1],t.terminal=this.parseTerminal(o)),""===i[0]&&i.shift(),t.steps=i.map(function(e){return this.parseStep(e)}.bind(this)),t}parseStep(e){var t,n,i,o,r;if(o=e.match(/\[(.*)\]/),o&&o[1]&&(r=o[1]),n=parseInt(e),!isNaN(n))return 0==n%2?(t="element",i=n/2-1):(t="text",i=(n-1)/2),{type:t,index:i,id:r||null}}parseTerminal(e){var t=e.match(/\[(.*)\]/),n,i;return t&&t[1]?(n=parseInt(e.split("[")[0]),i=t[1]):n=parseInt(e),Object(o.isNumber)(n)||(n=null),{offset:n,assertion:i}}getChapterComponent(e){var t=e.split("!");return t[0]}getPathComponent(e){var t=e.split("!");if(t[1]){let e=t[1].split(",");return e[0]}}getRange(e){var t=e.split(",");return!(3!==t.length)&&[t[1],t[2]]}getCharecterOffsetComponent(e){var t=e.split(":");return t[1]||""}joinSteps(e){return e?e.map(function(e){var t="";return"element"===e.type&&(t+=2*(e.index+1)),"text"===e.type&&(t+=1+2*e.index),e.id&&(t+="["+e.id+"]"),t}).join("/"):""}segmentString(e){var t="/";return t+=this.joinSteps(e.steps),e.terminal&&null!=e.terminal.offset&&(t+=":"+e.terminal.offset),e.terminal&&null!=e.terminal.assertion&&(t+="["+e.terminal.assertion+"]"),t}toString(){var e="epubcfi(";return e+=this.segmentString(this.base),e+="!",e+=this.segmentString(this.path),this.range&&this.start&&(e+=",",e+=this.segmentString(this.start)),this.range&&this.end&&(e+=",",e+=this.segmentString(this.end)),e+=")",e}compare(e,t){var n,o,r,s,l,l;if("string"==typeof e&&(e=new a(e)),"string"==typeof t&&(t=new a(t)),e.spinePos>t.spinePos)return 1;if(e.spinePos<t.spinePos)return-1;e.range?(n=e.path.steps.concat(e.start.steps),r=e.start.terminal):(n=e.path.steps,r=e.path.terminal),t.range?(o=t.path.steps.concat(t.start.steps),s=t.start.terminal):(o=t.path.steps,s=t.path.terminal);for(var d=0;d<n.length;d++){if(!n[d])return-1;if(!o[d])return 1;if(n[d].index>o[d].index)return 1;if(n[d].index<o[d].index)return-1}return n.length<o.length?-1:r.offset>s.offset?1:r.offset<s.offset?-1:0}step(e){var t=e.nodeType===s?"text":"element";return{id:e.id,tagName:e.tagName,type:t,index:this.position(e)}}filteredStep(e,t){var n=this.filter(e,t),i;if(n)return i=n.nodeType===s?"text":"element",{id:n.id,tagName:n.tagName,type:i,index:this.filteredPosition(n,t)}}pathTo(e,t,n){for(var i={steps:[],terminal:{offset:null,assertion:null}},o=e,r;o&&o.parentNode&&o.parentNode.nodeType!=9;)r=n?this.filteredStep(o,n):this.step(o),r&&i.steps.unshift(r),o=o.parentNode;return null!=t&&0<=t&&(i.terminal.offset=t,"text"!=i.steps[i.steps.length-1].type&&i.steps.push({type:"text",index:0})),i}equalStep(e,t){return!!(e&&t)&&!(e.index!==t.index||e.id!==t.id||e.type!==t.type)}fromRange(e,t,n){var o={range:!1,base:{},path:{},start:null,end:null},r=e.startContainer,s=e.endContainer,a=e.startOffset,l=e.endOffset,d=!1;if(n&&(d=null!=r.ownerDocument.querySelector("."+n)),"string"==typeof t?(o.base=this.parseComponent(t),o.spinePos=o.base.steps[1].index):"object"==typeof t&&(o.base=t),e.collapsed)d&&(a=this.patchOffset(r,a,n)),o.path=this.pathTo(r,a,n);else{o.range=!0,d&&(a=this.patchOffset(r,a,n)),o.start=this.pathTo(r,a,n),d&&(l=this.patchOffset(s,l,n)),o.end=this.pathTo(s,l,n),o.path={steps:[],terminal:null};var c=o.start.steps.length,p;for(p=0;p<c&&this.equalStep(o.start.steps[p],o.end.steps[p]);p++)p===c-1?o.start.terminal===o.end.terminal&&(o.path.steps.push(o.start.steps[p]),o.range=!1):o.path.steps.push(o.start.steps[p]);o.start.steps=o.start.steps.slice(o.path.steps.length),o.end.steps=o.end.steps.slice(o.path.steps.length)}return o}fromNode(e,t,n){var i={range:!1,base:{},path:{},start:null,end:null};return"string"==typeof t?(i.base=this.parseComponent(t),i.spinePos=i.base.steps[1].index):"object"==typeof t&&(i.base=t),i.path=this.pathTo(e,null,n),i}filter(e,t){var n=!1,i,o,r,a,l;return e.nodeType===s?(n=!0,r=e.parentNode,i=e.parentNode.classList.contains(t)):(n=!1,i=e.classList.contains(t)),i&&n?(a=r.previousSibling,l=r.nextSibling,a&&a.nodeType===s?o=a:l&&l.nodeType===s&&(o=l),o?o:e):(!i||n)&&e}patchOffset(e,t,n){if(e.nodeType!=s)throw new Error("Anchor must be a text node");var i=e,o=t;for(e.parentNode.classList.contains(n)&&(i=e.parentNode);i.previousSibling;){if(!(i.previousSibling.nodeType===r))o+=i.previousSibling.textContent.length;else if(i.previousSibling.classList.contains(n))o+=i.previousSibling.textContent.length;else break;i=i.previousSibling}return o}normalizedMap(e,t,n){var o={},a=-1,l=e.length,d,c,p;for(d=0;d<l;d++)c=e[d].nodeType,c===r&&e[d].classList.contains(n)&&(c=s),0<d&&c===s&&p===s?o[d]=a:t===c&&(++a,o[d]=a),p=c;return o}position(e){var t,n;return e.nodeType===r?(t=e.parentNode.children,!t&&(t=Object(o.findChildren)(e.parentNode)),n=Array.prototype.indexOf.call(t,e)):(t=this.textNodes(e.parentNode),n=t.indexOf(e)),n}filteredPosition(e,t){var n,i,o;return e.nodeType===r?(n=e.parentNode.children,o=this.normalizedMap(n,r,t)):(n=e.parentNode.childNodes,e.parentNode.classList.contains(t)&&(e=e.parentNode,n=e.parentNode.childNodes),o=this.normalizedMap(n,s,t)),i=Array.prototype.indexOf.call(n,e),o[i]}stepsToXpath(e){var t=[".","*"];return e.forEach(function(e){var n=e.index+1;e.id?t.push("*[position()="+n+" and @id='"+e.id+"']"):"text"===e.type?t.push("text()["+n+"]"):t.push("*["+n+"]")}),t.join("/")}stepsToQuerySelector(e){var t=["html"];return e.forEach(function(e){var n=e.index+1;e.id?t.push("#"+e.id):"text"===e.type||t.push("*:nth-child("+n+")")}),t.join(">")}textNodes(e,t){return Array.prototype.slice.call(e.childNodes).filter(function(e){if(e.nodeType===s)return!0;return!!(t&&e.classList.contains(t))})}walkToNode(e,t,n){var r=t||document,s=r.documentElement,a=e.length,l,d,c;for(c=0;c<a&&(d=e[c],"element"===d.type?d.id?s=r.getElementById(d.id):(l=s.children||Object(o.findChildren)(s),s=l[d.index]):"text"===d.type&&(s=this.textNodes(s,n)[d.index]),!!s);c++);return s}findNode(e,t,n){var i=t||document,o,r;return n||"undefined"==typeof i.evaluate?n?o=this.walkToNode(e,i,n):o=this.walkToNode(e,i):(r=this.stepsToXpath(e),o=i.evaluate(r,i,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue),o}fixMiss(e,t,n,i){var o=this.findNode(e.slice(0,-1),n,i),a=o.childNodes,l=this.normalizedMap(a,s,i),d=e[e.length-1].index,c,p;for(let s in l){if(!l.hasOwnProperty(s))return;if(l[s]===d)if(c=a[s],p=c.textContent.length,t>p)t-=p;else{o=c.nodeType===r?c.childNodes[0]:c;break}}return{container:o,offset:t}}toRange(e,t){var n=e||document,i=this,r=!!t&&null!=n.querySelector("."+t),s,a,l,d,c,p,h,u;if(s="undefined"==typeof n.createRange?new o.RangeObject:n.createRange(),i.range?(a=i.start,p=i.path.steps.concat(a.steps),d=this.findNode(p,n,r?t:null),l=i.end,h=i.path.steps.concat(l.steps),c=this.findNode(h,n,r?t:null)):(a=i.path,p=i.path.steps,d=this.findNode(i.path.steps,n,r?t:null)),d)try{null==a.terminal.offset?s.setStart(d,0):s.setStart(d,a.terminal.offset)}catch(i){u=this.fixMiss(p,a.terminal.offset,n,r?t:null),s.setStart(u.container,u.offset)}else return console.log("No startContainer found for",this.toString()),null;if(c)try{null==l.terminal.offset?s.setEnd(c,0):s.setEnd(c,l.terminal.offset)}catch(o){u=this.fixMiss(h,i.end.terminal.offset,n,r?t:null),s.setEnd(u.container,u.offset)}return s}isCfiString(e){return!("string"!=typeof e||0!==e.indexOf("epubcfi(")||")"!==e[e.length-1])}generateChapterComponent(e,t,n){var i=parseInt(t),o="/"+2*(e+1)+"/";return o+=2*(i+1),n&&(o+="["+n+"]"),o}collapse(e){this.range&&(this.range=!1,e?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}}t.a=a},function(e,t,n){"use strict";var i=n(108),o=n(122),r=Function.prototype.apply,s=Function.prototype.call,a=Object.create,l=Object.defineProperty,d=Object.defineProperties,c=Object.prototype.hasOwnProperty,p={configurable:!0,enumerable:!1,writable:!0},h,u,g,m,f,y,b;h=function(e,t){var n;return o(t),c.call(this,"__ee__")?n=this.__ee__:(n=p.value=a(null),l(this,"__ee__",p),p.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},u=function(e,t){var n,i;return o(t),i=this,h.call(this,e,n=function(){g.call(i,e,n),r.call(t,this,arguments)}),n.__eeOnceListener__=t,this},g=function(e,t){var n,r,s,a;if(o(t),!c.call(this,"__ee__"))return this;if(n=this.__ee__,!n[e])return this;if(r=n[e],"object"==typeof r)for(a=0;s=r[a];++a)(s===t||s.__eeOnceListener__===t)&&(2===r.length?n[e]=r[a?0:1]:r.splice(a,1));else(r===t||r.__eeOnceListener__===t)&&delete n[e];return this},m=function(e){var t,n,o,a,d;if(c.call(this,"__ee__")&&(a=this.__ee__[e],!!a))if("object"==typeof a){for(n=arguments.length,d=Array(n-1),t=1;t<n;++t)d[t-1]=arguments[t];for(a=a.slice(),t=0;o=a[t];++t)r.call(o,this,d)}else switch(arguments.length){case 1:s.call(a,this);break;case 2:s.call(a,this,arguments[1]);break;case 3:s.call(a,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,d=Array(n-1),t=1;t<n;++t)d[t-1]=arguments[t];r.call(a,this,d);}},f={on:h,once:u,off:g,emit:m},y={on:i(h),once:i(u),off:i(g),emit:i(m)},b=d({},y),e.exports=t=function(e){return null==e?a(b):d(Object(e),y)},t.methods=f},function(e,t,n){"use strict";var i=n(14),o=n.n(i),r=n(20),s=n.n(r),a=n(9),l=n.n(a);t.a=class e{constructor(e){var t,n;t=e.indexOf("://"),-1<t&&(e=new URL(e).pathname),n=this.parse(e),this.path=e,this.directory=this.isDirectory(e)?e:n.dir+"/",this.filename=n.base,this.extension=n.ext.slice(1)}parse(e){return l.a.parse(e)}isAbsolute(e){return l.a.isAbsolute(e||this.path)}isDirectory(e){return"/"===e.charAt(e.length-1)}resolve(e){return l.a.resolve(this.directory,e)}relative(e){var t=e&&-1<e.indexOf("://");return t?e:l.a.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}}},function(e,t,n){"use strict";var i=n(14),o=n.n(i),r=n(20),s=n.n(r),a=n(4),l=n(9),d=n.n(l);t.a=class e{constructor(e,t){var n=-1<e.indexOf("://"),i=e,o;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=t,!n&&!1!==t&&"string"!=typeof t&&window&&window.location&&(this.base=window.location.href),n||this.base)try{this.Url=this.base?new URL(e,this.base):new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,i=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(t){this.Url=void 0,this.base&&(o=new a.a(this.base),i=o.resolve(i))}this.Path=new a.a(i),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var t=-1<e.indexOf("://"),n;return t?e:(n=d.a.resolve(this.directory,e),this.origin+n)}relative(e){return d.a.relative(e,this.directory)}toString(){return this.href}}},function(e,t,n){"use strict";var i=n(14),o=n.n(i);t.a=class e{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e<arguments.length;++e)if("function"==typeof arguments[e])this.hooks.push(arguments[e]);else for(var t=0;t<arguments[e].length;++t)this.hooks.push(arguments[e][t])}deregister(e){let t;for(let n=0;n<this.hooks.length;n++)if(t=this.hooks[n],t===e){this.hooks.splice(n,1);break}}trigger(){var e=arguments,t=this.context,n=[];return this.hooks.forEach(function(i){var o=i.apply(t,e);o&&"function"==typeof o.then&&n.push(o)}),Promise.all(n)}list(){return this.hooks}clear(){return this.hooks=[]}}},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(30))},function(e,t,n){var i=n(7),o=n(66),r=n(10),s=n(67),a=n(70),l=n(99),d=o("wks"),c=i.Symbol,p=l?c:c&&c.withoutSetter||s;e.exports=function(e){return r(d,e)||(a&&r(c,e)?d[e]=c[e]:d[e]=p("Symbol."+e)),d[e]}},function(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+e)}function n(e,t){for(var n="",o=-1,r=0,s=0,a;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else if(47===a)break;else a=47;if(47===a){if(o===s-1||1===r);else if(o!==s-1&&2===r){if(2>n.length||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(2<n.length){for(var l=n.length-1,d=l;0<=d&&47!==n.charCodeAt(d);--d);if(d!==l){n=-1===d?"":n.slice(0,d),o=s,r=0;continue}}else if(2===n.length||1===n.length){n="",o=s,r=0;continue}t&&(0<n.length?n+="/..":n="..")}else 0<n.length?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s);o=s,r=0}else 46===a&&-1!==r?++r:r=-1}return n}function i(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}if(!o)var o={cwd:function(){return"/"}};var r={resolve:function(){for(var e="",r=!1,s=arguments.length-1,a;-1<=s&&!r;s--){var l;(0<=s?l=arguments[s]:(void 0===a&&(a=o.cwd()),l=a),t(l),0!==l.length)&&(e=l+"/"+e,r=47===l.charCodeAt(0))}return e=n(e,!r),r?0<e.length?"/"+e:"/":0<e.length?e:"."},normalize:function(e){if(t(e),0===e.length)return".";var i=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return e=n(e,!i),0!==e.length||i||(e="."),0<e.length&&o&&(e+="/"),i?"/"+e:e},isAbsolute:function(e){return t(e),0<e.length&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e=0,n,o;e<arguments.length;++e)o=arguments[e],t(o),0<o.length&&(void 0===n?n=o:n+="/"+o);return void 0===n?".":r.normalize(n)},relative:function(e,n){if(t(e),t(n),e===n)return"";if(e=r.resolve(e),n=r.resolve(n),e===n)return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length,a=s-o,l=1;l<n.length&&47===n.charCodeAt(l);++l);for(var d=n.length,c=d-l,p=a<c?a:c,h=-1,u=0;u<=p;++u){if(u===p){if(c>p){if(47===n.charCodeAt(l+u))return n.slice(l+u+1);if(0===u)return n.slice(l+u)}else a>p&&(47===e.charCodeAt(o+u)?h=u:0===u&&(h=0));break}var g=e.charCodeAt(o+u),m=n.charCodeAt(l+u);if(g!==m)break;else 47===g&&(h=u)}var f="";for(u=o+h+1;u<=s;++u)(u===s||47===e.charCodeAt(u))&&(f+=0===f.length?"..":"/..");return 0<f.length?f+n.slice(l+h):(l+=h,47===n.charCodeAt(l)&&++l,n.slice(l))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),o=47===n,r=-1,s=!0,a=e.length-1;1<=a;--a)if(n=e.charCodeAt(a),47!==n)s=!1;else if(!s){r=a;break}return-1===r?o?"/":".":o&&1===r?"//":e.slice(0,r)},basename:function(e,n){if(n!==void 0&&"string"!=typeof n)throw new TypeError("\"ext\" argument must be a string");t(e);var o=0,r=-1,s=!0,a;if(void 0!==n&&0<n.length&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var l=n.length-1,d=-1;for(a=e.length-1;0<=a;--a){var c=e.charCodeAt(a);if(47!==c)-1===d&&(s=!1,d=a+1),0<=l&&(c===n.charCodeAt(l)?-1==--l&&(r=a):(l=-1,r=d));else if(!s){o=a+1;break}}return o===r?r=d:-1===r&&(r=e.length),e.slice(o,r)}for(a=e.length-1;0<=a;--a)if(47!==e.charCodeAt(a))-1===r&&(s=!1,r=a+1);else if(!s){o=a+1;break}return-1===r?"":e.slice(o,r)},extname:function(e){t(e);for(var n=-1,o=0,r=-1,s=!0,a=0,l=e.length-1,d;0<=l;--l){if(d=e.charCodeAt(l),47===d){if(!s){o=l+1;break}continue}-1===r&&(s=!1,r=l+1),46===d?-1===n?n=l:1!==a&&(a=1):-1!==n&&(a=-1)}return-1===n||-1===r||0===a||1===a&&n===r-1&&n===o+1?"":e.slice(n,r)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError("Parameter \"pathObject\" must be an object, not "+typeof e);return i("/",e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var o=e.charCodeAt(0),r=47===o,s;r?(n.root="/",s=1):s=0;for(var a=-1,l=0,d=-1,c=!0,p=e.length-1,h=0;p>=s;--p){if(o=e.charCodeAt(p),47===o){if(!c){l=p+1;break}continue}-1===d&&(c=!1,d=p+1),46===o?-1===a?a=p:1!==h&&(h=1):-1!==a&&(h=-1)}return-1===a||-1===d||0===h||1===h&&a===d-1&&a===l+1?-1!==d&&(0===l&&r?n.base=n.name=e.slice(1,d):n.base=n.name=e.slice(l,d)):(0===l&&r?(n.name=e.slice(1,a),n.base=e.slice(1,d)):(n.name=e.slice(l,a),n.base=e.slice(l,d)),n.ext=e.slice(a,d)),0<l?n.dir=e.slice(0,l-1):r&&(n.dir="/"),n},sep:"/",delimiter:":",posix:null};e.exports=r},function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},function(e,t,n){"use strict";function i(e,t){var n=t.url,i=-1<n.indexOf("://"),o,r;e&&(r=Object(c.qs)(e,"head"),o=Object(c.qs)(r,"base"),!o&&(o=e.createElement("base"),r.insertBefore(o,r.firstChild)),!i&&window&&window.location&&(n=window.location.origin+n),o.setAttribute("href",n))}function o(e,t){var n=t.canonical,i,o;e&&(i=Object(c.qs)(e,"head"),o=Object(c.qs)(i,"link[rel='canonical']"),o?o.setAttribute("href",n):(o=e.createElement("link"),o.setAttribute("rel","canonical"),o.setAttribute("href",n),i.appendChild(o)))}function r(e,t){var n=t.idref,i,o;e&&(i=Object(c.qs)(e,"head"),o=Object(c.qs)(i,"link[property='dc.identifier']"),o?o.setAttribute("content",n):(o=e.createElement("meta"),o.setAttribute("name","dc.identifier"),o.setAttribute("content",n),i.appendChild(o)))}function s(e,t){var n=e.querySelectorAll("a[href]");if(n.length)for(var o=Object(c.qs)(e.ownerDocument,"base"),r=o?o.getAttribute("href"):void 0,s=function(e){var n=e.getAttribute("href");if(0!==n.indexOf("mailto:")){var i=-1<n.indexOf("://");if(i)e.setAttribute("target","_blank");else{var o;try{o=new p.a(n,r)}catch(e){}e.onclick=function(){return o&&o.hash?t(o.Path.path+o.hash):o?t(o.Path.path):t(n),!1}}}}.bind(this),a=0;a<n.length;a++)s(n[a])}function a(e,t,n){return t.forEach(function(t,o){t&&n[o]&&(t=t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),e=e.replace(new RegExp(t,"g"),n[o]))}),e}n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"c",function(){return s}),n.d(t,"e",function(){return a});var l=n(24),d=n.n(l),c=n(0),p=n(5),h=n(4)},function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var i=n(17);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object");return e}},function(e,t,n){var i=n(7),o=n(102),r=n(71),s=n(15),a=n(8),l=a("iterator"),d=a("toStringTag"),c=r.values;for(var p in o){var h=i[p],u=h&&h.prototype;if(u){if(u[l]!==c)try{s(u,l,c)}catch(e){u[l]=c}if(u[d]||s(u,d,p),o[p])for(var g in r)if(u[g]!==r[g])try{s(u,g,r[g])}catch(e){u[g]=r[g]}}}},function(e,t,n){var i=n(16),o=n(18),r=n(25);e.exports=i?function(e,t,n){return o.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var i=n(12);e.exports=!i(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var i=n(16),o=n(62),r=n(13),s=n(41),a=Object.defineProperty;t.f=i?a:function(e,t,n){if(r(e),t=s(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var i=n(7),o=n(15),r=n(10),s=n(42),a=n(64),l=n(26),d=l.get,c=l.enforce,p=(String+"").split("String");(e.exports=function(e,t,n,a){var l=!!a&&!!a.unsafe,d=!!a&&!!a.enumerable,h=!!a&&!!a.noTargetGet;return("function"==typeof n&&("string"==typeof t&&!r(n,"name")&&o(n,"name",t),c(n).source=p.join("string"==typeof t?t:"")),e===i)?void(d?e[t]=n:s(t,n)):void(l?!h&&e[t]&&(d=!0):delete e[t],d?e[t]=n:o(e,t,n))})(Function.prototype,"toString",function(){return"function"==typeof this&&d(this).source||a(this)})},function(e,t,n){"use strict";n(123);var i=n(31),o=n(16),r=n(78),s=n(7),a=n(72),l=n(19),d=n(79),c=n(10),p=n(124),h=n(125),u=n(49).codeAt,g=n(131),m=n(37),f=n(132),y=n(26),b=s.URL,v=f.URLSearchParams,x=f.getState,E=y.set,_=y.getterFor("URL"),w=Math.floor,S=Math.pow,C="Invalid scheme",T="Invalid host",k="Invalid port",R=/[A-Za-z]/,I=/\d/,N=/^[\dA-Fa-f]+$/,L=function(e,t){var n,i,o;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return T;if(n=O(t.slice(1,-1)),!n)return T;e.host=n}else if(!W(e)){if(/[\u0000\u0009\u000A\u000D #/:?@[\\]]/.test(t))return T;for(n="",i=h(t),o=0;o<i.length;o++)n+=M(i[o],z);e.host=n}else{if(t=g(t),/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/.test(t))return T;if(n=A(t),null===n)return T;e.host=n}},A=function(e){var t=e.split("."),n,i,o,r,s,a,l;if(t.length&&""==t[t.length-1]&&t.pop(),n=t.length,4<n)return e;for(i=[],o=0;o<n;o++){if(r=t[o],""==r)return e;if(s=10,1<r.length&&"0"==r.charAt(0)&&(s=/^(0x|0X)/.test(r)?16:8,r=r.slice(8==s?1:2)),""===r)a=0;else{if(!(10==s?/^\d+$/:8==s?/^[0-7]+$/:N).test(r))return e;a=parseInt(r,s)}i.push(a)}for(o=0;o<n;o++)if(a=i[o],o==n-1){if(a>=S(256,5-n))return null;}else if(255<a)return null;for(l=i.pop(),o=0;o<i.length;o++)l+=i[o]*S(256,3-o);return l},O=function(e){var t=[0,0,0,0,0,0,0,0],n=0,i=null,o=0,r=function(){return e.charAt(o)},s,a,l,d,c,p,h;if(":"==r()){if(":"!=e.charAt(1))return;o+=2,n++,i=n}for(;r();){if(8==n)return;if(":"==r()){if(null!==i)return;o++,n++,i=n;continue}for(s=a=0;4>a&&N.test(r());)s=16*s+parseInt(r(),16),o++,a++;if("."==r()){if(0==a)return;if(o-=a,6<n)return;for(l=0;r();){if(d=null,0<l)if("."==r()&&4>l)o++;else return;if(!I.test(r()))return;for(;I.test(r());){if(c=parseInt(r(),10),null===d)d=c;else{if(0==d)return;d=10*d+c}if(255<d)return;o++}t[n]=256*t[n]+d,l++,(2==l||4==l)&&n++}if(4!=l)return;break}else if(":"==r()){if(o++,!r())return;}else if(r())return;t[n++]=s}if(null!==i)for(p=n-i,n=7;0!=n&&0<p;)h=t[n],t[n--]=t[i+p-1],t[i+--p]=h;else if(8!=n)return;return t},P=function(e){for(var t=null,n=1,i=null,o=0,r=0;8>r;r++)0===e[r]?(null===i&&(i=r),++o):(o>n&&(t=i,n=o),i=null,o=0);return o>n&&(t=i,n=o),t},D=function(e){var t,n,i,o;if("number"==typeof e){for(t=[],n=0;4>n;n++)t.unshift(e%256),e=w(e/256);return t.join(".")}if("object"==typeof e){for(t="",i=P(e),n=0;8>n;n++)o&&0===e[n]||(o&&(o=!1),i===n?(t+=n?":":"::",o=!0):(t+=e[n].toString(16),7>n&&(t+=":")));return"["+t+"]"}return e},z={},q=p({},z,{" ":1,'"':1,"<":1,">":1,"`":1}),B=p({},q,{"#":1,"?":1,"{":1,"}":1}),j=p({},B,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),M=function(e,t){var n=u(e,0);return 32<n&&127>n&&!c(t,e)?e:encodeURIComponent(e)},U={ftp:21,file:null,http:80,https:443,ws:80,wss:443},W=function(e){return c(U,e.scheme)},F=function(e){return""!=e.username||""!=e.password},H=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},V=function(e,t){var n;return 2==e.length&&R.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},G=function(e){var t;return 1<e.length&&V(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},X=function(e){var t=e.path,n=t.length;n&&("file"!=e.scheme||1!=n||!V(t[0],!0))&&t.pop()},Y=function(e){return"."===e||"%2e"===e.toLowerCase()},K=function(e){return e=e.toLowerCase(),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},Z={},J={},Q={},$={},ee={},te={},ne={},ie={},oe={},re={},se={},ae={},le={},de={},ce={},pe={},he={},ue={},ge={},me={},fe={},ye=function(e,t,n,o){var r=n||Z,s=0,a="",l=!1,d=!1,p=!1,u,g,m,f;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,"")),t=t.replace(/[\u0009\u000A\u000D]/g,""),u=h(t);s<=u.length;){switch(g=u[s],r){case Z:if(g&&R.test(g))a+=g.toLowerCase(),r=J;else if(!n){r=Q;continue}else return C;break;case J:if(g&&(/[\d+-.A-Za-z]/.test(g)||"+"==g||"-"==g||"."==g))a+=g.toLowerCase();else if(":"==g){if(n&&(W(e)!=c(U,a)||"file"==a&&(F(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=a,n)return void(W(e)&&U[e.scheme]==e.port&&(e.port=null));a="","file"==e.scheme?r=de:W(e)&&o&&o.scheme==e.scheme?r=$:W(e)?r=ie:"/"==u[s+1]?(r=ee,s++):(e.cannotBeABaseURL=!0,e.path.push(""),r=ge)}else if(!n){a="",r=Q,s=0;continue}else return C;break;case Q:if(!o||o.cannotBeABaseURL&&"#"!=g)return C;if(o.cannotBeABaseURL&&"#"==g){e.scheme=o.scheme,e.path=o.path.slice(),e.query=o.query,e.fragment="",e.cannotBeABaseURL=!0,r=fe;break}r="file"==o.scheme?de:te;continue;case $:if("/"==g&&"/"==u[s+1])r=oe,s++;else{r=te;continue}break;case ee:if("/"==g){r=re;break}else{r=ue;continue}case te:if(e.scheme=o.scheme,g==Oe)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query;else if("/"==g||"\\"==g&&W(e))r=ne;else if("?"==g)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query="",r=me;else if("#"==g)e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.query=o.query,e.fragment="",r=fe;else{e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,e.path=o.path.slice(),e.path.pop(),r=ue;continue}break;case ne:if(W(e)&&("/"==g||"\\"==g))r=oe;else if("/"==g)r=re;else{e.username=o.username,e.password=o.password,e.host=o.host,e.port=o.port,r=ue;continue}break;case ie:if(r=oe,"/"!=g||"/"!=a.charAt(s+1))continue;s++;break;case oe:if("/"!=g&&"\\"!=g){r=re;continue}break;case re:if("@"==g){l&&(a="%40"+a),l=!0,m=h(a);for(var y=0,b;y<m.length;y++){if(b=m[y],":"==b&&!p){p=!0;continue}var v=M(b,j);p?e.password+=v:e.username+=v}a=""}else if(g==Oe||"/"==g||"?"==g||"#"==g||"\\"==g&&W(e)){if(l&&""==a)return"Invalid authority";s-=h(a).length+1,a="",r=se}else a+=g;break;case se:case ae:if(n&&"file"==e.scheme){r=pe;continue}else if(":"==g&&!d){if(""==a)return T;if(f=L(e,a),f)return f;if(a="",r=le,n==ae)return}else if(g==Oe||"/"==g||"?"==g||"#"==g||"\\"==g&&W(e)){if(W(e)&&""==a)return T;if(n&&""==a&&(F(e)||null!==e.port))return;if(f=L(e,a),f)return f;if(a="",r=he,n)return;continue}else"["==g?d=!0:"]"==g&&(d=!1),a+=g;break;case le:if(I.test(g))a+=g;else if(g==Oe||"/"==g||"?"==g||"#"==g||"\\"==g&&W(e)||n){if(""!=a){var x=parseInt(a,10);if(65535<x)return k;e.port=W(e)&&x===U[e.scheme]?null:x,a=""}if(n)return;r=he;continue}else return k;break;case de:if(e.scheme="file","/"==g||"\\"==g)r=ce;else if(!(o&&"file"==o.scheme)){r=ue;continue}else if(g==Oe)e.host=o.host,e.path=o.path.slice(),e.query=o.query;else if("?"==g)e.host=o.host,e.path=o.path.slice(),e.query="",r=me;else if("#"==g)e.host=o.host,e.path=o.path.slice(),e.query=o.query,e.fragment="",r=fe;else{G(u.slice(s).join(""))||(e.host=o.host,e.path=o.path.slice(),X(e)),r=ue;continue}break;case ce:if("/"==g||"\\"==g){r=pe;break}o&&"file"==o.scheme&&!G(u.slice(s).join(""))&&(V(o.path[0],!0)?e.path.push(o.path[0]):e.host=o.host),r=ue;continue;case pe:if(g==Oe||"/"==g||"\\"==g||"?"==g||"#"==g){if(!n&&V(a))r=ue;else if(""==a){if(e.host="",n)return;r=he}else{if(f=L(e,a),f)return f;if("localhost"==e.host&&(e.host=""),n)return;a="",r=he}continue}else a+=g;break;case he:if(W(e)){if(r=ue,"/"!=g&&"\\"!=g)continue;}else if(!n&&"?"==g)e.query="",r=me;else if(!n&&"#"==g)e.fragment="",r=fe;else if(g!=Oe&&(r=ue,"/"!=g))continue;break;case ue:if(g==Oe||"/"==g||"\\"==g&&W(e)||!n&&("?"==g||"#"==g)){if(K(a)?(X(e),"/"!=g&&!("\\"==g&&W(e))&&e.path.push("")):Y(a)?"/"!=g&&!("\\"==g&&W(e))&&e.path.push(""):("file"==e.scheme&&!e.path.length&&V(a)&&(e.host&&(e.host=""),a=a.charAt(0)+":"),e.path.push(a)),a="","file"==e.scheme&&(g==Oe||"?"==g||"#"==g))for(;1<e.path.length&&""===e.path[0];)e.path.shift();"?"==g?(e.query="",r=me):"#"==g&&(e.fragment="",r=fe)}else a+=M(g,B);break;case ge:"?"==g?(e.query="",r=me):"#"==g?(e.fragment="",r=fe):g!=Oe&&(e.path[0]+=M(g,z));break;case me:n||"#"!=g?g!=Oe&&("'"==g&&W(e)?e.query+="%27":"#"==g?e.query+="%23":e.query+=M(g,z)):(e.fragment="",r=fe);break;case fe:g!=Oe&&(e.fragment+=M(g,q));}s++}},be=function(e){var t=d(this,be,"URL"),n=1<arguments.length?arguments[1]:void 0,i=E(t,{type:"URL"}),r,s;if(void 0!==n)if(n instanceof be)r=_(n);else if(s=ye(r={},n+""),s)throw TypeError(s);if(s=ye(i,e+"",null,r),s)throw TypeError(s);var a=i.searchParams=new v,l=x(a);l.updateSearchParams(i.query),l.updateURL=function(){i.query=a+""||null},o||(t.href=xe.call(t),t.origin=Ee.call(t),t.protocol=_e.call(t),t.username=we.call(t),t.password=Se.call(t),t.host=Ce.call(t),t.hostname=Te.call(t),t.port=ke.call(t),t.pathname=Re.call(t),t.search=Ie.call(t),t.searchParams=Ne.call(t),t.hash=Le.call(t))},ve=be.prototype,xe=function(){var e=_(this),t=e.scheme,n=e.username,i=e.password,o=e.host,r=e.port,s=e.path,a=e.query,l=e.fragment,d=t+":";return null===o?"file"==t&&(d+="//"):(d+="//",F(e)&&(d+=n+(i?":"+i:"")+"@"),d+=D(o),null!==r&&(d+=":"+r)),d+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==a&&(d+="?"+a),null!==l&&(d+="#"+l),d},Ee=function(){var e=_(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&W(e)?t+"://"+D(e.host)+(null===n?"":":"+n):"null"},_e=function(){return _(this).scheme+":"},we=function(){return _(this).username},Se=function(){return _(this).password},Ce=function(){var e=_(this),t=e.host,n=e.port;return null===t?"":null===n?D(t):D(t)+":"+n},Te=function(){var e=_(this).host;return null===e?"":D(e)},ke=function(){var e=_(this).port;return null===e?"":e+""},Re=function(){var e=_(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ie=function(){var e=_(this).query;return e?"?"+e:""},Ne=function(){return _(this).searchParams},Le=function(){var e=_(this).fragment;return e?"#"+e:""},Ae=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}},Oe;if(o&&a(ve,{href:Ae(xe,function(e){var t=_(this),n=ye(t,e+"");if(n)throw TypeError(n);x(t.searchParams).updateSearchParams(t.query)}),origin:Ae(Ee),protocol:Ae(_e,function(e){var t=_(this);ye(t,e+":",Z)}),username:Ae(we,function(e){var t=_(this),n=h(e+"");if(!H(t)){t.username="";for(var o=0;o<n.length;o++)t.username+=M(n[o],j)}}),password:Ae(Se,function(e){var t=_(this),n=h(e+"");if(!H(t)){t.password="";for(var o=0;o<n.length;o++)t.password+=M(n[o],j)}}),host:Ae(Ce,function(e){var t=_(this);t.cannotBeABaseURL||ye(t,e+"",se)}),hostname:Ae(Te,function(e){var t=_(this);t.cannotBeABaseURL||ye(t,e+"",ae)}),port:Ae(ke,function(e){var t=_(this);H(t)||(e+="",""==e?t.port=null:ye(t,e,le))}),pathname:Ae(Re,function(e){var t=_(this);t.cannotBeABaseURL||(t.path=[],ye(t,e+"",he))}),search:Ae(Ie,function(e){var t=_(this);e+="",""==e?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",ye(t,e,me)),x(t.searchParams).updateSearchParams(t.query)}),searchParams:Ae(Ne),hash:Ae(Le,function(e){var t=_(this);return e+="",""==e?void(t.fragment=null):void("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",ye(t,e,fe))})}),l(ve,"toJSON",function(){return xe.call(this)},{enumerable:!0}),l(ve,"toString",function(){return xe.call(this)},{enumerable:!0}),b){var Pe=b.createObjectURL,De=b.revokeObjectURL;Pe&&l(be,"createObjectURL",function(){return Pe.apply(b,arguments)}),De&&l(be,"revokeObjectURL",function(){return De.apply(b,arguments)})}m(be,"URL"),i({global:!0,forced:!r,sham:!o},{URL:be})},function(e,t,n){"use strict";var i=n(0);t.a=class e{constructor(e){this._q=[],this.context=e,this.tick=i.requestAnimationFrame,this.running=!1,this.paused=!1}enqueue(){var e=[].shift.call(arguments),t=arguments,n,o,r;if(!e)throw new Error("No Task Provided");return"function"==typeof e?(n=new i.defer,o=n.promise,r={task:e,args:t,deferred:n,promise:o}):r={promise:e},this._q.push(r),!1!=this.paused||this.running||this.run(),r.promise}dequeue(){var e,t,n;if(this._q.length&&!this.paused){if(e=this._q.shift(),t=e.task,t)return n=t.apply(this.context,e.args),n&&"function"==typeof n.then?n.then(function(){e.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){e.deferred.reject.apply(this.context,arguments)}.bind(this)):(e.deferred.resolve.apply(this.context,n),e.promise);if(e.promise)return e.promise}else return e=new i.defer,e.deferred.resolve(),e.promise}dump(){for(;this._q.length;)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new i.defer),this.tick.call(window,()=>{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),!0==this.paused&&(this.paused=!1),this.defered.promise}flush(){return this.running?this.running:this._q.length?(this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running):void 0}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}}},function(e,t,n){"use strict";function i(){var e="reverse",t=o();return document.body.appendChild(t),0<t.scrollLeft?e="default":"undefined"!=typeof Element&&Element.prototype.scrollIntoView?(t.children[0].children[1].scrollIntoView(),0>t.scrollLeft&&(e="negative")):(t.scrollLeft=1,0===t.scrollLeft&&(e="negative")),document.body.removeChild(t),e}function o(){var e=document.createElement("div");e.dir="rtl",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.top="0px",e.style.left="0px",e.style.overflow="hidden";var t=document.createElement("div");t.style.width="2px";var n=document.createElement("span");n.style.width="1px",n.style.display="inline-block";var i=document.createElement("span");return i.style.width="1px",i.style.display="inline-block",t.appendChild(n),t.appendChild(i),e.appendChild(t),e}var r=n(3),s=n.n(r),a=n(0),l=n(23),d=n(21),c=n(84),p=n.n(c);var h=class e{constructor(e){this.settings=e||{},this.id="epubjs-container-"+Object(a.uuid)(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let t=e.height,n=e.width,i=e.overflow||!1,o=e.axis||"vertical",r=e.direction;Object(a.extend)(this.settings,e),e.height&&Object(a.isNumber)(e.height)&&(t=e.height+"px"),e.width&&Object(a.isNumber)(e.width)&&(n=e.width+"px");let s=document.createElement("div");return s.id=this.id,s.classList.add("epub-container"),s.style.wordSpacing="0",s.style.lineHeight="0",s.style.verticalAlign="top",s.style.position="relative","horizontal"===o&&(s.style.display="flex",s.style.flexDirection="row",s.style.flexWrap="nowrap"),n&&(s.style.width=n),t&&(s.style.height=t),i&&("scroll"===i&&"vertical"===o?(s.style["overflow-y"]=i,s.style["overflow-x"]="hidden"):"scroll"===i&&"horizontal"===o?(s.style["overflow-y"]="hidden",s.style["overflow-x"]=i):s.style.overflow=i),r&&(s.dir=r,s.style.direction=r),r&&this.settings.fullsize&&(document.body.style.direction=r),s}wrap(e){var t=document.createElement("div");return t.style.visibility="hidden",t.style.overflow="hidden",t.style.width="0",t.style.height="0",t.appendChild(e),t}getElement(e){var t;if(Object(a.isElement)(e)?t=e:"string"==typeof e&&(t=document.getElementById(e)),!t)throw new Error("Not an Element");return t}attachTo(e){var t=this.getElement(e),n;if(t)return n=this.settings.hidden?this.wrapper:this.container,t.appendChild(n),this.element=t,t}getContainer(){return this.container}onResize(e){Object(a.isNumber)(this.settings.width)&&Object(a.isNumber)(this.settings.height)||(this.resizeFunc=p()(e,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(e,t){var n;let i=e||this.settings.width,o=t||this.settings.height;null===e?(n=this.element.getBoundingClientRect(),n.width&&(e=Math.floor(n.width),this.container.style.width=e+"px")):Object(a.isNumber)(e)?this.container.style.width=e+"px":this.container.style.width=e,null===t?(n=n||this.element.getBoundingClientRect(),n.height&&(t=n.height,this.container.style.height=t+"px")):Object(a.isNumber)(t)?this.container.style.height=t+"px":this.container.style.height=t,Object(a.isNumber)(e)||(e=this.container.clientWidth),Object(a.isNumber)(t)||(t=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};let r=Object(a.windowBounds)(),s=window.getComputedStyle(document.body),l={left:parseFloat(s["padding-left"])||0,right:parseFloat(s["padding-right"])||0,top:parseFloat(s["padding-top"])||0,bottom:parseFloat(s["padding-bottom"])||0};return i||(e=r.width-l.left-l.right),(!this.settings.fullsize||o)&&o||(t=r.height-l.top-l.bottom),{width:e-this.containerPadding.left-this.containerPadding.right,height:t-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return"visible"!==this.container.style.overflow&&(e=this.container&&this.container.getBoundingClientRect()),e&&e.width&&e.height?e:Object(a.windowBounds)()}getSheet(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet}addStyleRules(e,t){var n="#"+this.id+" ",i="";this.sheet||(this.sheet=this.getSheet()),t.forEach(function(e){for(var t in e)e.hasOwnProperty(t)&&(i+=t+":"+e[t]+";")}),this.sheet.insertRule(n+e+" {"+i+"}",0)}axis(e){"horizontal"===e?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&("scroll"===e&&"vertical"===this.settings.axis?(this.container.style["overflow-y"]=e,this.container.style["overflow-x"]="hidden"):"scroll"===e&&"horizontal"===this.settings.axis?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=e):this.container.style.overflow=e),this.settings.overflow=e}destroy(){var e;this.element&&(e=this.settings.hidden?this.wrapper:this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))}};var u=class e{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,t){return this._views.splice(t,0,e),this.container&&(t<this.container.children.length?this.container.insertBefore(e.element,this.container.children[t]):this.container.appendChild(e.element)),this.length++,e}remove(e){var t=this._views.indexOf(e);-1<t&&this._views.splice(t,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e=this.length,t;if(this.length){for(var n=0;n<e;n++)t=this._views[n],this.destroy(t);this._views=[],this.length=0}}find(e){for(var t=this.length,n=0,o;n<t;n++)if(o=this._views[n],o.displayed&&o.section.index==e.index)return o}displayed(){for(var e=[],t=this.length,n=0,o;n<t;n++)o=this._views[n],o.displayed&&e.push(o);return e}show(){for(var e=this.length,t=0,n;t<e;t++)n=this._views[t],n.displayed&&n.show();this.hidden=!1}hide(){for(var e=this.length,t=0,n;t<e;t++)n=this._views[t],n.displayed&&n.hide();this.hidden=!0}},g=n(1);class m{constructor(e){this.name="default",this.optsSettings=e.settings,this.View=e.view,this.request=e.request,this.renditionQueue=e.queue,this.q=new d.a(this),this.settings=Object(a.extend)(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",ignoreClass:"",fullsize:void 0}),Object(a.extend)(this.settings,e.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0},this.rendered=!1}render(e,t){let n=e.tagName;"undefined"==typeof this.settings.fullsize&&n&&("body"==n.toLowerCase()||"html"==n.toLowerCase())&&(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow="visible",this.overflow=this.settings.overflow),this.settings.size=t,this.settings.rtlScrollType=i(),this.stage=new h({width:t.width,height:t.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(e),this.container=this.stage.getContainer(),this.views=new u(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.stage.onOrientationChange(this.onOrientationChange.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout(),this.rendered=!0}addEventListeners(){var e;window.addEventListener("unload",function(){this.destroy()}.bind(this)),e=this.settings.fullsize?window:this.container,this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll)}removeEventListeners(){var e;e=this.settings.fullsize?window:this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}destroy(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1}onOrientationChange(){let{orientation:e}=window;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout(function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit(g.c.MANAGERS.ORIENTATION_CHANGE,e)}.bind(this),500)}onResized(){this.resize()}resize(e,t,n){let i=this.stage.size(e,t);return this.winBounds=Object(a.windowBounds)(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height?void(this._stageSize=void 0):void(this._stageSize&&this._stageSize.width===i.width&&this._stageSize.height===i.height||(this._stageSize=i,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit(g.c.MANAGERS.RESIZED,{width:this._stageSize.width,height:this._stageSize.height},n)))}createView(e,t){return new this.View(e,Object(a.extend)(this.viewSettings,{forceRight:t}))}handleNextPrePaginated(e,t,n){let i;if("pre-paginated"===this.layout.name&&1<this.layout.divisor){if(e||0===t.index)return;if(i=t.next(),i&&!i.properties.includes("page-spread-left"))return n.call(this,i)}}display(e,t){var n=new a.defer,i=n.promise;(t===e.href||Object(a.isNumber)(t))&&(t=void 0);var o=this.views.find(e);if(o&&e&&"pre-paginated"!==this.layout.name){let e=o.offset();if("ltr"===this.settings.direction)this.scrollTo(e.left,e.top,!0);else{let t=o.width();this.scrollTo(e.left+t,e.top,!0)}if(t){let e=o.locationOf(t);this.moveTo(e)}return n.resolve(),i}this.clear();let r=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&e.properties.includes("page-spread-right")&&(r=!0),this.add(e,r).then(function(e){if(t){let n=e.locationOf(t);this.moveTo(n)}}.bind(this),e=>{n.reject(e)}).then(function(){return this.handleNextPrePaginated(r,e,this.add)}.bind(this)).then(function(){this.views.show(),n.resolve()}.bind(this)),i}afterDisplayed(e){this.emit(g.c.MANAGERS.ADDED,e)}afterResized(e){this.emit(g.c.MANAGERS.RESIZE,e.section)}moveTo(e){var t=0,n=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,t+this.layout.delta>this.container.scrollWidth&&(t=this.container.scrollWidth-this.layout.delta)):n=e.top,this.scrollTo(t,n,!0)}add(e,t){var n=this.createView(e,t);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(g.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),n.on(g.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),n.display(this.request)}append(e,t){var n=this.createView(e,t);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(g.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),n.on(g.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),n.display(this.request)}prepend(e,t){var n=this.createView(e,t);return n.on(g.c.VIEWS.RESIZED,e=>{this.counter(e)}),this.views.prepend(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(g.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),n.on(g.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),n.display(this.request)}counter(e){"vertical"===this.settings.axis?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e,t;let n=this.settings.direction;if(this.views.length){if(this.isPaginated&&"horizontal"===this.settings.axis&&(!n||"ltr"===n))this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,t<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next();else if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===n)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?(t=this.container.scrollLeft,0<t?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):(t=this.container.scrollLeft+-1*this.layout.delta,t>-1*this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next());else if(this.isPaginated&&"vertical"===this.settings.axis){this.scrollTop=this.container.scrollTop;let t=this.container.scrollTop+this.container.offsetHeight;t<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):e=this.views.last().section.next()}else e=this.views.last().section.next();if(e){this.clear();let t=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&e.properties.includes("page-spread-right")&&(t=!0),this.append(e,t).then(function(){return this.handleNextPrePaginated(t,e,this.append)}.bind(this),e=>e).then(function(){this.isPaginated||"horizontal"!==this.settings.axis||"rtl"!==this.settings.direction||"default"!==this.settings.rtlScrollType||this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}.bind(this))}}}prev(){var e,t;let n=this.settings.direction;if(this.views.length){if(this.isPaginated&&"horizontal"===this.settings.axis&&(!n||"ltr"===n))this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft,0<t?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev();else if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===n)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?(t=this.container.scrollLeft+this.container.offsetWidth,t<this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):(t=this.container.scrollLeft,0>t?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev());else if(this.isPaginated&&"vertical"===this.settings.axis){this.scrollTop=this.container.scrollTop;let t=this.container.scrollTop;0<t?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()}else e=this.views.first().section.prev();if(e){this.clear();let t=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&"object"!=typeof e.prev()&&(t=!0),this.prepend(e,t).then(function(){var t;if("pre-paginated"===this.layout.name&&1<this.layout.divisor&&(t=e.prev(),t))return this.prepend(t)}.bind(this),e=>e).then(function(){this.isPaginated&&"horizontal"===this.settings.axis&&("rtl"===this.settings.direction?"default"===this.settings.rtlScrollType?this.scrollTo(0,0,!0):this.scrollTo(-1*this.container.scrollWidth+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))}}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.location=this.isPaginated&&"horizontal"===this.settings.axis?this.paginatedLocation():this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),n=t.height<window.innerHeight?t.height:window.innerHeight,o=t.width<window.innerWidth?t.width:window.innerWidth,r="vertical"===this.settings.axis,s="rtl"===this.settings.direction,a=0,l=0;this.settings.fullsize&&(a=r?window.scrollY:window.scrollX);let d=e.map(e=>{let{index:s,href:d}=e.section,c=e.position(),p=e.width(),h=e.height(),u,g,m,f;r?(u=a+t.top-c.top+l,g=u+n-l,f=this.layout.count(h,n).pages,m=n):(u=a+t.left-c.left+l,g=u+o-l,f=this.layout.count(p,o).pages,m=o);let y=Math.ceil(u/m),b=[],v=Math.ceil(g/m);if("rtl"===this.settings.direction&&!r){let e=y;y=f-v,v=f-e}b=[];for(var x=y;x<=v;x++){let e=x+1;b.push(e)}let E=this.mapping.page(e.contents,e.section.cfiBase,u,g);return{index:s,href:d,pages:b,totalPages:f,mapping:E}});return d}paginatedLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),n=0,o=0;this.settings.fullsize&&(n=window.scrollX);let r=e.map(e=>{let{index:r,href:s}=e.section,a=e.position(),l=e.width(),d,c,p,h;"rtl"===this.settings.direction?(d=t.right-n,h=Math.min(Math.abs(d-a.left),this.layout.width)-o,p=a.width-(a.right-d)-o,c=p-h):(d=t.left+n,h=Math.min(a.right-d,this.layout.width)-o,c=d-a.left+o,p=c+h),o+=h;let u=this.mapping.page(e.contents,e.section.cfiBase,c,p),g=this.layout.count(l).pages,m=Math.floor(c/this.layout.pageWidth),f=[],y=Math.floor(p/this.layout.pageWidth);if(0>m&&(m=0,++y),"rtl"===this.settings.direction){let e=m;m=g-y,y=g-e}for(var b=m+1;b<=y;b++){let e=b;f.push(e)}return{index:r,href:s,pages:f,totalPages:g,mapping:u}});return r}isVisible(e,t,n,i){var o=e.position(),r=i||this.bounds();if("horizontal"===this.settings.axis&&o.right>r.left-t&&o.left<r.right+n)return!0;return!!("vertical"===this.settings.axis&&o.bottom>r.top-t&&o.top<r.bottom+n)}visible(){for(var e=this.bounds(),t=this.views.displayed(),n=t.length,o=[],r=0,s,a;r<n;r++)a=t[r],s=this.isVisible(a,0,0,e),!0===s&&o.push(a);return o}scrollBy(e,t,n){let i="rtl"===this.settings.direction?-1:1;n&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(e*i,t*i):(e&&(this.container.scrollLeft+=e*i),t&&(this.container.scrollTop+=t)),this.scrolled=!0}scrollTo(e,t,n){n&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(e,t):(this.container.scrollLeft=e,this.container.scrollTop=t),this.scrolled=!0}onScroll(){let e,t;this.settings.fullsize?(e=window.scrollY,t=window.scrollX):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:(this.emit(g.c.MANAGERS.SCROLL,{top:e,left:t}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit(g.c.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),20))}bounds(){var e;return e=this.stage.bounds(),e}applyLayout(e){this.layout=e,this.updateLayout(),this.views&&0<this.views.length&&"pre-paginated"===this.layout.name&&this.display(this.views.first().section)}updateLayout(){this.stage&&(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new l.a(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach(function(t){t&&t.setLayout(e)})}updateWritingMode(e){this.writingMode=e}updateAxis(e,t){(t||e!==this.settings.axis)&&(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&(this.mapping=new l.a(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&("vertical"===e?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,t="auto"){let n="paginated"===e||"auto"===e;this.isPaginated=n,"scrolled-doc"===e||"scrolled-continuous"===e||"scrolled"===e?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=e,this.overflow=this.settings.overflow?this.settings.overflow:n?"hidden":t,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views?(this.views.forEach(function(t){const n=t&&t.contents;n&&e.push(n)}),e):e}direction(e="ltr"){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}}s()(m.prototype);t.a=m},function(e,t,n){"use strict";var i=n(2),o=n(0);t.a=class e{constructor(e,t,n,i=!1){this.layout=e,this.horizontal=!("horizontal"!==n),this.direction=t||"ltr",this._dev=i}section(e){var t=this.findRanges(e),n=this.rangeListToCfiList(e.section.cfiBase,t);return n}page(e,t,n,o){var r=!!(e&&e.document)&&e.document.body,s;if(r){if(s=this.rangePairToCfiPair(t,{start:this.findStart(r,n,o),end:this.findEnd(r,n,o)}),!0===this._dev){let t=e.document,n=new i.a(s.start).toRange(t),o=new i.a(s.end).toRange(t),a=t.defaultView.getSelection(),l=t.createRange();a.removeAllRanges(),l.setStart(n.startContainer,n.startOffset),l.setEnd(o.endContainer,o.endOffset),a.addRange(l)}return s}}walk(e,t){if(!(e&&e.nodeType===Node.TEXT_NODE)){var n={acceptNode:function(e){return 0<e.data.trim().length?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},i=n.acceptNode;i.acceptNode=n.acceptNode;for(var o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,i,!1),r,s;(r=o.nextNode())&&(s=t(r),!s););return s}}findRanges(e){for(var t=[],n=e.contents.scrollWidth(),o=Math.ceil(n/this.layout.spreadWidth),r=o*this.layout.divisor,s=this.layout.columnWidth,a=this.layout.gap,l=0,d,c;l<r.pages;l++)d=(s+a)*l,c=s*(l+1)+a*l,t.push({start:this.findStart(e.document.body,d,c),end:this.findEnd(e.document.body,d,c)});return t}findStart(e,t,n){for(var i=[e],r=e,s,a;i.length;)if(s=i.shift(),a=this.walk(s,e=>{var s,a,l,d,c;if(c=Object(o.nodeBounds)(e),this.horizontal&&"ltr"===this.direction){if(s=this.horizontal?c.left:c.top,a=this.horizontal?c.right:c.bottom,s>=t&&s<=n)return e;if(a>t)return e;r=e,i.push(e)}else if(this.horizontal&&"rtl"===this.direction){if(s=c.left,a=c.right,a<=n&&a>=t)return e;if(s<n)return e;r=e,i.push(e)}else{if(l=c.top,d=c.bottom,l>=t&&l<=n)return e;if(d>t)return e;r=e,i.push(e)}}),a)return this.findTextStartRange(a,t,n);return this.findTextStartRange(r,t,n)}findEnd(e,t,n){for(var i=[e],r=e,s,a;i.length;)if(s=i.shift(),a=this.walk(s,e=>{var s,a,l,d,c;if(c=Object(o.nodeBounds)(e),this.horizontal&&"ltr"===this.direction){if(s=Math.round(c.left),a=Math.round(c.right),s>n&&r)return r;if(a>n)return e;r=e,i.push(e)}else if(this.horizontal&&"rtl"===this.direction){if(s=Math.round(this.horizontal?c.left:c.top),a=Math.round(this.horizontal?c.right:c.bottom),a<t&&r)return r;if(s<t)return e;r=e,i.push(e)}else{if(l=Math.round(c.top),d=Math.round(c.bottom),l>n&&r)return r;if(d>n)return e;r=e,i.push(e)}}),a)return this.findTextEndRange(a,t,n);return this.findTextEndRange(r,t,n)}findTextStartRange(e,t,n){for(var o=this.splitTextNodeIntoRanges(e),r=0,s,a,l,d,c;r<o.length;r++)if(s=o[r],a=s.getBoundingClientRect(),this.horizontal&&"ltr"===this.direction){if(l=a.left,l>=t)return s;}else if(this.horizontal&&"rtl"===this.direction){if(c=a.right,c<=n)return s;}else if(d=a.top,d>=t)return s;return o[0]}findTextEndRange(e,t,n){for(var o=this.splitTextNodeIntoRanges(e),r=0,s,a,l,d,c,p,h;r<o.length;r++){if(a=o[r],l=a.getBoundingClientRect(),this.horizontal&&"ltr"===this.direction){if(d=l.left,c=l.right,d>n&&s)return s;if(c>n)return a}else if(this.horizontal&&"rtl"===this.direction){if(d=l.left,c=l.right,c<t&&s)return s;if(d<t)return a}else{if(p=l.top,h=l.bottom,p>n&&s)return s;if(h>n)return a}s=a}return o[o.length-1]}splitTextNodeIntoRanges(e,t){var n=[],i=e.textContent||"",o=i.trim(),r=e.ownerDocument,s=t||" ",a=o.indexOf(s),l;if(-1===a||e.nodeType!=Node.TEXT_NODE)return l=r.createRange(),l.selectNodeContents(e),[l];for(l=r.createRange(),l.setStart(e,0),l.setEnd(e,a),n.push(l),l=!1;-1!=a;)a=o.indexOf(s,a+1),0<a&&(l&&(l.setEnd(e,a),n.push(l)),l=r.createRange(),l.setStart(e,a+1));return l&&(l.setEnd(e,o.length),n.push(l)),n}rangePairToCfiPair(e,t){var n=t.start,o=t.end;n.collapse(!0),o.collapse(!1);let r=new i.a(n,e).toString(),s=new i.a(o,e).toString();return{start:r,end:s}}rangeListToCfiList(e,t){for(var n=[],o=0,r;o<t.length;o++)r=this.rangePairToCfiPair(e,t[o]),n.push(r);return n}axis(e){return e&&(this.horizontal="horizontal"===e),this.horizontal}}},function(e,t,n){"use strict";var i=n(87),o=n(13),r=n(36),s=n(46),a=n(35),l=n(33),d=n(100),c=n(101),p=Math.max,h=Math.min,u=Math.floor,g=function(e){return e===void 0?e:e+""};i("replace",2,function(e,t,n,i){function m(e,i,o,s,a,l){var d=o+e.length,c=s.length,n=/\$([$&'`]|\d\d?)/g;return void 0!==a&&(a=r(a),n=/\$([$&'`]|\d\d?|<[^>]*>)/g),t.call(l,n,function(t,r){var l;switch(r.charAt(0)){case"$":return"$";case"&":return e;case"`":return i.slice(0,o);case"'":return i.slice(d);case"<":l=a[r.slice(1,-1)];break;default:var p=+r;if(0==p)return t;if(p>c){var n=u(p/10);return 0===n?t:n<=c?void 0===s[n-1]?r.charAt(1):s[n-1]+r.charAt(1):t}l=s[p-1];}return void 0===l?"":l})}var f=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,y=i.REPLACE_KEEPS_$0,b=f?"$":"$0";return[function(n,i){var o=l(this),r=n==null?void 0:n[e];return r===void 0?t.call(o+"",n,i):r.call(n,o,i)},function(e,r){if(!f&&y||"string"==typeof r&&-1===r.indexOf(b)){var l=n(t,e,this,r);if(l.done)return l.value}var u=o(e),v=this+"",x="function"==typeof r;x||(r=r+"");var E=u.global;if(E){var _=u.unicode;u.lastIndex=0}for(var w=[],S;(S=c(u,v),null!==S)&&!(w.push(S),!E);){var C=S[0]+"";""==C&&(u.lastIndex=d(v,s(u.lastIndex),_))}for(var T="",k=0,R=0;R<w.length;R++){S=w[R];for(var I=S[0]+"",N=p(h(a(S.index),v.length),0),L=[],A=1;A<S.length;A++)L.push(g(S[A]));var O=S.groups;if(x){var P=[I].concat(L,N,v);O!==void 0&&P.push(O);var D=r.apply(void 0,P)+""}else D=m(I,v,N,L,O,r);N>=k&&(T+=v.slice(k,N)+D,k=N+I.length)}return T+v.slice(k)}]})},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(89),o=n(7),r=n(17),s=n(15),a=n(10),l=n(43),d=n(44),c=o.WeakMap,p=function(e){return g(e)?u(e):h(e,{})},h,u,g;if(i){var m=new c,f=m.get,y=m.has,b=m.set;h=function(e,t){return b.call(m,e,t),t},u=function(e){return f.call(m,e)||{}},g=function(e){return y.call(m,e)}}else{var v=l("state");d[v]=!0,h=function(e,t){return s(e,v,t),t},u=function(e){return a(e,v)?e[v]:{}},g=function(e){return a(e,v)}}e.exports={set:h,get:u,has:g,enforce:p,getterFor:function(e){return function(t){var n;if(!r(t)||(n=u(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e){e.exports={}},function(e,t,n){"use strict";var i=n(3),o=n.n(i),r=n(0),s=n(2),a=n(23),l=n(11),d=n(1);const c="undefined"!=typeof navigator,p=c&&/Chrome/.test(navigator.userAgent),h=c&&!p&&/AppleWebKit/.test(navigator.userAgent);class u{constructor(e,t,n,i){this.epubcfi=new s.a,this.document=e,this.documentElement=this.document.documentElement,this.content=t||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=i||0,this.cfiBase=n||"",this.epubReadingSystem("epub.js",d.b),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return d.a}width(e){var t=this.content;return e&&Object(r.isNumber)(e)&&(e+="px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}height(e){var t=this.content;return e&&Object(r.isNumber)(e)&&(e+="px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}contentWidth(e){var t=this.content||this.document.body;return e&&Object(r.isNumber)(e)&&(e+="px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}contentHeight(e){var t=this.content||this.document.body;return e&&Object(r.isNumber)(e)&&(e+="px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}textWidth(){let e=this.document.createRange(),t=this.content||this.document.body,n=Object(r.borders)(t),i,o;return e.selectNodeContents(t),i=e.getBoundingClientRect(),o=i.width,n&&n.width&&(o+=n.width),Math.round(o)}textHeight(){let e=this.document.createRange(),t=this.content||this.document.body,n,i;return e.selectNodeContents(t),n=e.getBoundingClientRect(),i=n.bottom,Math.round(i)}scrollWidth(){var e=this.documentElement.scrollWidth;return e}scrollHeight(){var e=this.documentElement.scrollHeight;return e}overflow(e){return e&&(this.documentElement.style.overflow=e),this.window.getComputedStyle(this.documentElement).overflow}overflowX(e){return e&&(this.documentElement.style.overflowX=e),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(e){return e&&(this.documentElement.style.overflowY=e),this.window.getComputedStyle(this.documentElement).overflowY}css(e,t,n){var i=this.content||this.document.body;return t?i.style.setProperty(e,t,n?"important":""):i.style.removeProperty(e),this.window.getComputedStyle(i)[e]}viewport(e){var t=this.document.querySelector("meta[name='viewport']"),n={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},i=[],o={};if(t&&t.hasAttribute("content")){let e=t.getAttribute("content"),i=e.match(/width\s*=\s*([^,]*)/),o=e.match(/height\s*=\s*([^,]*)/),r=e.match(/initial-scale\s*=\s*([^,]*)/),s=e.match(/minimum-scale\s*=\s*([^,]*)/),a=e.match(/maximum-scale\s*=\s*([^,]*)/),l=e.match(/user-scalable\s*=\s*([^,]*)/);i&&i.length&&"undefined"!=typeof i[1]&&(n.width=i[1]),o&&o.length&&"undefined"!=typeof o[1]&&(n.height=o[1]),r&&r.length&&"undefined"!=typeof r[1]&&(n.scale=r[1]),s&&s.length&&"undefined"!=typeof s[1]&&(n.minimum=s[1]),a&&a.length&&"undefined"!=typeof a[1]&&(n.maximum=a[1]),l&&l.length&&"undefined"!=typeof l[1]&&(n.scalable=l[1])}return o=Object(r.defaults)(e||{},n),e&&(o.width&&i.push("width="+o.width),o.height&&i.push("height="+o.height),o.scale&&i.push("initial-scale="+o.scale),"no"===o.scalable?(i.push("minimum-scale="+o.scale),i.push("maximum-scale="+o.scale),i.push("user-scalable="+o.scalable)):(o.scalable&&i.push("user-scalable="+o.scalable),o.minimum&&i.push("minimum-scale="+o.minimum),o.maximum&&i.push("minimum-scale="+o.maximum)),!t&&(t=this.document.createElement("meta"),t.setAttribute("name","viewport"),this.document.querySelector("head").appendChild(t)),t.setAttribute("content",i.join(", ")),this.window.scrollTo(0,0)),o}expand(){this.emit(d.c.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),"undefined"==typeof ResizeObserver?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let e=this.textWidth(),t=this.textHeight();(e!=this._size.width||t!=this._size.height)&&(this._size={width:e,height:t},this.onResize&&this.onResize(this._size),this.emit(d.c.CONTENTS.RESIZE,this._size))}resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&!1===this.active?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",e.style.transitionDuration="0.001ms",e.style.transitionTimingFunction="linear",e.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,t=function(e){e.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),n=0;n<e.length;n+=1){var o;try{o=e[n].cssRules}catch(t){return}if(!o)return;for(var r=0;r<o.length;r+=1)if(o[r].media){var s=this.window.matchMedia(o[r].media.mediaText);s.addListener(t)}}}resizeObservers(){this.observer=new ResizeObserver(()=>{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(()=>{this.resizeCheck()});this.observer.observe(this.document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}imageLoadListeners(){for(var e=this.document.querySelectorAll("img"),t=0,n;t<e.length;t++)n=e[t],"undefined"!=typeof n.naturalWidth&&0===n.naturalWidth&&(n.onload=this.expand.bind(this))}fontLoadListeners(){this.document&&this.document.fonts&&this.document.fonts.ready.then(function(){this.resizeCheck()}.bind(this))}root(){return this.document?this.document.documentElement:null}locationOf(e,t){var n={left:0,top:0},i;if(!this.document)return n;if(this.epubcfi.isCfiString(e)){let o=new s.a(e).toRange(this.document,t);if(o){try{if(!o.endContainer||o.startContainer==o.endContainer&&o.startOffset==o.endOffset){let e=o.startContainer.textContent.indexOf(" ",o.startOffset);-1==e&&(e=o.startContainer.textContent.length),o.setEnd(o.startContainer,e)}}catch(t){console.error("setting end offset to start container length failed",t)}if(o.startContainer.nodeType===Node.ELEMENT_NODE)i=o.startContainer.getBoundingClientRect(),n.left=i.left,n.top=i.top;else if(h){let e=o.startContainer,t=new Range;try{e.nodeType===1?i=e.getBoundingClientRect():o.startOffset+2<e.length?(t.setStart(e,o.startOffset),t.setEnd(e,o.startOffset+2),i=t.getBoundingClientRect()):0<o.startOffset-2?(t.setStart(e,o.startOffset-2),t.setEnd(e,o.startOffset),i=t.getBoundingClientRect()):i=e.parentNode.getBoundingClientRect()}catch(t){console.error(t,t.stack)}}else i=o.getBoundingClientRect()}}else if("string"==typeof e&&-1<e.indexOf("#")){let t=e.substring(e.indexOf("#")+1),n=this.document.getElementById(t);if(n)if(h){let e=new Range;e.selectNode(n),i=e.getBoundingClientRect()}else i=n.getBoundingClientRect()}return i&&(n.left=i.left,n.top=i.top),n}addStylesheet(e){return new Promise(function(t){var n=!1,i;return this.document?(i=this.document.querySelector("link[href='"+e+"']"),i?void t(!0):void(i=this.document.createElement("link"),i.type="text/css",i.rel="stylesheet",i.href=e,i.onload=i.onreadystatechange=function(){n||this.readyState&&"complete"!=this.readyState||(n=!0,setTimeout(()=>{t(!0)},1))},this.document.head.appendChild(i))):void t(!1)}.bind(this))}_getStylesheetNode(e){var t;return(e="epubjs-inserted-css-"+(e||""),!!this.document)&&(t=this.document.getElementById(e),t||(t=this.document.createElement("style"),t.id=e,this.document.head.appendChild(t)),t)}addStylesheetCss(e,t){if(!this.document||!e)return!1;var n;return n=this._getStylesheetNode(t),n.innerHTML=e,!0}addStylesheetRules(e,t){var n;if(this.document&&e&&0!==e.length)if(n=this._getStylesheetNode(t).sheet,"[object Array]"===Object.prototype.toString.call(e))for(var o=0,r=e.length;o<r;o++){var s=1,a=e[o],l=e[o][0],d="";"[object Array]"===Object.prototype.toString.call(a[1][0])&&(a=a[1],s=0);for(var c=a.length,p;s<c;s++)p=a[s],d+=p[0]+":"+p[1]+(p[2]?" !important":"")+";\n";n.insertRule(l+"{"+d+"}",n.cssRules.length)}else{const t=Object.keys(e);t.forEach(t=>{const i=e[t];if(Array.isArray(i))i.forEach(e=>{const i=Object.keys(e),o=i.map(t=>`${t}:${e[t]}`).join(";");n.insertRule(`${t}{${o}}`,n.cssRules.length)});else{const e=Object.keys(i),o=e.map(e=>`${e}:${i[e]}`).join(";");n.insertRule(`${t}{${o}}`,n.cssRules.length)}})}}addScript(e){return new Promise(function(t){var n=!1,i;return this.document?void(i=this.document.createElement("script"),i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){n||this.readyState&&"complete"!=this.readyState||(n=!0,setTimeout(function(){t(!0)},1))},this.document.head.appendChild(i)):void t(!1)}.bind(this))}addClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.add(e))}removeClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.remove(e))}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),d.a.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){this.document&&(d.a.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(t){this.emit(t.type,t)}addSelectionListeners(){this.document&&(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){this.document&&(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var e=this.window.getSelection();this.triggerSelectedEvent(e)}.bind(this),250)}triggerSelectedEvent(e){var t,n;e&&0<e.rangeCount&&(t=e.getRangeAt(0),!t.collapsed&&(n=new s.a(t,this.cfiBase).toString(),this.emit(d.c.CONTENTS.SELECTED,n),this.emit(d.c.CONTENTS.SELECTED_RANGE,t)))}range(e,t){var n=new s.a(e);return n.toRange(this.document,t)}cfiFromRange(e,t){return new s.a(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new s.a(e,this.cfiBase,t).toString()}map(e){var t=new a.a(e);return t.section()}size(e,t){var n={scale:1,scalable:"no"};this.layoutStyle("scrolling"),0<=e&&(this.width(e),n.width=e,this.css("padding","0 "+e/12+"px")),0<=t&&(this.height(t),n.height=t),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(n)}columns(e,t,n,i,o){let s=Object(r.prefixed)("column-axis"),a=Object(r.prefixed)("column-gap"),l=Object(r.prefixed)("column-width"),d=Object(r.prefixed)("column-fill"),c=this.writingMode(),p=0===c.indexOf("vertical")?"vertical":"horizontal";this.layoutStyle("paginated"),"rtl"===o&&"horizontal"===p&&this.direction(o),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),"vertical"===p?(this.css("padding-top",i/2+"px",!0),this.css("padding-bottom",i/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(s,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",i/2+"px",!0),this.css("padding-right",i/2+"px",!0),this.css(s,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(d,"auto"),this.css(a,i+"px"),this.css(l,n+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,t,n){var i="";this.css("transform-origin","top left"),(0<=t||0<=n)&&(i=" translate("+(t||0)+"px, "+(n||0)+"px )"),this.css("transform","scale("+e+")"+i)}fit(e,t,n){var i=this.viewport(),o=parseInt(i.width),r=parseInt(i.height),s=e/o,a=t/r,l=s<a?s:a;if(this.layoutStyle("paginated"),this.width(o),this.height(r),this.overflow("hidden"),this.scaler(l,0,0),this.css("background-size",o*l+"px "+r*l+"px"),this.css("background-color","transparent"),n&&n.properties.includes("page-spread-left")){this.css("margin-left",e-o*l+"px")}}direction(e){this.documentElement&&(this.documentElement.style.direction=e)}mapPage(e,t,n,i,o){var r=new a.a(t,o);return r.page(this,e,n,i)}linksHandler(){Object(l.c)(this.content,e=>{this.emit(d.c.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let t=Object(r.prefixed)("writing-mode");return e&&this.documentElement&&(this.documentElement.style[t]=e),this.window.getComputedStyle(this.documentElement)[t]||""}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(e,t){return navigator.epubReadingSystem={name:e,version:t,layoutStyle:this.layoutStyle(),hasFeature:function(e){return"dom-manipulation"===e||"layout-changes"===e||"touch-events"===e||"mouse-events"===e||"keyboard-events"===e||"spine-scripting"!==e&&!1}},navigator.epubReadingSystem}destroy(){this.removeListeners()}}o()(u.prototype),t.a=u},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return{top:i.top-n.top,left:i.left-n.left,height:e.scrollHeight,width:e.scrollWidth}}function l(e,t){e.style.setProperty("top",t.top+"px","important"),e.style.setProperty("left",t.left+"px","important"),e.style.setProperty("height",t.height+"px","important"),e.style.setProperty("width",t.width+"px","important")}function d(e,t){return t.right<=e.right&&t.left>=e.left&&t.top>=e.top&&t.bottom<=e.bottom}Object.defineProperty(t,"__esModule",{value:!0}),t.Underline=t.Highlight=t.Mark=t.Pane=void 0;var c=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(o===void 0){var r=Object.getPrototypeOf(t);return null===r?void 0:e(r,n,i)}if("value"in o)return o.value;var s=o.get;return void 0===s?void 0:s.call(i)},p=function(){function e(e,t){for(var n=0,o;n<t.length;n++)o=t[n],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=n(135),u=i(h),g=n(136),m=i(g),f=t.Pane=function(){function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.body;s(this,e),this.target=t,this.element=u.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),m.default.proxyMouse(this.target,this.marks),this.container=n,this.container.appendChild(this.element),this.render()}return p(e,[{key:"addMark",value:function(e){var t=u.default.createElement("g");return this.element.appendChild(t),e.bind(t,this.container),this.marks.push(e),e.render(),e}},{key:"removeMark",value:function(e){var t=this.marks.indexOf(e);if(-1!==t){var n=e.unbind();this.element.removeChild(n),this.marks.splice(t,1)}}},{key:"render",value:function(){l(this.element,a(this.target,this.container));var e=!0,t=!1,n=void 0;try{for(var i=this.marks[Symbol.iterator](),o,r;!(e=(o=i.next()).done);e=!0)r=o.value,r.render()}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}}}]),e}(),y=t.Mark=function(){function e(){s(this,e),this.element=null}return p(e,[{key:"bind",value:function(e,t){this.element=e,this.container=t}},{key:"unbind",value:function(){var e=this.element;return this.element=null,e}},{key:"render",value:function(){}},{key:"dispatchEvent",value:function(t){this.element&&this.element.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this.element.getBoundingClientRect()}},{key:"getClientRects",value:function(){for(var e=[],t=this.element.firstChild;t;)e.push(t.getBoundingClientRect()),t=t.nextSibling;return e}},{key:"filteredRanges",value:function(){var e=Array.from(this.range.getClientRects());return e.filter(function(t){for(var n=0;n<e.length;n++){if(e[n]===t)return!0;var o=d(e[n],t);if(o)return!1}return!0})}}]),e}(),b=t.Highlight=function(e){function t(e,n,i,r){s(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.range=e,a.className=n,a.data=i||{},a.attributes=r||{},a}return r(t,e),p(t,[{key:"bind",value:function(e,n){for(var i in c(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"bind",this).call(this,e,n),this.data)this.data.hasOwnProperty(i)&&(this.element.dataset[i]=this.data[i]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&this.element.setAttribute(i,this.attributes[i]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var e=this.element.ownerDocument.createDocumentFragment(),t=this.filteredRanges(),n=this.element.getBoundingClientRect(),o=this.container.getBoundingClientRect(),s=0,a=t.length;s<a;s++){var l=t[s],r=u.default.createElement("rect");r.setAttribute("x",l.left-n.left+o.left),r.setAttribute("y",l.top-n.top+o.top),r.setAttribute("height",l.height),r.setAttribute("width",l.width),e.appendChild(r)}this.element.appendChild(e)}}]),t}(y),v=t.Underline=function(e){function t(e,n,i,r){return s(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i,r))}return r(t,e),p(t,[{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var e=this.element.ownerDocument.createDocumentFragment(),t=this.filteredRanges(),n=this.element.getBoundingClientRect(),o=this.container.getBoundingClientRect(),s=0,a=t.length;s<a;s++){var l=t[s],r=u.default.createElement("rect");r.setAttribute("x",l.left-n.left+o.left),r.setAttribute("y",l.top-n.top+o.top),r.setAttribute("height",l.height),r.setAttribute("width",l.width),r.setAttribute("fill","none");var d=u.default.createElement("line");d.setAttribute("x1",l.left-n.left+o.left),d.setAttribute("x2",l.left-n.left+o.left+l.width),d.setAttribute("y1",l.top-n.top+o.top+l.height-1),d.setAttribute("y2",l.top-n.top+o.top+l.height-1),d.setAttribute("stroke-width",1),d.setAttribute("stroke","black"),d.setAttribute("stroke-linecap","square"),e.appendChild(r),e.appendChild(d)}this.element.appendChild(e)}}]),t}(b)},function(e){var t=function(){return this}();try{t=t||new Function("return this")()}catch(n){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,n){var i=n(7),o=n(59).f,r=n(15),s=n(19),a=n(42),l=n(90),d=n(96);e.exports=function(e,t){var n=e.target,c=e.global,p=e.stat,h,u,g,m,f,y;if(u=c?i:p?i[n]||a(n,{}):(i[n]||{}).prototype,u)for(g in t){if(f=t[g],e.noTargetGet?(y=o(u,g),m=y&&y.value):m=u[g],h=d(c?g:n+(p?".":"#")+g,e.forced),!h&&void 0!==m){if(typeof f==typeof m)continue;l(f,m)}(e.sham||m&&m.sham)&&r(f,"sham",!0),s(u,g,f,e)}}},function(e,t,n){var i=n(61),o=n(33);e.exports=function(e){return i(o(e))}},function(e){e.exports=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e}},function(e){e.exports=!1},function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?n:t)(e)}},function(e,t,n){var i=n(33);e.exports=function(e){return Object(i(e))}},function(e,t,n){var i=n(18).f,o=n(10),r=n(8),s=r("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,s)&&i(e,s,{configurable:!0,value:t})}},function(t){t.exports=e},function(e,t,n){"use strict";var i=n(3),o=n.n(i),r=n(0),s=n(6),a=n(2),l=n(21),d=n(1);class c{constructor(e){this.settings=e,this.name=e.layout||"reflowable",this._spread="none"!==e.spread,this._minSpreadWidth=e.minSpreadWidth||800,this._evenSpreads=e.evenSpreads||!1,this._flow="scrolled"===e.flow||"scrolled-continuous"===e.flow||"scrolled-doc"===e.flow?"scrolled":"paginated",this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1,this.props={name:this.name,spread:this._spread,flow:this._flow,width:0,height:0,spreadWidth:0,delta:0,columnWidth:0,gap:0,divisor:1}}flow(e){return"undefined"!=typeof e&&(this._flow="scrolled"===e||"scrolled-continuous"===e||"scrolled-doc"===e?"scrolled":"paginated",this.update({flow:this._flow})),this._flow}spread(e,t){return e&&(this._spread="none"!==e,this.update({spread:this._spread})),0<=t&&(this._minSpreadWidth=t),this._spread}calculate(e,t,n){var i=1,o=n||0,r=e,s=t,a=Math.floor(r/12),l,d,c,p;i=this._spread&&r>=this._minSpreadWidth?2:1,"reflowable"!==this.name||"paginated"!==this._flow||0<=n||(o=0==a%2?a:a-1),"pre-paginated"===this.name&&(o=0),1<i?(l=r/i-o,c=l+o):(l=r,c=r),"pre-paginated"===this.name&&1<i&&(r=l),d=l*i+o,p=r,this.width=r,this.height=s,this.spreadWidth=d,this.pageWidth=c,this.delta=p,this.columnWidth=l,this.gap=o,this.divisor=i,this.update({width:r,height:s,spreadWidth:d,pageWidth:c,delta:p,columnWidth:l,gap:o,divisor:i})}format(e,t,n){var i;return i="pre-paginated"===this.name?e.fit(this.columnWidth,this.height,t):"paginated"===this._flow?e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):n&&"horizontal"===n?e.size(null,this.height):e.size(this.width,null),i}count(e,t){let n,i;return"pre-paginated"===this.name?(n=1,i=1):"paginated"===this._flow?(t=t||this.delta,n=Math.ceil(e/t),i=n*this.divisor):(t=t||this.height,n=Math.ceil(e/t),i=n),{spreads:n,pages:i}}update(e){if(Object.keys(e).forEach(t=>{this.props[t]===e[t]&&delete e[t]}),0<Object.keys(e).length){let t=Object(r.extend)(this.props,e);this.emit(d.c.LAYOUT.UPDATED,t,e)}}}o()(c.prototype);var p=n(5);var h=class e{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){return 0===arguments.length?void 0:1===arguments.length&&"object"==typeof arguments[0]?this.registerThemes(arguments[0]):1===arguments.length&&"string"==typeof arguments[0]?this.default(arguments[0]):2===arguments.length&&"string"==typeof arguments[1]?this.registerUrl(arguments[0],arguments[1]):2===arguments.length&&"object"==typeof arguments[1]?this.registerRules(arguments[0],arguments[1]):void 0}default(e){return e?"string"==typeof e?this.registerUrl("default",e):"object"==typeof e?this.registerRules("default",e):void 0:void 0}registerThemes(e){for(var t in e)e.hasOwnProperty(t)&&("string"==typeof e[t]?this.registerUrl(t,e[t]):this.registerRules(t,e[t]))}registerCss(e,t){this._themes[e]={serialized:t},(this._injected[e]||"default"==e)&&this.update(e)}registerUrl(e,t){var n=new p.a(t);this._themes[e]={url:n.toString()},(this._injected[e]||"default"==e)&&this.update(e)}registerRules(e,t){this._themes[e]={rules:t},(this._injected[e]||"default"==e)&&this.update(e)}select(e){var t=this._current,n;this._current=e,this.update(e),n=this.rendition.getContents(),n.forEach(n=>{n.removeClass(t),n.addClass(e)})}update(e){var t=this.rendition.getContents();t.forEach(t=>{this.add(e,t)})}inject(e){var t=[],n=this._themes,i;for(var o in n)n.hasOwnProperty(o)&&(o===this._current||"default"===o)&&(i=n[o],(i.rules&&0<Object.keys(i.rules).length||i.url&&-1===t.indexOf(i.url))&&this.add(o,e),this._injected.push(o));"default"!=this._current&&e.addClass(this._current)}add(e,t){var n=this._themes[e];n&&t&&(n.url?t.addStylesheet(n.url):n.serialized?(t.addStylesheetCss(n.serialized,e),n.injected=!0):n.rules&&(t.addStylesheetRules(n.rules,e),n.injected=!0))}override(e,t,n){var i=this.rendition.getContents();this._overrides[e]={value:t,priority:!0===n},i.forEach(t=>{t.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var t=this.rendition.getContents();delete this._overrides[e],t.forEach(t=>{t.css(e)})}overrides(e){var t=this._overrides;for(var n in t)t.hasOwnProperty(n)&&e.css(n,t[n].value,t[n].priority)}fontSize(e){this.override("font-size",e)}font(e){this.override("font-family",e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}},u=n(28);class g{constructor({type:e,cfiRange:t,data:n,sectionIndex:i,cb:o,className:r,styles:s}){this.type=e,this.cfiRange=t,this.data=n,this.sectionIndex=i,this.mark=void 0,this.cb=o,this.className=r,this.styles=s}update(e){this.data=e}attach(e){let{cfiRange:t,data:n,type:i,mark:o,cb:r,className:s,styles:a}=this,l;return"highlight"===i?l=e.highlight(t,n,r,s,a):"underline"===i?l=e.underline(t,n,r,s,a):"mark"===i&&(l=e.mark(t,n,r)),this.mark=l,this.emit(d.c.ANNOTATION.ATTACH,l),l}detach(e){let{cfiRange:t,type:n}=this,i;return e&&("highlight"===n?i=e.unhighlight(t):"underline"===n?i=e.ununderline(t):"mark"===n&&(i=e.unmark(t))),this.mark=void 0,this.emit(d.c.ANNOTATION.DETACH,i),i}text(){}}o()(g.prototype);var m=class e{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,t,n,i,o,r){let s=encodeURI(t+e),l=new a.a(t),d=l.spinePos,c=new g({type:e,cfiRange:t,data:n,sectionIndex:d,cb:i,className:o,styles:r});this._annotations[s]=c,d in this._annotationsBySectionIndex?this._annotationsBySectionIndex[d].push(s):this._annotationsBySectionIndex[d]=[s];let p=this.rendition.views();return p.forEach(e=>{c.sectionIndex===e.index&&c.attach(e)}),c}remove(e,t){let n=encodeURI(e+t);if(n in this._annotations){let e=this._annotations[n];if(t&&e.type!==t)return;let i=this.rendition.views();i.forEach(t=>{this._removeFromAnnotationBySectionIndex(e.sectionIndex,n),e.sectionIndex===t.index&&e.detach(t)}),delete this._annotations[n]}}_removeFromAnnotationBySectionIndex(e,t){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(e=>e!==t)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,t,n,i,o){return this.add("highlight",e,t,n,i,o)}underline(e,t,n,i,o){return this.add("underline",e,t,n,i,o)}mark(e,t,n){return this.add("mark",e,t,n)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let t=e.index;if(t in this._annotationsBySectionIndex){let n=this._annotationsBySectionIndex[t];n.forEach(t=>{let n=this._annotations[t];n.attach(e)})}}clear(e){let t=e.index;if(t in this._annotationsBySectionIndex){let n=this._annotationsBySectionIndex[t];n.forEach(t=>{let n=this._annotations[t];n.detach(e)})}}show(){}hide(){}},f=n(54),y=n(22),b=n(56);class v{constructor(e,t){this.settings=Object(r.extend)(this.settings||{},{width:null,height:null,ignoreClass:"",manager:"default",view:"iframe",flow:null,layout:null,spread:null,minSpreadWidth:800,stylesheet:null,resizeOnOrientationChange:!0,script:null,snap:!1,defaultDirection:"ltr"}),Object(r.extend)(this.settings,t),"object"==typeof this.settings.manager&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new s.a(this),this.hooks.serialize=new s.a(this),this.hooks.content=new s.a(this),this.hooks.unloaded=new s.a(this),this.hooks.layout=new s.a(this),this.hooks.render=new s.a(this),this.hooks.show=new s.a(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.book.spine.hooks.content.register(this.injectIdentifier.bind(this)),this.settings.stylesheet&&this.book.spine.hooks.content.register(this.injectStylesheet.bind(this)),this.settings.script&&this.book.spine.hooks.content.register(this.injectScript.bind(this)),this.themes=new h(this),this.annotations=new m(this),this.epubcfi=new a.a,this.q=new l.a(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new r.defer,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){var t;return t="string"==typeof e&&"default"===e?y.a:"string"==typeof e&&"continuous"===e?b.a:e,t}requireView(e){var t;return t="string"==typeof e&&"iframe"===e?f.a:e,t}start(){switch(this.settings.layout||"pre-paginated"!==this.book.package.metadata.layout&&"true"!==this.book.displayOptions.fixedLayout||(this.settings.layout="pre-paginated"),this.book.package.metadata.spread){case"none":this.settings.spread="none";break;case"both":this.settings.spread=!0;}this.manager||(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),this.manager=new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.direction(this.book.package.metadata.direction||this.settings.defaultDirection),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on(d.c.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(d.c.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(d.c.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(d.c.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(d.c.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(d.c.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue(function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit(d.c.RENDITION.ATTACHED)}.bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(this.book){var t=this.epubcfi.isCfiString(e),n=new r.defer,i=n.promise,o;return(this.displaying=n,this.book.locations.length()&&Object(r.isFloat)(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),o=this.book.spine.get(e),!o)?(n.reject(new Error("No Section Found")),i):(this.manager.display(o,e).then(()=>{n.resolve(o),this.displaying=void 0,this.emit(d.c.RENDITION.DISPLAYED,o),this.reportLocation()},e=>{this.emit(d.c.RENDITION.DISPLAY_ERROR,e)}),i)}}afterDisplayed(e){e.on(d.c.VIEWS.MARK_CLICKED,(t,n)=>this.triggerMarkEvent(t,n,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit(d.c.RENDITION.RENDERED,e.section,e)}):this.emit(d.c.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit(d.c.RENDITION.REMOVED,e.section,e)})}onResized(e,t){this.emit(d.c.RENDITION.RESIZED,{width:e.width,height:e.height},t),this.location&&this.location.start&&this.display(t||this.location.start.cfi)}onOrientationChange(e){this.emit(d.c.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,t,n){e&&(this.settings.width=e),t&&(this.settings.height=t),this.manager.resize(e,t,n)}clear(){this.manager.clear()}next(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}prev(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}determineLayoutProperties(e){var t=this.settings.layout||e.layout||"reflowable",n=this.settings.spread||e.spread||"auto",i=this.settings.orientation||e.orientation||"auto",o=this.settings.flow||e.flow||"auto",r=e.viewport||"",s=this.settings.minSpreadWidth||e.minSpreadWidth||800,a=this.settings.direction||e.direction||"ltr",l;return(0===this.settings.width||0<this.settings.width)&&(0===this.settings.height||0<this.settings.height),l={layout:t,spread:n,orientation:i,flow:o,viewport:r,minSpreadWidth:s,direction:a},l}flow(e){var t=e;("scrolled"===e||"scrolled-doc"===e||"scrolled-continuous"===e)&&(t="scrolled"),("auto"===e||"paginated"===e)&&(t="paginated"),this.settings.flow=e,this._layout&&this._layout.flow(t),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(t),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new c(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on(d.c.LAYOUT.UPDATED,(e,t)=>{this.emit(d.c.RENDITION.LAYOUT,e,t)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,t){this.settings.spread=e,t&&(this.settings.minSpreadWidth=t),this._layout&&this._layout.spread(e,t),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue(function(){requestAnimationFrame(function(){var e=this.manager.currentLocation();if(e&&e.then&&"function"==typeof e.then)e.then(function(e){let t=this.located(e);t&&t.start&&t.end&&(this.location=t,this.emit(d.c.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(d.c.RENDITION.RELOCATED,this.location))}.bind(this));else if(e){let t=this.located(e);if(!t||!t.start||!t.end)return;this.location=t,this.emit(d.c.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(d.c.RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&"function"==typeof e.then)e.then(function(e){let t=this.located(e);return t}.bind(this));else if(e){let t=this.located(e);return t}}located(e){if(!e.length)return{};let t=e[0],n=e[e.length-1],i={start:{index:t.index,href:t.href,cfi:t.mapping.start,displayed:{page:t.pages[0]||1,total:t.totalPages}},end:{index:n.index,href:n.href,cfi:n.mapping.end,displayed:{page:n.pages[n.pages.length-1]||1,total:n.totalPages}}},o=this.book.locations.locationFromCfi(t.mapping.start),r=this.book.locations.locationFromCfi(n.mapping.end);null!=o&&(i.start.location=o,i.start.percentage=this.book.locations.percentageFromLocation(o)),null!=r&&(i.end.location=r,i.end.percentage=this.book.locations.percentageFromLocation(r));let s=this.book.pageList.pageFromCfi(t.mapping.start),a=this.book.pageList.pageFromCfi(n.mapping.end);return-1!=s&&(i.start.page=s),-1!=a&&(i.end.page=a),n.index===this.book.spine.last().index&&i.end.displayed.page>=i.end.displayed.total&&(i.atEnd=!0),t.index===this.book.spine.first().index&&1===i.start.displayed.page&&(i.atStart=!0),i}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(t){d.a.forEach(n=>{t.on(n,e=>this.triggerViewEvent(e,t))}),t.on(d.c.CONTENTS.SELECTED,n=>this.triggerSelectedEvent(n,t))}triggerViewEvent(t,e){this.emit(t.type,t,e)}triggerSelectedEvent(e,t){this.emit(d.c.RENDITION.SELECTED,e,t)}triggerMarkEvent(e,t,n){this.emit(d.c.RENDITION.MARK_CLICKED,e,t,n)}getRange(e,t){var n=new a.a(e),i=this.manager.visible().filter(function(e){if(n.spinePos===e.index)return!0});if(i.length)return i[0].contents.range(n,t)}adjustImages(e){if("pre-paginated"===this._layout.name)return new Promise(function(e){e()});let t=e.window.getComputedStyle(e.content,null),n=.95*(e.content.offsetHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom))),i=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-i+"px":"100%")+"!important","max-height":n+"px!important","object-fit":"contain","page-break-inside":"avoid","break-inside":"avoid","box-sizing":"border-box"},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-i+"px":"100%")+"!important","max-height":n+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise(function(e){setTimeout(function(){e()},1)})}getContents(){return this.manager?this.manager.getContents():[]}views(){let e=this.manager?this.manager.views:void 0;return e||[]}handleLinks(e){e&&e.on(d.c.CONTENTS.LINK_CLICKED,e=>{let t=this.book.path.relative(e);this.display(t)})}injectStylesheet(e){let t=e.createElement("link");t.setAttribute("type","text/css"),t.setAttribute("rel","stylesheet"),t.setAttribute("href",this.settings.stylesheet),e.getElementsByTagName("head")[0].appendChild(t)}injectScript(e){let t=e.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",this.settings.script),t.textContent=" ",e.getElementsByTagName("head")[0].appendChild(t)}injectIdentifier(e){let t=this.book.packaging.metadata.identifier,n=e.createElement("meta");n.setAttribute("name","dc.relation.ispartof"),t&&n.setAttribute("content",t),e.getElementsByTagName("head")[0].appendChild(n)}}o()(v.prototype);t.a=v},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e,t,n){var i=n(17);e.exports=function(e,t){if(!i(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!i(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!i(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var i=n(7),o=n(15);e.exports=function(e,t){try{o(i,e,t)}catch(n){i[e]=t}return t}},function(e,t,n){var i=n(66),o=n(67),r=i("keys");e.exports=function(e){return r[e]||(r[e]=o(e))}},function(e){e.exports={}},function(e,t,n){var i=n(92),o=n(7),r=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return 2>arguments.length?r(i[e])||r(o[e]):i[e]&&i[e][t]||o[e]&&o[e][t]}},function(e,t,n){var i=n(35),o=Math.min;e.exports=function(e){return 0<e?o(i(e),9007199254740991):0}},function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){"use strict";var o=n(97),r=n(98),s=RegExp.prototype.exec,a=String.prototype.replace,l=s,d=function(){var e=/a/,t=/b*/g;return s.call(e,"a"),s.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),c=r.UNSUPPORTED_Y||r.BROKEN_CARET,p=/()??/.exec("")[1]!==void 0;(d||p||c)&&(l=function(e){var t=this,n=c&&t.sticky,r=o.call(t),l=t.source,h=0,u=e,g,m,f,y;return n&&(r=r.replace("y",""),-1===r.indexOf("g")&&(r+="g"),u=(e+"").slice(t.lastIndex),0<t.lastIndex&&(!t.multiline||t.multiline&&"\n"!==e[t.lastIndex-1])&&(l="(?: "+l+")",u=" "+u,h++),m=new RegExp("^(?:"+l+")",r)),p&&(m=new RegExp("^"+l+"$(?!\\s)",r)),d&&(g=t.lastIndex),f=s.call(n?m:t,u),n?f?(f.input=f.input.slice(h),f[0]=f[0].slice(h),f.index=t.lastIndex,t.lastIndex+=f[0].length):t.lastIndex=0:d&&f&&(t.lastIndex=t.global?f.index+f[0].length:g),p&&f&&1<f.length&&a.call(f[0],m,function(){for(y=1;y<arguments.length-2;y++)void 0===arguments[y]&&(f[y]=void 0)}),f}),e.exports=l},function(e,t,n){var i=n(35),o=n(33),r=function(e){return function(t,n){var r=o(t)+"",s=i(n),a=r.length,l,d;return 0>s||s>=a?e?"":void 0:(l=r.charCodeAt(s),55296>l||56319<l||s+1===a||56320>(d=r.charCodeAt(s+1))||57343<d?e?r.charAt(s):l:e?r.slice(s,s+2):(l-55296<<10)+(d-56320)+65536)}};e.exports={codeAt:r(!1),charAt:r(!0)}},function(e,t,n){var i=n(13),o=n(72),r=n(47),s=n(44),a=n(104),l=n(63),d=n(43),c=">",p="<",h="prototype",u="script",g=d("IE_PROTO"),m=function(){},f=function(e){return p+u+c+e+p+"/"+u+c},y=function(e){e.write(f("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e=l("iframe"),t;return e.style.display="none",a.appendChild(e),e.src="java"+u+":"+"",t=e.contentWindow.document,t.open(),t.write(f("document.F=Object")),t.close(),t.F},v=function(){try{x=document.domain&&new ActiveXObject("htmlfile")}catch(e){}v=x?y(x):b();for(var e=r.length;e--;)delete v[h][r[e]];return v()},x;s[g]=!0,e.exports=Object.create||function(e,t){var n;return null===e?n=v():(m[h]=i(e),n=new m,m[h]=null,n[g]=e),void 0===t?n:o(n,t)}},function(e,t,n){"use strict";var i=n(115)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){var i=n(81),o=n(27),r=n(8),s=r("iterator");e.exports=function(e){if(e!=null)return e[s]||e["@@iterator"]||o[i(e)]}},function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";var i=n(3),o=n.n(i),r=n(0),s=n(2),a=n(28),l=n(1),d=n(29),c=n.n(d);class p{constructor(e,t){this.settings=Object(r.extend)({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1},t||{}),this.id="epubjs-view-"+Object(r.uuid)(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new s.a,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var t=document.createElement("div");return t.classList.add("epub-view"),t.style.height="0px",t.style.width="0px",t.style.overflow="hidden",t.style.position="relative",t.style.display="block",t.style.flex=e&&"horizontal"==e?"none":"initial",t}create(){return this.iframe?this.iframe:(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.setAttribute("enable-annotation","true"),this.resizing=!0,this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this.element.setAttribute("ref",this.index),this.added=!0,this.elementBounds=Object(r.bounds)(this.element),this.supportsSrcdoc=!!("srcdoc"in this.iframe),this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write"),this.iframe)}render(e){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(e)),this.sectionRender.then(function(e){return this.load(e)}.bind(this)).then(function(){let e=this.contents.writingMode(),t;return t="scrolled"===this.settings.flow?0===e.indexOf("vertical")?"horizontal":"vertical":0===e.indexOf("vertical")?"vertical":"horizontal",0===e.indexOf("vertical")&&"paginated"===this.settings.flow&&(this.layout.delta=this.layout.height),this.setAxis(t),this.emit(l.c.VIEWS.AXIS,t),this.setWritingMode(e),this.emit(l.c.VIEWS.WRITING_MODE,e),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise(e=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),e()})}.bind(this),function(t){return this.emit(l.c.VIEWS.LOAD_ERROR,t),new Promise((e,n)=>{n(t)})}.bind(this)).then(function(){this.emit(l.c.VIEWS.RENDERED,this.section)}.bind(this))}reset(){this.iframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,t){var n=e||this.settings.width,i=t||this.settings.height;"pre-paginated"===this.layout.name?this.lock("both",n,i):"horizontal"===this.settings.axis?this.lock("height",n,i):this.lock("width",n,i),this.settings.width=n,this.settings.height=i}lock(e,t,n){var i=Object(r.borders)(this.element),o;o=this.iframe?Object(r.borders)(this.iframe):{width:0,height:0},"width"==e&&Object(r.isNumber)(t)&&(this.lockedWidth=t-i.width-o.width),"height"==e&&Object(r.isNumber)(n)&&(this.lockedHeight=n-i.height-o.height),"both"===e&&Object(r.isNumber)(t)&&Object(r.isNumber)(n)&&(this.lockedWidth=t-i.width-o.width,this.lockedHeight=n-i.height-o.height),this.displayed&&this.iframe&&this.expand()}expand(){var e=this.lockedWidth,t=this.lockedHeight,n;!this.iframe||this._expanding||(this._expanding=!0,"pre-paginated"===this.layout.name?(e=this.layout.columnWidth,t=this.layout.height):"horizontal"===this.settings.axis?(e=this.contents.textWidth(),0<e%this.layout.pageWidth&&(e=Math.ceil(e/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(n=e/this.layout.pageWidth,1<this.layout.divisor&&"reflowable"===this.layout.name&&0<n%2&&(e+=this.layout.pageWidth))):"vertical"===this.settings.axis&&(t=this.contents.textHeight(),"paginated"===this.settings.flow&&0<t%this.layout.height&&(t=Math.ceil(t/this.layout.height)*this.layout.height)),(this._needsReframe||e!=this._width||t!=this._height)&&this.reframe(e,t),this._expanding=!1)}reframe(e,t){var n;Object(r.isNumber)(e)&&(this.element.style.width=e+"px",this.iframe.style.width=e+"px",this._width=e),Object(r.isNumber)(t)&&(this.element.style.height=t+"px",this.iframe.style.height=t+"px",this._height=t);let i=this.prevBounds?e-this.prevBounds.width:e,o=this.prevBounds?t-this.prevBounds.height:t;n={width:e,height:t,widthDelta:i,heightDelta:o},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let e;for(let t in this.marks)this.marks.hasOwnProperty(t)&&(e=this.marks[t],this.placeMark(e.element,e.range))}),this.onResize(this,n),this.emit(l.c.VIEWS.RESIZED,n),this.prevBounds=n,this.elementBounds=Object(r.bounds)(this.element)}load(e){var t=new r.defer,n=t.promise;if(!this.iframe)return t.reject(new Error("No Iframe Available")),n;if(this.iframe.onload=function(e){this.onLoad(e,t)}.bind(this),"blobUrl"===this.settings.method)this.blobUrl=Object(r.createBlobUrl)(e,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if("srcdoc"===this.settings.method)this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return t.reject(new Error("No Document Available")),n;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var i=this;MSApp.execUnsafeLocalFunction(function(){i.iframe.contentDocument.write(e)})}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return n}onLoad(e,t){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new a.a(this.document,this.document.body,this.section.cfiBase,this.section.index),this.rendering=!1;var n=this.document.querySelector("link[rel='canonical']");n?n.setAttribute("href",this.section.canonical):(n=this.document.createElement("link"),n.setAttribute("rel","canonical"),n.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(n)),this.contents.on(l.c.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(l.c.CONTENTS.RESIZE,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),t.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,this.element.style.flex="horizontal"==e?"none":"initial",this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(){}display(e){var t=new r.defer;return this.displayed?t.resolve(this):this.render(e).then(function(){this.emit(l.c.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,t.resolve(this)}.bind(this),function(e){t.reject(e,this)}),t.promise}show(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit(l.c.VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(l.c.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){var t=this.iframe.getBoundingClientRect(),n=this.contents.locationOf(e,this.settings.ignoreClass);return{left:n.left,top:n.top}}onDisplayed(){}onResize(){}bounds(e){return(e||!this.elementBounds)&&(this.elementBounds=Object(r.bounds)(this.element)),this.elementBounds}highlight(e,t={},n,i="epubjs-hl",o={}){if(!this.contents)return;const r=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},o);let s=this.contents.range(e),a=()=>{this.emit(l.c.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new d.Pane(this.iframe,this.element));let c=new d.Highlight(s,i,t,r),p=this.pane.addMark(c);return this.highlights[e]={mark:p,element:p.element,listeners:[a,n]},p.element.setAttribute("ref",i),p.element.addEventListener("click",a),p.element.addEventListener("touchstart",a),n&&(p.element.addEventListener("click",n),p.element.addEventListener("touchstart",n)),p}underline(e,t={},n,i="epubjs-ul",o={}){if(!this.contents)return;const r=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},o);let s=this.contents.range(e),a=()=>{this.emit(l.c.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new d.Pane(this.iframe,this.element));let c=new d.Underline(s,i,t,r),p=this.pane.addMark(c);return this.underlines[e]={mark:p,element:p.element,listeners:[a,n]},p.element.setAttribute("ref",i),p.element.addEventListener("click",a),p.element.addEventListener("touchstart",a),n&&(p.element.addEventListener("click",n),p.element.addEventListener("touchstart",n)),p}mark(e,t={},n){if(!this.contents)return;if(e in this.marks){let t=this.marks[e];return t}let i=this.contents.range(e);if(!i)return;let o=i.commonAncestorContainer,r=1===o.nodeType?o:o.parentNode,s=()=>{this.emit(l.c.VIEWS.MARK_CLICKED,e,t)};i.collapsed&&1===o.nodeType?(i=new Range,i.selectNodeContents(o)):i.collapsed&&(i=new Range,i.selectNodeContents(r));let a=this.document.createElement("a");return a.setAttribute("ref","epubjs-mk"),a.style.position="absolute",a.dataset.epubcfi=e,t&&Object.keys(t).forEach(e=>{a.dataset[e]=t[e]}),n&&(a.addEventListener("click",n),a.addEventListener("touchstart",n)),a.addEventListener("click",s),a.addEventListener("touchstart",s),this.placeMark(a,i),this.element.appendChild(a),this.marks[e]={element:a,range:i,listeners:[s,n]},r}placeMark(e,t){let n,o,r;if("pre-paginated"===this.layout.name||"horizontal"!==this.settings.axis){let e=t.getBoundingClientRect();n=e.top,o=e.right}else{let e=t.getClientRects(),i;for(var s=0;s!=e.length;s++)i=e[s],(!r||i.left<r)&&(r=i.left,o=Math.ceil(r/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,n=i.top)}e.style.top=`${n}px`,e.style.left=`${o}px`}unhighlight(e){let t;e in this.highlights&&(t=this.highlights[e],this.pane.removeMark(t.mark),t.listeners.forEach(e=>{e&&(t.element.removeEventListener("click",e),t.element.removeEventListener("touchstart",e))}),delete this.highlights[e])}ununderline(e){let t;e in this.underlines&&(t=this.underlines[e],this.pane.removeMark(t.mark),t.listeners.forEach(e=>{e&&(t.element.removeEventListener("click",e),t.element.removeEventListener("touchstart",e))}),delete this.underlines[e])}unmark(e){let t;e in this.marks&&(t=this.marks[e],this.element.removeChild(t.element),t.listeners.forEach(e=>{e&&(t.element.removeEventListener("click",e),t.element.removeEventListener("touchstart",e))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&Object(r.revokeBlobUrl)(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}}o()(p.prototype),t.a=p},function(e,t,n){function i(e,t,n){function i(t){var n=E,i=_;return E=_=void 0,y=t,S=e.apply(i,n),S}function d(e){return y=e,C=setTimeout(h,t),b?i(e):S}function c(e){var n=e-T,i=e-y,o=t-n;return v?l(o,w-i):o}function p(e){var n=e-T,i=e-y;return void 0===T||n>=t||0>n||v&&i>=w}function h(){var e=r();return p(e)?u(e):void(C=setTimeout(h,c(e)))}function u(e){return(C=void 0,x&&E)?i(e):(E=_=void 0,S)}function g(){void 0!==C&&clearTimeout(C),y=0,E=T=_=C=void 0}function m(){return void 0===C?S:u(r())}function f(){var e=r(),n=p(e);if(E=arguments,_=this,T=e,n){if(void 0===C)return d(T);if(v)return clearTimeout(C),C=setTimeout(h,t),i(T)}return void 0===C&&(C=setTimeout(h,t)),S}var y=0,b=!1,v=!1,x=!0,E,_,w,S,C,T;if("function"!=typeof e)throw new TypeError("Expected a function");return t=s(t)||0,o(n)&&(b=!!n.leading,v="maxWait"in n,w=v?a(s(n.maxWait)||0,t):w,x="trailing"in n?!!n.trailing:x),f.cancel=g,f.flush=m,f}var o=n(53),r=n(137),s=n(139),a=Math.max,l=Math.min;e.exports=i},function(e,t,n){"use strict";var i=n(14),o=n(0),r=n(22),s=n(1),a=n(3),l=n.n(a);const d=Math.PI/2,c={easeOutSine:function(e){return Math.sin(e*d)},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInOutQuint:function(e){return 1>(e/=.5)?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2)},easeInCubic:function(e){return Math.pow(e,3)}};class p{constructor(e,t){this.settings=Object(o.extend)({duration:80,minVelocity:.2,minDistance:10,easing:c.easeInCubic},t||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=2*this.settings.duration,this.isVertical="vertical"===this.manager.settings.axis;!this.manager.isPaginated||this.isVertical||(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.scrollLeft,this.scrollTop,this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0,this.addListeners())}supportsTouch(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}disableScroll(){this.element.style.overflow="hidden"}enableScroll(){this.element.style.overflow=""}addListeners(){this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll),this._onTouchStart=this.onTouchStart.bind(this),this.scroller.addEventListener("touchstart",this._onTouchStart,{passive:!0}),this.on("touchstart",this._onTouchStart),this._onTouchMove=this.onTouchMove.bind(this),this.scroller.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.on("touchmove",this._onTouchMove),this._onTouchEnd=this.onTouchEnd.bind(this),this.scroller.addEventListener("touchend",this._onTouchEnd,{passive:!0}),this.on("touchend",this._onTouchEnd),this._afterDisplayed=this.afterDisplayed.bind(this),this.manager.on(s.c.MANAGERS.ADDED,this._afterDisplayed)}removeListeners(){window.removeEventListener("resize",this._onResize),this._onResize=void 0,this.scroller.removeEventListener("scroll",this._onScroll),this._onScroll=void 0,this.scroller.removeEventListener("touchstart",this._onTouchStart,{passive:!0}),this.off("touchstart",this._onTouchStart),this._onTouchStart=void 0,this.scroller.removeEventListener("touchmove",this._onTouchMove,{passive:!0}),this.off("touchmove",this._onTouchMove),this._onTouchMove=void 0,this.scroller.removeEventListener("touchend",this._onTouchEnd,{passive:!0}),this.off("touchend",this._onTouchEnd),this._onTouchEnd=void 0,this.manager.off(s.c.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let t=e.contents;["touchstart","touchmove","touchend"].forEach(n=>{t.on(n,e=>this.triggerViewEvent(e,t))})}triggerViewEvent(t,e){this.emit(t.type,t,e)}onScroll(){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(){this.resizeCanceler=!0}onTouchStart(t){let{screenX:e,screenY:n}=t.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=e,this.startTouchY=n,this.startTime=this.now()),this.endTouchX=e,this.endTouchY=n,this.endTime=this.now()}onTouchMove(t){let{screenX:e,screenY:n}=t.touches[0],i=Math.abs(n-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&10>i&&(this.element.scrollLeft-=e-this.endTouchX),this.endTouchX=e,this.endTouchY=n,this.endTime=this.now()}onTouchEnd(){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let e=this.wasSwiped();0===e?this.snap():this.snap(e),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0}wasSwiped(){let e=this.layout.pageWidth*this.layout.divisor,t=this.endTouchX-this.startTouchX,n=Math.abs(t),i=this.endTime-this.startTime,o=t/i,r=this.settings.minVelocity;if(n<=this.settings.minDistance||n>=e)return 0;return o>r?-1:o<-r?1:void 0}needsSnap(){let e=this.scrollLeft,t=this.layout.pageWidth*this.layout.divisor;return 0!=e%t}snap(e=0){let t=this.scrollLeft,n=this.layout.pageWidth*this.layout.divisor,i=Math.round(t/n)*n;return e&&(i+=e*n),this.smoothScrollTo(i)}smoothScrollTo(e){function t(){const o=this.now(),l=Math.min(1,(o-r)/s),d=a(l);return this.touchCanceler||this.resizeCanceler?(this.resizeCanceler=!1,this.snapping=!1,void n.resolve()):void(1>l?(window.requestAnimationFrame(t.bind(this)),this.scrollTo(i+(e-i)*l,0)):(this.scrollTo(e,0),this.snapping=!1,n.resolve()))}const n=new o.defer,i=this.scrollLeft,r=this.now(),s=this.settings.duration,a=this.settings.easing;return this.snapping=!0,t.call(this),n.promise}scrollTo(e=0,t=0){this.fullsize?window.scroll(e,t):(this.scroller.scrollLeft=e,this.scroller.scrollTop=t)}now(){return"now"in window.performance?performance.now():new Date().getTime()}destroy(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}}l()(p.prototype);var h=p,u=n(55),g=n.n(u);class m extends r.a{constructor(e){super(e),this.name="continuous",this.settings=Object(o.extend)(this.settings||{},{infinite:!0,overflow:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10}),Object(o.extend)(this.settings,e.settings||{}),"undefined"!=e.settings.gap&&0===e.settings.gap&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1},this.scrollTop=0,this.scrollLeft=0}display(e,t){return r.a.prototype.display.call(this,e,t).then(function(){return this.fill()}.bind(this))}fill(e){var t=e||new o.defer;return this.q.enqueue(()=>this.check()).then(e=>{e?this.fill(t):t.resolve()}),t.promise}moveTo(e){var t=0,n=0,i=0,o=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,i=t+this.settings.offsetDelta):(n=e.top,o=e.top+this.settings.offsetDelta),(0<t||0<n)&&this.scrollBy(t,n,!0)}afterResized(e){this.emit(s.c.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var t=this.createView(e);return this.views.append(t),t.on(s.c.VIEWS.RESIZED,()=>{t.expanded=!0}),t.on(s.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on(s.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.display(this.request)}append(e){var t=this.createView(e);return t.on(s.c.VIEWS.RESIZED,()=>{t.expanded=!0}),t.on(s.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on(s.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t}prepend(e){var t=this.createView(e);return t.on(s.c.VIEWS.RESIZED,e=>{this.counter(e),t.expanded=!0}),t.on(s.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on(s.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t}counter(e){"vertical"===this.settings.axis?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var t=this.bounds(),n=this.views.all(),r=n.length,s=[],a="undefined"==typeof e?this.settings.offset||0:e,l=new o.defer,d=[],c=0,p,h;c<r;c++)if(h=n[c],p=this.isVisible(h,a,a,t),!0===p){if(!h.displayed){let e=h.display(this.request).then(function(e){e.show()},()=>{h.hide()});d.push(e)}else h.show();s.push(h)}else this.q.enqueue(h.destroy.bind(h)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return d.length?Promise.all(d).catch(e=>{l.reject(e)}):(l.resolve(),l.promise)}check(e,t){var n=new o.defer,i=[],r="horizontal"===this.settings.axis,s=this.settings.offset||0;e&&r&&(s=e),t&&!r&&(s=t);var a=this._bounds;let l=r?this.scrollLeft:this.scrollTop,d=r?Math.floor(a.width):a.height,c=r?this.container.scrollWidth:this.container.scrollHeight,p=this.writingMode&&0===this.writingMode.indexOf("vertical")?"vertical":"horizontal",h=this.settings.rtlScrollType,u="rtl"===this.settings.direction;this.settings.fullsize?(r&&u&&"negative"===h||!r&&u&&"default"===h)&&(l*=-1):(u&&"default"===h&&"horizontal"===p&&(l=c-d-l),u&&"negative"===h&&"horizontal"===p&&(l*=-1));let g=l+d+s,m=l-s;g>=c&&(()=>{let e=this.views.last(),t=e&&e.section.next();t&&i.push(this.append(t))})(),0>m&&(()=>{let e=this.views.first(),t=e&&e.section.prev();t&&i.push(this.prepend(t))})();let f=i.map(e=>e.display(this.request));return i.length?Promise.all(f).then(()=>this.check()).then(()=>this.update(s),e=>e):(this.q.enqueue(function(){this.update()}.bind(this)),n.resolve(!1),n.promise)}trim(){for(var e=new o.defer,t=this.views.displayed(),n=t[0],r=t[t.length-1],s=this.views.indexOf(n),a=this.views.indexOf(r),l=this.views.slice(0,s),d=this.views.slice(a+1),c=0;c<l.length-1;c++)this.erase(l[c],l);for(var p=1;p<d.length;p++)this.erase(d[p]);return e.resolve(),e.promise}erase(e,t){var n,i;this.settings.fullsize?(n=window.scrollY,i=window.scrollX):(n=this.container.scrollTop,i=this.container.scrollLeft);var o=e.bounds();this.views.remove(e),t&&("vertical"===this.settings.axis?this.scrollTo(0,n-o.height,!0):"rtl"===this.settings.direction?this.settings.fullsize?this.scrollTo(i+Math.floor(o.width),0,!0):this.scrollTo(i,0,!0):this.scrollTo(i-Math.floor(o.width),0,!0))}addEventListeners(){window.addEventListener("unload",function(){this.ignore=!0,this.destroy()}.bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new h(this,this.settings.snap&&"object"==typeof this.settings.snap&&this.settings.snap))}addScrollListeners(){var e;this.tick=o.requestAnimationFrame;let t="rtl"===this.settings.direction&&"default"===this.settings.rtlScrollType?-1:1;this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(e=window,this.scrollTop=window.scrollY*t,this.scrollLeft=window.scrollX*t):(e=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll),this._scrolled=g()(this.scrolled.bind(this),30),this.didScroll=!1}removeEventListeners(){var e;e=this.settings.fullsize?window:this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}onScroll(){let e="rtl"===this.settings.direction&&"default"===this.settings.rtlScrollType?-1:1,t,n;this.settings.fullsize?(t=window.scrollY*e,n=window.scrollX*e):(t=this.container.scrollTop,n=this.container.scrollLeft),this.scrollTop=t,this.scrollLeft=n,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(t-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(n-this.prevScrollLeft),this.prevScrollTop=t,this.prevScrollLeft=n,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1}scrolled(){this.q.enqueue(function(){return this.check()}.bind(this)),this.emit(s.c.MANAGERS.SCROLL,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit(s.c.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),this.settings.afterScrolledTimeout)}next(){let e="pre-paginated"===this.layout.props.name&&this.layout.props.spread?2*this.layout.props.delta:this.layout.props.delta;this.views.length&&(this.isPaginated&&"horizontal"===this.settings.axis?this.scrollBy(e,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}prev(){let e="pre-paginated"===this.layout.props.name&&this.layout.props.spread?2*this.layout.props.delta:this.layout.props.delta;this.views.length&&(this.isPaginated&&"horizontal"===this.settings.axis?this.scrollBy(-e,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue(function(){return this.check()}.bind(this)))}updateFlow(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),super.updateFlow(e,"scroll"),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new h(this,this.settings.snap&&"object"==typeof this.settings.snap&&this.settings.snap))}destroy(){super.destroy(),this.snapper&&this.snapper.destroy()}}t.a=m},function(e,t,n){(function(t){var n,n;(function(t){e.exports=t()})(function(){return function d(c,e,t){function r(i,o){if(!e[i]){if(!c[i]){var p="function"==typeof n&&n;if(!o&&p)return n(i,!0);if(s)return s(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var h=e[i]={exports:{}};c[i][0].call(h.exports,function(t){var e=c[i][1][t];return r(e?e:t)},h,h.exports,d,c,e,t)}return e[i].exports}for(var s="function"==typeof n&&n,i=0;i<t.length;i++)r(t[i]);return r}({1:[function(e,n){(function(e){'use strict';function t(){p=!0;for(var e=c.length,t,n;e;){for(n=c,c=[],t=-1;++t<e;)n[t]();e=c.length}p=!1}function i(e){1!==c.push(e)||p||r()}var o=e.MutationObserver||e.WebKitMutationObserver,r;if(o){var s=0,a=new o(t),l=e.document.createTextNode("");a.observe(l,{characterData:!0}),r=function(){l.data=s=++s%2}}else if(!e.setImmediate&&"undefined"!=typeof e.MessageChannel){var d=new e.MessageChannel;d.port1.onmessage=t,r=function(){d.port2.postMessage(0)}}else r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var n=e.document.createElement("script");n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n)}:function(){setTimeout(t,0)};var c=[],p;n.exports=i}).call(this,"undefined"==typeof t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)},{}],2:[function(e,t){'use strict';function n(){}function i(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==n&&a(this,e)}function o(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function r(t,n,i){d(function(){var e;try{e=n(i)}catch(n){return c.reject(t,n)}e===t?c.reject(t,new TypeError("Cannot resolve promise with itself")):c.resolve(t,e)})}function s(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function a(e,t){function n(t){o||(o=!0,c.reject(e,t))}function i(t){o||(o=!0,c.resolve(e,t))}var o=!1,r=l(function(){t(i,n)});"error"===r.status&&n(r.value)}function l(e,t){var n={};try{n.value=e(t),n.status="success"}catch(t){n.status="error",n.value=t}return n}var d=e(1),c={},p=["REJECTED"],h=["FULFILLED"],u=["PENDING"];t.exports=i,i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(e,t){if("function"!=typeof e&&this.state===h||"function"!=typeof t&&this.state===p)return this;var i=new this.constructor(n);if(this.state!==u){var s=this.state===h?e:t;r(i,s,this.outcome)}else this.queue.push(new o(i,e,t));return i},o.prototype.callFulfilled=function(e){c.resolve(this.promise,e)},o.prototype.otherCallFulfilled=function(e){r(this.promise,this.onFulfilled,e)},o.prototype.callRejected=function(e){c.reject(this.promise,e)},o.prototype.otherCallRejected=function(e){r(this.promise,this.onRejected,e)},c.resolve=function(e,t){var n=l(s,t);if("error"===n.status)return c.reject(e,n.value);var o=n.value;if(o)a(e,o);else{e.state=h,e.outcome=t;for(var r=-1,d=e.queue.length;++r<d;)e.queue[r].callFulfilled(t)}return e},c.reject=function(e,t){e.state=p,e.outcome=t;for(var n=-1,o=e.queue.length;++n<o;)e.queue[n].callRejected(t);return e},i.resolve=function(e){return e instanceof this?e:c.resolve(new this(n),e)},i.reject=function(e){var t=new this(n);return c.reject(t,e)},i.all=function(e){function t(e,t){function n(e){a[t]=e,++l!==r||s||(s=!0,c.resolve(p,a))}o.resolve(e).then(n,function(e){s||(s=!0,c.reject(p,e))})}var o=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,s=!1;if(!r)return this.resolve([]);for(var a=Array(r),l=0,d=-1,p=new this(n);++d<r;)t(e[d],d);return p},i.race=function(e){function t(e){o.resolve(e).then(function(e){s||(s=!0,c.resolve(l,e))},function(e){s||(s=!0,c.reject(l,e))})}var o=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,s=!1;if(!r)return this.resolve([]);for(var a=-1,l=new this(n);++a<r;)t(e[a]);return l}},{1:1}],3:[function(e){(function(t){'use strict';"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,"undefined"==typeof t?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:t)},{2:2}],4:[function(e,t){'use strict';function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n="undefined"==typeof BlobBuilder?"undefined"==typeof MSBlobBuilder?"undefined"==typeof MozBlobBuilder?WebKitBlobBuilder:MozBlobBuilder:MSBlobBuilder:BlobBuilder,o=new n,r=0;r<e.length;r+=1)o.append(e[r]);return o.getBlob(t.type)}}function o(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function r(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e["catch"](n)}function s(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e+=""),e}function a(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function l(e){for(var t=e.length,n=new ArrayBuffer(t),o=new Uint8Array(n),r=0;r<t;r++)o[r]=e.charCodeAt(r);return n}function d(e){return new M(function(t){var n=e.transaction("local-forage-detect-blob-support","readwrite"),o=i([""]);n.objectStore("local-forage-detect-blob-support").put(o,"key"),n.onabort=function(n){n.preventDefault(),n.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||43<=parseInt(e[1],10))}})["catch"](function(){return!1})}function c(e){return"boolean"==typeof U?M.resolve(U):d(e).then(function(e){return U=e,U})}function p(e){var t=W[e.name],n={};n.promise=new M(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady=t.dbReady?t.dbReady.then(function(){return n.promise}):n.promise}function h(e){var t=W[e.name],n=t.deferredOperations.pop();if(n)return n.resolve(),n.promise}function u(e,t){var n=W[e.name],i=n.deferredOperations.pop();if(i)return i.reject(t),i.promise}function g(t,n){return new M(function(e,i){if(W[t.name]=W[t.name]||S(),t.db)if(n)p(t),t.db.close();else return e(t.db);var o=[t.name];n&&o.push(t.version);var r=B.open.apply(B,o);n&&(r.onupgradeneeded=function(n){var e=r.result;try{e.createObjectStore(t.storeName),1>=n.oldVersion&&e.createObjectStore("local-forage-detect-blob-support")}catch(e){if("ConstraintError"===e.name)console.warn("The database \""+t.name+"\" has been upgraded from version "+n.oldVersion+" to version "+n.newVersion+", but the storage \""+t.storeName+"\" already exists.");else throw e}}),r.onerror=function(t){t.preventDefault(),i(r.error)},r.onsuccess=function(){e(r.result),h(t)}})}function m(e){return g(e,!1)}function f(e){return g(e,!0)}function y(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,o=e.version>e.db.version;if(i&&(e.version!==t&&console.warn("The database \""+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function b(t){return new M(function(n,i){var o=new FileReader;o.onerror=i,o.onloadend=function(i){var e=btoa(i.target.result||"");n({__local_forage_encoded_blob:!0,data:e,type:t.type})},o.readAsBinaryString(t)})}function v(e){var t=l(atob(e.data));return i([t],{type:e.type})}function x(e){return e&&e.__local_forage_encoded_blob}function E(e){var t=this,n=t._initReady().then(function(){var e=W[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return r(n,e,e),n}function _(e){p(e);for(var t=W[e.name],n=t.forages,o=0,r;o<n.length;o++)r=n[o],r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null);return e.db=null,m(e).then(function(t){return e.db=t,y(e)?f(e):t}).then(function(o){e.db=t.db=o;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=o})["catch"](function(t){throw u(e,t),t})}function w(e,t,n,i){i===void 0&&(i=1);try{var o=e.db.transaction(e.storeName,t);n(null,o)}catch(o){if(0<i&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return M.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),f(e)}).then(function(){return _(e).then(function(){w(e,t,n,i-1)})})["catch"](n);n(o)}}function S(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function C(e){var t=.75*e.length,n=e.length,o=0,r,s,a,l,d;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);var c=new ArrayBuffer(t),h=new Uint8Array(c);for(r=0;r<n;r+=4)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r]),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r+1]),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r+2]),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r+3]),h[o++]=s<<2|a>>4,h[o++]=(15&a)<<4|l>>2,h[o++]=(3&l)<<6|63&d;return c}function T(e){var t=new Uint8Array(e),n="",o;for(o=0;o<t.length;o+=3)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[o]>>2],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[o])<<4|t[o+1]>>4],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[o+1])<<2|t[o+2]>>6],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[o+2]];return 2==t.length%3?n=n.substring(0,n.length-1)+"=":1==t.length%3&&(n=n.substring(0,n.length-2)+"=="),n}function k(e,t,n,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function R(e,n,i,o,r,s){e.executeSql(i,o,r,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],function(e,t){t.rows.length?s(e,a):k(e,n,function(){e.executeSql(i,o,r,s)},s)},s):s(e,a)},s)}function I(e,t,n,i){var r=this;e=s(e);var a=new M(function(o,s){r.ready().then(function(){void 0===t&&(t=null);var a=t,l=r._dbInfo;l.serializer.serialize(t,function(d,c){c?s(c):l.db.transaction(function(n){R(n,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,d],function(){o(a)},function(e,t){s(t)})},function(t){if(t.code===t.QUOTA_ERR){if(0<i)return void o(I.apply(r,[e,a,n,i-1]));s(t)}})})})["catch"](s)});return o(a,n),a}function N(e){return new M(function(n,i){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(o,t){for(var r=[],s=0;s<t.rows.length;s++)r.push(t.rows.item(s).name);n({db:e,storeNames:r})},function(e,t){i(t)})},function(e){i(e)})})}function L(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}function A(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function O(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(t){return!0}}function P(){return!O()||0<localStorage.length}function D(e,t){e[t]=function(){var n=arguments;return e.ready().then(function(){return e[t].apply(e,n)})}}function z(){for(var e=1,t;e<arguments.length;e++)if(t=arguments[e],t)for(var n in t)t.hasOwnProperty(n)&&(arguments[0][n]=ee(t[n])?t[n].slice():t[n]);return arguments[0]}var q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){}}();"undefined"==typeof Promise&&e(3);var M=Promise,U=void 0,W={},F=Object.prototype.toString,H={_driver:"asyncStorage",_initStorage:function(e){function t(){return M.resolve()}var n=this,o={db:null};if(e)for(var r in e)o[r]=e[r];var i=W[o.name];i||(i=S(),W[o.name]=i),i.forages.push(n),n._initReady||(n._initReady=n.ready,n.ready=E);for(var s=[],a=0,l;a<i.forages.length;a++)l=i.forages[a],l!==n&&s.push(l._initReady()["catch"](t));var d=i.forages.slice(0);return M.all(s).then(function(){return o.db=i.db,m(o)}).then(function(e){return o.db=e,y(o,n._defaultConfig.version)?f(o):e}).then(function(e){o.db=i.db=e,n._dbInfo=o;for(var t=0,r;t<d.length;t++)r=d[t],r!==n&&(r._dbInfo.db=o.db,r._dbInfo.version=o.version)})},_support:function(){try{if(!B)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(e,t){var n=this,i=new M(function(t,i){n.ready().then(function(){w(n._dbInfo,"readonly",function(o,r){if(o)return i(o);try{var s=r.objectStore(n._dbInfo.storeName),a=s.openCursor(),l=1;a.onsuccess=function(){var n=a.result;if(n){var i=n.value;x(i)&&(i=v(i));var o=e(i,n.key,l++);void 0===o?n["continue"]():t(o)}else t()},a.onerror=function(){i(a.error)}}catch(t){i(t)}})})["catch"](i)});return o(i,t),i},getItem:function(e,t){var n=this;e=s(e);var i=new M(function(t,i){n.ready().then(function(){w(n._dbInfo,"readonly",function(o,r){if(o)return i(o);try{var s=r.objectStore(n._dbInfo.storeName),a=s.get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),x(e)&&(e=v(e)),t(e)},a.onerror=function(){i(a.error)}}catch(t){i(t)}})})["catch"](i)});return o(i,t),i},setItem:function(e,t,n){var i=this;e=s(e);var r=new M(function(n,o){var r;i.ready().then(function(){return r=i._dbInfo,"[object Blob]"===F.call(t)?c(r.db).then(function(e){return e?t:b(t)}):t}).then(function(t){w(i._dbInfo,"readwrite",function(r,s){if(r)return o(r);try{var a=s.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var l=a.put(t,e);s.oncomplete=function(){void 0===t&&(t=null),n(t)},s.onabort=s.onerror=function(){var e=l.error?l.error:l.transaction.error;o(e)}}catch(t){o(t)}})})["catch"](o)});return o(r,n),r},removeItem:function(e,t){var n=this;e=s(e);var i=new M(function(t,i){n.ready().then(function(){w(n._dbInfo,"readwrite",function(o,r){if(o)return i(o);try{var s=r.objectStore(n._dbInfo.storeName),a=s["delete"](e);r.oncomplete=function(){t()},r.onerror=function(){i(a.error)},r.onabort=function(){var e=a.error?a.error:a.transaction.error;i(e)}}catch(t){i(t)}})})["catch"](i)});return o(i,t),i},clear:function(e){var t=this,n=new M(function(e,n){t.ready().then(function(){w(t._dbInfo,"readwrite",function(i,o){if(i)return n(i);try{var r=o.objectStore(t._dbInfo.storeName),s=r.clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=s.error?s.error:s.transaction.error;n(e)}}catch(t){n(t)}})})["catch"](n)});return o(n,e),n},length:function(e){var t=this,n=new M(function(e,n){t.ready().then(function(){w(t._dbInfo,"readonly",function(i,o){if(i)return n(i);try{var r=o.objectStore(t._dbInfo.storeName),s=r.count();s.onsuccess=function(){e(s.result)},s.onerror=function(){n(s.error)}}catch(t){n(t)}})})["catch"](n)});return o(n,e),n},key:function(e,t){var n=this,i=new M(function(t,i){return 0>e?void t(null):void n.ready().then(function(){w(n._dbInfo,"readonly",function(o,r){if(o)return i(o);try{var s=r.objectStore(n._dbInfo.storeName),a=!1,l=s.openCursor();l.onsuccess=function(){var n=l.result;return n?void(0===e?t(n.key):a?t(n.key):(a=!0,n.advance(e))):void t(null)},l.onerror=function(){i(l.error)}}catch(t){i(t)}})})["catch"](i)});return o(i,t),i},keys:function(e){var t=this,n=new M(function(e,n){t.ready().then(function(){w(t._dbInfo,"readonly",function(i,o){if(i)return n(i);try{var r=o.objectStore(t._dbInfo.storeName),s=r.openCursor(),a=[];s.onsuccess=function(){var t=s.result;return t?void(a.push(t.key),t["continue"]()):void e(a)},s.onerror=function(){n(s.error)}}catch(t){n(t)}})})["catch"](n)});return o(n,e),n},dropInstance:function(e,t){t=a.apply(this,arguments);var n=this.config();e="function"!=typeof e&&e||{},e.name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i=this,r;if(!e.name)r=M.reject("Invalid arguments");else{var s=e.name===n.name&&i._dbInfo.db,l=s?M.resolve(i._dbInfo.db):m(e).then(function(t){var n=W[e.name],o=n.forages;n.db=t;for(var r=0;r<o.length;r++)o[r]._dbInfo.db=t;return t});r=e.storeName?l.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;p(e);var o=W[e.name],r=o.forages;t.close();for(var s=0,a;s<r.length;s++)a=r[s],a._dbInfo.db=null,a._dbInfo.version=n;var l=new M(function(t,i){var o=B.open(e.name,n);o.onerror=function(e){var t=o.result;t.close(),i(e)},o.onupgradeneeded=function(){var t=o.result;t.deleteObjectStore(e.storeName)},o.onsuccess=function(){var e=o.result;e.close(),t(e)}});return l.then(function(e){o.db=e;for(var t=0,n;t<r.length;t++)n=r[t],n._dbInfo.db=e,h(n._dbInfo)})["catch"](function(t){throw(u(e,t)||M.resolve())["catch"](function(){}),t})}}):l.then(function(t){p(e);var n=W[e.name],o=n.forages;t.close();for(var r=0,s;r<o.length;r++)s=o[r],s._dbInfo.db=null;var a=new M(function(t,n){var i=B.deleteDatabase(e.name);i.onerror=i.onblocked=function(e){var t=i.result;t&&t.close(),n(e)},i.onsuccess=function(){var e=i.result;e&&e.close(),t(e)}});return a.then(function(e){n.db=e;for(var t=0,r;t<o.length;t++)r=o[t],h(r._dbInfo)})["catch"](function(t){throw(u(e,t)||M.resolve())["catch"](function(){}),t})})}return o(r,t),r}},V=/^~~local_forage_type~([^~]+)~/,G="__lfsc__:".length,X=G+"arbf".length,Y=Object.prototype.toString,K={serialize:function(t,n){var i="";if(t&&(i=Y.call(t)),t&&("[object ArrayBuffer]"===i||t.buffer&&"[object ArrayBuffer]"===Y.call(t.buffer))){var o="__lfsc__:",r;t instanceof ArrayBuffer?(r=t,o+="arbf"):(r=t.buffer,"[object Int8Array]"===i?o+="si08":"[object Uint8Array]"===i?o+="ui08":"[object Uint8ClampedArray]"===i?o+="uic8":"[object Int16Array]"===i?o+="si16":"[object Uint16Array]"===i?o+="ur16":"[object Int32Array]"===i?o+="si32":"[object Uint32Array]"===i?o+="ui32":"[object Float32Array]"===i?o+="fl32":"[object Float64Array]"===i?o+="fl64":n(new Error("Failed to get type for BinaryArray"))),n(o+T(r))}else if("[object Blob]"===i){var s=new FileReader;s.onload=function(){var e="~~local_forage_type~"+t.type+"~"+T(this.result);n("__lfsc__:blob"+e)},s.readAsArrayBuffer(t)}else try{n(JSON.stringify(t))}catch(i){console.error("Couldn't convert value into a JSON string: ",t),n(null,i)}},deserialize:function(e){if(e.substring(0,G)!=="__lfsc__:")return JSON.parse(e);var t=e.substring(X),n=e.substring(G,X),o;if(n==="blob"&&V.test(t)){var r=t.match(V);o=r[1],t=t.substring(r[0].length)}var s=C(t);switch(n){case"arbf":return s;case"blob":return i([s],{type:o});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+n);}},stringToBuffer:C,bufferToString:T},Z={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var o in e)n[o]="string"==typeof e[o]?e[o]:e[o].toString();var i=new M(function(e,i){try{n.db=openDatabase(n.name,n.version+"",n.description,n.size)}catch(t){return i(t)}n.db.transaction(function(o){k(o,n,function(){t._dbInfo=n,e()},function(e,t){i(t)})},i)});return n.serializer=K,i},_support:function(){return"function"==typeof openDatabase}(),iterate:function(e,t){var n=this,i=new M(function(o,r){n.ready().then(function(){var s=n._dbInfo;s.db.transaction(function(n){R(n,s,"SELECT * FROM "+s.storeName,[],function(n,t){for(var r=t.rows,a=r.length,l=0;l<a;l++){var d=r.item(l),c=d.value;if(c&&(c=s.serializer.deserialize(c)),c=e(c,d.key,l+1),void 0!==c)return void o(c)}o()},function(e,t){r(t)})})})["catch"](r)});return o(i,t),i},getItem:function(e,t){var n=this;e=s(e);var i=new M(function(i,o){n.ready().then(function(){var r=n._dbInfo;r.db.transaction(function(n){R(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[e],function(e,t){var n=t.rows.length?t.rows.item(0).value:null;n&&(n=r.serializer.deserialize(n)),i(n)},function(e,t){o(t)})})})["catch"](o)});return o(i,t),i},setItem:function(e,t,n){return I.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=s(e);var i=new M(function(t,i){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){R(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){t()},function(e,t){i(t)})})})["catch"](i)});return o(i,t),i},clear:function(e){var t=this,n=new M(function(e,n){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(o){R(o,i,"DELETE FROM "+i.storeName,[],function(){e()},function(e,t){n(t)})})})["catch"](n)});return o(n,e),n},length:function(e){var t=this,n=new M(function(e,n){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(o){R(o,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(n,t){var i=t.rows.item(0).c;e(i)},function(e,t){n(t)})})})["catch"](n)});return o(n,e),n},key:function(e,t){var n=this,i=new M(function(i,o){n.ready().then(function(){var r=n._dbInfo;r.db.transaction(function(n){R(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,t){var n=t.rows.length?t.rows.item(0).key:null;i(n)},function(e,t){o(t)})})})["catch"](o)});return o(i,t),i},keys:function(e){var t=this,n=new M(function(e,n){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(o){R(o,i,"SELECT key FROM "+i.storeName,[],function(n,t){for(var o=[],r=0;r<t.rows.length;r++)o.push(t.rows.item(r).key);e(o)},function(e,t){n(t)})})})["catch"](n)});return o(n,e),n},dropInstance:function(e,t){t=a.apply(this,arguments);var n=this.config();e="function"!=typeof e&&e||{},e.name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i=this,r;return r=e.name?new M(function(t){var o;o=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:o,storeNames:[e.storeName]}):t(N(o))}).then(function(e){return new M(function(t,n){e.db.transaction(function(o){function r(e){return new M(function(t,n){o.executeSql("DROP TABLE IF EXISTS "+e,[],function(){t()},function(e,t){n(t)})})}for(var s=[],a=0,l=e.storeNames.length;a<l;a++)s.push(r(e.storeNames[a]));M.all(s).then(function(){t()})["catch"](function(t){n(t)})},function(e){n(e)})})}):M.reject("Invalid arguments"),o(r,t),r}},J={_driver:"localStorageWrapper",_initStorage:function(e){var t=this,n={};if(e)for(var o in e)n[o]=e[o];return(n.keyPrefix=A(e,t._defaultConfig),!P())?M.reject():(t._dbInfo=n,n.serializer=K,M.resolve())},_support:L(),iterate:function(e,t){var n=this,i=n.ready().then(function(){for(var t=n._dbInfo,o=t.keyPrefix,r=o.length,s=localStorage.length,a=1,l=0,d;l<s;l++)if(d=localStorage.key(l),0===d.indexOf(o)){var c=localStorage.getItem(d);if(c&&(c=t.serializer.deserialize(c)),c=e(c,d.substring(r),a++),void 0!==c)return c}});return o(i,t),i},getItem:function(e,t){var n=this;e=s(e);var i=n.ready().then(function(){var t=n._dbInfo,i=localStorage.getItem(t.keyPrefix+e);return i&&(i=t.serializer.deserialize(i)),i});return o(i,t),i},setItem:function(e,t,n){var i=this;e=s(e);var r=i.ready().then(function(){void 0===t&&(t=null);var n=t;return new M(function(o,r){var s=i._dbInfo;s.serializer.serialize(t,function(t,i){if(i)r(i);else try{localStorage.setItem(s.keyPrefix+e,t),o(n)}catch(t){("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&r(t),r(t)}})})});return o(r,n),r},removeItem:function(e,t){var n=this;e=s(e);var i=n.ready().then(function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return o(i,t),i},clear:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1,o;0<=n;n--)o=localStorage.key(n),0===o.indexOf(e)&&localStorage.removeItem(o)});return o(n,e),n},length:function(e){var t=this,n=t.keys().then(function(e){return e.length});return o(n,e),n},key:function(e,t){var n=this,i=n.ready().then(function(){var t=n._dbInfo,i;try{i=localStorage.key(e)}catch(e){i=null}return i&&(i=i.substring(t.keyPrefix.length)),i});return o(i,t),i},keys:function(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,o=[],r=0,s;r<n;r++)s=localStorage.key(r),0===s.indexOf(e.keyPrefix)&&o.push(s.substring(e.keyPrefix.length));return o});return o(n,e),n},dropInstance:function(e,t){if(t=a.apply(this,arguments),e="function"!=typeof e&&e||{},!e.name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var i=this,r;return r=e.name?new M(function(t){e.storeName?t(A(e,i._defaultConfig)):t(e.name+"/")}).then(function(e){for(var t=localStorage.length-1,n;0<=t;t--)n=localStorage.key(t),0===n.indexOf(e)&&localStorage.removeItem(n)}):M.reject("Invalid arguments"),o(r,t),r}},Q=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},$=function(e,t){for(var n=e.length,o=0;o<n;){if(Q(e[o],t))return!0;o++}return!1},ee=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},te={},ne={},ie={INDEXEDDB:H,WEBSQL:Z,LOCALSTORAGE:J},oe=[ie.INDEXEDDB._driver,ie.WEBSQL._driver,ie.LOCALSTORAGE._driver],re=["dropInstance"],se=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(re),ae={description:"",driver:oe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},le=function(){function e(t){for(var i in n(this,e),ie)if(ie.hasOwnProperty(i)){var o=ie[i],r=o._driver;this[i]=r,te[r]||this.defineDriver(o)}this._defaultConfig=z({},ae),this._config=z({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver)["catch"](function(){})}return e.prototype.config=function(e){if("object"===("undefined"==typeof e?"undefined":q(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"==t&&(e[t]=e[t].replace(/\W/g,"_")),"version"==t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var i=new M(function(t,n){try{var r=e._driver,s=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(s);for(var a=se.concat("_initStorage"),l=0,d=a.length;l<d;l++){var c=a[l],p=!$(re,c);if((p||e[c])&&"function"!=typeof e[c])return void n(s)}var h=function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=M.reject(t);return o(n,arguments[arguments.length-1]),n}},n=0,i=re.length,r;n<i;n++)r=re[n],e[r]||(e[r]=t(r))};h();var u=function(n){te[r]&&console.info("Redefining LocalForage driver: "+r),te[r]=e,ne[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(u,n):u(!!e._support):u(!0)}catch(t){n(t)}});return r(i,t,n),i},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var i=te[e]?M.resolve(te[e]):M.reject(new Error("Driver not found."));return r(i,t,n),i},e.prototype.getSerializer=function(e){var t=M.resolve(K);return r(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return r(n,e,e),n},e.prototype.setDriver=function(e,t,n){function i(){a._config.driver=a.driver()}function o(e){return a._extend(e),i(),a._ready=a._initStorage(a._config),a._ready}function s(e){return function(){function t(){for(;n<e.length;){var r=e[n];return n++,a._dbInfo=null,a._ready=null,a.getDriver(r).then(o)["catch"](t)}i();var s=new Error("No available storage method found.");return a._driverSet=M.reject(s),a._driverSet}var n=0;return t()}}var a=this;ee(e)||(e=[e]);var l=this._getSupportedDrivers(e),d=null===this._driverSet?M.resolve():this._driverSet["catch"](function(){return M.resolve()});return this._driverSet=d.then(function(){var e=l[0];return a._dbInfo=null,a._ready=null,a.getDriver(e).then(function(e){a._driver=e._driver,i(),a._wrapLibraryMethodsWithReady(),a._initDriver=s(l)})})["catch"](function(){i();var e=new Error("No available storage method found.");return a._driverSet=M.reject(e),a._driverSet}),r(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ne[e]},e.prototype._extend=function(e){z(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,o=e.length,r;n<o;n++)r=e[n],this.supports(r)&&t.push(r);return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=se.length;e<t;e++)D(this,se[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),de=new le;t.exports=de},{3:3}]},{},[4])(4)})}).call(this,n(30))},function(e,t,n){"use strict";function i(e,t,n,i){function o(t){d.reject(t)}function r(){if(this.readyState===XMLHttpRequest.DONE){var e=!1;if((""===this.responseType||"document"===this.responseType)&&(e=this.responseXML),200===this.status||0===this.status||e){var n;if(!this.response&&!e)return d.reject({status:this.status,message:"Empty Response",stack:new Error().stack}),d.promise;if(403===this.status)return d.reject({status:this.status,response:this.response,message:"Forbidden",stack:new Error().stack}),d.promise;n=e?this.responseXML:Object(l.isXml)(t)?Object(l.parse)(this.response,"text/xml"):"xhtml"==t?Object(l.parse)(this.response,"application/xhtml+xml"):"html"==t||"htm"==t?Object(l.parse)(this.response,"text/html"):"json"==t?JSON.parse(this.response):"blob"==t?s?this.response:new Blob([this.response]):this.response,d.resolve(n)}else d.reject({status:this.status,message:this.response,stack:new Error().stack})}}var s="undefined"!=typeof window&&window.URL,a=s?"blob":"arraybuffer",d=new l.defer,p=new XMLHttpRequest,h=XMLHttpRequest.prototype,u;for(u in"overrideMimeType"in h||Object.defineProperty(h,"overrideMimeType",{value:function(){}}),n&&(p.withCredentials=!0),p.onreadystatechange=r,p.onerror=o,p.open("GET",e,!0),i)p.setRequestHeader(u,i[u]);return"json"==t&&p.setRequestHeader("Accept","application/json"),t||(t=new c.a(e).extension),"blob"==t&&(p.responseType=a),Object(l.isXml)(t)&&p.overrideMimeType("text/xml"),"xhtml"==t,"html"!=t&&"htm"!=t,"binary"==t&&(p.responseType="arraybuffer"),p.send(),d.promise}var o=n(24),r=n(14),s=n(3),a=n.n(s),l=n(0),d=n(5),c=n(4),p=n(2),h=n(6),u=n(11),g=n(20),m=i,f=n(38);var y=class e{constructor(e,t){this.idref=e.idref,this.linear="yes"===e.linear,this.properties=e.properties,this.index=e.index,this.href=e.href,this.url=e.url,this.canonical=e.canonical,this.next=e.next,this.prev=e.prev,this.cfiBase=e.cfiBase,t?this.hooks=t:(this.hooks={},this.hooks.serialize=new h.a(this),this.hooks.content=new h.a(this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(e){var t=e||this.request||m,n=new l.defer,i=n.promise;return this.contents?n.resolve(this.contents):t(this.url).then(function(e){return this.document=e,this.contents=e.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){n.resolve(this.contents)}.bind(this)).catch(function(e){n.reject(e)}),i}base(){return Object(u.a)(this.document,this)}render(e){var t=new l.defer,n=t.promise;return this.output,this.load(e).then(function(e){var t="undefined"!=typeof navigator&&navigator.userAgent||"",n=0<=t.indexOf("Trident"),i;i="undefined"==typeof XMLSerializer||n?f.XMLDOMParser:XMLSerializer;var o=new i;return this.output=o.serializeToString(e),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){t.resolve(this.output)}.bind(this)).catch(function(e){t.reject(e)}),n}find(e){var t=this,n=[],i=e.toLowerCase(),o=function(e){for(var o=e.textContent.toLowerCase(),r=t.document.createRange(),s=-1,a=150,l,d,c;-1!=d;)d=o.indexOf(i,s+1),-1!=d&&(r=t.document.createRange(),r.setStart(e,d),r.setEnd(e,d+i.length),l=t.cfiFromRange(r),e.textContent.length<a?c=e.textContent:(c=e.textContent.substring(d-a/2,d+a/2),c="..."+c+"..."),n.push({cfi:l,excerpt:c})),s=d};return Object(l.sprint)(t.document,function(e){o(e)}),n}search(e,t=5){if("undefined"==typeof document.createTreeWalker)return this.find(e);let n=[];const i=this,o=e.toLowerCase(),r=function(e){const t=e.reduce((e,t)=>e+t.textContent,""),r=t.toLowerCase(),s=r.indexOf(o);if(-1!=s){const t=s+o.length;let r=0,a=0;if(s<e[0].length){let o;for(;r<e.length-1&&(a+=e[r].length,!(t<=a));)r+=1;let l=e[0],d=e[r],c=i.document.createRange();c.setStart(l,s);let p=e.slice(0,r).reduce((e,t)=>e+t.textContent.length,0);c.setEnd(d,p>t?t:t-p),o=i.cfiFromRange(c);let h=e.slice(0,r+1).reduce((e,t)=>e+t.textContent,"");h.length>150&&(h=h.substring(s-75,s+75),h="..."+h+"..."),n.push({cfi:o,excerpt:h})}}},s=document.createTreeWalker(i.document,NodeFilter.SHOW_TEXT,null,!1);let a=[],l;for(;l=s.nextNode();)a.push(l),a.length==t&&(r(a.slice(0,t)),a=a.slice(1,t));return 0<a.length&&r(a),n}reconcileLayoutSettings(e){var t={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach(function(e){var n=e.replace("rendition:",""),i=n.indexOf("-"),o,r;-1!=i&&(o=n.slice(0,i),r=n.slice(i+1),t[o]=r)}),t}cfiFromRange(e){return new p.a(e,this.cfiBase).toString()}cfiFromElement(e){return new p.a(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}};var b=class e{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new h.a,this.hooks.content=new h.a,this.hooks.content.register(u.a),this.hooks.content.register(u.b),this.hooks.content.register(u.d),this.epubcfi=new p.a,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,t,n){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||"",this.length=this.items.length,this.items.forEach((e,i)=>{var o=this.manifest[e.idref],r;e.index=i,e.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,e.index,e.idref),e.href&&(e.url=t(e.href,!0),e.canonical=n(e.href)),o&&(e.href=o.href,e.url=t(e.href,!0),e.canonical=n(e.href),o.properties.length&&e.properties.push.apply(e.properties,o.properties)),"yes"===e.linear?(e.prev=function(){for(let t=e.index;0<t;){let e=this.get(t-1);if(e&&e.linear)return e;t-=1}}.bind(this),e.next=function(){for(let t=e.index;t<this.spineItems.length-1;){let e=this.get(t+1);if(e&&e.linear)return e;t+=1}}.bind(this)):(e.prev=function(){},e.next=function(){}),r=new y(e,this.hooks),this.append(r)}),this.loaded=!0}get(e){var t=0;if("undefined"==typeof e)for(;t<this.spineItems.length;){let e=this.spineItems[t];if(e&&e.linear)break;t+=1}else if(this.epubcfi.isCfiString(e)){let n=new p.a(e);t=n.spinePos}else"number"==typeof e||!1===isNaN(e)?t=e:"string"==typeof e&&0===e.indexOf("#")?t=this.spineById[e.substring(1)]:"string"==typeof e&&(e=e.split("#")[0],t=this.spineByHref[e]||this.spineByHref[encodeURI(e)]);return this.spineItems[t]||null}append(e){var t=this.spineItems.length;return e.index=t,this.spineItems.push(e),this.spineByHref[decodeURI(e.href)]=t,this.spineByHref[encodeURI(e.href)]=t,this.spineByHref[e.href]=t,this.spineById[e.idref]=t,t}prepend(e){return this.spineByHref[e.href]=0,this.spineById[e.idref]=0,this.spineItems.forEach(function(e,t){e.index=t}),0}remove(e){var t=this.spineItems.indexOf(e);if(-1<t)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(t,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let t=this.get(e);if(t&&t.linear)return t;e+=1}while(e<this.spineItems.length)}last(){let e=this.spineItems.length-1;do{let t=this.get(e);if(t&&t.linear)return t;e-=1}while(0<=e)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}},v=n(21),x=n(1);class E{constructor(e,t,n){this.spine=e,this.request=t,this.pause=n||100,this.q=new v.a(this),this.epubcfi=new p.a,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each(function(e){e.linear&&this.q.enqueue(this.process.bind(this),e)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))}createRange(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}process(e){return e.load(this.request).then(function(t){var n=new l.defer,i=this.parse(t,e.cfiBase);return this._locations=this._locations.concat(i),e.unload(),this.processingTimeout=setTimeout(()=>n.resolve(i),this.pause),n.promise}.bind(this))}parse(e,t,n){var i=[],o=e.ownerDocument,r=Object(l.qs)(o,"body"),s=0,a=n||this.break,d=function(e){var n=e.length,o=0,r;if(0===e.textContent.trim().length)return!1;for(0==s&&(c=this.createRange(),c.startContainer=e,c.startOffset=0),r=a-s,r>n&&(s+=n,o=n);o<n;)if(r=a-s,0===s&&(o+=1,c=this.createRange(),c.startContainer=e,c.startOffset=o),o+r>=n)s+=n-o,o=n;else{o+=r,c.endContainer=e,c.endOffset=o;let n=new p.a(c,t).toString();i.push(n),s=0}h=e},c,h;if(Object(l.sprint)(r,d.bind(this)),c&&c.startContainer&&h){c.endContainer=h,c.endOffset=h.length;let e=new p.a(c,t).toString();i.push(e),s=0}return i}generateFromWords(e,t,n){var i=e?new p.a(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each(function(e){e.linear&&(i?e.index>=i.spinePos&&this.q.enqueue(this.processWords.bind(this),e,t,i,n):this.q.enqueue(this.processWords.bind(this),e,t,i,n))}.bind(this)),this.q.run().then(function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}.bind(this))}processWords(e,t,n,i){return i&&this._locationsWords.length>=i?Promise.resolve():e.load(this.request).then(function(o){var r=new l.defer,s=this.parseWords(o,e,t,n),a=i-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(s.length>=i?s.slice(0,a):s),e.unload(),this.processingTimeout=setTimeout(()=>r.resolve(s),this.pause),r.promise}.bind(this))}countWords(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n"),e.split(" ").length}parseWords(e,t,n,i){var o=t.cfiBase,r=[],s=e.ownerDocument,a=Object(l.qs)(s,"body"),d=n,c=!i||i.spinePos!==t.index,h;i&&t.index===i.spinePos&&(h=i.findNode(i.range?i.path.steps.concat(i.start.steps):i.path.steps,e.ownerDocument));var u=function(e){if(!c)if(e===h)c=!0;else return!1;if(10>e.textContent.length&&0===e.textContent.trim().length)return!1;var t=this.countWords(e.textContent),n=0,i;if(0===t)return!1;for(i=d-this._wordCounter,i>t&&(this._wordCounter+=t,n=t);n<t;)if(i=d-this._wordCounter,n+i>=t)this._wordCounter+=t-n,n=t;else{n+=i;let t=new p.a(e,o);r.push({cfi:t.toString(),wordCount:this._wordCounter}),this._wordCounter=0}};return Object(l.sprint)(a,u.bind(this)),r}locationFromCfi(e){let t;return(p.a.prototype.isCfiString(e)&&(e=new p.a(e)),0===this._locations.length)?-1:(t=Object(l.locationOf)(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(0===this._locations.length)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return e&&this.total?e/this.total:0}cfiFromLocation(e){var t=-1;return"number"!=typeof e&&(e=parseInt(e)),0<=e&&e<this._locations.length&&(t=this._locations[e]),t}cfiFromPercentage(e){let t;if(1<e&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),1<=e){let e=new p.a(this._locations[this.total]);return e.collapse(),e.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return this._locations="string"==typeof e?JSON.parse(e):e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if("string"==typeof e)this._currentCfi=e;else if("number"==typeof e)this._current=e;else return;0===this._locations.length||("string"==typeof e?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit(x.c.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}}a()(E.prototype);var _=n(9),w=n.n(_);var S=class e{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var t;if(!e)throw new Error("Container File Not Found");if(t=Object(l.qs)(e,"rootfile"),!t)throw new Error("No RootFile Found");this.packagePath=t.getAttribute("full-path"),this.directory=w.a.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}};var C=class e{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,n,i;if(!e)throw new Error("Package File Not Found");if(t=Object(l.qs)(e,"metadata"),!t)throw new Error("No Metadata Found");if(n=Object(l.qs)(e,"manifest"),!n)throw new Error("No Manifest Found");if(i=Object(l.qs)(e,"spine"),!i)throw new Error("No Spine Found");return this.manifest=this.parseManifest(n),this.navPath=this.findNavPath(n),this.ncxPath=this.findNcxPath(n,i),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=Object(l.indexOfElementNode)(i),this.spine=this.parseSpine(i,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=i.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var t={title:this.getElementText(e,"title"),creator:this.getElementText(e,"creator"),description:this.getElementText(e,"description"),pubdate:this.getElementText(e,"date"),publisher:this.getElementText(e,"publisher"),identifier:this.getElementText(e,"identifier"),language:this.getElementText(e,"language"),rights:this.getElementText(e,"rights"),modified_date:this.getPropertyText(e,"dcterms:modified"),layout:this.getPropertyText(e,"rendition:layout"),orientation:this.getPropertyText(e,"rendition:orientation"),flow:this.getPropertyText(e,"rendition:flow"),viewport:this.getPropertyText(e,"rendition:viewport"),media_active_class:this.getPropertyText(e,"media:active-class"),spread:this.getPropertyText(e,"rendition:spread")};return t}parseManifest(e){var t={},n=Object(l.qsa)(e,"item"),i=Array.prototype.slice.call(n);return i.forEach(function(e){var n=e.getAttribute("id"),i=e.getAttribute("href")||"",o=e.getAttribute("media-type")||"",r=e.getAttribute("media-overlay")||"",s=e.getAttribute("properties")||"";t[n]={href:i,type:o,overlay:r,properties:s.length?s.split(" "):[]}}),t}parseSpine(e){var t=[],n=Object(l.qsa)(e,"itemref"),i=Array.prototype.slice.call(n);return i.forEach(function(e,n){var i=e.getAttribute("idref"),o=e.getAttribute("properties")||"",r=o.length?o.split(" "):[],s={idref:i,linear:e.getAttribute("linear")||"yes",properties:r,index:n};t.push(s)}),t}findUniqueIdentifier(e){var t=e.documentElement.getAttribute("unique-identifier");if(!t)return"";var n=e.getElementById(t);return n?"identifier"===n.localName&&"http://purl.org/dc/elements/1.1/"===n.namespaceURI?0<n.childNodes.length?n.childNodes[0].nodeValue.trim():"":"":""}findNavPath(e){var t=Object(l.qsp)(e,"item",{properties:"nav"});return!!t&&t.getAttribute("href")}findNcxPath(e,t){var n=Object(l.qsp)(e,"item",{"media-type":"application/x-dtbncx+xml"}),i;return n||(i=t.getAttribute("toc"),i&&(n=e.querySelector(`#${i}`))),!!n&&n.getAttribute("href")}findCoverPath(e){var t=Object(l.qs)(e,"package"),n=t.getAttribute("version"),i=Object(l.qsp)(e,"item",{properties:"cover-image"});if(i)return i.getAttribute("href");var o=Object(l.qsp)(e,"meta",{name:"cover"});if(o){var r=o.getAttribute("content"),s=e.getElementById(r);return s?s.getAttribute("href"):""}return!1}getElementText(e,t){var n=e.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",t),i;return n&&0!==n.length?(i=n[0],i.childNodes.length?i.childNodes[0].nodeValue:""):""}getPropertyText(e,t){var n=Object(l.qsp)(e,"meta",{property:t});return n&&n.childNodes.length?n.childNodes[0].nodeValue:""}load(e){this.metadata=e.metadata;let t=e.readingOrder||e.spine;return this.spine=t.map((e,t)=>(e.index=t,e.linear=e.linear||"yes",e)),e.resources.forEach((e,t)=>{this.manifest[t]=e,e.rel&&"cover"===e.rel[0]&&(this.coverPath=e.href)}),this.spineNodeIndex=0,this.toc=e.toc.map(e=>(e.label=e.title,e)),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}}destroy(){this.manifest=void 0,this.navPath=void 0,this.ncxPath=void 0,this.coverPath=void 0,this.spineNodeIndex=void 0,this.spine=void 0,this.metadata=void 0}};var T=class e{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let t=e.nodeType,n,i;t&&(n=Object(l.qs)(e,"html"),i=Object(l.qs)(e,"ncx")),t?n?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):i&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var t=0,n;t<e.length;t++)n=e[t],n.href&&(this.tocByHref[n.href]=t),n.id&&(this.tocById[n.id]=t),this.length++,n.subitems.length&&this.unpack(n.subitems)}get(e){var t;return e?(0===e.indexOf("#")?t=this.tocById[e.substring(1)]:e in this.tocByHref&&(t=this.tocByHref[e]),this.getByIndex(e,t,this.toc)):this.toc}getByIndex(e,t,n){if(0!==n.length){const i=n[t];if(i&&(e===i.id||e===i.href))return i;else{let o;for(let r=0;r<n.length&&(o=this.getByIndex(e,t,n[r].subitems),!o);++r);return o}}}landmark(e){var t;return e?(t=this.landmarksByType[e],this.landmarks[t]):this.landmarks}parseNav(e){var t=Object(l.querySelectorByType)(e,"nav","toc"),n=t?Object(l.qsa)(t,"li"):[],o=n.length,r={},s=[],a,d,c;if(!n||0===o)return s;for(a=0;a<o;++a)d=this.navItem(n[a]),d&&(r[d.id]=d,d.parent?(c=r[d.parent],c.subitems.push(d)):s.push(d));return s}navItem(e){let t=e.getAttribute("id")||void 0,n=Object(l.filterChildren)(e,"a",!0);if(!n)return;let i=n.getAttribute("href")||"";t||(t=i);let o=n.textContent||"",r=Object(l.getParentByTagName)(e,"li"),s;if(r&&(s=r.getAttribute("id"),!s)){const e=Object(l.filterChildren)(r,"a",!0);s=e&&e.getAttribute("href")}for(;!s&&r;)if(r=Object(l.getParentByTagName)(r,"li"),r&&(s=r.getAttribute("id"),!s)){const e=Object(l.filterChildren)(r,"a",!0);s=e&&e.getAttribute("href")}return{id:t,href:i,label:o,subitems:[],parent:s}}parseLandmarks(e){var t=Object(l.querySelectorByType)(e,"nav","landmarks"),n=t?Object(l.qsa)(t,"li"):[],o=n.length,r=[],s,a;if(!n||0===o)return r;for(s=0;s<o;++s)a=this.landmarkItem(n[s]),a&&(r.push(a),this.landmarksByType[a.type]=s);return r}landmarkItem(e){let t=Object(l.filterChildren)(e,"a",!0);if(!t)return;let n=t.getAttributeNS("http://www.idpf.org/2007/ops","type")||void 0,i=t.getAttribute("href")||"",o=t.textContent||"";return{href:i,label:o,type:n}}parseNcx(e){var t=Object(l.qsa)(e,"navPoint"),n=t.length,o={},r=[],s,a,d;if(!t||0===n)return r;for(s=0;s<n;++s)a=this.ncxItem(t[s]),o[a.id]=a,a.parent?(d=o[a.parent],d.subitems.push(a)):r.push(a);return r}ncxItem(e){var t=e.getAttribute("id")||!1,n=Object(l.qs)(e,"content"),i=n.getAttribute("src"),o=Object(l.qs)(e,"navLabel"),r=o.textContent?o.textContent:"",s=e.parentNode,a;return s&&("navPoint"===s.nodeName||"navPoint"===s.nodeName.split(":").slice(-1)[0])&&(a=s.getAttribute("id")),{id:t,href:i,label:r,subitems:[],parent:a}}load(e){return e.map(e=>(e.label=e.title,e.subitems=e.children?this.load(e.children):[],e))}forEach(e){return this.toc.forEach(e)}},k={application:{ecmascript:["es","ecma"],javascript:"js",ogg:"ogx",pdf:"pdf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],"rdf+xml":"rdf",smil:["smi","smil"],"xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","opf","ncx"],zip:"zip","x-httpd-eruby":"rhtml","x-latex":"latex","x-maker":["frm","maker","frame","fm","fb","book","fbdoc"],"x-object":"o","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","epub+zip":"epub","font-tdpfr":"pfr","inkml+xml":["ink","inkml"],json:"json","jsonml+json":"jsonml","mathml+xml":"mathml","metalink+xml":"metalink",mp4:"mp4s","omdoc+xml":"omdoc",oxps:"oxps","vnd.amazon.ebook":"azw",widget:"wgt","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-otf":"otf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-font-woff":"woff","x-mobipocket-ebook":["prc","mobi"],"x-mspublisher":"pub","x-nzb":"nzb","x-tgif":"obj","xaml+xml":"xaml","xml-dtd":"dtd","xproc+xml":"xpl","xslt+xml":"xslt","internet-property-stream":"acx","x-compress":"z","x-compressed":"tgz","x-gzip":"gz"},audio:{flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp2","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"x-aiff":["aif","aiff","aifc"],"x-ms-wma":"wma","x-wav":"wav",adpcm:"adp",mp4:"mp4a",webm:"weba","x-aac":"aac","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",mid:["mid","rmi"]},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"x-icon":"ico",bmp:"bmp",webp:"webp","x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod"},text:{"cache-manifest":["manifest","appcache"],css:"css",csv:"csv",html:["html","htm","shtml","stm"],mathml:"mml",plain:["txt","text","brf","conf","def","list","log","in","bas"],richtext:"rtx","tab-separated-values":"tsv","x-bibtex":"bib"},video:{mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv"}},R=function(){var e={},t,n,i,o;for(t in k)if(k.hasOwnProperty(t))for(n in k[t])if(k[t].hasOwnProperty(n))if(i=k[t][n],"string"==typeof i)e[i]=t+"/"+n;else for(o=0;o<i.length;o++)e[i[o]]=t+"/"+n;return e}();var I={lookup:function(e){return e&&R[e.split(".").pop().toLowerCase()]||"text/plain"}};var N=class e{constructor(e,t){this.settings={replacements:t&&t.replacements||"base64",archive:t&&t.archive,resolver:t&&t.resolver,request:t&&t.request},this.process(e)}process(e){this.manifest=e,this.resources=Object.keys(e).map(function(t){return e[t]}),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()}split(){this.html=this.resources.filter(function(e){if("application/xhtml+xml"===e.type||"text/html"===e.type)return!0}),this.assets=this.resources.filter(function(e){if("application/xhtml+xml"!==e.type&&"text/html"!==e.type)return!0}),this.css=this.resources.filter(function(e){if("text/css"===e.type)return!0})}splitUrls(){this.urls=this.assets.map(function(e){return e.href}.bind(this)),this.cssUrls=this.css.map(function(e){return e.href})}createUrl(e){var t=new d.a(e),n=I.lookup(t.filename);return this.settings.archive?this.settings.archive.createUrl(e,{base64:"base64"===this.settings.replacements}):"base64"===this.settings.replacements?this.settings.request(e,"blob").then(e=>Object(l.blob2base64)(e)).then(e=>Object(l.createBase64Url)(e,n)):this.settings.request(e,"blob").then(e=>Object(l.createBlobUrl)(e,n))}replacements(){if("none"===this.settings.replacements)return new Promise(function(e){e(this.urls)}.bind(this));var e=this.urls.map(e=>{var t=this.settings.resolver(e);return this.createUrl(t).catch(e=>(console.error(e),null))});return Promise.all(e).then(e=>(this.replacementUrls=e.filter(e=>"string"==typeof e),e))}replaceCss(e,t){var n=[];return e=e||this.settings.archive,t=t||this.settings.resolver,this.cssUrls.forEach(function(i){var o=this.createCssFile(i,e,t).then(function(e){var t=this.urls.indexOf(i);-1<t&&(this.replacementUrls[t]=e)}.bind(this));n.push(o)}.bind(this)),Promise.all(n)}createCssFile(e){var t;if(w.a.isAbsolute(e))return new Promise(function(e){e()});var n=this.settings.resolver(e),i;i=this.settings.archive?this.settings.archive.getText(n):this.settings.request(n,"text");var o=this.urls.map(e=>{var t=this.settings.resolver(e),i=new c.a(n).relative(t);return i});return i?i.then(e=>(e=Object(u.e)(e,o,this.replacementUrls),t="base64"===this.settings.replacements?Object(l.createBase64Url)(e,"text/css"):Object(l.createBlobUrl)(e,"text/css"),t),()=>new Promise(function(e){e()})):new Promise(function(e){e()})}relativeTo(e,t){return t=t||this.settings.resolver,this.urls.map(function(n){var i=t(n),o=new c.a(e).relative(i);return o}.bind(this))}get(e){var t=this.urls.indexOf(e);return-1===t?void 0:this.replacementUrls.length?new Promise(function(e){e(this.replacementUrls[t])}.bind(this)):this.createUrl(e)}substitute(e,t){var n;return n=t?this.relativeTo(t):this.urls,Object(u.e)(e,n,this.replacementUrls)}destroy(){this.settings=void 0,this.manifest=void 0,this.resources=void 0,this.replacementUrls=void 0,this.html=void 0,this.assets=void 0,this.css=void 0,this.urls=void 0,this.cssUrls=void 0}};var L=class e{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new p.a,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var t=Object(l.qs)(e,"html"),n=Object(l.qs)(e,"ncx");if(t)return this.parseNav(e);return n?this.parseNcx(e):void 0}parseNav(e){var t=Object(l.querySelectorByType)(e,"nav","page-list"),n=t?Object(l.qsa)(t,"li"):[],o=n.length,r=[],s,a;if(!n||0===o)return r;for(s=0;s<o;++s)a=this.item(n[s]),r.push(a);return r}parseNcx(e){var t=[],n=0,o=0,r,s,a;if(s=Object(l.qs)(e,"pageList"),!s)return t;if(a=Object(l.qsa)(s,"pageTarget"),o=a.length,!a||0===a.length)return t;for(n=0;n<o;++n)r=this.ncxItem(a[n]),t.push(r);return t}ncxItem(e){var t=Object(l.qs)(e,"navLabel"),n=Object(l.qs)(t,"text"),i=n.textContent,o=Object(l.qs)(e,"content"),r=o.getAttribute("src"),s=parseInt(i,10);return{href:r,page:s}}item(e){var t=Object(l.qs)(e,"a"),n=t.getAttribute("href")||"",i=t.textContent||"",o=parseInt(i),r=n.indexOf("epubcfi"),s,a,d;return-1==r?{href:n,page:o}:(s=n.split("#"),a=s[0],d=!!(1<s.length)&&s[1],{cfi:d,href:n,packageUrl:a,page:o})}process(e){e.forEach(function(e){this.pages.push(e.page),e.cfi&&this.locations.push(e.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(e){var t=-1;if(0===this.locations.length)return-1;var n=Object(l.indexOfSorted)(e,this.locations,this.epubcfi.compare);return-1==n?(n=Object(l.locationOf)(e,this.locations,this.epubcfi.compare),t=0<=n-1?this.pages[n-1]:this.pages[0],void 0!==t||(t=-1)):t=this.pages[n],t}cfiFromPage(e){var t=-1;"number"!=typeof e&&(e=parseInt(e));var n=this.pages.indexOf(e);return-1!=n&&(t=this.locations[n]),t}pageFromPercentage(e){var t=Math.round(this.totalPages*e);return t}percentageFromPage(e){var t=(e-this.firstPage)/this.totalPages;return Math.round(1e3*t)/1e3}percentageFromCfi(e){var t=this.pageFromCfi(e),n=this.percentageFromPage(t);return n}destroy(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0}},A=n(39),O=n(85),P=n.n(O);var D=class e{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new P.a}catch(t){throw new Error("JSZip lib not loaded")}}open(e,t){return this.zip.loadAsync(e,{base64:t})}openUrl(e,t){return m(e,"binary").then(function(e){return this.zip.loadAsync(e,{base64:t})}.bind(this))}request(e,t){var n=new l.defer,i=new c.a(e),o;return t||(t=i.extension),o="blob"==t?this.getBlob(e):this.getText(e),o?o.then(function(e){let i=this.handleResponse(e,t);n.resolve(i)}.bind(this)):n.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),n.promise}handleResponse(e,t){var n;return n="json"==t?JSON.parse(e):Object(l.isXml)(t)?Object(l.parse)(e,"text/xml"):"xhtml"==t?Object(l.parse)(e,"application/xhtml+xml"):"html"==t||"htm"==t?Object(l.parse)(e,"text/html"):e,n}getBlob(e,t){var n=window.decodeURIComponent(e.substr(1)),i=this.zip.file(n);if(i)return t=t||I.lookup(i.name),i.async("uint8array").then(function(e){return new Blob([e],{type:t})})}getText(e){var t=window.decodeURIComponent(e.substr(1)),n=this.zip.file(t);if(n)return n.async("string").then(function(e){return e})}getBase64(e,t){var n=window.decodeURIComponent(e.substr(1)),i=this.zip.file(n);if(i)return t=t||I.lookup(i.name),i.async("base64").then(function(e){return"data:"+t+";base64,"+e})}createUrl(e,t){var n=new l.defer,i=window.URL||window.webkitURL||window.mozURL,o=t&&t.base64,r,s;return e in this.urlCache?(n.resolve(this.urlCache[e]),n.promise):(o?(s=this.getBase64(e),s&&s.then(function(t){this.urlCache[e]=t,n.resolve(t)}.bind(this))):(s=this.getBlob(e),s&&s.then(function(t){r=i.createObjectURL(t),this.urlCache[e]=r,n.resolve(r)}.bind(this))),s||n.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),n.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,n=this.urlCache[e];n&&t.revokeObjectURL(n)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.zip=void 0,this.urlCache={}}},z=n(57),q=n.n(z);class B{constructor(e,t,n){this.urlCache={},this.storage=void 0,this.name=e,this.requester=t||m,this.resolver=n,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let e;"undefined"==typeof q.a&&(e=q.a),this.storage=e.createInstance({name:this.name})}catch(t){throw new Error("localForage lib not loaded")}}addListeners(){this._status=this.status.bind(this),window.addEventListener("online",this._status),window.addEventListener("offline",this._status)}removeListeners(){window.removeEventListener("online",this._status),window.removeEventListener("offline",this._status),this._status=void 0}status(){let e=navigator.onLine;this.online=e,e?this.emit("online",this):this.emit("offline",this)}add(e,t){let n=e.resources.map(e=>{let{href:n}=e,i=this.resolver(n),o=window.encodeURIComponent(i);return this.storage.getItem(o).then(e=>!e||t?this.requester(i,"binary").then(e=>this.storage.setItem(o,e)):e)});return Promise.all(n)}put(e,t,n){let i=window.encodeURIComponent(e);return this.storage.getItem(i).then(o=>o?o:this.requester(e,"binary",t,n).then(e=>this.storage.setItem(i,e)))}request(e,t,n,i){return this.online?this.requester(e,t,n,i).then(t=>(this.put(e),t)):this.retrieve(e,t)}retrieve(e,t){var n=new l.defer,i=new c.a(e),o;return t||(t=i.extension),o="blob"==t?this.getBlob(e):this.getText(e),o.then(n=>{var i=new l.defer,o;return n?(o=this.handleResponse(n,t),i.resolve(o)):i.reject({message:"File not found in storage: "+e,stack:new Error().stack}),i.promise})}handleResponse(e,t){var n;return n="json"==t?JSON.parse(e):Object(l.isXml)(t)?Object(l.parse)(e,"text/xml"):"xhtml"==t?Object(l.parse)(e,"application/xhtml+xml"):"html"==t||"htm"==t?Object(l.parse)(e,"text/html"):e,n}getBlob(e,t){let n=window.encodeURIComponent(e);return this.storage.getItem(n).then(function(n){if(n)return t=t||I.lookup(e),new Blob([n],{type:t})})}getText(e,t){let n=window.encodeURIComponent(e);return t=t||I.lookup(e),this.storage.getItem(n).then(function(e){var n=new l.defer,i=new FileReader,o;if(e)return o=new Blob([e],{type:t}),i.addEventListener("loadend",()=>{n.resolve(i.result)}),i.readAsText(o,t),n.promise})}getBase64(e,t){let n=window.encodeURIComponent(e);return t=t||I.lookup(e),this.storage.getItem(n).then(e=>{var n=new l.defer,i=new FileReader,o;if(e)return o=new Blob([e],{type:t}),i.addEventListener("loadend",()=>{n.resolve(i.result)}),i.readAsDataURL(o,t),n.promise})}createUrl(e,t){var n=new l.defer,i=window.URL||window.webkitURL||window.mozURL,o=t&&t.base64,r,s;return e in this.urlCache?(n.resolve(this.urlCache[e]),n.promise):(o?(s=this.getBase64(e),s&&s.then(function(t){this.urlCache[e]=t,n.resolve(t)}.bind(this))):(s=this.getBlob(e),s&&s.then(function(t){r=i.createObjectURL(t),this.urlCache[e]=r,n.resolve(r)}.bind(this))),s||n.reject({message:"File not found in storage: "+e,stack:new Error().stack}),n.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,n=this.urlCache[e];n&&t.revokeObjectURL(n)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.urlCache={},this.removeListeners()}}a()(B.prototype);var j=class e{constructor(e){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",e&&this.parse(e)}parse(e){if(!e)return this;const t=Object(l.qs)(e,"display_options");if(!t)return this;const n=Object(l.qsa)(t,"option");return n.forEach(e=>{let t="";switch(e.childNodes.length&&(t=e.childNodes[0].nodeValue),e.attributes.name.value){case"interactive":this.interactive=t;break;case"fixed-layout":this.fixedLayout=t;break;case"open-to-spread":this.openToSpread=t;break;case"orientation-lock":this.orientationLock=t;}}),this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}};const M={BINARY:"binary",BASE64:"base64",EPUB:"epub",OPF:"opf",MANIFEST:"json",DIRECTORY:"directory"};class U{constructor(e,t){"undefined"==typeof t&&"string"!=typeof e&&!1==e instanceof Blob&&!1==e instanceof ArrayBuffer&&(t=e,e=void 0),this.settings=Object(l.extend)(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:void 0,canonical:void 0,openAs:void 0,store:void 0}),Object(l.extend)(this.settings,t),this.opening=new l.defer,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new l.defer,spine:new l.defer,metadata:new l.defer,cover:new l.defer,navigation:new l.defer,pageList:new l.defer,resources:new l.defer,displayOptions:new l.defer},this.loaded={manifest:this.loading.manifest.promise,spine:this.loading.spine.promise,metadata:this.loading.metadata.promise,cover:this.loading.cover.promise,navigation:this.loading.navigation.promise,pageList:this.loading.pageList.promise,resources:this.loading.resources.promise,displayOptions:this.loading.displayOptions.promise},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources,this.loaded.displayOptions]),this.isRendered=!1,this.request=this.settings.requestMethod||m,this.spine=new b,this.locations=new E(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),e&&this.open(e,this.settings.openAs).catch(()=>{var t=new Error("Cannot load book at "+e);this.emit(x.c.BOOK.OPEN_FAILED,t)})}open(e){return this.archived=!0,this.url=new d.a("/",""),this.request(e,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))}openEpub(e,t){return this.unarchive(e,t||this.settings.encoding).then(()=>this.openContainer("META-INF/container.xml")).then(e=>this.openPackaging(e))}openContainer(e){return this.load(e).then(e=>(this.container=new S(e),this.resolve(this.container.packagePath)))}openPackaging(e){return this.path=new c.a(e),this.load(e).then(e=>(this.packaging=new C(e),this.unpack(this.packaging)))}openManifest(e){return this.path=new c.a(e),this.load(e).then(e=>(this.packaging=new C,this.packaging.load(e),this.unpack(this.packaging)))}load(e){var t=this.resolve(e);return this.archived?this.archive.request(t):this.request(t,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(e,t){if(e){var n=e,i=-1<e.indexOf("://");return i?e:(this.path&&(n=this.path.resolve(e)),!1!=t&&this.url&&(n=this.url.resolve(n)),n)}}canonical(e){var t=e;return e?(t=this.settings.canonical?this.settings.canonical(e):this.resolve(e,!0),t):""}determineType(e){var t,n,i;return"base64"===this.settings.encoding?M.BASE64:"string"==typeof e?(t=new d.a(e),n=t.path(),i=n.extension,i&&(i=i.replace(/\?.*$/,"")),i?"epub"===i?M.EPUB:"opf"===i?M.OPF:"json"===i?M.MANIFEST:void 0:M.DIRECTORY):M.BINARY}unpack(e){this.package=e,""===this.packaging.metadata.layout?this.load(this.url.resolve("META-INF/com.apple.ibooks.display-options.xml")).then(e=>{this.displayOptions=new j(e),this.loading.displayOptions.resolve(this.displayOptions)}).catch(()=>{this.displayOptions=new j,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new j,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new N(this.packaging.manifest,{archive:this.archive,resolver:this.resolve.bind(this),request:this.request.bind(this),replacements:this.settings.replacements||(this.archived?"blobUrl":"base64")}),this.loadNavigation(this.packaging).then(()=>{this.loading.navigation.resolve(this.navigation)}),this.packaging.coverPath&&(this.cover=this.resolve(this.packaging.coverPath)),this.loading.manifest.resolve(this.packaging.manifest),this.loading.metadata.resolve(this.packaging.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived||this.settings.replacements&&"none"!=this.settings.replacements?this.replacements().then(()=>{this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}).catch(e=>{console.error(e)}):this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}loadNavigation(e){let t=e.navPath||e.ncxPath,n=e.toc;return n?new Promise(t=>{this.navigation=new T(n),e.pageList&&(this.pageList=new L(e.pageList)),t(this.navigation)}):t?this.load(t,"xml").then(e=>(this.navigation=new T(e),this.pageList=new L(e),this.navigation)):new Promise(e=>{this.navigation=new T,this.pageList=new L,e(this.navigation)})}section(e){return this.spine.get(e)}renderTo(e,t){return this.rendition=new A.a(this,t),this.rendition.attachTo(e),this.rendition}setRequestCredentials(e){this.settings.requestCredentials=e}setRequestHeaders(e){this.settings.requestHeaders=e}unarchive(e,t){return this.archive=new D,this.archive.open(e,t)}store(e){let t=this.settings.replacements&&"none"!==this.settings.replacements,n=this.url,i=this.settings.requestMethod||m.bind(this);return this.storage=new B(e,i,this.resolve.bind(this)),this.request=this.storage.request.bind(this.storage),this.opened.then(()=>{this.archived&&(this.storage.requester=this.archive.request.bind(this.archive));let e=(e,t)=>{t.output=this.resources.substitute(e,t.url)};this.resources.settings.replacements=t||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new d.a("/",""),this.spine.hooks.serialize.register(e)}),this.storage.on("online",()=>{this.url=n,this.spine.hooks.serialize.deregister(e)})}),this.storage}coverUrl(){return this.loaded.cover.then(()=>this.cover?this.archived?this.archive.createUrl(this.cover):this.cover:null)}replacements(){return this.spine.hooks.serialize.register((e,t)=>{t.output=this.resources.substitute(e,t.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(e){var t=new p.a(e),n=this.spine.get(t.spinePos),i=this.load.bind(this);return n?n.load(i).then(function(){var e=t.toRange(n.document);return e}):new Promise((e,t)=>{t("CFI could not be found")})}key(e){var t=e||this.packaging.metadata.identifier||this.url.filename;return`epubjs:${x.b}:${t}`}destroy(){this.opened=void 0,this.loading=void 0,this.loaded=void 0,this.ready=void 0,this.isOpen=!1,this.isRendered=!1,this.spine&&this.spine.destroy(),this.locations&&this.locations.destroy(),this.pageList&&this.pageList.destroy(),this.archive&&this.archive.destroy(),this.resources&&this.resources.destroy(),this.container&&this.container.destroy(),this.packaging&&this.packaging.destroy(),this.rendition&&this.rendition.destroy(),this.displayOptions&&this.displayOptions.destroy(),this.spine=void 0,this.locations=void 0,this.pageList=void 0,this.archive=void 0,this.resources=void 0,this.container=void 0,this.packaging=void 0,this.rendition=void 0,this.navigation=void 0,this.url=void 0,this.path=void 0,this.archived=!1}}a()(U.prototype);t.a=U},function(e,t,n){var i=n(16),o=n(60),r=n(25),s=n(32),a=n(41),l=n(10),d=n(62),c=Object.getOwnPropertyDescriptor;t.f=i?c:function(e,t){if(e=s(e),t=a(t,!0),d)try{return c(e,t)}catch(e){}return l(e,t)?r(!o.f.call(e,t),e[t]):void 0}},function(e,t){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);t.f=o?function(e){var t=i(this,e);return!!t&&t.enumerable}:n},function(e,t,n){var i=n(12),o=n(40),r="".split;e.exports=i(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==o(e)?r.call(e,""):Object(e)}:Object},function(e,t,n){var i=n(16),o=n(12),r=n(63);e.exports=!i&&!o(function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(7),o=n(17),r=i.document,s=o(r)&&o(r.createElement);e.exports=function(e){return s?r.createElement(e):{}}},function(e,t,n){var i=n(65),o=Function.toString;"function"!=typeof i.inspectSource&&(i.inspectSource=function(e){return o.call(e)}),e.exports=i.inspectSource},function(e,t,n){var i=n(7),o=n(42),r="__core-js_shared__",s=i[r]||o(r,{});e.exports=s},function(e,t,n){var i=n(34),o=n(65);(e.exports=function(e,t){return o[e]||(o[e]=t===void 0?{}:t)})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"\xA9 2020 Denis Pushkarev (zloirock.ru)"})},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+((e===void 0?"":e)+"")+")_"+(++t+n).toString(36)}},function(e,t,n){var o=n(10),r=n(32),s=n(94).indexOf,a=n(44);e.exports=function(e,t){var n=r(e),l=0,d=[],c;for(c in n)!o(a,c)&&o(n,c)&&d.push(c);for(;t.length>l;)o(n,c=t[l++])&&(~s(d,c)||d.push(c));return d}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var i=n(12);e.exports=!!Object.getOwnPropertySymbols&&!i(function(){return!(Symbol()+"")})},function(e,t,n){"use strict";var i=n(32),o=n(103),r=n(27),s=n(26),a=n(74),l="Array Iterator",d=s.set,c=s.getterFor(l);e.exports=a(Array,"Array",function(e,t){d(this,{type:l,target:i(e),index:0,kind:t})},function(){var e=c(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}},"values"),r.Arguments=r.Array,o("keys"),o("values"),o("entries")},function(e,t,n){var i=n(16),o=n(18),r=n(13),s=n(73);e.exports=i?Object.defineProperties:function(e,t){r(e);for(var n=s(t),i=n.length,a=0,l;i>a;)o.f(e,l=n[a++],t[l]);return e}},function(e,t,n){var i=n(68),o=n(47);e.exports=Object.keys||function(e){return i(e,o)}},function(e,t,n){"use strict";var i=n(31),o=n(75),r=n(77),s=n(106),a=n(37),l=n(15),d=n(19),c=n(8),p=n(34),h=n(27),u=n(76),g=u.IteratorPrototype,m=u.BUGGY_SAFARI_ITERATORS,f=c("iterator"),y="keys",b="values",v="entries",x=function(){return this};e.exports=function(e,t,n,c,u,E,_){o(n,t,c);var w=function(e){return e===u&&R?R:!m&&e in T?T[e]:e===y?function(){return new n(this,e)}:e===b?function(){return new n(this,e)}:e===v?function(){return new n(this,e)}:function(){return new n(this)}},S=t+" Iterator",C=!1,T=e.prototype,k=T[f]||T["@@iterator"]||u&&T[u],R=!m&&k||w(u),I="Array"==t?T.entries||k:k,N,L,A;if(I&&(N=r(I.call(new e)),g!==Object.prototype&&N.next&&(!p&&r(N)!==g&&(s?s(N,g):"function"!=typeof N[f]&&l(N,f,x)),a(N,S,!0,!0),p&&(h[S]=x))),u==b&&k&&k.name!==b&&(C=!0,R=function(){return k.call(this)}),(!p||_)&&T[f]!==R&&l(T,f,R),h[t]=R,u)if(L={values:w(b),keys:E?R:w(y),entries:w(v)},_)for(A in L)(m||C||!(A in T))&&d(T,A,L[A]);else i({target:t,proto:!0,forced:m||C},L);return L}},function(e,t,n){"use strict";var i=n(76).IteratorPrototype,o=n(50),r=n(25),s=n(37),a=n(27),l=function(){return this};e.exports=function(e,t,n){var d=t+" Iterator";return e.prototype=o(i,{next:r(1,n)}),s(e,d,!1,!0),a[d]=l,e}},function(e,t,n){"use strict";var i=n(77),o=n(15),r=n(10),s=n(8),a=n(34),l=s("iterator"),d=!1,c,p,h;[].keys&&(h=[].keys(),"next"in h?(p=i(i(h)),p!==Object.prototype&&(c=p)):d=!0),c==null&&(c={}),a||r(c,l)||o(c,l,function(){return this}),e.exports={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:d}},function(e,t,n){var i=n(10),o=n(36),r=n(43),s=n(105),a=r("IE_PROTO"),l=Object.prototype;e.exports=s?Object.getPrototypeOf:function(e){return e=o(e),i(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},function(e,t,n){var i=n(12),o=n(8),r=n(34),s=o("iterator");e.exports=!i(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach(function(e,i){t["delete"]("b"),n+=i+e}),r&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==new URLSearchParams("?a=1")+""||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})},function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},function(e,t,n){var i=n(126);e.exports=function(e,t,n){return(i(e),void 0===t)?e:0===n?function(){return e.call(t)}:1===n?function(n){return e.call(t,n)}:2===n?function(n,i){return e.call(t,n,i)}:3===n?function(n,i,o){return e.call(t,n,i,o)}:function(){return e.apply(t,arguments)}}},function(e,t,n){var i=n(130),o=n(40),r=n(8),s=r("toStringTag"),a="Arguments"==o(function(){return arguments}()),l=function(e,t){try{return e[t]}catch(e){}};e.exports=i?o:function(e){var t,n,i;return e===void 0?"Undefined":null===e?"Null":"string"==typeof(n=l(t=Object(e),s))?n:a?o(t):"Object"==(i=o(t))&&"function"==typeof t.callee?"Arguments":i}},function(e,t,n){var i=n(138),o="object"==typeof self&&self&&self.Object===Object&&self,r=i||o||Function("return this")();e.exports=r},function(e,t,n){var i=n(82),o=i.Symbol;e.exports=o},function(e,t,n){function i(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:i,maxWait:t,trailing:s})}var o=n(55),r=n(53);e.exports=i},function(e){e.exports=t},function(e,t,n){"use strict";n.r(t),function(e){function i(e,t){return new o.a(e,t)}var o=n(58),r=n(39),s=n(2),a=n(28),l=n(0),d=n(1),c=n(54),p=n(22),h=n(56);i.VERSION=d.b,"undefined"!=typeof e&&(e.EPUBJS_VERSION=d.b),i.Book=o.a,i.Rendition=r.a,i.Contents=a.a,i.CFI=s.a,i.utils=l,t["default"]=i}.call(this,n(30))},function(e,t,n){"use strict";n(88);var i=n(19),o=n(12),r=n(8),s=n(48),a=n(15),l=r("species"),d=!o(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),c=function(){return"$0"==="a".replace(/./,"$0")}(),p=r("replace"),h=function(){return!!/./[p]&&""===/./[p]("a","$0")}(),u=!o(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});e.exports=function(e,t,n,p){var g=r(e),m=!o(function(){var t={};return t[g]=function(){return 7},7!=""[e](t)}),f=m&&!o(function(){var t=!1,n=/a/;return"split"===e&&(n={},n.constructor={},n.constructor[l]=function(){return n},n.flags="",n[g]=/./[g]),n.exec=function(){return t=!0,null},n[g](""),!t});if(!m||!f||"replace"===e&&!(d&&c&&!h)||"split"===e&&!u){var y=/./[g],b=n(g,""[e],function(e,t,n,i,o){return t.exec===s?m&&!o?{done:!0,value:y.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}},{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:h}),v=b[0],x=b[1];i(String.prototype,e,v),i(RegExp.prototype,g,2==t?function(e,t){return x.call(e,this,t)}:function(e){return x.call(e,this)})}p&&a(RegExp.prototype[g],"sham",!0)}},function(e,t,n){"use strict";var i=n(31),o=n(48);i({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(e,t,n){var i=n(7),o=n(64),r=i.WeakMap;e.exports="function"==typeof r&&/native code/.test(o(r))},function(e,t,n){var o=n(10),r=n(91),s=n(59),a=n(18);e.exports=function(e,t){for(var n=r(t),l=a.f,d=s.f,c=0,p;c<n.length;c++)p=n[c],o(e,p)||l(e,p,d(t,p))}},function(e,t,n){var i=n(45),o=n(93),r=n(69),s=n(13);e.exports=i("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=r.f;return n?t.concat(n(e)):t}},function(e,t,n){var i=n(7);e.exports=i},function(e,t,n){var i=n(68),o=n(47),r=o.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},function(e,t,n){var i=n(32),o=n(46),r=n(95),s=function(e){return function(t,n,s){var a=i(t),l=o(a.length),d=r(s,l),c;if(e&&n!=n){for(;l>d;)if(c=a[d++],c!=c)return!0;}else for(;l>d;d++)if((e||d in a)&&a[d]===n)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},function(e,t,n){var i=n(35),o=Math.max,r=Math.min;e.exports=function(e,t){var n=i(e);return 0>n?o(n+t,0):r(n,t)}},function(e,t,n){var i=n(12),o=function(e,t){var n=s[r(e)];return!(n!=l)||n!=a&&("function"==typeof t?i(t):!!t)},r=o.normalize=function(e){return(e+"").replace(/#|\.prototype\./,".").toLowerCase()},s=o.data={},a=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o},function(e,t,n){"use strict";var i=n(13);e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){"use strict";function i(e,t){return RegExp(e,t)}var o=n(12);t.UNSUPPORTED_Y=o(function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),t.BROKEN_CARET=o(function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},function(e,t,n){var i=n(70);e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){"use strict";var i=n(49).charAt;e.exports=function(e,t,n){return t+(n?i(e,t).length:1)}},function(e,t,n){var i=n(40),o=n(48);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==i(e))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,n){var i=n(8),o=n(50),r=n(18),s=i("unscopables"),a=Array.prototype;a[s]==null&&r.f(a,s,{configurable:!0,value:o(null)}),e.exports=function(e){a[s][e]=!0}},function(e,t,n){var i=n(45);e.exports=i("document","documentElement")},function(e,t,n){var i=n(12);e.exports=!i(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,n){var i=n(13),o=n(107);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,n.call(t,[]),e=t instanceof Array}catch(e){}return function(t,r){return i(t),o(r),e?n.call(t,r):t.__proto__=r,t}}():void 0)},function(e,t,n){var i=n(17);e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+(e+" as a prototype"));return e}},function(e,t,n){"use strict";var i=n(109),o=n(117),r=n(118),s=n(119),a;a=e.exports=function(t,n){var r,a,l,d,p;return 2>arguments.length||"string"!=typeof t?(d=n,n=t,t=null):d=arguments[2],null==t?(r=l=!0,a=!1):(r=s.call(t,"c"),a=s.call(t,"e"),l=s.call(t,"w")),p={value:n,configurable:r,enumerable:a,writable:l},d?i(o(d),p):p},a.gs=function(t,n,a){var l,d,p,h;return"string"==typeof t?p=arguments[3]:(p=a,a=n,n=t,t=null),null==n?n=void 0:r(n)?null==a?a=void 0:!r(a)&&(p=a,a=void 0):(p=n,n=a=void 0),null==t?(l=!0,d=!1):(l=s.call(t,"c"),d=s.call(t,"e")),h={get:n,set:a,configurable:l,enumerable:d},p?i(o(p),h):h}},function(e,t,n){"use strict";e.exports=n(110)()?Object.assign:n(111)},function(e){"use strict";e.exports=function(){var e=Object.assign,t;return!("function"!=typeof e)&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),"razdwatrzy"===t.foo+t.bar+t.trzy)}},function(e,t,n){"use strict";var o=n(112),r=n(116),s=Math.max;e.exports=function(e,t){var n=s(arguments.length,2),a,l,d;for(e=Object(r(e)),d=function(n){try{e[n]=t[n]}catch(t){a||(a=t)}},l=1;l<n;++l)t=arguments[l],o(t).forEach(d);if(a!==void 0)throw a;return e}},function(e,t,n){"use strict";e.exports=n(113)()?Object.keys:n(114)},function(e){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(e,t,n){"use strict";var i=n(51),o=Object.keys;e.exports=function(e){return o(i(e)?Object(e):e)}},function(e){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(51);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(51),o=Array.prototype.forEach,r=Object.create,s=function(e,t){for(var n in e)t[n]=e[n]};e.exports=function(){var e=r(null);return o.call(arguments,function(t){i(t)&&s(Object(t),e)}),e}},function(e){"use strict";e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";e.exports=n(120)()?String.prototype.contains:n(121)},function(e){"use strict";e.exports=function(){return!1}},function(e){"use strict";var t=String.prototype.indexOf;e.exports=function(e){return-1<t.call(this,e,arguments[1])}},function(e){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){"use strict";var i=n(49).charAt,o=n(26),r=n(74),s="String Iterator",a=o.set,l=o.getterFor(s);r(String,"String",function(e){a(this,{type:s,string:e+"",index:0})},function(){var e=l(this),t=e.string,n=e.index,o;return n>=t.length?{value:void 0,done:!0}:(o=i(t,n),e.index+=o.length,{value:o,done:!1})})},function(e,t,n){"use strict";var i=n(16),o=n(12),r=n(73),s=n(69),a=n(60),l=n(36),d=n(61),c=Object.assign,p=Object.defineProperty;e.exports=!c||o(function(){if(i&&1!==c({b:1},c(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach(function(e){t[e]=e}),7!=c({},e)[n]||r(c({},t)).join("")!=o})?function(e){for(var t=l(e),n=arguments.length,o=1,c=s.f,p=a.f;n>o;)for(var h=d(arguments[o++]),u=c?r(h).concat(c(h)):r(h),g=u.length,m=0,f;g>m;)f=u[m++],(!i||p.call(h,f))&&(t[f]=h[f]);return t}:c},function(e,t,n){"use strict";var i=n(80),o=n(36),r=n(127),s=n(128),a=n(46),l=n(129),d=n(52);e.exports=function(e){var t=o(e),n="function"==typeof this?this:Array,c=arguments.length,p=1<c?arguments[1]:void 0,h=void 0!==p,u=d(t),g=0,m,f,y,b,v,x;if(h&&(p=i(p,2<c?arguments[2]:void 0,2)),null!=u&&!(n==Array&&s(u)))for(b=u.call(t),v=b.next,f=new n;!(y=v.call(b)).done;g++)x=h?r(b,p,[y.value,g],!0):y.value,l(f,g,x);else for(m=a(t.length),f=new n(m);m>g;g++)x=h?p(t[g],g):t[g],l(f,g,x);return f.length=g,f}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function");return e}},function(e,t,n){var i=n(13);e.exports=function(e,t,n,o){try{return o?t(i(n)[0],n[1]):t(n)}catch(t){var r=e["return"];throw void 0!==r&&i(r.call(e)),t}}},function(e,t,n){var i=n(8),o=n(27),r=i("iterator"),s=Array.prototype;e.exports=function(e){return e!==void 0&&(o.Array===e||s[r]===e)}},function(e,t,n){"use strict";var i=n(41),o=n(18),r=n(25);e.exports=function(e,t,n){var s=i(t);s in e?o.f(e,s,r(0,n)):e[s]=n}},function(e,t,n){var i=n(8),o=i("toStringTag"),r={};r[o]="z",e.exports="[object z]"===r+""},function(e){"use strict";var n=36,i=1,o=26,r="Overflow: input needs wider integers to process",s=n-i,a=Math.floor,l=String.fromCharCode,d=function(e){for(var t=[],n=0,i=e.length;n<i;){var o=e.charCodeAt(n++);if(55296<=o&&56319>=o&&n<i){var r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),n--)}else t.push(o)}return t},c=function(e){return e+22+75*(26>e)},p=function(e,t,i){var r=0;for(e=i?a(e/700):e>>1,e+=a(e/t);e>s*o>>1;r+=n)e=a(e/s);return a(r+(s+1)*e/(e+38))},h=function(e){var s=[];e=d(e);var h=e.length,u=128,g=0,f=72,y,b;for(y=0;y<e.length;y++)b=e[y],128>b&&s.push(l(b));var v=s.length,x=v;for(v&&s.push("-");x<h;){var E=2147483647;for(y=0;y<e.length;y++)b=e[y],b>=u&&b<E&&(E=b);var _=x+1;if(E-u>a((2147483647-g)/_))throw RangeError(r);for(g+=(E-u)*_,u=E,y=0;y<e.length;y++){if(b=e[y],b<u&&2147483647<++g)throw RangeError(r);if(b==u){for(var w=g,S=n,C;;S+=n){if(C=S<=f?i:S>=f+o?o:S-f,w<C)break;var T=w-C,R=n-C;s.push(l(c(C+T%R))),w=a(T/R)}s.push(l(c(w))),f=p(g,_,x==v),g=0,++x}}++g,++u}return s.join("")};e.exports=function(e){var t=[],n=e.toLowerCase().replace(/[.\u3002\uFF0E\uFF61]/g,".").split("."),o,r;for(o=0;o<n.length;o++)r=n[o],t.push(/[^\0-\u007E]/.test(r)?"xn--"+h(r):r);return t.join(".")}},function(e,t,n){"use strict";n(71);var i=n(31),o=n(45),r=n(78),s=n(19),a=n(133),l=n(37),d=n(75),c=n(26),p=n(79),h=n(10),u=n(80),g=n(81),m=n(13),f=n(17),y=n(50),b=n(25),v=n(134),x=n(52),E=n(8),_=o("fetch"),w=o("Headers"),S=E("iterator"),C="URLSearchParams",T=C+"Iterator",k=c.set,R=c.getterFor(C),I=c.getterFor(T),N=[,,,,],L=function(e){return N[e-1]||(N[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},A=function(e){try{return decodeURIComponent(e)}catch(t){return e}},O=function(e){var t=e.replace(/\+/g," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(L(n--),A);return t}},P={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},D=function(e){return P[e]},z=function(e){return encodeURIComponent(e).replace(/[!'()~]|%20/g,D)},q=function(e,t){if(t)for(var n=t.split("&"),i=0,o,r;i<n.length;)o=n[i++],o.length&&(r=o.split("="),e.push({key:O(r.shift()),value:O(r.join("="))}))},B=function(e){this.entries.length=0,q(this.entries,e)},j=function(e,t){if(e<t)throw TypeError("Not enough arguments")},M=d(function(e,t){k(this,{type:T,iterator:v(R(e).entries),kind:t})},"Iterator",function(){var e=I(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),U=function(){p(this,U,C);var e=0<arguments.length?arguments[0]:void 0,t=this,n=[],i,o,r,s,a,l,d,c,u;if(k(t,{type:C,entries:n,updateURL:function(){},updateSearchParams:B}),void 0!==e)if(!f(e))q(n,"string"==typeof e?"?"===e.charAt(0)?e.slice(1):e:e+"");else if(i=x(e),"function"==typeof i)for(o=i.call(e),r=o.next;!(s=r.call(o)).done;){if(a=v(m(s.value)),l=a.next,(d=l.call(a)).done||(c=l.call(a)).done||!l.call(a).done)throw TypeError("Expected sequence with length 2");n.push({key:d.value+"",value:c.value+""})}else for(u in e)h(e,u)&&n.push({key:u,value:e[u]+""})},W=U.prototype;a(W,{append:function(e,t){j(arguments.length,2);var n=R(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){j(arguments.length,1);for(var t=R(this),n=t.entries,i=0;i<n.length;)n[i].key===e+""?n.splice(i,1):i++;t.updateURL()},get:function(e){j(arguments.length,1);for(var t=R(this).entries,n=0;n<t.length;n++)if(t[n].key===e+"")return t[n].value;return null},getAll:function(e){j(arguments.length,1);for(var t=R(this).entries,n=[],i=0;i<t.length;i++)t[i].key===e+""&&n.push(t[i].value);return n},has:function(e){j(arguments.length,1);for(var t=R(this).entries,n=0;n<t.length;)if(t[n++].key===e+"")return!0;return!1},set:function(e,t){j(arguments.length,1);for(var n=R(this),i=n.entries,o=!1,r=e+"",s=t+"",a=0,l;a<i.length;a++)l=i[a],l.key===r&&(o?i.splice(a--,1):(o=!0,l.value=s));o||i.push({key:r,value:s}),n.updateURL()},sort:function(){var e=R(this),t=e.entries,n=t.slice(),i,o,r;for(t.length=0,r=0;r<n.length;r++){for(i=n[r],o=0;o<r;o++)if(t[o].key>i.key){t.splice(o,0,i);break}o===r&&t.push(i)}e.updateURL()},forEach:function(e){for(var t=R(this).entries,n=u(e,1<arguments.length?arguments[1]:void 0,3),i=0,o;i<t.length;)o=t[i++],n(o.value,o.key,this)},keys:function(){return new M(this,"keys")},values:function(){return new M(this,"values")},entries:function(){return new M(this,"entries")}},{enumerable:!0}),s(W,S,W.entries),s(W,"toString",function(){for(var e=R(this).entries,t=[],n=0,i;n<e.length;)i=e[n++],t.push(z(i.key)+"="+z(i.value));return t.join("&")},{enumerable:!0}),l(U,C),i({global:!0,forced:!r},{URLSearchParams:U}),r||"function"!=typeof _||"function"!=typeof w||i({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t=[e],n,i,o;return 1<arguments.length&&(n=arguments[1],f(n)&&(i=n.body,g(i)===C&&(o=n.headers?new w(n.headers):new w,!o.has("content-type")&&o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),n=y(n,{body:b(0,i+""),headers:b(0,o)}))),t.push(n)),_.apply(this,t)}}),e.exports={URLSearchParams:U,getState:R}},function(e,t,n){var i=n(19);e.exports=function(e,t,n){for(var o in t)i(e,o,t[o],n);return e}},function(e,t,n){var i=n(13),o=n(52);e.exports=function(e){var t=o(e);if("function"!=typeof t)throw TypeError(e+" is not iterable");return i(t.call(e))}},function(e,t){"use strict";function n(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=n,t.default={createElement:n}},function(e,t){"use strict";function n(n,r){function s(s){for(var e=r.length-1;0<=e;e--){var a=r[e],t=s.clientX,l=s.clientY;if(s.touches&&s.touches.length&&(t=s.touches[0].clientX,l=s.touches[0].clientY),!!o(a,n,t,l)){a.dispatchEvent(i(s));break}}}if("iframe"===n.nodeName||"IFRAME"===n.nodeName)try{this.target=n.contentDocument}catch(e){this.target=n}else this.target=n;for(var a=["mouseup","mousedown","click","touchstart"],l=0,e;l<a.length;l++)e=a[l],this.target.addEventListener(e,function(t){return s(t)},!1)}function i(t){var e=Object.assign({},t,{bubbles:!1});try{return new MouseEvent(t.type,e)}catch(i){var n=document.createEvent("MouseEvents");return n.initMouseEvent(t.type,!1,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),n}}function o(e,t,n,o){function r(e,t,n){var i=e.top-s.top,o=e.left-s.left,r=i+e.height,a=o+e.width;return i<=n&&o<=t&&r>n&&a>t}var s=t.getBoundingClientRect(),a=e.getBoundingClientRect();if(!r(a,n,o))return!1;for(var l=e.getClientRects(),d=0,c=l.length;d<c;d++)if(r(l[d],n,o))return!0;return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.proxyMouse=n,t.clone=i,t.default={proxyMouse:n}},function(e,t,n){var i=n(82);e.exports=function(){return i.Date.now()}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(30))},function(e,t,n){var i=n(53),o=n(140),r=0/0,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return r;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(/^\s+|\s+$/g,"");var n=/^0b[01]+$/i.test(e);return n||/^0o[0-7]+$/i.test(e)?s(e.slice(2),n?2:8):/^[-+]0x[0-9a-f]+$/i.test(e)?r:+e}},function(e,t,n){var i=n(141),o=n(144);e.exports=function(e){return"symbol"==typeof e||o(e)&&i(e)=="[object Symbol]"}},function(e,t,n){function i(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?r(e):s(e)}var o=n(83),r=n(142),s=n(143),a=o?o.toStringTag:void 0;e.exports=i},function(e,t,n){var i=n(83),o=Object.prototype,r=o.hasOwnProperty,s=o.toString,a=i?i.toStringTag:void 0;e.exports=function(e){var t=r.call(e,a),n=e[a];try{e[a]=void 0;var i=!0}catch(t){}var o=s.call(e);return i&&(t?e[a]=n:delete e[a]),o}},function(e){var t=Object.prototype,n=t.toString;e.exports=function(e){return n.call(e)}},function(e){e.exports=function(e){return null!=e&&"object"==typeof e}}])["default"]});
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.2 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�