(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d02ec01"],{"00fd":function(t,e,i){var n=i("9e69"),r=Object.prototype,s=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function h(t){var e=s.call(t,a),i=t[a];try{t[a]=void 0;var n=!0}catch(h){}var r=o.call(t);return n&&(e?t[a]=i:delete t[a]),r}t.exports=h},"06d2":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return r})),i.d(e,"c",(function(){return s}));const n="0.3",r=["keydown","keyup","keypressed","mouseup","mousedown","mousemove","click","touchend","touchstart","touchmove"],s={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"}}},"0b16":function(t,e,i){"use strict";i.r(e),i.d(e,"requestAnimationFrame",(function(){return r})),i.d(e,"uuid",(function(){return h})),i.d(e,"documentHeight",(function(){return l})),i.d(e,"isElement",(function(){return c})),i.d(e,"isNumber",(function(){return u})),i.d(e,"isFloat",(function(){return d})),i.d(e,"prefixed",(function(){return f})),i.d(e,"defaults",(function(){return p})),i.d(e,"extend",(function(){return m})),i.d(e,"insert",(function(){return g})),i.d(e,"locationOf",(function(){return v})),i.d(e,"indexOfSorted",(function(){return w})),i.d(e,"bounds",(function(){return y})),i.d(e,"borders",(function(){return b})),i.d(e,"nodeBounds",(function(){return _})),i.d(e,"windowBounds",(function(){return x})),i.d(e,"indexOfNode",(function(){return E})),i.d(e,"indexOfTextNode",(function(){return k})),i.d(e,"indexOfElementNode",(function(){return S})),i.d(e,"isXml",(function(){return C})),i.d(e,"createBlob",(function(){return T})),i.d(e,"createBlobUrl",(function(){return O})),i.d(e,"revokeBlobUrl",(function(){return A})),i.d(e,"createBase64Url",(function(){return N})),i.d(e,"type",(function(){return R})),i.d(e,"parse",(function(){return I})),i.d(e,"qs",(function(){return L})),i.d(e,"qsa",(function(){return z})),i.d(e,"qsp",(function(){return D})),i.d(e,"sprint",(function(){return P})),i.d(e,"treeWalker",(function(){return B})),i.d(e,"walk",(function(){return j})),i.d(e,"blob2base64",(function(){return U})),i.d(e,"defer",(function(){return M})),i.d(e,"querySelectorByType",(function(){return F})),i.d(e,"findChildren",(function(){return W})),i.d(e,"parents",(function(){return q})),i.d(e,"filterChildren",(function(){return H})),i.d(e,"getParentByTagName",(function(){return Y})),i.d(e,"RangeObject",(function(){return V}));var n=i("1456");const r="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),s=1,o=3,a="undefined"!=typeof URL?URL:"undefined"!=typeof window?window.URL||window.webkitURL||window.mozURL:void 0;function h(){var t=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:7&i|8).toString(16)}));return e}function l(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function c(t){return!(!t||1!=t.nodeType)}function u(t){return!isNaN(parseFloat(t))&&isFinite(t)}function d(t){let e=parseFloat(t);return!1!==u(t)&&("string"===typeof t&&t.indexOf(".")>-1||Math.floor(e)!==e)}function f(t){var e=["Webkit","webkit","Moz","O","ms"],i=["-webkit-","-webkit-","-moz-","-o-","-ms-"],n=t.toLowerCase(),r=e.length;if("undefined"===typeof document||"undefined"!=typeof document.body.style[n])return t;for(var s=0;se?1:t=0?h:h+1:0===s?h:-1===s?v(t,e,i,h,a):v(t,e,i,o,h))}function w(t,e,i,n,r){var s,o=n||0,a=r||e.length,h=parseInt(o+(a-o)/2);return i||(i=function(t,e){return t>e?1:t-1}function T(t,e){return new Blob([t],{type:e})}function O(t,e){var i,n=T(t,e);return i=a.createObjectURL(n),i}function A(t){return a.revokeObjectURL(t)}function N(t,e){var i,n;if("string"===typeof t)return i=btoa(encodeURIComponent(t)),n="data:"+e+";base64,"+i,n}function R(t){return Object.prototype.toString.call(t).slice(8,-1)}function I(t,e,i){var r,s;return s="undefined"===typeof DOMParser||i?n["DOMParser"]:DOMParser,65279===t.charCodeAt(0)&&(t=t.slice(1)),r=(new s).parseFromString(t,e),r}function L(t,e){var i;if(!t)throw new Error("No Element Provided");return"undefined"!=typeof t.querySelector?t.querySelector(e):(i=t.getElementsByTagName(e),i.length?i[0]:void 0)}function z(t,e){return"undefined"!=typeof t.querySelector?t.querySelectorAll(e):t.getElementsByTagName(e)}function D(t,e,i){var n,r;if("undefined"!=typeof t.querySelector){for(var s in e+="[",i)e+=s+"~='"+i[s]+"'";return e+="]",t.querySelector(e)}if(n=t.getElementsByTagName(e),r=Array.prototype.slice.call(n,0).filter((function(t){for(var e in i)if(t.getAttribute(e)===i[e])return!0;return!1})),r)return r[0]}function P(t,e){var i=t.ownerDocument||t;"undefined"!==typeof i.createTreeWalker?B(t,e,NodeFilter.SHOW_TEXT):j(t,(function(t){t&&3===t.nodeType&&e(t)}),!0)}function B(t,e,i){var n=document.createTreeWalker(t,i,null,!1);let r;while(r=n.nextNode())e(r)}function j(t,e){if(e(t))return!0;if(t=t.firstChild,t)do{let i=j(t,e);if(i)return!0;t=t.nextSibling}while(t)}function U(t){return new Promise((function(e,i){var n=new FileReader;n.readAsDataURL(t),n.onloadend=function(){e(n.result)}}))}function M(){this.resolve=null,this.reject=null,this.id=h(),this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e}),Object.freeze(this)}function F(t,e,i){var n;if("undefined"!=typeof t.querySelector&&(n=t.querySelector(`${e}[*|type="${i}"]`)),n&&0!==n.length)return n;n=z(t,e);for(var r=0;r-1,s=t;if(this.Url=void 0,this.href=t,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=e,!r&&!1!==e&&"string"!==typeof e&&window&&window.location&&(this.base=window.location.href),r||this.base)try{this.base?this.Url=new URL(t,this.base):this.Url=new URL(t),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,s=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(o){this.Url=void 0,this.base&&(i=new n["a"](this.base),s=i.resolve(s))}this.Path=new n["a"](s),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(t){var e,i=t.indexOf("://")>-1;return i?t:(e=s.a.resolve(this.directory,t),this.origin+e)}relative(t){return s.a.relative(t,this.directory)}toString(){return this.href}}e["a"]=o},1310:function(t,e){function i(t){return null!=t&&"object"==typeof t}t.exports=i},1456:function(t,e,i){function n(t){this.options=t||{locator:{}}}function r(t,e,i){if(!t){if(e instanceof s)return e;t=e}var n={},r=t instanceof Function;function o(e){var s=t[e];!s&&r&&(s=2==t.length?function(i){t(e,i)}:t),n[e]=s&&function(t){s("[xmldom "+e+"]\t"+t+a(i))}||function(){}}return i=i||{},o("warning"),o("error"),o("fatalError"),n}function s(){this.cdata=!1}function o(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function a(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function h(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function l(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}n.prototype.parseFromString=function(t,e){var i=this.options,n=new d,o=i.domBuilder||new s,a=i.errorHandler,h=i.locator,l=i.xmlns||{},u=/\/x?html?$/.test(e),f=u?c.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return h&&o.setDocumentLocator(h),n.errorHandler=r(a,o,h),n.domBuilder=i.domBuilder||o,u&&(l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",t&&"string"===typeof t?n.parse(t,l,f):n.errorHandler.error("invalid doc source"),o.doc},s.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,n){var r=this.doc,s=r.createElementNS(t,i||e),a=n.length;l(this,s),this.currentElement=s,this.locator&&o(this.locator,s);for(var h=0;h-1;t&&(r=Object(n["qs"])(t,"head"),i=Object(n["qs"])(r,"base"),i||(i=t.createElement("base"),r.insertBefore(i,r.firstChild)),!o&&window&&window.location&&(s=window.location.origin+s),i.setAttribute("href",s))}function o(t,e){var i,r,s=e.canonical;t&&(i=Object(n["qs"])(t,"head"),r=Object(n["qs"])(i,"link[rel='canonical']"),r?r.setAttribute("href",s):(r=t.createElement("link"),r.setAttribute("rel","canonical"),r.setAttribute("href",s),i.appendChild(r)))}function a(t,e){var i,r,s=e.idref;t&&(i=Object(n["qs"])(t,"head"),r=Object(n["qs"])(i,"link[property='dc.identifier']"),r?r.setAttribute("content",s):(r=t.createElement("meta"),r.setAttribute("name","dc.identifier"),r.setAttribute("content",s),i.appendChild(r)))}function h(t,e){var i=t.querySelectorAll("a[href]");if(i.length)for(var s=Object(n["qs"])(t.ownerDocument,"base"),o=s?s.getAttribute("href"):void 0,a=function(t){var i=t.getAttribute("href");if(0!==i.indexOf("mailto:")){var n=i.indexOf("://")>-1;if(n)t.setAttribute("target","_blank");else{var s;try{s=new r["a"](i,o)}catch(a){}t.onclick=function(){return s&&s.hash?e(s.Path.path+s.hash):e(s?s.Path.path:i),!1}}}}.bind(this),h=0;h0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=e);var n=i===e?0:4-i%4;return[i,n]}function c(t){var e=l(t),i=e[0],n=e[1];return 3*(i+n)/4-n}function u(t,e,i){return 3*(e+i)/4-i}function d(t){var e,i,n=l(t),o=n[0],a=n[1],h=new s(u(t,o,a)),c=0,d=a>0?o-4:o;for(i=0;i>16&255,h[c++]=e>>8&255,h[c++]=255&e;return 2===a&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,h[c++]=255&e),1===a&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,h[c++]=e>>8&255,h[c++]=255&e),h}function f(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function p(t,e,i){for(var n,r=[],s=e;sh?h:a+o));return 1===r?(e=t[i-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},2031:function(t,e,i){"use strict";t.exports=i("14ab")()?Object.assign:i("f60e")},"29f3":function(t,e){var i=Object.prototype,n=i.toString;function r(t){return n.call(t)}t.exports=r},"2b3e":function(t,e,i){var n=i("585a"),r="object"==typeof self&&self&&self.Object===Object&&self,s=n||r||Function("return this")();t.exports=s},"2cef":function(t,e,i){"use strict";i("d328")},3268:function(t,e,i){"use strict";var n=i("8f8f"),r=i("0b16");class s{constructor(t,e,i,n=!1){this.layout=t,this.horizontal="horizontal"===i,this.direction=e||"ltr",this._dev=n}section(t){var e=this.findRanges(t),i=this.rangeListToCfiList(t.section.cfiBase,e);return i}page(t,e,i,r){var s,o=!(!t||!t.document)&&t.document.body;if(o){if(s=this.rangePairToCfiPair(e,{start:this.findStart(o,i,r),end:this.findEnd(o,i,r)}),!0===this._dev){let e=t.document,i=new n["a"](s.start).toRange(e),r=new n["a"](s.end).toRange(e),o=e.defaultView.getSelection(),a=e.createRange();o.removeAllRanges(),a.setStart(i.startContainer,i.startOffset),a.setEnd(r.endContainer,r.endOffset),o.addRange(a)}return s}}walk(t,e){if(!t||t.nodeType!==Node.TEXT_NODE){var i={acceptNode:function(t){return t.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},n=i.acceptNode;n.acceptNode=i.acceptNode;var r,s,o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,n,!1);while(r=o.nextNode())if(s=e(r),s)break;return s}}findRanges(t){for(var e,i,n=[],r=t.contents.scrollWidth(),s=Math.ceil(r/this.layout.spreadWidth),o=s*this.layout.divisor,a=this.layout.columnWidth,h=this.layout.gap,l=0;l{var n,s,h,l,c;if(c=Object(r["nodeBounds"])(t),this.horizontal&&"ltr"===this.direction){if(n=this.horizontal?c.left:c.top,s=this.horizontal?c.right:c.bottom,n>=e&&n<=i)return t;if(s>e)return t;a=t,o.push(t)}else if(this.horizontal&&"rtl"===this.direction){if(n=c.left,s=c.right,s<=i&&s>=e)return t;if(n=e&&h<=i)return t;if(l>e)return t;a=t,o.push(t)}}),s)return this.findTextStartRange(s,e,i);return this.findTextStartRange(a,e,i)}findEnd(t,e,i){var n,s,o=[t],a=t;while(o.length)if(n=o.shift(),s=this.walk(n,t=>{var n,s,h,l,c;if(c=Object(r["nodeBounds"])(t),this.horizontal&&"ltr"===this.direction){if(n=Math.round(c.left),s=Math.round(c.right),n>i&&a)return a;if(s>i)return t;a=t,o.push(t)}else if(this.horizontal&&"rtl"===this.direction){if(n=Math.round(this.horizontal?c.left:c.top),s=Math.round(this.horizontal?c.right:c.bottom),si&&a)return a;if(l>i)return t;a=t,o.push(t)}}),s)return this.findTextEndRange(s,e,i);return this.findTextEndRange(a,e,i)}findTextStartRange(t,e,i){for(var n,r,s,o,a,h=this.splitTextNodeIntoRanges(t),l=0;l=e)return n}else if(this.horizontal&&"rtl"===this.direction){if(a=r.right,a<=i)return n}else if(o=r.top,o>=e)return n;return h[0]}findTextEndRange(t,e,i){for(var n,r,s,o,a,h,l,c=this.splitTextNodeIntoRanges(t),u=0;ui&&n)return n;if(a>i)return r}else if(this.horizontal&&"rtl"===this.direction){if(o=s.left,a=s.right,ai&&n)return n;if(l>i)return r}n=r}return c[c.length-1]}splitTextNodeIntoRanges(t,e){var i,n=[],r=t.textContent||"",s=r.trim(),o=t.ownerDocument,a=e||" ",h=s.indexOf(a);if(-1===h||t.nodeType!=Node.TEXT_NODE)return i=o.createRange(),i.selectNodeContents(t),[i];i=o.createRange(),i.setStart(t,0),i.setEnd(t,h),n.push(i),i=!1;while(-1!=h)h=s.indexOf(a,h+1),h>0&&(i&&(i.setEnd(t,h),n.push(i)),i=o.createRange(),i.setStart(t,h+1));return i&&(i.setEnd(t,s.length),n.push(i)),n}rangePairToCfiPair(t,e){var i=e.start,r=e.end;i.collapse(!0),r.collapse(!1);let s=new n["a"](i,t).toString(),o=new n["a"](r,t).toString();return{start:s,end:o}}rangeListToCfiList(t,e){for(var i,n=[],r=0;r2){for(var a=n.length-1,h=a;h>=0;--h)if(47===n.charCodeAt(h))break;if(h!==a){n=-1===h?"":n.slice(0,h),r=o,s=0;continue}}else if(2===n.length||1===n.length){n="",r=o,s=0;continue}e&&(n.length>0?n+="/..":n="..")}else n.length>0?n+="/"+t.slice(r+1,o):n=t.slice(r+1,o);r=o,s=0}else 46===i&&-1!==s?++s:s=-1}return n}function o(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}var a={resolve:function(){for(var t,e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===t&&(t=n.cwd()),a=t),r(a),0!==a.length&&(e=a+"/"+e,i=47===a.charCodeAt(0))}return e=s(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(r(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return t=s(t,!e),0!==t.length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(r(t),r(e),t===e)return"";if(t=a.resolve(t),e=a.resolve(e),t===e)return"";for(var i=1;ic){if(47===e.charCodeAt(o+d))return e.slice(o+d+1);if(0===d)return e.slice(o+d)}else s>c&&(47===t.charCodeAt(i+d)?u=d:0===d&&(u=0));break}var f=t.charCodeAt(i+d),p=e.charCodeAt(o+d);if(f!==p)break;47===f&&(u=d)}var m="";for(d=i+u+1;d<=n;++d)d!==n&&47!==t.charCodeAt(d)||(0===m.length?m+="..":m+="/..");return m.length>0?m+e.slice(o+u):(o+=u,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(r(t),0===t.length)return".";for(var e=t.charCodeAt(0),i=47===e,n=-1,s=!0,o=t.length-1;o>=1;--o)if(e=t.charCodeAt(o),47===e){if(!s){n=o;break}}else s=!1;return-1===n?i?"/":".":i&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!==typeof e)throw new TypeError('"ext" argument must be a string');r(t);var i,n=0,s=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,h=-1;for(i=t.length-1;i>=0;--i){var l=t.charCodeAt(i);if(47===l){if(!o){n=i+1;break}}else-1===h&&(o=!1,h=i+1),a>=0&&(l===e.charCodeAt(a)?-1===--a&&(s=i):(a=-1,s=h))}return n===s?s=h:-1===s&&(s=t.length),t.slice(n,s)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":t.slice(n,s)},extname:function(t){r(t);for(var e=-1,i=0,n=-1,s=!0,o=0,a=t.length-1;a>=0;--a){var h=t.charCodeAt(a);if(47!==h)-1===n&&(s=!1,n=a+1),46===h?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!s){i=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===i+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!==typeof t)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof t);return o("/",t)},parse:function(t){r(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var i,n=t.charCodeAt(0),s=47===n;s?(e.root="/",i=1):i=0;for(var o=-1,a=0,h=-1,l=!0,c=t.length-1,u=0;c>=i;--c)if(n=t.charCodeAt(c),47!==n)-1===h&&(l=!1,h=c+1),46===n?-1===o?o=c:1!==u&&(u=1):-1!==o&&(u=-1);else if(!l){a=c+1;break}return-1===o||-1===h||0===u||1===u&&o===h-1&&o===a+1?-1!==h&&(e.base=e.name=0===a&&s?t.slice(1,h):t.slice(a,h)):(0===a&&s?(e.name=t.slice(1,o),e.base=t.slice(1,h)):(e.name=t.slice(a,o),e.base=t.slice(a,h)),e.ext=t.slice(o,h)),a>0?e.dir=t.slice(0,a-1):s&&(e.dir="/"),e},sep:"/",delimiter:":",posix:null};t.exports=a},"408c":function(t,e,i){var n=i("2b3e"),r=function(){return n.Date.now()};t.exports=r},4923:function(t,e,i){"use strict";class n{constructor(t){this.context=t||this,this.hooks=[]}register(){for(var t=0;t{"visible"===document.visibilityState&&!1===this.active?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let t=this.content;t.style["transitionProperty"]="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",t.style["transitionDuration"]="0.001ms",t.style["transitionTimingFunction"]="linear",t.style["transitionDelay"]="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var t=this.document.styleSheets,e=function(t){t.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),i=0;i{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(t=>{this.resizeCheck()});let t={attributes:!0,childList:!0,characterData:!0,subtree:!0};this.observer.observe(this.document,t)}imageLoadListeners(){for(var t,e=this.document.querySelectorAll("img"),i=0;i0?(e.setStart(t,s.startOffset-2),e.setEnd(t,s.startOffset),i=e.getBoundingClientRect()):i=t.parentNode.getBoundingClientRect()}catch(r){console.error(r,r.stack)}}else i=s.getBoundingClientRect()}}else if("string"===typeof t&&t.indexOf("#")>-1){let e=t.substring(t.indexOf("#")+1),n=this.document.getElementById(e);if(n)if(d){let t=new Range;t.selectNode(n),i=t.getBoundingClientRect()}else i=n.getBoundingClientRect()}return i&&(n.left=i.left,n.top=i.top),n}addStylesheet(t){return new Promise(function(e,i){var n,r=!1;this.document?(n=this.document.querySelector("link[href='"+t+"']"),n?e(!0):(n=this.document.createElement("link"),n.type="text/css",n.rel="stylesheet",n.href=t,n.onload=n.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout(()=>{e(!0)},1))},this.document.head.appendChild(n))):e(!1)}.bind(this))}_getStylesheetNode(t){var e;return t="epubjs-inserted-css-"+(t||""),!!this.document&&(e=this.document.getElementById(t),e||(e=this.document.createElement("style"),e.id=t,this.document.head.appendChild(e)),e)}addStylesheetCss(t,e){return!(!this.document||!t)&&(i=this._getStylesheetNode(e),i.innerHTML=t,!0);var i}addStylesheetRules(t,e){var i;if(this.document&&t&&0!==t.length)if(i=this._getStylesheetNode(e).sheet,"[object Array]"===Object.prototype.toString.call(t))for(var n=0,r=t.length;n{const n=t[e];if(Array.isArray(n))n.forEach(t=>{const n=Object.keys(t),r=n.map(e=>`${e}:${t[e]}`).join(";");i.insertRule(`${e}{${r}}`,i.cssRules.length)});else{const t=Object.keys(n),r=t.map(t=>`${t}:${n[t]}`).join(";");i.insertRule(`${e}{${r}}`,i.cssRules.length)}})}}addScript(t){return new Promise(function(e,i){var n,r=!1;this.document?(n=this.document.createElement("script"),n.type="text/javascript",n.async=!0,n.src=t,n.onload=n.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout((function(){e(!0)}),1))},this.document.head.appendChild(n)):e(!1)}.bind(this))}addClass(t){var e;this.document&&(e=this.content||this.document.body,e&&e.classList.add(t))}removeClass(t){var e;this.document&&(e=this.content||this.document.body,e&&e.classList.remove(t))}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),l["a"].forEach((function(t){this.document.addEventListener(t,this._triggerEvent,{passive:!0})}),this))}removeEventListeners(){this.document&&(l["a"].forEach((function(t){this.document.removeEventListener(t,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(t){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}.bind(this),250)}triggerSelectedEvent(t){var e,i;t&&t.rangeCount>0&&(e=t.getRangeAt(0),e.collapsed||(i=new o["a"](e,this.cfiBase).toString(),this.emit(l["c"].CONTENTS.SELECTED,i),this.emit(l["c"].CONTENTS.SELECTED_RANGE,e)))}range(t,e){var i=new o["a"](t);return i.toRange(this.document,e)}cfiFromRange(t,e){return new o["a"](t,this.cfiBase,e).toString()}cfiFromNode(t,e){return new o["a"](t,this.cfiBase,e).toString()}map(t){var e=new a["a"](t);return e.section()}size(t,e){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),t>=0&&(this.width(t),i.width=t,this.css("padding","0 "+t/12+"px")),e>=0&&(this.height(e),i.height=e),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(t,e,i,n,r){let o=Object(s["prefixed"])("column-axis"),a=Object(s["prefixed"])("column-gap"),h=Object(s["prefixed"])("column-width"),l=Object(s["prefixed"])("column-fill"),c=this.writingMode(),u=0===c.indexOf("vertical")?"vertical":"horizontal";this.layoutStyle("paginated"),"rtl"===r&&"horizontal"===u&&this.direction(r),this.width(t),this.height(e),this.viewport({width:t,height:e,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),"vertical"===u?(this.css("padding-top",n/2+"px",!0),this.css("padding-bottom",n/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(o,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",n/2+"px",!0),this.css("padding-right",n/2+"px",!0),this.css(o,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(l,"auto"),this.css(a,n+"px"),this.css(h,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(t,e,i){var n="scale("+t+")",r="";this.css("transform-origin","top left"),(e>=0||i>=0)&&(r=" translate("+(e||0)+"px, "+(i||0)+"px )"),this.css("transform",n+r)}fit(t,e,i){var n=this.viewport(),r=parseInt(n.width),s=parseInt(n.height),o=t/r,a=e/s,h=o{this.emit(l["c"].CONTENTS.LINK_CLICKED,t)})}writingMode(t){let e=Object(s["prefixed"])("writing-mode");return t&&this.documentElement&&(this.documentElement.style[e]=t),this.window.getComputedStyle(this.documentElement)[e]||""}layoutStyle(t){return t&&(this._layoutStyle=t,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(t,e){return navigator.epubReadingSystem={name:t,version:e,layoutStyle:this.layoutStyle(),hasFeature:function(t){switch(t){case"dom-manipulation":return!0;case"layout-changes":return!0;case"touch-events":return!0;case"mouse-events":return!0;case"keyboard-events":return!0;case"spine-scripting":return!1;default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}}r()(p.prototype),e["a"]=p},"585a":function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(this,i("c8ba"))},"59c0":function(t,e,i){"use strict";var n=i("3c2a"),r=i.n(n);class s{constructor(t){var e,i;e=t.indexOf("://"),e>-1&&(t=new URL(t).pathname),i=this.parse(t),this.path=t,this.isDirectory(t)?this.directory=t:this.directory=i.dir+"/",this.filename=i.base,this.extension=i.ext.slice(1)}parse(t){return r.a.parse(t)}isAbsolute(t){return r.a.isAbsolute(t||this.path)}isDirectory(t){return"/"===t.charAt(t.length-1)}resolve(t){return r.a.resolve(this.directory,t)}relative(t){var e=t&&t.indexOf("://")>-1;return e?t:r.a.relative(this.directory,t)}splitPath(t){return this.splitPathRe.exec(t).slice(1)}toString(){return this.path}}e["a"]=s},"5edd":function(t,e,i){"use strict";var n=i("936a"),r={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!n(t)&&hasOwnProperty.call(r,typeof t)}},"62c4":function(t,e,i){"use strict";var n=i("e76c")();t.exports=function(t){return t!==n&&null!==t}},6321:function(t,e,i){"use strict";var n=i("9013");t.exports=function(t){if("function"!==typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!==typeof t.length)return!1;if("function"!==typeof t.call)return!1;if("function"!==typeof t.apply)return!1}catch(e){return!1}return!n(t)}},7373:function(t,e,i){"use strict";var n=i("62c4"),r=Object.keys;t.exports=function(t){return r(n(t)?Object(t):t)}},"7bdf":function(t,e,i){"use strict";t.exports=i("ecf9")()?Object.keys:i("7373")},8355:function(t,e,i){(function(e,i){var n; /*! JSZip v3.7.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE */ (function(e){t.exports=e()})((function(){return function t(e,i,r){function s(a,h){if(!i[a]){if(!e[a]){var l="function"==typeof n&&n;if(!h&&l)return n(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};e[a][0].call(u.exports,(function(t){var i=e[a][1][t];return s(i||t)}),u,u.exports,t,e,i,r)}return i[a].exports}for(var o="function"==typeof n&&n,a=0;a>2,a=(3&e)<<4|i>>4,h=f>1?(15&i)<<2|r>>6:64,l=f>2?63&r:64,c.push(s.charAt(o)+s.charAt(a)+s.charAt(h)+s.charAt(l));return c.join("")},i.decode=function(t){var e,i,n,o,a,h,l,c=0,u=0,d="data:";if(t.substr(0,d.length)===d)throw new Error("Invalid base64 input, it looks like a data url.");t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");var f,p=3*t.length/4;if(t.charAt(t.length-1)===s.charAt(64)&&p--,t.charAt(t.length-2)===s.charAt(64)&&p--,p%1!==0)throw new Error("Invalid base64 input, bad content length.");f=r.uint8array?new Uint8Array(0|p):new Array(0|p);while(c>4,i=(15&a)<<4|h>>2,n=(3&h)<<6|l,f[u++]=e,64!==h&&(f[u++]=i),64!==l&&(f[u++]=n);return f}},{"./support":30,"./utils":32}],2:[function(t,e,i){"use strict";var n=t("./external"),r=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,i,n,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=n,this.compressedContent=r}a.prototype={getContentWorker:function(){var t=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo["data_length"]!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,i){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){"use strict";var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){"use strict";var n=t("./utils");function r(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}var s=r();function o(t,e,i,n){var r=s,o=n+i;t^=-1;for(var a=n;a>>8^r[255&(t^e[a])];return-1^t}function a(t,e,i,n){var r=s,o=n+i;t^=-1;for(var a=n;a>>8^r[255&(t^e.charCodeAt(a))];return-1^t}e.exports=function(t,e){if("undefined"===typeof t||!t.length)return 0;var i="string"!==n.getTypeOf(t);return i?o(0|e,t,t.length,0):a(0|e,t,t.length,0)}},{"./utils":32}],5:[function(t,e,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){"use strict";var n=null;n="undefined"!==typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,i){"use strict";var n="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array,r=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function h(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",s.inherits(h,o),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},h.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new h("Deflate",t)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){"use strict";var n=t("../utils"),r=t("../stream/GenericWorker"),s=t("../utf8"),o=t("../crc32"),a=t("../signature"),h=function(t,e){var i,n="";for(i=0;i>>=8;return n},l=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16},c=function(t,e){return 63&(t||0)},u=function(t,e,i,r,u,d){var f,p,m=t["file"],g=t["compression"],v=d!==s.utf8encode,w=n.transformTo("string",d(m.name)),y=n.transformTo("string",s.utf8encode(m.name)),b=m.comment,_=n.transformTo("string",d(b)),x=n.transformTo("string",s.utf8encode(b)),E=y.length!==m.name.length,k=x.length!==b.length,S="",C="",T="",O=m.dir,A=m.date,N={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(N.crc32=t["crc32"],N.compressedSize=t["compressedSize"],N.uncompressedSize=t["uncompressedSize"]);var R=0;e&&(R|=8),v||!E&&!k||(R|=2048);var I=0,L=0;O&&(I|=16),"UNIX"===u?(L=798,I|=l(m.unixPermissions,O)):(L=20,I|=c(m.dosPermissions,O)),f=A.getUTCHours(),f<<=6,f|=A.getUTCMinutes(),f<<=5,f|=A.getUTCSeconds()/2,p=A.getUTCFullYear()-1980,p<<=4,p|=A.getUTCMonth()+1,p<<=5,p|=A.getUTCDate(),E&&(C=h(1,1)+h(o(w),4)+y,S+="up"+h(C.length,2)+C),k&&(T=h(1,1)+h(o(_),4)+x,S+="uc"+h(T.length,2)+T);var z="";z+="\n\0",z+=h(R,2),z+=g.magic,z+=h(f,2),z+=h(p,2),z+=h(N.crc32,4),z+=h(N.compressedSize,4),z+=h(N.uncompressedSize,4),z+=h(w.length,2),z+=h(S.length,2);var D=a.LOCAL_FILE_HEADER+z+w+S,P=a.CENTRAL_FILE_HEADER+h(L,2)+z+h(_.length,2)+"\0\0\0\0"+h(I,4)+h(r,4)+w+S+_;return{fileRecord:D,dirRecord:P}},d=function(t,e,i,r,s){var o="",l=n.transformTo("string",s(r));return o=a.CENTRAL_DIRECTORY_END+"\0\0\0\0"+h(t,2)+h(t,2)+h(e,4)+h(i,4)+h(l.length,2)+l,o},f=function(t){var e="";return e=a.DATA_DESCRIPTOR+h(t["crc32"],4)+h(t["compressedSize"],4)+h(t["uncompressedSize"],4),e};function p(t,e,i,n){r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(p,r),p.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,r.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-n-1))/i:100}}))},p.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t["file"].name;var e=this.streamFiles&&!t["file"].dir;if(e){var i=u(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t["file"].dir,i=u(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:f(t),meta:{percent:100}});else{this.push({data:i.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null},p.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e0?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e="undefined"!==typeof e?e:a.createFolders,t=m(t),this.files[t]||f.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function v(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var w={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,n;for(e in this.files)n=this.files[e],i=e.slice(this.root.length,e.length),i&&e.slice(0,this.root.length)===this.root&&t(i,n)},filter:function(t){var e=[];return this.forEach((function(i,n){t(i,n)&&e.push(n)})),e},file:function(t,e,i){if(1===arguments.length){if(v(t)){var n=t;return this.filter((function(t,e){return!e.dir&&n.test(t)}))}var r=this.files[this.root+t];return r&&!r.dir?r:null}return t=this.root+t,f.call(this,t,e,i),this},folder:function(t){if(!t)return this;if(v(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=g.call(this,e),n=this.clone();return n.root=i.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter((function(e,i){return i.name.slice(0,t.length)===t})),n=0;n=0;--s)if(this.data[s]===e&&this.data[s+1]===i&&this.data[s+2]===n&&this.data[s+3]===r)return s-this.zero;return-1},s.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),n=t.charCodeAt(2),r=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&i===s[1]&&n===s[2]&&r===s[3]},s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){"use strict";var n=t("../utils");function r(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=r},{"../utils":32}],19:[function(t,e,i){"use strict";var n=t("./Uint8ArrayReader"),r=t("../utils");function s(t){n.call(this,t)}r.inherits(s,n),s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){"use strict";var n=t("./DataReader"),r=t("../utils");function s(t){n.call(this,t)}r.inherits(s,n),s.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},s.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},s.prototype.readAndCheckSignature=function(t){var e=this.readData(4);return t===e},s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){"use strict";var n=t("./ArrayReader"),r=t("../utils");function s(t){n.call(this,t)}r.inherits(s,n),s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){"use strict";var n=t("../utils"),r=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new h(n.transformTo("uint8array",t)):new s(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){"use strict";var n=t("./GenericWorker"),r=t("../utils");function s(t){n.call(this,"ConvertWorker to "+t),this.destType=t}r.inherits(s,n),s.prototype.processChunk=function(t){this.push({data:r.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){"use strict";var n=t("./GenericWorker"),r=t("../crc32"),s=t("../utils");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s.inherits(o,n),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){"use strict";var n=t("../utils"),r=t("./GenericWorker");function s(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(s,r),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){"use strict";var n=t("../utils"),r=t("./GenericWorker"),s=16384;function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=s,e=null,i=Math.min(this.max,this.index+t);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,i);break;case"uint8array":e=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":e=this.data.slice(this.index,i);break}return this.index=i,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){"use strict";function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i "+t:t}},e.exports=n},{}],29:[function(t,i,n){"use strict";var r=t("../utils"),s=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),h=t("../support"),l=t("../external"),c=null;if(h.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(m){}function u(t,e,i){switch(t){case"blob":return r.newBlob(r.transformTo("arraybuffer",e),i);case"base64":return a.encode(e);default:return r.transformTo(t,e)}}function d(t,i){var n,r=0,s=null,o=0;for(n=0;n=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;a[254]=a[254]=1;var l=function(t){var e,i,n,s,o,a=t.length,h=0;for(s=0;s>>6,e[o++]=128|63&i):i<65536?(e[o++]=224|i>>>12,e[o++]=128|i>>>6&63,e[o++]=128|63&i):(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63,e[o++]=128|i>>>6&63,e[o++]=128|63&i);return e},c=function(t,e){var i;e=e||t.length,e>t.length&&(e=t.length),i=e-1;while(i>=0&&128===(192&t[i]))i--;return i<0||0===i?e:i+a[t[i]]>e?i:e},u=function(t){var e,i,r,s,o=t.length,h=new Array(2*o);for(i=0,e=0;e4)h[i++]=65533,e+=s-1;else{r&=2===s?31:3===s?15:7;while(s>1&&e1?h[i++]=65533:r<65536?h[i++]=r:(r-=65536,h[i++]=55296|r>>10&1023,h[i++]=56320|1023&r)}return h.length!==i&&(h.subarray?h=h.subarray(0,i):h.length=i),n.applyFromCharCode(h)};function d(){o.call(this,"utf-8 decode"),this.leftOver=null}function f(){o.call(this,"utf-8 encode")}i.utf8encode=function(t){return r.nodebuffer?s.newBufferFrom(t,"utf-8"):l(t)},i.utf8decode=function(t){return r.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):(t=n.transformTo(r.uint8array?"uint8array":"array",t),u(t))},n.inherits(d,o),d.prototype.processChunk=function(t){var e=n.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=e;e=new Uint8Array(s.length+this.leftOver.length),e.set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=c(e),a=e;o!==e.length&&(r.uint8array?(a=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(a=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:i.utf8decode(a),meta:t.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=d,n.inherits(f,o),f.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){"use strict";var n=t("./support"),r=t("./base64"),s=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function h(t){var e=null;return e=n.uint8array?new Uint8Array(t.length):new Array(t.length),c(t,e)}function l(t){return t}function c(t,e){for(var i=0;i1)try{return u.stringifyByChunk(t,n,e)}catch(s){e=Math.floor(e/2)}return u.stringifyByChar(t)}function f(t,e){for(var i=0;i1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(i,s.CENTRAL_FILE_HEADER)||(this.reader.zero=o);else if(o<0)throw new Error("Corrupted zip: missing "+Math.abs(o)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){"use strict";var n=t("./reader/readerFor"),r=t("./utils"),s=t("./compressedObject"),o=t("./crc32"),a=t("./utf8"),h=t("./compressions"),l=t("./support"),c=0,u=3,d=function(t){for(var e in h)if(h.hasOwnProperty(e)&&h[e].magic===t)return h[e];return null};function f(t,e){this.options=t,this.loadOptions=e}f.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(e=d(this.compressionMethod),null===e)throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),t===c&&(this.dosPermissions=63&this.externalFileAttributes),t===u&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,i,n,r=t.index+this.extraFieldsLength;this.extraFields||(this.extraFields={});while(t.index+40?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==u)throw new Error(o[i]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var l;if(l="string"===typeof e.dictionary?s.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,i=n.deflateSetDictionary(this.strm,l),i!==u)throw new Error(o[i]);this._dict_set=!0}}function w(t,e){var i=new v(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}function y(t,e){return e=e||{},e.raw=!0,w(t,e)}function b(t,e){return e=e||{},e.gzip=!0,w(t,e)}v.prototype.push=function(t,e){var i,o,a=this.strm,p=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?c:l,"string"===typeof t?a.input=s.string2buf(t):"[object ArrayBuffer]"===h.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(p),a.next_out=0,a.avail_out=p),i=n.deflate(a,o),i!==d&&i!==u)return this.onEnd(i),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||o!==c&&o!==f)||("string"===this.options.to?this.onData(s.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&i!==d);return o===c?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===u):o!==f||(this.onEnd(u),a.avail_out=0,!0)},v.prototype.onData=function(t){this.chunks.push(t)},v.prototype.onEnd=function(t){t===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=v,i.deflate=w,i.deflateRaw=y,i.gzip=b},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){"use strict";var n=t("./zlib/inflate"),r=t("./utils/common"),s=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),h=t("./zlib/zstream"),l=t("./zlib/gzheader"),c=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,e.windowBits);if(i!==o.Z_OK)throw new Error(a[i]);this.header=new l,n.inflateGetHeader(this.strm,this.header)}function d(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}function f(t,e){return e=e||{},e.raw=!0,d(t,e)}u.prototype.push=function(t,e){var i,a,h,l,u,d,f=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"===typeof t?f.input=s.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(p),f.next_out=0,f.avail_out=p),i=n.inflate(f,o.Z_NO_FLUSH),i===o.Z_NEED_DICT&&m&&(d="string"===typeof m?s.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,i=n.inflateSetDictionary(this.strm,d)),i===o.Z_BUF_ERROR&&!0===g&&(i=o.Z_OK,g=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&i!==o.Z_STREAM_END&&(0!==f.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(f.output,f.next_out),l=f.next_out-h,u=s.buf2string(f.output,h),f.next_out=l,f.avail_out=p-l,l&&r.arraySet(f.output,f.output,h,l,0),this.onData(u)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((f.avail_in>0||0===f.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),f.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=u,i.inflate=d,i.inflateRaw=f,i.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){"use strict";var n="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Int32Array;i.assign=function(t){var e=Array.prototype.slice.call(arguments,1);while(e.length){var i=e.shift();if(i){if("object"!==typeof i)throw new TypeError(i+"must be non-object");for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,i,n,r){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+n),r);else for(var s=0;s=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function h(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var i="",o=0;o>>6,e[o++]=128|63&i):i<65536?(e[o++]=224|i>>>12,e[o++]=128|i>>>6&63,e[o++]=128|63&i):(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63,e[o++]=128|i>>>6&63,e[o++]=128|63&i);return e},i.buf2binstring=function(t){return h(t,t.length)},i.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,r=e.length;i4)l[n++]=65533,i+=s-1;else{r&=2===s?31:3===s?15:7;while(s>1&&i1?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return h(l,n)},i.utf8border=function(t,e){var i;e=e||t.length,e>t.length&&(e=t.length),i=e-1;while(i>=0&&128===(192&t[i]))i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){"use strict";function n(t,e,i,n){var r=65535&t|0,s=t>>>16&65535|0,o=0;while(0!==i){o=i>2e3?2e3:i,i-=o;do{r=r+e[n++]|0,s=s+r|0}while(--o);r%=65521,s%=65521}return r|s<<16|0}e.exports=n},{}],44:[function(t,e,i){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){"use strict";function n(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}var r=n();function s(t,e,i,n){var s=r,o=n+i;t^=-1;for(var a=n;a>>8^s[255&(t^e[a])];return-1^t}e.exports=s},{}],46:[function(t,e,i){"use strict";var n,r=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),h=t("./messages"),l=0,c=1,u=3,d=4,f=5,p=0,m=1,g=-2,v=-3,w=-5,y=-1,b=1,_=2,x=3,E=4,k=0,S=2,C=8,T=9,O=15,A=8,N=29,R=256,I=R+1+N,L=30,z=19,D=2*I+1,P=15,B=3,j=258,U=j+B+1,M=32,F=42,W=69,q=73,H=91,Y=103,V=113,Z=666,X=1,G=2,K=3,$=4,J=3;function Q(t,e){return t.msg=h[e],e}function tt(t){return(t<<1)-(t>4?9:0)}function et(t){var e=t.length;while(--e>=0)t[e]=0}function it(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(r.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function nt(t,e){s._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,it(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function st(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function ot(t,e,i,n){var s=t.avail_in;return s>n&&(s=n),0===s?0:(t.avail_in-=s,r.arraySet(e,t.input,t.next_in,s,i),1===t.state.wrap?t.adler=o(t.adler,e,s,i):2===t.state.wrap&&(t.adler=a(t.adler,e,s,i)),t.next_in+=s,t.total_in+=s,s)}function at(t,e){var i,n,r=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-U?t.strstart-(t.w_size-U):0,l=t.window,c=t.w_mask,u=t.prev,d=t.strstart+j,f=l[s+o-1],p=l[s+o];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(i=e,l[i+o]===p&&l[i+o-1]===f&&l[i]===l[s]&&l[++i]===l[s+1]){s+=2,i++;do{}while(l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&so){if(t.match_start=e,o=n,n>=a)break;f=l[s+o-1],p=l[s+o]}}}while((e=u[e&c])>h&&0!==--r);return o<=t.lookahead?o:t.lookahead}function ht(t){var e,i,n,s,o,a=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-U)){r.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,i=t.hash_size,e=i;do{n=t.head[--e],t.head[e]=n>=a?n-a:0}while(--i);i=a,e=i;do{n=t.prev[--e],t.prev[e]=n>=a?n-a:0}while(--i);s+=a}if(0===t.strm.avail_in)break;if(i=ot(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=B){o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ht(t),0===t.lookahead&&e===l)return X;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,nt(t,!1),0===t.strm.avail_out))return X;if(t.strstart-t.block_start>=t.w_size-U&&(nt(t,!1),0===t.strm.avail_out))return X}return t.insert=0,e===d?(nt(t,!0),0===t.strm.avail_out?K:$):(t.strstart>t.block_start&&(nt(t,!1),t.strm.avail_out),X)}function ct(t,e){for(var i,n;;){if(t.lookahead=B&&(t.ins_h=(t.ins_h<=B)if(n=s._tr_tally(t,t.strstart-t.match_start,t.match_length-B),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=B){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=B&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=B-1)),t.prev_length>=B&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-B,n=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-B),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<=B&&t.strstart>0&&(r=t.strstart-1,n=a[r],n===a[++r]&&n===a[++r]&&n===a[++r])){o=t.strstart+j;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=B?(i=s._tr_tally(t,1,t.match_length-B),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(nt(t,!1),0===t.strm.avail_out))return X}return t.insert=0,e===d?(nt(t,!0),0===t.strm.avail_out?K:$):t.last_lit&&(nt(t,!1),0===t.strm.avail_out)?X:G}function ft(t,e){for(var i;;){if(0===t.lookahead&&(ht(t),0===t.lookahead)){if(e===l)return X;break}if(t.match_length=0,i=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(nt(t,!1),0===t.strm.avail_out))return X}return t.insert=0,e===d?(nt(t,!0),0===t.strm.avail_out?K:$):t.last_lit&&(nt(t,!1),0===t.strm.avail_out)?X:G}function pt(t,e,i,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=n,this.func=r}function mt(t){t.window_size=2*t.w_size,et(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=B-1,t.match_available=0,t.ins_h=0}function gt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*D),this.dyn_dtree=new r.Buf16(2*(2*L+1)),this.bl_tree=new r.Buf16(2*(2*z+1)),et(this.dyn_ltree),et(this.dyn_dtree),et(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(P+1),this.heap=new r.Buf16(2*I+1),et(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*I+1),et(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function vt(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=S,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?F:V,t.adler=2===e.wrap?0:1,e.last_flush=l,s._tr_init(e),p):Q(t,g)}function wt(t){var e=vt(t);return e===p&&mt(t.state),e}function yt(t,e){return t&&t.state?2!==t.state.wrap?g:(t.state.gzhead=e,p):g}function bt(t,e,i,n,s,o){if(!t)return g;var a=1;if(e===y&&(e=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),s<1||s>T||i!==C||n<8||n>15||e<0||e>9||o<0||o>E)return Q(t,g);8===n&&(n=9);var h=new gt;return t.state=h,h.strm=t,h.wrap=a,h.gzhead=null,h.w_bits=n,h.w_size=1<f||e<0)return t?Q(t,g):g;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||r.status===Z&&e!==d)return Q(t,0===t.avail_out?w:g);if(r.strm=t,i=r.last_flush,r.last_flush=e,r.status===F)if(2===r.wrap)t.adler=0,rt(r,31),rt(r,139),rt(r,8),r.gzhead?(rt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),rt(r,255&r.gzhead.time),rt(r,r.gzhead.time>>8&255),rt(r,r.gzhead.time>>16&255),rt(r,r.gzhead.time>>24&255),rt(r,9===r.level?2:r.strategy>=_||r.level<2?4:0),rt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(rt(r,255&r.gzhead.extra.length),rt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=W):(rt(r,0),rt(r,0),rt(r,0),rt(r,0),rt(r,0),rt(r,9===r.level?2:r.strategy>=_||r.level<2?4:0),rt(r,J),r.status=V);else{var v=C+(r.w_bits-8<<4)<<8,y=-1;y=r.strategy>=_||r.level<2?0:r.level<6?1:6===r.level?2:3,v|=y<<6,0!==r.strstart&&(v|=M),v+=31-v%31,r.status=V,st(r,v),0!==r.strstart&&(st(r,t.adler>>>16),st(r,65535&t.adler)),t.adler=1}if(r.status===W)if(r.gzhead.extra){o=r.pending;while(r.gzindex<(65535&r.gzhead.extra.length)){if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),it(t),o=r.pending,r.pending===r.pending_buf_size))break;rt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++}r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=q)}else r.status=q;if(r.status===q)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),it(t),o=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindexo&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),0===h&&(r.gzindex=0,r.status=H)}else r.status=H;if(r.status===H)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),it(t),o=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindexo&&(t.adler=a(t.adler,r.pending_buf,r.pending-o,o)),0===h&&(r.status=Y)}else r.status=Y;if(r.status===Y&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&it(t),r.pending+2<=r.pending_buf_size&&(rt(r,255&t.adler),rt(r,t.adler>>8&255),t.adler=0,r.status=V)):r.status=V),0!==r.pending){if(it(t),0===t.avail_out)return r.last_flush=-1,p}else if(0===t.avail_in&&tt(e)<=tt(i)&&e!==d)return Q(t,w);if(r.status===Z&&0!==t.avail_in)return Q(t,w);if(0!==t.avail_in||0!==r.lookahead||e!==l&&r.status!==Z){var b=r.strategy===_?ft(r,e):r.strategy===x?dt(r,e):n[r.level].func(r,e);if(b!==K&&b!==$||(r.status=Z),b===X||b===K)return 0===t.avail_out&&(r.last_flush=-1),p;if(b===G&&(e===c?s._tr_align(r):e!==f&&(s._tr_stored_block(r,0,0,!1),e===u&&(et(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),it(t),0===t.avail_out))return r.last_flush=-1,p}return e!==d?p:r.wrap<=0?m:(2===r.wrap?(rt(r,255&t.adler),rt(r,t.adler>>8&255),rt(r,t.adler>>16&255),rt(r,t.adler>>24&255),rt(r,255&t.total_in),rt(r,t.total_in>>8&255),rt(r,t.total_in>>16&255),rt(r,t.total_in>>24&255)):(st(r,t.adler>>>16),st(r,65535&t.adler)),it(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?p:m)}function Et(t){var e;return t&&t.state?(e=t.state.status,e!==F&&e!==W&&e!==q&&e!==H&&e!==Y&&e!==V&&e!==Z?Q(t,g):(t.state=null,e===V?Q(t,v):p)):g}function kt(t,e){var i,n,s,a,h,l,c,u,d=e.length;if(!t||!t.state)return g;if(i=t.state,a=i.wrap,2===a||1===a&&i.status!==F||i.lookahead)return g;1===a&&(t.adler=o(t.adler,e,d,0)),i.wrap=0,d>=i.w_size&&(0===a&&(et(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new r.Buf8(i.w_size),r.arraySet(u,e,d-i.w_size,i.w_size,0),e=u,d=i.w_size),h=t.avail_in,l=t.next_in,c=t.input,t.avail_in=d,t.next_in=0,t.input=e,ht(i);while(i.lookahead>=B){n=i.strstart,s=i.lookahead-(B-1);do{i.ins_h=(i.ins_h<>>24,m>>>=x,g-=x,x=_>>>16&255,0===x)O[a++]=65535&_;else{if(!(16&x)){if(0===(64&x)){_=v[(65535&_)+(m&(1<>>=x,g-=x),g<15&&(m+=T[s++]<>>24,m>>>=x,g-=x,x=_>>>16&255,!(16&x)){if(0===(64&x)){_=w[(65535&_)+(m&(1<c){t.msg="invalid distance too far back",i.mode=n;break t}if(m>>>=x,g-=x,x=a-h,k>x){if(x=k-x,x>d&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(S=0,C=p,0===f){if(S+=u-x,x2)O[a++]=C[S++],O[a++]=C[S++],O[a++]=C[S++],E-=3;E&&(O[a++]=C[S++],E>1&&(O[a++]=C[S++]))}else{S=a-k;do{O[a++]=O[S++],O[a++]=O[S++],O[a++]=O[S++],E-=3}while(E>2);E&&(O[a++]=O[S++],E>1&&(O[a++]=O[S++]))}break}}break}}while(s>3,s-=E,g-=E<<3,m&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function st(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ot(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=x,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(tt),e.distcode=e.distdyn=new n.Buf32(et),e.sane=1,e.back=-1,p):v}function at(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,ot(t)):v}function ht(t,e){var i,n;return t&&t.state?(n=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?v:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=i,n.wbits=e,at(t))):v}function lt(t,e){var i,n;return t?(n=new st,t.state=n,n.window=null,i=ht(t,e),i!==p&&(t.state=null),i):v}function ct(t){return lt(t,nt)}var ut,dt,ft=!0;function pt(t){if(ft){var e;ut=new n.Buf32(512),dt=new n.Buf32(32),e=0;while(e<144)t.lens[e++]=8;while(e<256)t.lens[e++]=9;while(e<280)t.lens[e++]=7;while(e<288)t.lens[e++]=8;a(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;while(e<32)t.lens[e++]=5;a(c,t.lens,0,32,dt,0,t.work,{bits:5}),ft=!1}t.lencode=ut,t.lenbits=9,t.distcode=dt,t.distbits=5}function mt(t,e,i,r){var s,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(n.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>r&&(s=r),n.arraySet(o.window,e,i-r,s,o.wnext),r-=s,r?(n.arraySet(o.window,e,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,i.check=s(i.check,Tt,2,0),at=0,ht=0,i.mode=E;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&at)<<8)+(at>>8))%31){t.msg="incorrect header check",i.mode=$;break}if((15&at)!==_){t.msg="unknown compression method",i.mode=$;break}if(at>>>=4,ht-=4,xt=8+(15&at),0===i.wbits)i.wbits=xt;else if(xt>i.wbits){t.msg="invalid window size",i.mode=$;break}i.dmax=1<>8&1),512&i.flags&&(Tt[0]=255&at,Tt[1]=at>>>8&255,i.check=s(i.check,Tt,2,0)),at=0,ht=0,i.mode=k;case k:while(ht<32){if(0===st)break t;st--,at+=tt[it++]<>>8&255,Tt[2]=at>>>16&255,Tt[3]=at>>>24&255,i.check=s(i.check,Tt,4,0)),at=0,ht=0,i.mode=S;case S:while(ht<16){if(0===st)break t;st--,at+=tt[it++]<>8),512&i.flags&&(Tt[0]=255&at,Tt[1]=at>>>8&255,i.check=s(i.check,Tt,2,0)),at=0,ht=0,i.mode=C;case C:if(1024&i.flags){while(ht<16){if(0===st)break t;st--,at+=tt[it++]<>>8&255,i.check=s(i.check,Tt,2,0)),at=0,ht=0}else i.head&&(i.head.extra=null);i.mode=T;case T:if(1024&i.flags&&(ut=i.length,ut>st&&(ut=st),ut&&(i.head&&(xt=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,tt,it,ut,xt)),512&i.flags&&(i.check=s(i.check,tt,ut,it)),st-=ut,it+=ut,i.length-=ut),i.length))break t;i.length=0,i.mode=O;case O:if(2048&i.flags){if(0===st)break t;ut=0;do{xt=tt[it+ut++],i.head&&xt&&i.length<65536&&(i.head.name+=String.fromCharCode(xt))}while(xt&&ut>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=L;break;case R:while(ht<32){if(0===st)break t;st--,at+=tt[it++]<>>=7&ht,ht-=7&ht,i.mode=X;break}while(ht<3){if(0===st)break t;st--,at+=tt[it++]<>>=1,ht-=1,3&at){case 0:i.mode=D;break;case 1:if(pt(i),i.mode=F,e===f){at>>>=2,ht-=2;break t}break;case 2:i.mode=j;break;case 3:t.msg="invalid block type",i.mode=$}at>>>=2,ht-=2;break;case D:at>>>=7&ht,ht-=7&ht;while(ht<32){if(0===st)break t;st--,at+=tt[it++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=$;break}if(i.length=65535&at,at=0,ht=0,i.mode=P,e===f)break t;case P:i.mode=B;case B:if(ut=i.length,ut){if(ut>st&&(ut=st),ut>ot&&(ut=ot),0===ut)break t;n.arraySet(et,tt,it,ut,nt),st-=ut,it+=ut,ot-=ut,nt+=ut,i.length-=ut;break}i.mode=L;break;case j:while(ht<14){if(0===st)break t;st--,at+=tt[it++]<>>=5,ht-=5,i.ndist=1+(31&at),at>>>=5,ht-=5,i.ncode=4+(15&at),at>>>=4,ht-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=$;break}i.have=0,i.mode=U;case U:while(i.have>>=3,ht-=3}while(i.have<19)i.lens[Ot[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,kt={bits:i.lenbits},Et=a(h,i.lens,0,19,i.lencode,0,i.work,kt),i.lenbits=kt.bits,Et){t.msg="invalid code lengths set",i.mode=$;break}i.have=0,i.mode=M;case M:while(i.have>>24,vt=Ct>>>16&255,wt=65535&Ct,gt<=ht)break;if(0===st)break t;st--,at+=tt[it++]<>>=gt,ht-=gt,i.lens[i.have++]=wt;else{if(16===wt){St=gt+2;while(ht>>=gt,ht-=gt,0===i.have){t.msg="invalid bit length repeat",i.mode=$;break}xt=i.lens[i.have-1],ut=3+(3&at),at>>>=2,ht-=2}else if(17===wt){St=gt+3;while(ht>>=gt,ht-=gt,xt=0,ut=3+(7&at),at>>>=3,ht-=3}else{St=gt+7;while(ht>>=gt,ht-=gt,xt=0,ut=11+(127&at),at>>>=7,ht-=7}if(i.have+ut>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=$;break}while(ut--)i.lens[i.have++]=xt}}if(i.mode===$)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=$;break}if(i.lenbits=9,kt={bits:i.lenbits},Et=a(l,i.lens,0,i.nlen,i.lencode,0,i.work,kt),i.lenbits=kt.bits,Et){t.msg="invalid literal/lengths set",i.mode=$;break}if(i.distbits=6,i.distcode=i.distdyn,kt={bits:i.distbits},Et=a(c,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,kt),i.distbits=kt.bits,Et){t.msg="invalid distances set",i.mode=$;break}if(i.mode=F,e===f)break t;case F:i.mode=W;case W:if(st>=6&&ot>=258){t.next_out=nt,t.avail_out=ot,t.next_in=it,t.avail_in=st,i.hold=at,i.bits=ht,o(t,ct),nt=t.next_out,et=t.output,ot=t.avail_out,it=t.next_in,tt=t.input,st=t.avail_in,at=i.hold,ht=i.bits,i.mode===L&&(i.back=-1);break}for(i.back=0;;){if(Ct=i.lencode[at&(1<>>24,vt=Ct>>>16&255,wt=65535&Ct,gt<=ht)break;if(0===st)break t;st--,at+=tt[it++]<>yt)],gt=Ct>>>24,vt=Ct>>>16&255,wt=65535&Ct,yt+gt<=ht)break;if(0===st)break t;st--,at+=tt[it++]<>>=yt,ht-=yt,i.back+=yt}if(at>>>=gt,ht-=gt,i.back+=gt,i.length=wt,0===vt){i.mode=Z;break}if(32&vt){i.back=-1,i.mode=L;break}if(64&vt){t.msg="invalid literal/length code",i.mode=$;break}i.extra=15&vt,i.mode=q;case q:if(i.extra){St=i.extra;while(ht>>=i.extra,ht-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=H;case H:for(;;){if(Ct=i.distcode[at&(1<>>24,vt=Ct>>>16&255,wt=65535&Ct,gt<=ht)break;if(0===st)break t;st--,at+=tt[it++]<>yt)],gt=Ct>>>24,vt=Ct>>>16&255,wt=65535&Ct,yt+gt<=ht)break;if(0===st)break t;st--,at+=tt[it++]<>>=yt,ht-=yt,i.back+=yt}if(at>>>=gt,ht-=gt,i.back+=gt,64&vt){t.msg="invalid distance code",i.mode=$;break}i.offset=wt,i.extra=15&vt,i.mode=Y;case Y:if(i.extra){St=i.extra;while(ht>>=i.extra,ht-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=$;break}i.mode=V;case V:if(0===ot)break t;if(ut=ct-ot,i.offset>ut){if(ut=i.offset-ut,ut>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=$;break}ut>i.wnext?(ut-=i.wnext,dt=i.wsize-ut):dt=i.wnext-ut,ut>i.length&&(ut=i.length),ft=i.window}else ft=et,dt=nt-i.offset,ut=i.length;ut>ot&&(ut=ot),ot-=ut,i.length-=ut;do{et[nt++]=ft[dt++]}while(--ut);0===i.length&&(i.mode=W);break;case Z:if(0===ot)break t;et[nt++]=i.length,ot--,i.mode=W;break;case X:if(i.wrap){while(ht<32){if(0===st)break t;st--,at|=tt[it++]<=1;I--)if(0!==F[I])break;if(L>I&&(L=I),0===I)return m[g++]=20971520,m[g++]=20971520,w.bits=1,0;for(R=1;R0&&(t===a||1!==I))return-1;for(W[1]=0,A=1;As||t===l&&B>o)return 1;for(;;){S=A-D,v[N]k?(C=q[H+v[N]],T=U[M+v[N]]):(C=96,T=0),y=1<>D)+b]=S<<24|C<<16|T|0}while(0!==b);y=1<>=1;if(0!==y?(j&=y-1,j+=y):j=0,N++,0===--F[A]){if(A===I)break;A=e[i+v[N]]}if(A>L&&(j&x)!==_){0===D&&(D=L),E+=R,z=A-D,P=1<s||t===l&&B>o)return 1;_=j&x,m[_]=L<<24|z<<16|E-g|0}}return 0!==j&&(m[E+j]=A-D<<24|64<<16|0),w.bits=L,0}},{"../utils/common":41}],51:[function(t,e,i){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){"use strict";var n=t("../utils/common"),r=4,s=0,o=1,a=2;function h(t){var e=t.length;while(--e>=0)t[e]=0}var l=0,c=1,u=2,d=3,f=258,p=29,m=256,g=m+1+p,v=30,w=19,y=2*g+1,b=15,_=16,x=7,E=256,k=16,S=17,C=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=512,I=new Array(2*(g+2));h(I);var L=new Array(2*v);h(L);var z=new Array(R);h(z);var D=new Array(f-d+1);h(D);var P=new Array(p);h(P);var B,j,U,M=new Array(v);function F(t,e,i,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function W(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function q(t){return t<256?z[t]:z[256+(t>>>7)]}function H(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Y(t,e,i){t.bi_valid>_-i?(t.bi_buf|=e<>_-t.bi_valid,t.bi_valid+=i-_):(t.bi_buf|=e<>>=1,i<<=1}while(--e>0);return i>>>1}function X(t){16===t.bi_valid?(H(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function G(t,e){var i,n,r,s,o,a,h=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,u=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(s=0;s<=b;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;ip&&(s=p,m++),h[2*n+1]=s,n>l||(t.bl_count[s]++,o=0,n>=f&&(o=d[n-f]),a=h[2*n],t.opt_len+=a*(s+o),u&&(t.static_len+=a*(c[2*n+1]+o)));if(0!==m){do{s=p-1;while(0===t.bl_count[s])s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(s=p;0!==s;s--){n=t.bl_count[s];while(0!==n)r=t.heap[--i],r>l||(h[2*r+1]!==s&&(t.opt_len+=(s-h[2*r+1])*h[2*r],h[2*r+1]=s),n--)}}}function K(t,e,i){var n,r,s=new Array(b+1),o=0;for(n=1;n<=b;n++)s[n]=o=o+i[n-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=Z(s[a]++,a))}}function $(){var t,e,i,n,r,s=new Array(b+1);for(i=0,n=0;n>=7;n8?H(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function tt(t,e,i,r){Q(t),r&&(H(t,i),H(t,~i)),n.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}function et(t,e,i,n){var r=2*e,s=2*i;return t[r]>1;i>=1;i--)it(t,s,i);r=h;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],it(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=n,s[2*r]=s[2*i]+s[2*n],t.depth[r]=(t.depth[i]>=t.depth[n]?t.depth[i]:t.depth[n])+1,s[2*i+1]=s[2*n+1]=r,t.heap[1]=r++,it(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],G(t,e),K(s,l,t.bl_count)}function st(t,e,i){var n,r,s=-1,o=e[1],a=0,h=7,l=4;for(0===o&&(h=138,l=3),e[2*(i+1)+1]=65535,n=0;n<=i;n++)r=o,o=e[2*(n+1)+1],++a=3;e--)if(0!==t.bl_tree[2*N[e]+1])break;return t.opt_len+=3*(e+1)+5+5+4,e}function ht(t,e,i,n){var r;for(Y(t,e-257,5),Y(t,i-1,5),Y(t,n-4,4),r=0;r>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return s;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return o;for(e=32;e0?(t.strm.data_type===a&&(t.strm.data_type=lt(t)),rt(t,t.l_desc),rt(t,t.d_desc),h=at(t),s=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=s&&(s=o)):s=o=i+5,i+4<=s&&-1!==e?dt(t,e,i,n):t.strategy===r||o===s?(Y(t,(c<<1)+(n?1:0),3),nt(t,I,L)):(Y(t,(u<<1)+(n?1:0),3),ht(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),nt(t,t.dyn_ltree,t.dyn_dtree)),J(t),n&&Q(t)}function mt(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(D[i]+m+1)]++,t.dyn_dtree[2*q(e)]++),t.last_lit===t.lit_bufsize-1}i._tr_init=ut,i._tr_stored_block=dt,i._tr_flush_block=pt,i._tr_tally=mt,i._tr_align=ft},{"../utils/common":41}],53:[function(t,e,i){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},{}],54:[function(t,e,i){"use strict";e.exports="function"===typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}))}).call(this,i("b639").Buffer,i("c8ba"))},"894b":function(t,e,i){"use strict";function n(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}Object.defineProperty(e,"__esModule",{value:!0}),e.createElement=n,e.default={createElement:n}},"8a9e":function(t,e,i){"use strict";var n=i("0b16"),r=i("06d2"),s=i("c9fc"),o=i.n(s);class a{constructor(t){this.settings=t,this.name=t.layout||"reflowable",this._spread="none"!==t.spread,this._minSpreadWidth=t.minSpreadWidth||800,this._evenSpreads=t.evenSpreads||!1,"scrolled"===t.flow||"scrolled-continuous"===t.flow||"scrolled-doc"===t.flow?this._flow="scrolled":this._flow="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(t){return"undefined"!=typeof t&&(this._flow="scrolled"===t||"scrolled-continuous"===t||"scrolled-doc"===t?"scrolled":"paginated",this.update({flow:this._flow})),this._flow}spread(t,e){return t&&(this._spread="none"!==t,this.update({spread:this._spread})),e>=0&&(this._minSpreadWidth=e),this._spread}calculate(t,e,i){var n,r,s,o,a=1,h=i||0,l=t,c=e,u=Math.floor(l/12);a=this._spread&&l>=this._minSpreadWidth?2:1,"reflowable"!==this.name||"paginated"!==this._flow||i>=0||(h=u%2===0?u:u-1),"pre-paginated"===this.name&&(h=0),a>1?(n=l/a-h,s=n+h):(n=l,s=l),"pre-paginated"===this.name&&a>1&&(l=n),r=n*a+h,o=l,this.width=l,this.height=c,this.spreadWidth=r,this.pageWidth=s,this.delta=o,this.columnWidth=n,this.gap=h,this.divisor=a,this.update({width:l,height:c,spreadWidth:r,pageWidth:s,delta:o,columnWidth:n,gap:h,divisor:a})}format(t,e,i){var n;return n="pre-paginated"===this.name?t.fit(this.columnWidth,this.height,e):"paginated"===this._flow?t.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):i&&"horizontal"===i?t.size(null,this.height):t.size(this.width,null),n}count(t,e){let i,n;return"pre-paginated"===this.name?(i=1,n=1):"paginated"===this._flow?(e=e||this.delta,i=Math.ceil(t/e),n=i*this.divisor):(e=e||this.height,i=Math.ceil(t/e),n=i),{spreads:i,pages:n}}update(t){if(Object.keys(t).forEach(e=>{this.props[e]===t[e]&&delete t[e]}),Object.keys(t).length>0){let e=Object(n["extend"])(this.props,t);this.emit(r["c"].LAYOUT.UPDATED,e,t)}}}o()(a.prototype),e["a"]=a},"8b5a":function(t,e,i){"use strict";var n=i("0b16"),r=i("e58e"),s=i("06d2"),o=i("c9fc"),a=i.n(o);const h=Math.PI/2,l={easeOutSine:function(t){return Math.sin(t*h)},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},easeInCubic:function(t){return Math.pow(t,3)}};class c{constructor(t,e){this.settings=Object(n["extend"])({duration:80,minVelocity:.2,minDistance:10,easing:l["easeInCubic"]},e||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(t)}setup(t){this.manager=t,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(t){let e=t.contents;["touchstart","touchmove","touchend"].forEach(t=>{e.on(t,t=>this.triggerViewEvent(t,e))})}triggerViewEvent(t,e){this.emit(t.type,t,e)}onScroll(t){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(t){this.resizeCanceler=!0}onTouchStart(t){let{screenX:e,screenY:i}=t.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=e,this.startTouchY=i,this.startTime=this.now()),this.endTouchX=e,this.endTouchY=i,this.endTime=this.now()}onTouchMove(t){let{screenX:e,screenY:i}=t.touches[0],n=Math.abs(i-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&n<10&&(this.element.scrollLeft-=e-this.endTouchX),this.endTouchX=e,this.endTouchY=i,this.endTime=this.now()}onTouchEnd(t){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let e=this.wasSwiped();0!==e?this.snap(e):this.snap(),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 t=this.layout.pageWidth*this.layout.divisor,e=this.endTouchX-this.startTouchX,i=Math.abs(e),n=this.endTime-this.startTime,r=e/n,s=this.settings.minVelocity;return i<=this.settings.minDistance||i>=t?0:r>s?-1:r<-s?1:void 0}needsSnap(){let t=this.scrollLeft,e=this.layout.pageWidth*this.layout.divisor;return t%e!==0}snap(t=0){let e=this.scrollLeft,i=this.layout.pageWidth*this.layout.divisor,n=Math.round(e/i)*i;return t&&(n+=t*i),this.smoothScrollTo(n)}smoothScrollTo(t){const e=new n["defer"],i=this.scrollLeft,r=this.now(),s=this.settings.duration,o=this.settings.easing;function a(){const n=this.now(),h=Math.min(1,(n-r)/s);o(h);if(this.touchCanceler||this.resizeCanceler)return this.resizeCanceler=!1,this.snapping=!1,void e.resolve();h<1?(window.requestAnimationFrame(a.bind(this)),this.scrollTo(i+(t-i)*h,0)):(this.scrollTo(t,0),this.snapping=!1,e.resolve())}return this.snapping=!0,a.call(this),e.promise}scrollTo(t=0,e=0){this.fullsize?window.scroll(t,e):(this.scroller.scrollLeft=t,this.scroller.scrollTop=e)}now(){return"now"in window.performance?performance.now():(new Date).getTime()}destroy(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}}a()(c.prototype);var u=c,d=i("b047"),f=i.n(d);class p extends r["a"]{constructor(t){super(t),this.name="continuous",this.settings=Object(n["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,allowScriptedContent:!1}),Object(n["extend"])(this.settings,t.settings||{}),"undefined"!=t.settings.gap&&0===t.settings.gap&&(this.settings.gap=t.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,allowScriptedContent:this.settings.allowScriptedContent},this.scrollTop=0,this.scrollLeft=0}display(t,e){return r["a"].prototype.display.call(this,t,e).then(function(){return this.fill()}.bind(this))}fill(t){var e=t||new n["defer"];return this.q.enqueue(()=>this.check()).then(t=>{t?this.fill(e):e.resolve()}),e.promise}moveTo(t){var e=0,i=0;this.isPaginated?(e=Math.floor(t.left/this.layout.delta)*this.layout.delta,this.settings.offsetDelta):(i=t.top,t.top,this.settings.offsetDelta),(e>0||i>0)&&this.scrollBy(e,i,!0)}afterResized(t){this.emit(s["c"].MANAGERS.RESIZE,t.section)}removeShownListeners(t){t.onDisplayed=function(){}}add(t){var e=this.createView(t);return this.views.append(e),e.on(s["c"].VIEWS.RESIZED,t=>{e.expanded=!0}),e.on(s["c"].VIEWS.AXIS,t=>{this.updateAxis(t)}),e.on(s["c"].VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),e.onDisplayed=this.afterDisplayed.bind(this),e.onResize=this.afterResized.bind(this),e.display(this.request)}append(t){var e=this.createView(t);return e.on(s["c"].VIEWS.RESIZED,t=>{e.expanded=!0}),e.on(s["c"].VIEWS.AXIS,t=>{this.updateAxis(t)}),e.on(s["c"].VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),this.views.append(e),e.onDisplayed=this.afterDisplayed.bind(this),e}prepend(t){var e=this.createView(t);return e.on(s["c"].VIEWS.RESIZED,t=>{this.counter(t),e.expanded=!0}),e.on(s["c"].VIEWS.AXIS,t=>{this.updateAxis(t)}),e.on(s["c"].VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),this.views.prepend(e),e.onDisplayed=this.afterDisplayed.bind(this),e}counter(t){"vertical"===this.settings.axis?this.scrollBy(0,t.heightDelta,!0):this.scrollBy(t.widthDelta,0,!0)}update(t){for(var e,i,r=this.bounds(),s=this.views.all(),o=s.length,a=[],h="undefined"!=typeof t?t:this.settings.offset||0,l=new n["defer"],c=[],u=0;u{i.hide()});c.push(t)}a.push(i)}else this.q.enqueue(i.destroy.bind(i)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return c.length?Promise.all(c).catch(t=>{l.reject(t)}):(l.resolve(),l.promise)}check(t,e){var i=new n["defer"],r=[],s="horizontal"===this.settings.axis,o=this.settings.offset||0;t&&s&&(o=t),e&&!s&&(o=e);var a=this._bounds;let h=s?this.scrollLeft:this.scrollTop,l=s?Math.floor(a.width):a.height,c=s?this.container.scrollWidth:this.container.scrollHeight,u=this.writingMode&&0===this.writingMode.indexOf("vertical")?"vertical":"horizontal",d=this.settings.rtlScrollType,f="rtl"===this.settings.direction;this.settings.fullsize?(s&&f&&"negative"===d||!s&&f&&"default"===d)&&(h*=-1):(f&&"default"===d&&"horizontal"===u&&(h=c-l-h),f&&"negative"===d&&"horizontal"===u&&(h*=-1));let p=()=>{let t=this.views.first(),e=t&&t.section.prev();e&&r.push(this.prepend(e))},m=()=>{let t=this.views.last(),e=t&&t.section.next();e&&r.push(this.append(e))},g=h+l+o,v=h-o;g>=c&&m(),v<0&&p();let w=r.map(t=>t.display(this.request));return r.length?Promise.all(w).then(()=>this.check()).then(()=>this.update(o),t=>t):(this.q.enqueue(function(){this.update()}.bind(this)),i.resolve(!1),i.promise)}trim(){for(var t=new n["defer"],e=this.views.displayed(),i=e[0],r=e[e.length-1],s=this.views.indexOf(i),o=this.views.indexOf(r),a=this.views.slice(0,s),h=this.views.slice(o+1),l=0;l65535){t-=65536;var e=55296+(t>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}function o(t){var e=t.slice(1,-1);return e in i?i[e]:"#"===e.charAt(0)?s(parseInt(e.substr(1).replace("x","0x"))):(r.error("entity not found:"+t),t)}function a(e){if(e>_){var i=t.substring(_,e).replace(/&#?\w+;/g,o);d&&h(_),n.characters(i,0,e-_),_=e}}function h(e,i){while(e>=c&&(i=u.exec(t)))l=i.index,c=l+i[0].length,d.lineNumber++;d.columnNumber=e-l+1}var l=0,c=0,u=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,p=[{currentNSMap:e}],m={},_=0;while(1){try{var S=t.indexOf("<",_);if(S<0){if(!t.substr(_).match(/^\s*$/)){var C=n.doc,T=C.createTextNode(t.substr(_));C.appendChild(T),n.currentElement=T}return}switch(S>_&&a(S),t.charAt(S+1)){case"/":var O=t.indexOf(">",S+3),A=t.substring(S+2,O),N=p.pop();O<0?(A=t.substring(S+2).replace(/[\s<].*/,""),r.error("end tag name: "+A+" is not complete:"+N.tagName),O=S+1+A.length):A.match(/\s_?_=O:a(Math.max(S,_)+1)}}function g(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function v(t,e,i,n,r,f){function p(t,e,n){t in i.attributeNames&&f.fatalError("Attribute "+t+" redefined"),i.addValue(t,e,n)}var m,g=++e,v=s;while(1){var w=t.charAt(g);switch(w){case"=":if(v===o)m=t.slice(e,g),v=h;else{if(v!==a)throw new Error("attribute equal must after attrName");v=h}break;case"'":case'"':if(v===h||v===o){if(v===o&&(f.warning('attribute value must after "="'),m=t.slice(e,g)),e=g+1,g=t.indexOf(w,e),!(g>0))throw new Error("attribute value no end '"+w+"' match");y=t.slice(e,g).replace(/&#?\w+;/g,r),p(m,y,e-1),v=c}else{if(v!=l)throw new Error('attribute value must after "="');y=t.slice(e,g).replace(/&#?\w+;/g,r),p(m,y,e),f.warning('attribute "'+m+'" missed start quot('+w+")!!"),e=g+1,v=c}break;case"/":switch(v){case s:i.setTagName(t.slice(e,g));case c:case u:case d:v=d,i.closed=!0;case l:case o:case a:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return f.error("unexpected end of input"),v==s&&i.setTagName(t.slice(e,g)),g;case">":switch(v){case s:i.setTagName(t.slice(e,g));case c:case u:case d:break;case l:case o:y=t.slice(e,g),"/"===y.slice(-1)&&(i.closed=!0,y=y.slice(0,-1));case a:v===a&&(y=m),v==l?(f.warning('attribute "'+y+'" missed quot(")!'),p(m,y.replace(/&#?\w+;/g,r),e)):("http://www.w3.org/1999/xhtml"===n[""]&&y.match(/^(?:disabled|checked|selected)$/i)||f.warning('attribute "'+y+'" missed value!! "'+y+'" instead!!'),p(y,y,e));break;case h:throw new Error("attribute value missed!!")}return g;case"€":w=" ";default:if(w<=" ")switch(v){case s:i.setTagName(t.slice(e,g)),v=u;break;case o:m=t.slice(e,g),v=a;break;case l:var y=t.slice(e,g).replace(/&#?\w+;/g,r);f.warning('attribute "'+y+'" missed quot(")!!'),p(m,y,e);case c:v=u;break}else switch(v){case a:i.tagName;"http://www.w3.org/1999/xhtml"===n[""]&&m.match(/^(?:disabled|checked|selected)$/i)||f.warning('attribute "'+m+'" missed value!! "'+m+'" instead2!!'),p(m,m,e),e=g,v=o;break;case c:f.warning('attribute space is required"'+m+'"!!');case u:v=o,e=g;break;case h:v=l,e=g;break;case d:throw new Error("elements closed character '/' and '>' must be connected to")}}g++}}function w(t,e,i){var n=t.tagName,r=null,s=t.length;while(s--){var o=t[s],a=o.qName,h=o.value,l=a.indexOf(":");if(l>0)var c=o.prefix=a.slice(0,l),u=a.slice(l+1),d="xmlns"===c&&u;else u=a,c=null,d="xmlns"===a&&"";o.localName=u,!1!==d&&(null==r&&(r={},_(i,i={})),i[d]=r[d]=h,o.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(d,h))}s=t.length;while(s--){o=t[s];c=o.prefix;c&&("xml"===c&&(o.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==c&&(o.uri=i[c||""]))}l=n.indexOf(":");l>0?(c=t.prefix=n.slice(0,l),u=t.localName=n.slice(l+1)):(c=null,u=t.localName=n);var f=t.uri=i[c||""];if(e.startElement(f,u,n,t),!t.closed)return t.currentNSMap=i,t.localNSMap=r,!0;if(e.endElement(f,u,n),r)for(c in r)e.endPrefixMapping(c)}function y(t,e,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=t.indexOf("",e),o=t.substring(e+1,s);if(/[&<]/.test(o))return/^script$/i.test(i)?(r.characters(o,0,o.length),s):(o=o.replace(/&#?\w+;/g,n),r.characters(o,0,o.length),s)}return e+1}function b(t,e,i,n){var r=n[i];return null==r&&(r=t.lastIndexOf(""),re?(i.comment(t,e+4,s-e-4),s+3):(n.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==t.substr(e+3,6)){s=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,s-e-9),i.endCDATA(),s+3}var o=S(t,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var h=o[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var u=o[a-1];return i.startDTD(h,l,c),i.endDTD(),u.index+u[0].length}}return-1}function E(t,e,i){var n=t.indexOf("?>",e);if(n){var r=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function k(){this.attributeNames={}}function S(t,e){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=e,r.exec(t);while(i=r.exec(t))if(n.push(i),i[1])return n}f.prototype=new Error,f.prototype.name=f.name,p.prototype={parse:function(t,e,i){var n=this.domBuilder;n.startDocument(),_(e,e={}),m(t,e,i,n,this.errorHandler),n.endDocument()}},k.prototype={setTagName:function(t){if(!r.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!r.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=p,e.ParseError=f},"8f8f":function(t,e,i){"use strict";var n=i("0b16");const r=1,s=3,o=9;class a{constructor(t,e,i){var r;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(t,e,i);if("string"===typeof e?this.base=this.parseComponent(e):"object"===typeof e&&e.steps&&(this.base=e),r=this.checkType(t),"string"===r)return this.str=t,Object(n["extend"])(this,this.parse(t));if("range"===r)return Object(n["extend"])(this,this.fromRange(t,this.base,i));if("node"===r)return Object(n["extend"])(this,this.fromNode(t,this.base,i));if("EpubCFI"===r&&t.path)return t;if(t)throw new TypeError("not a valid argument for EpubCFI");return this}checkType(t){return this.isCfiString(t)?"string":!t||"object"!==typeof t||"Range"!==Object(n["type"])(t)&&"undefined"==typeof t.startContainer?t&&"object"===typeof t&&"undefined"!=typeof t.nodeType?"node":!!(t&&"object"===typeof t&&t instanceof a)&&"EpubCFI":"range"}parse(t){var e,i,n,r={spinePos:-1,range:!1,base:{},path:{},start:null,end:null};return"string"!==typeof t?{spinePos:-1}:(0===t.indexOf("epubcfi(")&&")"===t[t.length-1]&&(t=t.slice(8,t.length-1)),e=this.getChapterComponent(t),e?(r.base=this.parseComponent(e),i=this.getPathComponent(t),r.path=this.parseComponent(i),n=this.getRange(t),n&&(r.range=!0,r.start=this.parseComponent(n[0]),r.end=this.parseComponent(n[1])),r.spinePos=r.base.steps[1].index,r):{spinePos:-1})}parseComponent(t){var e,i={steps:[],terminal:{offset:null,assertion:null}},n=t.split(":"),r=n[0].split("/");return n.length>1&&(e=n[1],i.terminal=this.parseTerminal(e)),""===r[0]&&r.shift(),i.steps=r.map(function(t){return this.parseStep(t)}.bind(this)),i}parseStep(t){var e,i,n,r,s;if(r=t.match(/\[(.*)\]/),r&&r[1]&&(s=r[1]),i=parseInt(t),!isNaN(i))return i%2===0?(e="element",n=i/2-1):(e="text",n=(i-1)/2),{type:e,index:n,id:s||null}}parseTerminal(t){var e,i,r=t.match(/\[(.*)\]/);return r&&r[1]?(e=parseInt(t.split("[")[0]),i=r[1]):e=parseInt(t),Object(n["isNumber"])(e)||(e=null),{offset:e,assertion:i}}getChapterComponent(t){var e=t.split("!");return e[0]}getPathComponent(t){var e=t.split("!");if(e[1]){let t=e[1].split(",");return t[0]}}getRange(t){var e=t.split(",");return 3===e.length&&[e[1],e[2]]}getCharecterOffsetComponent(t){var e=t.split(":");return e[1]||""}joinSteps(t){return t?t.map((function(t){var e="";return"element"===t.type&&(e+=2*(t.index+1)),"text"===t.type&&(e+=1+2*t.index),t.id&&(e+="["+t.id+"]"),e})).join("/"):""}segmentString(t){var e="/";return e+=this.joinSteps(t.steps),t.terminal&&null!=t.terminal.offset&&(e+=":"+t.terminal.offset),t.terminal&&null!=t.terminal.assertion&&(e+="["+t.terminal.assertion+"]"),e}toString(){var t="epubcfi(";return t+=this.segmentString(this.base),t+="!",t+=this.segmentString(this.path),this.range&&this.start&&(t+=",",t+=this.segmentString(this.start)),this.range&&this.end&&(t+=",",t+=this.segmentString(this.end)),t+=")",t}compare(t,e){var i,n,r,s;if("string"===typeof t&&(t=new a(t)),"string"===typeof e&&(e=new a(e)),t.spinePos>e.spinePos)return 1;if(t.spinePosn[o].index)return 1;if(i[o].indexs.offset?1:r.offset=0&&(r.terminal.offset=e,"text"!=r.steps[r.steps.length-1].type&&r.steps.push({type:"text",index:0})),r}equalStep(t,e){return!(!t||!e)&&(t.index===e.index&&t.id===e.id&&t.type===e.type)}fromRange(t,e,i){var n={range:!1,base:{},path:{},start:null,end:null},r=t.startContainer,s=t.endContainer,o=t.startOffset,a=t.endOffset,h=!1;if(i&&(h=null!=r.ownerDocument.querySelector("."+i)),"string"===typeof e?(n.base=this.parseComponent(e),n.spinePos=n.base.steps[1].index):"object"===typeof e&&(n.base=e),t.collapsed)h&&(o=this.patchOffset(r,o,i)),n.path=this.pathTo(r,o,i);else{n.range=!0,h&&(o=this.patchOffset(r,o,i)),n.start=this.pathTo(r,o,i),h&&(a=this.patchOffset(s,a,i)),n.end=this.pathTo(s,a,i),n.path={steps:[],terminal:null};var l,c=n.start.steps.length;for(l=0;l0&&o===s&&a===s?h[n]=l:e===o&&(l+=1,h[n]=l),a=o;return h}position(t){var e,i;return t.nodeType===r?(e=t.parentNode.children,e||(e=Object(n["findChildren"])(t.parentNode)),i=Array.prototype.indexOf.call(e,t)):(e=this.textNodes(t.parentNode),i=e.indexOf(t)),i}filteredPosition(t,e){var i,n,o;return t.nodeType===r?(i=t.parentNode.children,o=this.normalizedMap(i,r,e)):(i=t.parentNode.childNodes,t.parentNode.classList.contains(e)&&(t=t.parentNode,i=t.parentNode.childNodes),o=this.normalizedMap(i,s,e)),n=Array.prototype.indexOf.call(i,t),o[n]}stepsToXpath(t){var e=[".","*"];return t.forEach((function(t){var i=t.index+1;t.id?e.push("*[position()="+i+" and @id='"+t.id+"']"):"text"===t.type?e.push("text()["+i+"]"):e.push("*["+i+"]")})),e.join("/")}stepsToQuerySelector(t){var e=["html"];return t.forEach((function(t){var i=t.index+1;t.id?e.push("#"+t.id):"text"===t.type||e.push("*:nth-child("+i+")")})),e.join(">")}textNodes(t,e){return Array.prototype.slice.call(t.childNodes).filter((function(t){return t.nodeType===s||!(!e||!t.classList.contains(e))}))}walkToNode(t,e,i){var r,s,o,a=e||document,h=a.documentElement,l=t.length;for(o=0;oa)){h=o.nodeType===r?o.childNodes[0]:o;break}e-=a}}return{container:h,offset:e}}toRange(t,e){var i,r,s,o,a,h,l,c,u=t||document,d=this,f=!!e&&null!=u.querySelector("."+e);if(i="undefined"!==typeof u.createRange?u.createRange():new n["RangeObject"],d.range?(r=d.start,h=d.path.steps.concat(r.steps),o=this.findNode(h,u,f?e:null),s=d.end,l=d.path.steps.concat(s.steps),a=this.findNode(l,u,f?e:null)):(r=d.path,h=d.path.steps,o=this.findNode(d.path.steps,u,f?e:null)),!o)return console.log("No startContainer found for",this.toString()),null;try{null!=r.terminal.offset?i.setStart(o,r.terminal.offset):i.setStart(o,0)}catch(p){c=this.fixMiss(h,r.terminal.offset,u,f?e:null),i.setStart(c.container,c.offset)}if(a)try{null!=s.terminal.offset?i.setEnd(a,s.terminal.offset):i.setEnd(a,0)}catch(p){c=this.fixMiss(l,d.end.terminal.offset,u,f?e:null),i.setEnd(c.container,c.offset)}return i}isCfiString(t){return"string"===typeof t&&0===t.indexOf("epubcfi(")&&")"===t[t.length-1]}generateChapterComponent(t,e,i){var n=parseInt(e),r=2*(t+1),s="/"+r+"/";return s+=2*(n+1),i&&(s+="["+i+"]"),s}collapse(t){this.range&&(this.range=!1,t?(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))}}e["a"]=a},9013:function(t,e,i){"use strict";var n=i("5edd");t.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(e){return!1}}},9152:function(t,e){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ e.read=function(t,e,i,n,r){var s,o,a=8*r-n-1,h=(1<>1,c=-7,u=i?r-1:0,d=i?-1:1,f=t[e+u];for(u+=d,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+t[e+u],u+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+t[e+u],u+=d,c-=8);if(0===s)s=1-l;else{if(s===h)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=l}return(f?-1:1)*o*Math.pow(2,s-n)},e.write=function(t,e,i,n,r,s){var o,a,h,l=8*s-r-1,c=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-o))<1&&(o--,h*=2),e+=o+u>=1?d/h:d*Math.pow(2,1-u),e*h>=2&&(o++,h/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*h-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[i+f]=255&a,f+=p,a/=256,r-=8);for(o=o<0;t[i+f]=255&o,f+=p,o/=256,l-=8);t[i+f-p]|=128*m}},"936a":function(t,e,i){"use strict";var n=void 0;t.exports=function(t){return t!==n&&null!==t}},9650:function(t,e,i){"use strict";var n=i("0b16");class r{constructor(t){this._q=[],this.context=t,this.tick=n["requestAnimationFrame"],this.running=!1,this.paused=!1}enqueue(){var t,e,i,r=[].shift.call(arguments),s=arguments;if(!r)throw new Error("No Task Provided");return"function"===typeof r?(t=new n["defer"],e=t.promise,i={task:r,args:s,deferred:t,promise:e}):i={promise:r},this._q.push(i),0!=this.paused||this.running||this.run(),i.promise}dequeue(){var t,e,i;return!this._q.length||this.paused?(t=new n["defer"],t.deferred.resolve(),t.promise):(t=this._q.shift(),e=t.task,e?(i=e.apply(this.context,t.args),i&&"function"===typeof i["then"]?i.then(function(){t.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){t.deferred.reject.apply(this.context,arguments)}.bind(this)):(t.deferred.resolve.apply(this.context,i),t.promise)):t.promise?t.promise:void 0)}dump(){while(this._q.length)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new n["defer"]),this.tick.call(window,()=>{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),1==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}}e["a"]=r},"96ae":function(t,e,i){"use strict";var n=i("62c4");t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},"99c9":function(t,e,i){"use strict";var n=i("c9fc"),r=i.n(n),s=i("0b16"),o=i("4923"),a=i("8f8f"),h=i("9650"),l=i("8a9e"),c=i("12c2");class u{constructor(t){this.rendition=t,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(){if(0!==arguments.length)return 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(t){if(t)return"string"===typeof t?this.registerUrl("default",t):"object"===typeof t?this.registerRules("default",t):void 0}registerThemes(t){for(var e in t)t.hasOwnProperty(e)&&("string"===typeof t[e]?this.registerUrl(e,t[e]):this.registerRules(e,t[e]))}registerCss(t,e){this._themes[t]={serialized:e},(this._injected[t]||"default"==t)&&this.update(t)}registerUrl(t,e){var i=new c["a"](e);this._themes[t]={url:i.toString()},(this._injected[t]||"default"==t)&&this.update(t)}registerRules(t,e){this._themes[t]={rules:e},(this._injected[t]||"default"==t)&&this.update(t)}select(t){var e,i=this._current;this._current=t,this.update(t),e=this.rendition.getContents(),e.forEach(e=>{e.removeClass(i),e.addClass(t)})}update(t){var e=this.rendition.getContents();e.forEach(e=>{this.add(t,e)})}inject(t){var e,i=[],n=this._themes;for(var r in n)!n.hasOwnProperty(r)||r!==this._current&&"default"!==r||(e=n[r],(e.rules&&Object.keys(e.rules).length>0||e.url&&-1===i.indexOf(e.url))&&this.add(r,t),this._injected.push(r));"default"!=this._current&&t.addClass(this._current)}add(t,e){var i=this._themes[t];i&&e&&(i.url?e.addStylesheet(i.url):i.serialized?(e.addStylesheetCss(i.serialized,t),i.injected=!0):i.rules&&(e.addStylesheetRules(i.rules,t),i.injected=!0))}override(t,e,i){var n=this.rendition.getContents();this._overrides[t]={value:e,priority:!0===i},n.forEach(e=>{e.css(t,this._overrides[t].value,this._overrides[t].priority)})}removeOverride(t){var e=this.rendition.getContents();delete this._overrides[t],e.forEach(e=>{e.css(t)})}overrides(t){var e=this._overrides;for(var i in e)e.hasOwnProperty(i)&&t.css(i,e[i].value,e[i].priority)}fontSize(t){this.override("font-size",t)}font(t){this.override("font-family",t,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}}var d=u,f=(i("55d4"),i("06d2"));class p{constructor(t){this.rendition=t,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(t,e,i,n,r,s){let o=encodeURI(e+t),h=new a["a"](e),l=h.spinePos,c=new m({type:t,cfiRange:e,data:i,sectionIndex:l,cb:n,className:r,styles:s});this._annotations[o]=c,l in this._annotationsBySectionIndex?this._annotationsBySectionIndex[l].push(o):this._annotationsBySectionIndex[l]=[o];let u=this.rendition.views();return u.forEach(t=>{c.sectionIndex===t.index&&c.attach(t)}),c}remove(t,e){let i=encodeURI(t+e);if(i in this._annotations){let t=this._annotations[i];if(e&&t.type!==e)return;let n=this.rendition.views();n.forEach(e=>{this._removeFromAnnotationBySectionIndex(t.sectionIndex,i),t.sectionIndex===e.index&&t.detach(e)}),delete this._annotations[i]}}_removeFromAnnotationBySectionIndex(t,e){this._annotationsBySectionIndex[t]=this._annotationsAt(t).filter(t=>t!==e)}_annotationsAt(t){return this._annotationsBySectionIndex[t]}highlight(t,e,i,n,r){return this.add("highlight",t,e,i,n,r)}underline(t,e,i,n,r){return this.add("underline",t,e,i,n,r)}mark(t,e,i){return this.add("mark",t,e,i)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(t){let e=t.index;if(e in this._annotationsBySectionIndex){let i=this._annotationsBySectionIndex[e];i.forEach(e=>{let i=this._annotations[e];i.attach(t)})}}clear(t){let e=t.index;if(e in this._annotationsBySectionIndex){let i=this._annotationsBySectionIndex[e];i.forEach(e=>{let i=this._annotations[e];i.detach(t)})}}show(){}hide(){}}class m{constructor({type:t,cfiRange:e,data:i,sectionIndex:n,cb:r,className:s,styles:o}){this.type=t,this.cfiRange=e,this.data=i,this.sectionIndex=n,this.mark=void 0,this.cb=r,this.className=s,this.styles=o}update(t){this.data=t}attach(t){let e,{cfiRange:i,data:n,type:r,mark:s,cb:o,className:a,styles:h}=this;return"highlight"===r?e=t.highlight(i,n,o,a,h):"underline"===r?e=t.underline(i,n,o,a,h):"mark"===r&&(e=t.mark(i,n,o)),this.mark=e,this.emit(f["c"].ANNOTATION.ATTACH,e),e}detach(t){let e,{cfiRange:i,type:n}=this;return t&&("highlight"===n?e=t.unhighlight(i):"underline"===n?e=t.ununderline(i):"mark"===n&&(e=t.unmark(i))),this.mark=void 0,this.emit(f["c"].ANNOTATION.DETACH,e),e}text(){}}r()(m.prototype);var g=p,v=i("ddea"),w=i("e58e"),y=i("8b5a");class b{constructor(t,e){this.settings=Object(s["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",allowScriptedContent:!1}),Object(s["extend"])(this.settings,e),"object"===typeof this.settings.manager&&(this.manager=this.settings.manager),this.book=t,this.hooks={},this.hooks.display=new o["a"](this),this.hooks.serialize=new o["a"](this),this.hooks.content=new o["a"](this),this.hooks.unloaded=new o["a"](this),this.hooks.layout=new o["a"](this),this.hooks.render=new o["a"](this),this.hooks.show=new o["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 d(this),this.annotations=new g(this),this.epubcfi=new a["a"],this.q=new h["a"](this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new s["defer"],this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(t){this.manager=t}requireManager(t){var e;return e="string"===typeof t&&"default"===t?w["a"]:"string"===typeof t&&"continuous"===t?y["a"]:t,e}requireView(t){var e;return e="string"==typeof t&&"iframe"===t?v["a"]:t,e}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;break}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(f["c"].MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(f["c"].MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(f["c"].MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(f["c"].MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(f["c"].MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(f["c"].RENDITION.STARTED),this.starting.resolve()}attachTo(t){return this.q.enqueue(function(){this.manager.render(t,{width:this.settings.width,height:this.settings.height}),this.emit(f["c"].RENDITION.ATTACHED)}.bind(this))}display(t){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,t)}_display(t){if(this.book){this.epubcfi.isCfiString(t);var e,i=new s["defer"],n=i.promise;return this.displaying=i,this.book.locations.length()&&Object(s["isFloat"])(t)&&(t=this.book.locations.cfiFromPercentage(parseFloat(t))),e=this.book.spine.get(t),e?(this.manager.display(e,t).then(()=>{i.resolve(e),this.displaying=void 0,this.emit(f["c"].RENDITION.DISPLAYED,e),this.reportLocation()},t=>{this.emit(f["c"].RENDITION.DISPLAY_ERROR,t)}),n):(i.reject(new Error("No Section Found")),n)}}afterDisplayed(t){t.on(f["c"].VIEWS.MARK_CLICKED,(e,i)=>this.triggerMarkEvent(e,i,t.contents)),this.hooks.render.trigger(t,this).then(()=>{t.contents?this.hooks.content.trigger(t.contents,this).then(()=>{this.emit(f["c"].RENDITION.RENDERED,t.section,t)}):this.emit(f["c"].RENDITION.RENDERED,t.section,t)})}afterRemoved(t){this.hooks.unloaded.trigger(t,this).then(()=>{this.emit(f["c"].RENDITION.REMOVED,t.section,t)})}onResized(t,e){this.emit(f["c"].RENDITION.RESIZED,{width:t.width,height:t.height},e),this.location&&this.location.start&&this.display(e||this.location.start.cfi)}onOrientationChange(t){this.emit(f["c"].RENDITION.ORIENTATION_CHANGE,t)}moveTo(t){this.manager.moveTo(t)}resize(t,e,i){t&&(this.settings.width=t),e&&(this.settings.height=e),this.manager.resize(t,e,i)}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(t){var e,i=this.settings.layout||t.layout||"reflowable",n=this.settings.spread||t.spread||"auto",r=this.settings.orientation||t.orientation||"auto",s=this.settings.flow||t.flow||"auto",o=t.viewport||"",a=this.settings.minSpreadWidth||t.minSpreadWidth||800,h=this.settings.direction||t.direction||"ltr";return(0===this.settings.width||this.settings.width>0)&&(0===this.settings.height||this.settings.height),e={layout:i,spread:n,orientation:r,flow:s,viewport:o,minSpreadWidth:a,direction:h},e}flow(t){var e=t;"scrolled"!==t&&"scrolled-doc"!==t&&"scrolled-continuous"!==t||(e="scrolled"),"auto"!==t&&"paginated"!==t||(e="paginated"),this.settings.flow=t,this._layout&&this._layout.flow(e),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(e),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(t){return t&&(this._layout=new l["a"](t),this._layout.spread(t.spread,this.settings.minSpreadWidth),this._layout.on(f["c"].LAYOUT.UPDATED,(t,e)=>{this.emit(f["c"].RENDITION.LAYOUT,t,e)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(t,e){this.settings.spread=t,e&&(this.settings.minSpreadWidth=e),this._layout&&this._layout.spread(t,e),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(t){this.settings.direction=t||"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 t=this.manager.currentLocation();if(t&&t.then&&"function"===typeof t.then)t.then(function(t){let e=this.located(t);e&&e.start&&e.end&&(this.location=e,this.emit(f["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(f["c"].RENDITION.RELOCATED,this.location))}.bind(this));else if(t){let e=this.located(t);if(!e||!e.start||!e.end)return;this.location=e,this.emit(f["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(f["c"].RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var t=this.manager.currentLocation();if(t&&t.then&&"function"===typeof t.then)t.then(function(t){let e=this.located(t);return e}.bind(this));else if(t){let e=this.located(t);return e}}located(t){if(!t.length)return{};let e=t[0],i=t[t.length-1],n={start:{index:e.index,href:e.href,cfi:e.mapping.start,displayed:{page:e.pages[0]||1,total:e.totalPages}},end:{index:i.index,href:i.href,cfi:i.mapping.end,displayed:{page:i.pages[i.pages.length-1]||1,total:i.totalPages}}},r=this.book.locations.locationFromCfi(e.mapping.start),s=this.book.locations.locationFromCfi(i.mapping.end);null!=r&&(n.start.location=r,n.start.percentage=this.book.locations.percentageFromLocation(r)),null!=s&&(n.end.location=s,n.end.percentage=this.book.locations.percentageFromLocation(s));let o=this.book.pageList.pageFromCfi(e.mapping.start),a=this.book.pageList.pageFromCfi(i.mapping.end);return-1!=o&&(n.start.page=o),-1!=a&&(n.end.page=a),i.index===this.book.spine.last().index&&n.end.displayed.page>=n.end.displayed.total&&(n.atEnd=!0),e.index===this.book.spine.first().index&&1===n.start.displayed.page&&(n.atStart=!0),n}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(t){f["a"].forEach(e=>{t.on(e,e=>this.triggerViewEvent(e,t))}),t.on(f["c"].CONTENTS.SELECTED,e=>this.triggerSelectedEvent(e,t))}triggerViewEvent(t,e){this.emit(t.type,t,e)}triggerSelectedEvent(t,e){this.emit(f["c"].RENDITION.SELECTED,t,e)}triggerMarkEvent(t,e,i){this.emit(f["c"].RENDITION.MARK_CLICKED,t,e,i)}getRange(t,e){var i=new a["a"](t),n=this.manager.visible().filter((function(t){if(i.spinePos===t.index)return!0}));if(n.length)return n[0].contents.range(i,e)}adjustImages(t){if("pre-paginated"===this._layout.name)return new Promise((function(t){t()}));let e=t.window.getComputedStyle(t.content,null),i=.95*(t.content.offsetHeight-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom))),n=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-n+"px":"100%")+"!important","max-height":i+"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-n+"px":"100%")+"!important","max-height":i+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise((function(t,e){setTimeout((function(){t()}),1)}))}getContents(){return this.manager?this.manager.getContents():[]}views(){let t=this.manager?this.manager.views:void 0;return t||[]}handleLinks(t){t&&t.on(f["c"].CONTENTS.LINK_CLICKED,t=>{let e=this.book.path.relative(t);this.display(e)})}injectStylesheet(t,e){let i=t.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",this.settings.stylesheet),t.getElementsByTagName("head")[0].appendChild(i)}injectScript(t,e){let i=t.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",this.settings.script),i.textContent=" ",t.getElementsByTagName("head")[0].appendChild(i)}injectIdentifier(t,e){let i=this.book.packaging.metadata.identifier,n=t.createElement("meta");n.setAttribute("name","dc.relation.ispartof"),i&&n.setAttribute("content",i),t.getElementsByTagName("head")[0].appendChild(n)}}r()(b.prototype);e["a"]=b},"9e69":function(t,e,i){var n=i("2b3e"),r=n.Symbol;t.exports=r},a211:function(t,e,i){"use strict";i("ae54"),i("8f8f"),i("99c9"),i("55d4"),i("8a9e");var n=i("34c2");e["a"]=n["a"]},ad72:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("transition",{attrs:{name:"fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"toast-bg"},[i("div",{staticClass:"toast-wrapper"},[i("div",{staticClass:"toast",domProps:{innerHTML:t._s(t.text)}})])])])},r=[],s=(i("c5f6"),{props:{text:[String,Number],timeout:{type:Number,default:1500}},data:function(){return{visible:!1}},methods:{hide:function(){this.visible=!1},show:function(){var t=this;clearTimeout(this.task),this.task=null,this.visible=!0,this.task=setTimeout((function(){t.visible=!1}),this.timeout)},continueShow:function(){clearTimeout(this.task),this.task=null,this.visible=!0}}}),o=s,a=(i("2cef"),i("2877")),h=Object(a["a"])(o,n,r,!1,null,"4f394b2b",null);e["a"]=h.exports},ae54:function(t,e,i){"use strict";var n=i("c9fc"),r=i.n(n),s=i("0b16"),o=i("12c2"),a=i("59c0"),h=i("8f8f"),l=i("4923"),c=i("18a6");function u(t,e,i,n){var r,o="undefined"!=typeof window&&window.URL,h=o?"blob":"arraybuffer",l=new s["defer"],c=new XMLHttpRequest,u=XMLHttpRequest.prototype;for(r in"overrideMimeType"in u||Object.defineProperty(u,"overrideMimeType",{value:function(){}}),i&&(c.withCredentials=!0),c.onreadystatechange=f,c.onerror=d,c.open("GET",t,!0),n)c.setRequestHeader(r,n[r]);function d(t){l.reject(t)}function f(){if(this.readyState===XMLHttpRequest.DONE){var t=!1;if(""!==this.responseType&&"document"!==this.responseType||(t=this.responseXML),200===this.status||0===this.status||t){var i;if(!this.response&&!t)return l.reject({status:this.status,message:"Empty Response",stack:(new Error).stack}),l.promise;if(403===this.status)return l.reject({status:this.status,response:this.response,message:"Forbidden",stack:(new Error).stack}),l.promise;i=t?this.responseXML:Object(s["isXml"])(e)?Object(s["parse"])(this.response,"text/xml"):"xhtml"==e?Object(s["parse"])(this.response,"application/xhtml+xml"):"html"==e||"htm"==e?Object(s["parse"])(this.response,"text/html"):"json"==e?JSON.parse(this.response):"blob"==e?o?this.response:new Blob([this.response]):this.response,l.resolve(i)}else l.reject({status:this.status,message:this.response,stack:(new Error).stack})}}return"json"==e&&c.setRequestHeader("Accept","application/json"),e||(e=new a["a"](t).extension),"blob"==e&&(c.responseType=h),Object(s["isXml"])(e)&&c.overrideMimeType("text/xml"),"binary"==e&&(c.responseType="arraybuffer"),c.send(),l.promise}var d=u,f=i("1456");class p{constructor(t,e){this.idref=t.idref,this.linear="yes"===t.linear,this.properties=t.properties,this.index=t.index,this.href=t.href,this.url=t.url,this.canonical=t.canonical,this.next=t.next,this.prev=t.prev,this.cfiBase=t.cfiBase,e?this.hooks=e:(this.hooks={},this.hooks.serialize=new l["a"](this),this.hooks.content=new l["a"](this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(t){var e=t||this.request||d,i=new s["defer"],n=i.promise;return this.contents?i.resolve(this.contents):e(this.url).then(function(t){return this.document=t,this.contents=t.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){i.resolve(this.contents)}.bind(this)).catch((function(t){i.reject(t)})),n}base(){return Object(c["a"])(this.document,this)}render(t){var e=new s["defer"],i=e.promise;return this.output,this.load(t).then(function(t){var e,i="undefined"!==typeof navigator&&navigator.userAgent||"",n=i.indexOf("Trident")>=0;e="undefined"===typeof XMLSerializer||n?f["DOMParser"]:XMLSerializer;var r=new e;return this.output=r.serializeToString(t),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){e.resolve(this.output)}.bind(this)).catch((function(t){e.reject(t)})),i}find(t){var e=this,i=[],n=t.toLowerCase(),r=function(t){var r,s,o,a=t.textContent.toLowerCase(),h=e.document.createRange(),l=-1,c=150;while(-1!=s)s=a.indexOf(n,l+1),-1!=s&&(h=e.document.createRange(),h.setStart(t,s),h.setEnd(t,s+n.length),r=e.cfiFromRange(h),t.textContent.lengtht+e.textContent,""),o=e.toLowerCase(),a=o.indexOf(s);if(-1!=a){const e=0,o=a+s.length;let h=0,l=0;if(at+e.textContent.length,0);d.setEnd(u,f>o?o:o-f),s=r.cfiFromRange(d);let p=t.slice(0,h+1).reduce((t,e)=>t+e.textContent,"");p.length>n&&(p=p.substring(a-n/2,a+n/2),p="..."+p+"..."),i.push({cfi:s,excerpt:p})}}},a=document.createTreeWalker(r.document,NodeFilter.SHOW_TEXT,null,!1);let h,l=[];while(h=a.nextNode())l.push(h),l.length==e&&(o(l.slice(0,e)),l=l.slice(1,e));return l.length>0&&o(l),i}reconcileLayoutSettings(t){var e={layout:t.layout,spread:t.spread,orientation:t.orientation};return this.properties.forEach((function(t){var i,n,r=t.replace("rendition:",""),s=r.indexOf("-");-1!=s&&(i=r.slice(0,s),n=r.slice(s+1),e[i]=n)})),e}cfiFromRange(t){return new h["a"](t,this.cfiBase).toString()}cfiFromElement(t){return new h["a"](t,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 m=p;class g{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new l["a"],this.hooks.content=new l["a"],this.hooks.content.register(c["a"]),this.hooks.content.register(c["b"]),this.hooks.content.register(c["d"]),this.epubcfi=new h["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(t,e,i){this.items=t.spine,this.manifest=t.manifest,this.spineNodeIndex=t.spineNodeIndex,this.baseUrl=t.baseUrl||t.basePath||"",this.length=this.items.length,this.items.forEach((t,n)=>{var r,s=this.manifest[t.idref];t.index=n,t.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,t.index,t.idref),t.href&&(t.url=e(t.href,!0),t.canonical=i(t.href)),s&&(t.href=s.href,t.url=e(t.href,!0),t.canonical=i(t.href),s.properties.length&&t.properties.push.apply(t.properties,s.properties)),"yes"===t.linear?(t.prev=function(){let e=t.index;while(e>0){let t=this.get(e-1);if(t&&t.linear)return t;e-=1}}.bind(this),t.next=function(){let e=t.index;while(e-1)return delete this.spineByHref[t.href],delete this.spineById[t.idref],this.spineItems.splice(e,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let t=0;do{let e=this.get(t);if(e&&e.linear)return e;t+=1}while(t=0)}destroy(){this.each(t=>t.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}}var v=g,w=i("9650"),y=i("06d2");class b{constructor(t,e,i){this.spine=t,this.request=e,this.pause=i||100,this.q=new w["a"](this),this.epubcfi=new h["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(t){return t&&(this.break=t),this.q.pause(),this.spine.each(function(t){t.linear&&this.q.enqueue(this.process.bind(this),t)}.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(t){return t.load(this.request).then(function(e){var i=new s["defer"],n=this.parse(e,t.cfiBase);return this._locations=this._locations.concat(n),t.unload(),this.processingTimeout=setTimeout(()=>i.resolve(n),this.pause),i.promise}.bind(this))}parse(t,e,i){var n,r,o=[],a=t.ownerDocument,l=Object(s["qs"])(a,"body"),c=0,u=i||this.break,d=function(t){var i,s=t.length,a=0;if(0===t.textContent.trim().length)return!1;0==c&&(n=this.createRange(),n.startContainer=t,n.startOffset=0),i=u-c,i>s&&(c+=s,a=s);while(a=s)c+=s-a,a=s;else{a+=i,n.endContainer=t,n.endOffset=a;let r=new h["a"](n,e).toString();o.push(r),c=0}r=t};if(Object(s["sprint"])(l,d.bind(this)),n&&n.startContainer&&r){n.endContainer=r,n.endOffset=r.length;let t=new h["a"](n,e).toString();o.push(t),c=0}return o}generateFromWords(t,e,i){var n=t?new h["a"](t):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each(function(t){t.linear&&(n?t.index>=n.spinePos&&this.q.enqueue(this.processWords.bind(this),t,e,n,i):this.q.enqueue(this.processWords.bind(this),t,e,n,i))}.bind(this)),this.q.run().then(function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}.bind(this))}processWords(t,e,i,n){return n&&this._locationsWords.length>=n?Promise.resolve():t.load(this.request).then(function(r){var o=new s["defer"],a=this.parseWords(r,t,e,i),h=n-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(a.length>=n?a.slice(0,h):a),t.unload(),this.processingTimeout=setTimeout(()=>o.resolve(a),this.pause),o.promise}.bind(this))}countWords(t){return t=t.replace(/(^\s*)|(\s*$)/gi,""),t=t.replace(/[ ]{2,}/gi," "),t=t.replace(/\n /,"\n"),t.split(" ").length}parseWords(t,e,i,n){var r,o=e.cfiBase,a=[],l=t.ownerDocument,c=Object(s["qs"])(l,"body"),u=i,d=!n||n.spinePos!==e.index;n&&e.index===n.spinePos&&(r=n.findNode(n.range?n.path.steps.concat(n.start.steps):n.path.steps,t.ownerDocument));var f=function(t){if(!d){if(t!==r)return!1;d=!0}if(t.textContent.length<10&&0===t.textContent.trim().length)return!1;var e,i=this.countWords(t.textContent),n=0;if(0===i)return!1;e=u-this._wordCounter,e>i&&(this._wordCounter+=i,n=i);while(n=i)this._wordCounter+=i-n,n=i;else{n+=e;let i=new h["a"](t,o);a.push({cfi:i.toString(),wordCount:this._wordCounter}),this._wordCounter=0}t};return Object(s["sprint"])(c,f.bind(this)),a}locationFromCfi(t){let e;return h["a"].prototype.isCfiString(t)&&(t=new h["a"](t)),0===this._locations.length?-1:(e=Object(s["locationOf"])(t,this._locations,this.epubcfi.compare),e>this.total?this.total:e)}percentageFromCfi(t){if(0===this._locations.length)return null;var e=this.locationFromCfi(t);return this.percentageFromLocation(e)}percentageFromLocation(t){return t&&this.total?t/this.total:0}cfiFromLocation(t){var e=-1;return"number"!=typeof t&&(t=parseInt(t)),t>=0&&t1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),t>=1){let t=new h["a"](this._locations[this.total]);return t.collapse(),t.toString()}return e=Math.ceil(this.total*t),this.cfiFromLocation(e)}load(t){return this._locations="string"===typeof t?JSON.parse(t):t,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(t){var e;if("string"==typeof t)this._currentCfi=t;else{if("number"!=typeof t)return;this._current=t}0!==this._locations.length&&("string"==typeof t?(e=this.locationFromCfi(t),this._current=e):e=t,this.emit(y["c"].LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(e)}))}get currentLocation(){return this._current}set currentLocation(t){this.setCurrent(t)}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)}}r()(b.prototype);var _=b,x=i("3c2a"),E=i.n(x);class k{constructor(t){this.packagePath="",this.directory="",this.encoding="",t&&this.parse(t)}parse(t){var e;if(!t)throw new Error("Container File Not Found");if(e=Object(s["qs"])(t,"rootfile"),!e)throw new Error("No RootFile Found");this.packagePath=e.getAttribute("full-path"),this.directory=E.a.dirname(this.packagePath),this.encoding=t.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}}var S=k;class C{constructor(t){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},t&&this.parse(t)}parse(t){var e,i,n;if(!t)throw new Error("Package File Not Found");if(e=Object(s["qs"])(t,"metadata"),!e)throw new Error("No Metadata Found");if(i=Object(s["qs"])(t,"manifest"),!i)throw new Error("No Manifest Found");if(n=Object(s["qs"])(t,"spine"),!n)throw new Error("No Spine Found");return this.manifest=this.parseManifest(i),this.navPath=this.findNavPath(i),this.ncxPath=this.findNcxPath(i,n),this.coverPath=this.findCoverPath(t),this.spineNodeIndex=Object(s["indexOfElementNode"])(n),this.spine=this.parseSpine(n,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(t),this.metadata=this.parseMetadata(e),this.metadata.direction=n.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(t){var e={};return e.title=this.getElementText(t,"title"),e.creator=this.getElementText(t,"creator"),e.description=this.getElementText(t,"description"),e.pubdate=this.getElementText(t,"date"),e.publisher=this.getElementText(t,"publisher"),e.identifier=this.getElementText(t,"identifier"),e.language=this.getElementText(t,"language"),e.rights=this.getElementText(t,"rights"),e.modified_date=this.getPropertyText(t,"dcterms:modified"),e.layout=this.getPropertyText(t,"rendition:layout"),e.orientation=this.getPropertyText(t,"rendition:orientation"),e.flow=this.getPropertyText(t,"rendition:flow"),e.viewport=this.getPropertyText(t,"rendition:viewport"),e.media_active_class=this.getPropertyText(t,"media:active-class"),e.spread=this.getPropertyText(t,"rendition:spread"),e}parseManifest(t){var e={},i=Object(s["qsa"])(t,"item"),n=Array.prototype.slice.call(i);return n.forEach((function(t){var i=t.getAttribute("id"),n=t.getAttribute("href")||"",r=t.getAttribute("media-type")||"",s=t.getAttribute("media-overlay")||"",o=t.getAttribute("properties")||"";e[i]={href:n,type:r,overlay:s,properties:o.length?o.split(" "):[]}})),e}parseSpine(t,e){var i=[],n=Object(s["qsa"])(t,"itemref"),r=Array.prototype.slice.call(n);return r.forEach((function(t,e){var n=t.getAttribute("idref"),r=t.getAttribute("properties")||"",s=r.length?r.split(" "):[],o={idref:n,linear:t.getAttribute("linear")||"yes",properties:s,index:e};i.push(o)})),i}findUniqueIdentifier(t){var e=t.documentElement.getAttribute("unique-identifier");if(!e)return"";var i=t.getElementById(e);return i&&"identifier"===i.localName&&"http://purl.org/dc/elements/1.1/"===i.namespaceURI&&i.childNodes.length>0?i.childNodes[0].nodeValue.trim():""}findNavPath(t){var e=Object(s["qsp"])(t,"item",{properties:"nav"});return!!e&&e.getAttribute("href")}findNcxPath(t,e){var i,n=Object(s["qsp"])(t,"item",{"media-type":"application/x-dtbncx+xml"});return n||(i=e.getAttribute("toc"),i&&(n=t.querySelector("#"+i))),!!n&&n.getAttribute("href")}findCoverPath(t){var e=Object(s["qs"])(t,"package"),i=(e.getAttribute("version"),Object(s["qsp"])(t,"item",{properties:"cover-image"}));if(i)return i.getAttribute("href");var n=Object(s["qsp"])(t,"meta",{name:"cover"});if(n){var r=n.getAttribute("content"),o=t.getElementById(r);return o?o.getAttribute("href"):""}return!1}getElementText(t,e){var i,n=t.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",e);return n&&0!==n.length?(i=n[0],i.childNodes.length?i.childNodes[0].nodeValue:""):""}getPropertyText(t,e){var i=Object(s["qsp"])(t,"meta",{property:e});return i&&i.childNodes.length?i.childNodes[0].nodeValue:""}load(t){this.metadata=t.metadata;let e=t.readingOrder||t.spine;return this.spine=e.map((t,e)=>(t.index=e,t.linear=t.linear||"yes",t)),t.resources.forEach((t,e)=>{this.manifest[e]=t,t.rel&&"cover"===t.rel[0]&&(this.coverPath=t.href)}),this.spineNodeIndex=0,this.toc=t.toc.map((t,e)=>(t.label=t.title,t)),{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=C;class O{constructor(t){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,t&&this.parse(t)}parse(t){let e,i,n=t.nodeType;n&&(e=Object(s["qs"])(t,"html"),i=Object(s["qs"])(t,"ncx")),n?e?(this.toc=this.parseNav(t),this.landmarks=this.parseLandmarks(t)):i&&(this.toc=this.parseNcx(t)):this.toc=this.load(t),this.length=0,this.unpack(this.toc)}unpack(t){for(var e,i=0;i(t.label=t.title,t.subitems=t.children?this.load(t.children):[],t))}forEach(t){return this.toc.forEach(t)}}var A=O,N={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 t,e,i,n,r={};for(t in N)if(N.hasOwnProperty(t))for(e in N[t])if(N[t].hasOwnProperty(e))if(i=N[t][e],"string"==typeof i)r[i]=t+"/"+e;else for(n=0;nObject(s["blob2base64"])(t)).then(t=>Object(s["createBase64Url"])(t,i)):this.settings.request(t,"blob").then(t=>Object(s["createBlobUrl"])(t,i))}replacements(){if("none"===this.settings.replacements)return new Promise(function(t){t(this.urls)}.bind(this));var t=this.urls.map(t=>{var e=this.settings.resolver(t);return this.createUrl(e).catch(t=>(console.error(t),null))});return Promise.all(t).then(t=>(this.replacementUrls=t.filter(t=>"string"===typeof t),t))}replaceCss(t,e){var i=[];return t=t||this.settings.archive,e=e||this.settings.resolver,this.cssUrls.forEach(function(n){var r=this.createCssFile(n,t,e).then(function(t){var e=this.urls.indexOf(n);e>-1&&(this.replacementUrls[e]=t)}.bind(this));i.push(r)}.bind(this)),Promise.all(i)}createCssFile(t){var e;if(E.a.isAbsolute(t))return new Promise((function(t){t()}));var i,n=this.settings.resolver(t);i=this.settings.archive?this.settings.archive.getText(n):this.settings.request(n,"text");var r=this.urls.map(t=>{var e=this.settings.resolver(t),i=new a["a"](n).relative(e);return i});return i?i.then(t=>(t=Object(c["e"])(t,r,this.replacementUrls),e="base64"===this.settings.replacements?Object(s["createBase64Url"])(t,"text/css"):Object(s["createBlobUrl"])(t,"text/css"),e),t=>new Promise((function(t){t()}))):new Promise((function(t){t()}))}relativeTo(t,e){return e=e||this.settings.resolver,this.urls.map(function(i){var n=e(i),r=new a["a"](t).relative(n);return r}.bind(this))}get(t){var e=this.urls.indexOf(t);if(-1!==e)return this.replacementUrls.length?new Promise(function(t,i){t(this.replacementUrls[e])}.bind(this)):this.createUrl(t)}substitute(t,e){var i;return i=e?this.relativeTo(e):this.urls,Object(c["e"])(t,i,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 P=D;class B{constructor(t){this.pages=[],this.locations=[],this.epubcfi=new h["a"],this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,t&&(this.pageList=this.parse(t)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(t){var e=Object(s["qs"])(t,"html"),i=Object(s["qs"])(t,"ncx");return e?this.parseNav(t):i?this.parseNcx(t):void 0}parseNav(t){var e,i,n=Object(s["querySelectorByType"])(t,"nav","page-list"),r=n?Object(s["qsa"])(n,"li"):[],o=r.length,a=[];if(!r||0===o)return a;for(e=0;e1&&e[1],{cfi:n,href:o,packageUrl:i,page:h}):{href:o,page:h}}process(t){t.forEach((function(t){this.pages.push(t.page),t.cfi&&this.locations.push(t.cfi)}),this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(t){var e=-1;if(0===this.locations.length)return-1;var i=Object(s["indexOfSorted"])(t,this.locations,this.epubcfi.compare);return-1!=i?e=this.pages[i]:(i=Object(s["locationOf"])(t,this.locations,this.epubcfi.compare),e=i-1>=0?this.pages[i-1]:this.pages[0],void 0!==e||(e=-1)),e}cfiFromPage(t){var e=-1;"number"!=typeof t&&(t=parseInt(t));var i=this.pages.indexOf(t);return-1!=i&&(e=this.locations[i]),e}pageFromPercentage(t){var e=Math.round(this.totalPages*t);return e}percentageFromPage(t){var e=(t-this.firstPage)/this.totalPages;return Math.round(1e3*e)/1e3}percentageFromCfi(t){var e=this.pageFromCfi(t),i=this.percentageFromPage(e);return i}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}}var j=B,U=i("99c9"),M=i("8355"),F=i.n(M);class W{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new F.a}catch(t){throw new Error("JSZip lib not loaded")}}open(t,e){return this.zip.loadAsync(t,{base64:e})}openUrl(t,e){return d(t,"binary").then(function(t){return this.zip.loadAsync(t,{base64:e})}.bind(this))}request(t,e){var i,n=new s["defer"],r=new a["a"](t);return e||(e=r.extension),i="blob"==e?this.getBlob(t):this.getText(t),i?i.then(function(t){let i=this.handleResponse(t,e);n.resolve(i)}.bind(this)):n.reject({message:"File not found in the epub: "+t,stack:(new Error).stack}),n.promise}handleResponse(t,e){var i;return i="json"==e?JSON.parse(t):Object(s["isXml"])(e)?Object(s["parse"])(t,"text/xml"):"xhtml"==e?Object(s["parse"])(t,"application/xhtml+xml"):"html"==e||"htm"==e?Object(s["parse"])(t,"text/html"):t,i}getBlob(t,e){var i=window.decodeURIComponent(t.substr(1)),n=this.zip.file(i);if(n)return e=e||z.lookup(n.name),n.async("uint8array").then((function(t){return new Blob([t],{type:e})}))}getText(t,e){var i=window.decodeURIComponent(t.substr(1)),n=this.zip.file(i);if(n)return n.async("string").then((function(t){return t}))}getBase64(t,e){var i=window.decodeURIComponent(t.substr(1)),n=this.zip.file(i);if(n)return e=e||z.lookup(n.name),n.async("base64").then((function(t){return"data:"+e+";base64,"+t}))}createUrl(t,e){var i,n,r=new s["defer"],o=window.URL||window.webkitURL||window.mozURL,a=e&&e.base64;return t in this.urlCache?(r.resolve(this.urlCache[t]),r.promise):(a?(n=this.getBase64(t),n&&n.then(function(e){this.urlCache[t]=e,r.resolve(e)}.bind(this))):(n=this.getBlob(t),n&&n.then(function(e){i=o.createObjectURL(e),this.urlCache[t]=i,r.resolve(i)}.bind(this))),n||r.reject({message:"File not found in the epub: "+t,stack:(new Error).stack}),r.promise)}revokeUrl(t){var e=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[t];i&&e.revokeObjectURL(i)}destroy(){var t=window.URL||window.webkitURL||window.mozURL;for(let e in this.urlCache)t.revokeObjectURL(e);this.zip=void 0,this.urlCache={}}}var q=W,H=i("a002"),Y=i.n(H);class V{constructor(t,e,i){this.urlCache={},this.storage=void 0,this.name=t,this.requester=e||d,this.resolver=i,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let t;"undefined"===typeof Y.a&&(t=Y.a),this.storage=t.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(t){let e=navigator.onLine;this.online=e,e?this.emit("online",this):this.emit("offline",this)}add(t,e){let i=t.resources.map(t=>{let{href:i}=t,n=this.resolver(i),r=window.encodeURIComponent(n);return this.storage.getItem(r).then(t=>!t||e?this.requester(n,"binary").then(t=>this.storage.setItem(r,t)):t)});return Promise.all(i)}put(t,e,i){let n=window.encodeURIComponent(t);return this.storage.getItem(n).then(r=>r||this.requester(t,"binary",e,i).then(t=>this.storage.setItem(n,t)))}request(t,e,i,n){return this.online?this.requester(t,e,i,n).then(e=>(this.put(t),e)):this.retrieve(t,e)}retrieve(t,e){new s["defer"];var i,n=new a["a"](t);return e||(e=n.extension),i="blob"==e?this.getBlob(t):this.getText(t),i.then(i=>{var n,r=new s["defer"];return i?(n=this.handleResponse(i,e),r.resolve(n)):r.reject({message:"File not found in storage: "+t,stack:(new Error).stack}),r.promise})}handleResponse(t,e){var i;return i="json"==e?JSON.parse(t):Object(s["isXml"])(e)?Object(s["parse"])(t,"text/xml"):"xhtml"==e?Object(s["parse"])(t,"application/xhtml+xml"):"html"==e||"htm"==e?Object(s["parse"])(t,"text/html"):t,i}getBlob(t,e){let i=window.encodeURIComponent(t);return this.storage.getItem(i).then((function(i){if(i)return e=e||z.lookup(t),new Blob([i],{type:e})}))}getText(t,e){let i=window.encodeURIComponent(t);return e=e||z.lookup(t),this.storage.getItem(i).then((function(t){var i,n=new s["defer"],r=new FileReader;if(t)return i=new Blob([t],{type:e}),r.addEventListener("loadend",()=>{n.resolve(r.result)}),r.readAsText(i,e),n.promise}))}getBase64(t,e){let i=window.encodeURIComponent(t);return e=e||z.lookup(t),this.storage.getItem(i).then(t=>{var i,n=new s["defer"],r=new FileReader;if(t)return i=new Blob([t],{type:e}),r.addEventListener("loadend",()=>{n.resolve(r.result)}),r.readAsDataURL(i,e),n.promise})}createUrl(t,e){var i,n,r=new s["defer"],o=window.URL||window.webkitURL||window.mozURL,a=e&&e.base64;return t in this.urlCache?(r.resolve(this.urlCache[t]),r.promise):(a?(n=this.getBase64(t),n&&n.then(function(e){this.urlCache[t]=e,r.resolve(e)}.bind(this))):(n=this.getBlob(t),n&&n.then(function(e){i=o.createObjectURL(e),this.urlCache[t]=i,r.resolve(i)}.bind(this))),n||r.reject({message:"File not found in storage: "+t,stack:(new Error).stack}),r.promise)}revokeUrl(t){var e=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[t];i&&e.revokeObjectURL(i)}destroy(){var t=window.URL||window.webkitURL||window.mozURL;for(let e in this.urlCache)t.revokeObjectURL(e);this.urlCache={},this.removeListeners()}}r()(V.prototype);var Z=V;class X{constructor(t){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",t&&this.parse(t)}parse(t){if(!t)return this;const e=Object(s["qs"])(t,"display_options");if(!e)return this;const i=Object(s["qsa"])(e,"option");return i.forEach(t=>{let e="";switch(t.childNodes.length&&(e=t.childNodes[0].nodeValue),t.attributes.name.value){case"interactive":this.interactive=e;break;case"fixed-layout":this.fixedLayout=e;break;case"open-to-spread":this.openToSpread=e;break;case"orientation-lock":this.orientationLock=e;break}}),this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}}var G=X;const K="META-INF/container.xml",$="META-INF/com.apple.ibooks.display-options.xml",J={BINARY:"binary",BASE64:"base64",EPUB:"epub",OPF:"opf",MANIFEST:"json",DIRECTORY:"directory"};class Q{constructor(t,e){"undefined"===typeof e&&"string"!==typeof t&&t instanceof Blob===!1&&t instanceof ArrayBuffer===!1&&(e=t,t=void 0),this.settings=Object(s["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(s["extend"])(this.settings,e),this.opening=new s["defer"],this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new s["defer"],spine:new s["defer"],metadata:new s["defer"],cover:new s["defer"],navigation:new s["defer"],pageList:new s["defer"],resources:new s["defer"],displayOptions:new s["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||d,this.spine=new v,this.locations=new _(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),t&&this.open(t,this.settings.openAs).catch(e=>{var i=new Error("Cannot load book at "+t);this.emit(y["c"].BOOK.OPEN_FAILED,i)})}open(t,e){var i,n=e||this.determineType(t);return n===J.BINARY?(this.archived=!0,this.url=new o["a"]("/",""),i=this.openEpub(t)):n===J.BASE64?(this.archived=!0,this.url=new o["a"]("/",""),i=this.openEpub(t,n)):n===J.EPUB?(this.archived=!0,this.url=new o["a"]("/",""),i=this.request(t,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))):n==J.OPF?(this.url=new o["a"](t),i=this.openPackaging(this.url.Path.toString())):n==J.MANIFEST?(this.url=new o["a"](t),i=this.openManifest(this.url.Path.toString())):(this.url=new o["a"](t),i=this.openContainer(K).then(this.openPackaging.bind(this))),i}openEpub(t,e){return this.unarchive(t,e||this.settings.encoding).then(()=>this.openContainer(K)).then(t=>this.openPackaging(t))}openContainer(t){return this.load(t).then(t=>(this.container=new S(t),this.resolve(this.container.packagePath)))}openPackaging(t){return this.path=new a["a"](t),this.load(t).then(t=>(this.packaging=new T(t),this.unpack(this.packaging)))}openManifest(t){return this.path=new a["a"](t),this.load(t).then(t=>(this.packaging=new T,this.packaging.load(t),this.unpack(this.packaging)))}load(t){var e=this.resolve(t);return this.archived?this.archive.request(e):this.request(e,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(t,e){if(t){var i=t,n=t.indexOf("://")>-1;return n?t:(this.path&&(i=this.path.resolve(t)),0!=e&&this.url&&(i=this.url.resolve(i)),i)}}canonical(t){var e=t;return t?(e=this.settings.canonical?this.settings.canonical(t):this.resolve(t,!0),e):""}determineType(t){var e,i,n;return"base64"===this.settings.encoding?J.BASE64:"string"!=typeof t?J.BINARY:(e=new o["a"](t),i=e.path(),n=i.extension,n&&(n=n.replace(/\?.*$/,"")),n?"epub"===n?J.EPUB:"opf"===n?J.OPF:"json"===n?J.MANIFEST:void 0:J.DIRECTORY)}unpack(t){this.package=t,""===this.packaging.metadata.layout?this.load(this.url.resolve($)).then(t=>{this.displayOptions=new G(t),this.loading.displayOptions.resolve(this.displayOptions)}).catch(t=>{this.displayOptions=new G,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new G,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new P(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(t=>{console.error(t)}):this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}loadNavigation(t){let e=t.navPath||t.ncxPath,i=t.toc;return i?new Promise((e,n)=>{this.navigation=new A(i),t.pageList&&(this.pageList=new j(t.pageList)),e(this.navigation)}):e?this.load(e,"xml").then(t=>(this.navigation=new A(t),this.pageList=new j(t),this.navigation)):new Promise((t,e)=>{this.navigation=new A,this.pageList=new j,t(this.navigation)})}section(t){return this.spine.get(t)}renderTo(t,e){return this.rendition=new U["a"](this,e),this.rendition.attachTo(t),this.rendition}setRequestCredentials(t){this.settings.requestCredentials=t}setRequestHeaders(t){this.settings.requestHeaders=t}unarchive(t,e){return this.archive=new q,this.archive.open(t,e)}store(t){let e=this.settings.replacements&&"none"!==this.settings.replacements,i=this.url,n=this.settings.requestMethod||d.bind(this);return this.storage=new Z(t,n,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 t=(t,e)=>{e.output=this.resources.substitute(t,e.url)};this.resources.settings.replacements=e||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new o["a"]("/",""),this.spine.hooks.serialize.register(t)}),this.storage.on("online",()=>{this.url=i,this.spine.hooks.serialize.deregister(t)})}),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((t,e)=>{e.output=this.resources.substitute(t,e.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(t){var e=new h["a"](t),i=this.spine.get(e.spinePos),n=this.load.bind(this);return i?i.load(n).then((function(t){var n=e.toRange(i.document);return n})):new Promise((t,e)=>{e("CFI could not be found")})}key(t){var e=t||this.packaging.metadata.identifier||this.url.filename;return`epubjs:${y["b"]}:${e}`}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}}r()(Q.prototype);e["a"]=Q},aedf:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Underline=e.Highlight=e.Mark=e.Pane=void 0;var n=function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,i,n)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(n):void 0},r=function(){function t(t,e){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:document.body;d(this,t),this.target=e,this.element=o.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),h.default.proxyMouse(this.target,this.marks),this.container=i,this.container.appendChild(this.element),this.render()}return r(t,[{key:"addMark",value:function(t){var e=o.default.createElement("g");return this.element.appendChild(e),t.bind(e,this.container),this.marks.push(t),t.render(),t}},{key:"removeMark",value:function(t){var e=this.marks.indexOf(t);if(-1!==e){var i=t.unbind();this.element.removeChild(i),this.marks.splice(e,1)}}},{key:"render",value:function(){g(this.element,m(this.target,this.container));var t=!0,e=!1,i=void 0;try{for(var n,r=this.marks[Symbol.iterator]();!(t=(n=r.next()).done);t=!0){var s=n.value;s.render()}}catch(o){e=!0,i=o}finally{try{!t&&r.return&&r.return()}finally{if(e)throw i}}}}]),t}();var f=e.Mark=function(){function t(){d(this,t),this.element=null}return r(t,[{key:"bind",value:function(t,e){this.element=t,this.container=e}},{key:"unbind",value:function(){var t=this.element;return this.element=null,t}},{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(){var t=[],e=this.element.firstChild;while(e)t.push(e.getBoundingClientRect()),e=e.nextSibling;return t}},{key:"filteredRanges",value:function(){var t=Array.from(this.range.getClientRects());return t.filter((function(e){for(var i=0;i=t.left&&e.top>=t.top&&e.bottom<=t.bottom}},b047:function(t,e,i){var n=i("1a8c"),r=i("408c"),s=i("b4b0"),o="Expected a function",a=Math.max,h=Math.min;function l(t,e,i){var l,c,u,d,f,p,m=0,g=!1,v=!1,w=!0;if("function"!=typeof t)throw new TypeError(o);function y(e){var i=l,n=c;return l=c=void 0,m=e,d=t.apply(n,i),d}function b(t){return m=t,f=setTimeout(E,e),g?y(t):d}function _(t){var i=t-p,n=t-m,r=e-i;return v?h(r,u-n):r}function x(t){var i=t-p,n=t-m;return void 0===p||i>=e||i<0||v&&n>=u}function E(){var t=r();if(x(t))return k(t);f=setTimeout(E,_(t))}function k(t){return f=void 0,w&&l?y(t):(l=c=void 0,d)}function S(){void 0!==f&&clearTimeout(f),m=0,l=p=c=f=void 0}function C(){return void 0===f?d:k(r())}function T(){var t=r(),i=x(t);if(l=arguments,c=this,p=t,i){if(void 0===f)return b(p);if(v)return clearTimeout(f),f=setTimeout(E,e),y(p)}return void 0===f&&(f=setTimeout(E,e)),d}return e=s(e)||0,n(i)&&(g=!!i.leading,v="maxWait"in i,u=v?a(s(i.maxWait)||0,e):u,w="trailing"in i?!!i.trailing:w),T.cancel=S,T.flush=C,T}t.exports=l},b4b0:function(t,e,i){var n=i("8d74"),r=i("1a8c"),s=i("ffd6"),o=NaN,a=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function u(t){if("number"==typeof t)return t;if(s(t))return o;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=h.test(t);return i||l.test(t)?c(t.slice(2),i?2:8):a.test(t)?o:+t}t.exports=u},b639:function(t,e,i){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=i("1fb5"),r=i("9152"),s=i("e3db");function o(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function y(t){return+t!=t&&(t=0),l.alloc(+t)}function b(t,e){if(l.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return Q(t).length;default:if(n)return K(t).length;e=(""+e).toLowerCase(),n=!0}}function _(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if(i>>>=0,e>>>=0,i<=e)return"";t||(t="utf8");while(1)switch(t){case"hex":return B(this,e,i);case"utf8":case"utf-8":return I(this,e,i);case"ascii":return D(this,e,i);case"latin1":case"binary":return P(this,e,i);case"base64":return R(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function x(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function E(t,e,i,n,r){if(0===t.length)return-1;if("string"===typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"===typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:k(t,e,i,n,r);if("number"===typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):k(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function k(t,e,i,n,r){var s,o=1,a=t.length,h=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,h/=2,i/=2}function l(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(r){var c=-1;for(s=i;sa&&(i=a-h),s=i;s>=0;s--){for(var u=!0,d=0;dr&&(n=r)):n=r;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o239?4:l>223?3:l>191?2:1;if(r+u<=i)switch(u){case 1:l<128&&(c=l);break;case 2:s=t[r+1],128===(192&s)&&(h=(31&l)<<6|63&s,h>127&&(c=h));break;case 3:s=t[r+1],o=t[r+2],128===(192&s)&&128===(192&o)&&(h=(15&l)<<12|(63&s)<<6|63&o,h>2047&&(h<55296||h>57343)&&(c=h));break;case 4:s=t[r+1],o=t[r+2],a=t[r+3],128===(192&s)&&128===(192&o)&&128===(192&a)&&(h=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a,h>65535&&h<1114112&&(c=h))}null===c?(c=65533,u=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),r+=u}return z(n)}e.Buffer=l,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:o(),e.kMaxLength=a(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return c(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return d(null,t,e,i)},l.allocUnsafe=function(t){return f(null,t)},l.allocUnsafeSlow=function(t){return f(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,s=Math.min(i,n);r0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),""},l.prototype.compare=function(t,e,i,n,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,r>>>=0,this===t)return 0;for(var s=r-n,o=i-e,a=Math.min(s,o),h=this.slice(n,r),c=t.slice(e,i),u=0;ur)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return S(this,t,e,i);case"utf8":case"utf-8":return C(this,t,e,i);case"ascii":return T(this,t,e,i);case"latin1":case"binary":return O(this,t,e,i);case"base64":return A(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function z(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);var i="",n=0;while(nn)&&(i=n);for(var r="",s=e;si)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,i,n,r,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function F(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,s=Math.min(t.length-i,2);r>>8*(n?r:1-r)}function W(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,s=Math.min(t.length-i,4);r>>8*(n?r:3-r)&255}function q(t,e,i,n,r,s){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function H(t,e,i,n,s){return s||q(t,e,i,4,34028234663852886e22,-34028234663852886e22),r.write(t,e,i,n,23,4),i+4}function Y(t,e,i,n,s){return s||q(t,e,i,8,17976931348623157e292,-17976931348623157e292),r.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){var i,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e0&&(r*=256))n+=this[t+--e]*r;return n},l.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||U(t,e,this.length);var n=this[t],r=1,s=0;while(++s=r&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||U(t,e,this.length);var n=e,r=1,s=this[t+--n];while(n>0&&(r*=256))s+=this[t+--n]*r;return r*=128,s>=r&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){if(t=+t,e|=0,i|=0,!n){var r=Math.pow(2,8*i)-1;M(this,t,e,i,r,0)}var s=1,o=0;this[e]=255&t;while(++o=0&&(o*=256))this[e+s]=t/o&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):W(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):W(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);M(this,t,e,i,r-1,-r)}var s=0,o=1,a=0;this[e]=255&t;while(++s>0)-a&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);M(this,t,e,i,r-1,-r)}var s=i-1,o=1,a=0;this[e+s]=255&t;while(--s>=0&&(o*=256))t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):W(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):W(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return H(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return H(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return Y(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return Y(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--r)t[r+e]=this[r+i];else if(s<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"===typeof t)for(s=e;s55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function $(t){for(var e=[],i=0;i>8,r=i%256,s.push(r),s.push(n)}return s}function Q(t){return n.toByteArray(Z(t))}function tt(t,e,i,n){for(var r=0;r=e.length||r>=t.length)break;e[r+i]=t[r]}return r}function et(t){return t!==t}}).call(this,i("c8ba"))},c1dd:function(t,e){function i(t,e){for(var i in t)e[i]=t[i]}function n(t,e){var n=t.prototype;if(!(n instanceof e)){function r(){}r.prototype=e.prototype,r=new r,i(n,r),t.prototype=n=r}n.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),n.constructor=t)}var r="http://www.w3.org/1999/xhtml",s={},o=s.ELEMENT_NODE=1,a=s.ATTRIBUTE_NODE=2,h=s.TEXT_NODE=3,l=s.CDATA_SECTION_NODE=4,c=s.ENTITY_REFERENCE_NODE=5,u=s.ENTITY_NODE=6,d=s.PROCESSING_INSTRUCTION_NODE=7,f=s.COMMENT_NODE=8,p=s.DOCUMENT_NODE=9,m=s.DOCUMENT_TYPE_NODE=10,g=s.DOCUMENT_FRAGMENT_NODE=11,v=s.NOTATION_NODE=12,w={},y={},b=(w.INDEX_SIZE_ERR=(y[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(y[2]="DOMString size error",2),w.HIERARCHY_REQUEST_ERR=(y[3]="Hierarchy request error",3)),_=(w.WRONG_DOCUMENT_ERR=(y[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(y[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(y[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(y[7]="No modification allowed",7),w.NOT_FOUND_ERR=(y[8]="Not found",8)),x=(w.NOT_SUPPORTED_ERR=(y[9]="Not supported",9),w.INUSE_ATTRIBUTE_ERR=(y[10]="Attribute in use",10));w.INVALID_STATE_ERR=(y[11]="Invalid state",11),w.SYNTAX_ERR=(y[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(y[13]="Invalid modification",13),w.NAMESPACE_ERR=(y[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(y[15]="Invalid access",15);function E(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,y[t]),this.message=y[t],Error.captureStackTrace&&Error.captureStackTrace(this,E);return i.code=t,e&&(this.message=this.message+": "+e),i}function k(){}function S(t,e){this._node=t,this._refresh=e,C(this)}function C(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);ot(t,"length",n.length),i(n,t),t._inc=e}}function T(){}function O(t,e){var i=t.length;while(i--)if(t[i]===e)return i}function A(t,e,i,n){if(n?e[O(e,n)]=i:e[e.length++]=i,t){i.ownerElement=t;var r=t.ownerDocument;r&&(n&&B(r,t,n),P(r,t,i))}}function N(t,e,i){var n=O(e,i);if(!(n>=0))throw E(_,new Error(t.tagName+"@"+i));var r=e.length-1;while(n"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function z(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(z(t,e))return!0}while(t=t.nextSibling)}function D(){}function P(t,e,i){t&&t._inc++;var n=i.namespaceURI;"http://www.w3.org/2000/xmlns/"==n&&(e._nsMap[i.prefix?i.localName:""]=i.value)}function B(t,e,i,n){t&&t._inc++;var r=i.namespaceURI;"http://www.w3.org/2000/xmlns/"==r&&delete e._nsMap[i.prefix?i.localName:""]}function j(t,e,i){if(t&&t._inc){t._inc++;var n=e.childNodes;if(i)n[n.length++]=i;else{var r=e.firstChild,s=0;while(r)n[s++]=r,r=r.nextSibling;n.length=s}}}function U(t,e){var i=e.previousSibling,n=e.nextSibling;return i?i.nextSibling=n:t.firstChild=n,n?n.previousSibling=i:t.lastChild=i,j(t.ownerDocument,t),e}function M(t,e,i){var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===g){var r=e.firstChild;if(null==r)return e;var s=e.lastChild}else r=s=e;var o=i?i.previousSibling:t.lastChild;r.previousSibling=o,s.nextSibling=i,o?o.nextSibling=r:t.firstChild=r,null==i?t.lastChild=s:i.previousSibling=s;do{r.parentNode=t}while(r!==s&&(r=r.nextSibling));return j(t.ownerDocument||t,t),e.nodeType==g&&(e.firstChild=e.lastChild=null),e}function F(t,e){var i=e.parentNode;if(i){var n=t.lastChild;i.removeChild(e);n=t.lastChild}n=t.lastChild;return e.parentNode=t,e.previousSibling=n,e.nextSibling=null,n?n.nextSibling=e:t.firstChild=e,t.lastChild=e,j(t.ownerDocument,t,e),e}function W(){this._nsMap={}}function q(){}function H(){}function Y(){}function V(){}function Z(){}function X(){}function G(){}function K(){}function $(){}function J(){}function Q(){}function tt(){}function et(t,e){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&null==r){r=n.lookupPrefix(s);if(null==r)var o=[{namespace:s,prefix:null}]}return nt(this,i,t,e,o),i.join("")}function it(t,e,i){var n=t.prefix||"",r=t.namespaceURI;if(!n&&!r)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;var s=i.length;while(s--){var o=i[s];if(o.prefix==n)return o.namespace!=r}return!0}function nt(t,e,i,n,s){if(n){if(t=n(t),!t)return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case o:s||(s=[]);s.length;var u=t.attributes,v=u.length,w=t.firstChild,y=t.tagName;i=r===t.namespaceURI||i,e.push("<",y);for(var b=0;b"),i&&/^script$/i.test(y))while(w)w.data?e.push(w.data):nt(w,e,i,n,s),w=w.nextSibling;else while(w)nt(w,e,i,n,s),w=w.nextSibling;e.push("")}else e.push("/>");return;case p:case g:w=t.firstChild;while(w)nt(w,e,i,n,s),w=w.nextSibling;return;case a:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,L),'"');case h:return e.push(t.data.replace(/[<&]/g,L).replace(/]]>/g,"]]>"));case l:return e.push("");case f:return e.push("\x3c!--",t.data,"--\x3e");case m:var S=t.publicId,C=t.systemId;if(e.push("");else if(C&&"."!=C)e.push(" SYSTEM ",C,">");else{var T=t.internalSubset;T&&e.push(" [",T,"]"),e.push(">")}return;case d:return e.push("");case c:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function rt(t,e,i){var n;switch(e.nodeType){case o:n=e.cloneNode(!1),n.ownerDocument=t;case g:break;case a:i=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,i){var r=e.firstChild;while(r)n.appendChild(rt(t,r,i)),r=r.nextSibling}return n}function st(t,e,i){var n=new e.constructor;for(var r in e){var s=e[r];"object"!=typeof s&&s!=n[r]&&(n[r]=s)}switch(e.childNodes&&(n.childNodes=new k),n.ownerDocument=t,n.nodeType){case o:var h=e.attributes,l=n.attributes=new T,c=h.length;l._ownerElement=n;for(var u=0;u0},lookupPrefix:function(t){var e=this;while(e){var i=e._nsMap;if(i)for(var n in i)if(i[n]==t)return n;e=e.nodeType==a?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){var e=this;while(e){var i=e._nsMap;if(i&&t in i)return i[t];e=e.nodeType==a?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return null==e}},i(s,I),i(s,I.prototype),D.prototype={nodeName:"#document",nodeType:p,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==g){var i=t.firstChild;while(i){var n=i.nextSibling;this.insertBefore(i,e),i=n}return t}return null==this.documentElement&&t.nodeType==o&&(this.documentElement=t),M(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),U(this,t)},importNode:function(t,e){return rt(this,t,e)},getElementById:function(t){var e=null;return z(this.documentElement,(function(i){if(i.nodeType==o&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=new RegExp("(^|\\s)"+t+"(\\s|$)");return new S(this,(function(t){var i=[];return z(t.documentElement,(function(n){n!==t&&n.nodeType==o&&e.test(n.getAttribute("class"))&&i.push(n)})),i}))},createElement:function(t){var e=new W;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new k;var i=e.attributes=new T;return i._ownerElement=e,e},createDocumentFragment:function(){var t=new J;return t.ownerDocument=this,t.childNodes=new k,t},createTextNode:function(t){var e=new Y;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new V;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new Z;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new Q;return i.ownerDocument=this,i.tagName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new q;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new $;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new W,n=e.split(":"),r=i.attributes=new T;return i.childNodes=new k,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,r._ownerElement=i,i},createAttributeNS:function(t,e){var i=new q,n=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=e,i}},n(D,I),W.prototype={nodeType:o,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e,this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===g?this.insertBefore(t,null):F(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new S(this,(function(e){var i=[];return z(e,(function(n){n===e||n.nodeType!=o||"*"!==t&&n.tagName!=t||i.push(n)})),i}))},getElementsByTagNameNS:function(t,e){return new S(this,(function(i){var n=[];return z(i,(function(r){r===i||r.nodeType!==o||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||n.push(r)})),n}))}},D.prototype.getElementsByTagName=W.prototype.getElementsByTagName,D.prototype.getElementsByTagNameNS=W.prototype.getElementsByTagNameNS,n(W,I),q.prototype.nodeType=a,n(q,I),H.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(y[b])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){var n=this.data.substring(0,t),r=this.data.substring(t+e);i=n+i+r,this.nodeValue=this.data=i,this.length=i.length}},n(H,I),Y.prototype={nodeName:"#text",nodeType:h,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},n(Y,H),V.prototype={nodeName:"#comment",nodeType:f},n(V,H),Z.prototype={nodeName:"#cdata-section",nodeType:l},n(Z,H),X.prototype.nodeType=m,n(X,I),G.prototype.nodeType=v,n(G,I),K.prototype.nodeType=u,n(K,I),$.prototype.nodeType=c,n($,I),J.prototype.nodeName="#document-fragment",J.prototype.nodeType=g,n(J,I),Q.prototype.nodeType=d,n(Q,I),tt.prototype.serializeToString=function(t,e,i){return et.call(t,e,i)},I.prototype.toString=et;try{if(Object.defineProperty){function at(t){switch(t.nodeType){case o:case g:var e=[];t=t.firstChild;while(t)7!==t.nodeType&&8!==t.nodeType&&e.push(at(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(S.prototype,"length",{get:function(){return C(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){return at(this)},set:function(t){switch(this.nodeType){case o:case g:while(this.firstChild)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),ot=function(t,e,i){t["$$"+e]=i}}}catch(ht){}e.Node=I,e.DOMException=E,e.DOMImplementation=R,e.XMLSerializer=tt},c9fc:function(t,e,i){"use strict";var n,r,s,o,a,h,l,c=i("f508"),u=i("1a94"),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,m=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,w={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var i;return u(e),v.call(this,"__ee__")?i=this.__ee__:(i=w.value=p(null),m(this,"__ee__",w),w.value=null),i[t]?"object"===typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},r=function(t,e){var i,r;return u(e),r=this,n.call(this,t,i=function(){s.call(r,t,i),d.call(e,this,arguments)}),i.__eeOnceListener__=e,this},s=function(t,e){var i,n,r,s;if(u(e),!v.call(this,"__ee__"))return this;if(i=this.__ee__,!i[t])return this;if(n=i[t],"object"===typeof n)for(s=0;r=n[s];++s)r!==e&&r.__eeOnceListener__!==e||(2===n.length?i[t]=n[s?0:1]:n.splice(s,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},o=function(t){var e,i,n,r,s;if(v.call(this,"__ee__")&&(r=this.__ee__[t],r))if("object"===typeof r){for(i=arguments.length,s=new Array(i-1),e=1;e=0;n--){var o=e[n],a=i.clientX,h=i.clientY;if(i.touches&&i.touches.length&&(a=i.touches[0].clientX,h=i.touches[0].clientY),s(o,t,a,h)){o.dispatchEvent(r(i));break}}}if("iframe"===t.nodeName||"IFRAME"===t.nodeName)try{this.target=t.contentDocument}catch(h){this.target=t}else this.target=t;for(var n=["mouseup","mousedown","click","touchstart"],o=0;oi&&a>e}var o=t.getBoundingClientRect();if(!s(o,i,n))return!1;for(var a=t.getClientRects(),h=0,l=a.length;h",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},ddea:function(t,e,i){"use strict";var n=i("c9fc"),r=i.n(n),s=i("0b16"),o=i("8f8f"),a=i("55d4"),h=i("06d2"),l=i("aedf");class c{constructor(t,e){this.settings=Object(s["extend"])({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1},e||{}),this.id="epubjs-view-"+Object(s["uuid"])(),this.section=t,this.index=t.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 o["a"],this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(t){var e=document.createElement("div");return e.classList.add("epub-view"),e.style.height="0px",e.style.width="0px",e.style.overflow="hidden",e.style.position="relative",e.style.display="block",e.style.flex=t&&"horizontal"==t?"none":"initial",e}create(){return 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.sandbox="allow-same-origin",this.settings.allowScriptedContent&&this.section.properties.indexOf("scripted")>-1&&(this.iframe.sandbox+=" allow-scripts"),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(s["bounds"])(this.element),"srcdoc"in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write")),this.iframe}render(t,e){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(t)),this.sectionRender.then(function(t){return this.load(t)}.bind(this)).then(function(){let t,e=this.contents.writingMode();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(h["c"].VIEWS.AXIS,t),this.setWritingMode(e),this.emit(h["c"].VIEWS.WRITING_MODE,e),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((t,e)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),t()})}.bind(this),function(t){return this.emit(h["c"].VIEWS.LOAD_ERROR,t),new Promise((e,i)=>{i(t)})}.bind(this)).then(function(){this.emit(h["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(t,e){var i=t||this.settings.width,n=e||this.settings.height;"pre-paginated"===this.layout.name?this.lock("both",i,n):"horizontal"===this.settings.axis?this.lock("height",i,n):this.lock("width",i,n),this.settings.width=i,this.settings.height=n}lock(t,e,i){var n,r=Object(s["borders"])(this.element);n=this.iframe?Object(s["borders"])(this.iframe):{width:0,height:0},"width"==t&&Object(s["isNumber"])(e)&&(this.lockedWidth=e-r.width-n.width),"height"==t&&Object(s["isNumber"])(i)&&(this.lockedHeight=i-r.height-n.height),"both"===t&&Object(s["isNumber"])(e)&&Object(s["isNumber"])(i)&&(this.lockedWidth=e-r.width-n.width,this.lockedHeight=i-r.height-n.height),this.displayed&&this.iframe&&this.expand()}expand(t){var e,i=this.lockedWidth,n=this.lockedHeight;this.iframe&&!this._expanding&&(this._expanding=!0,"pre-paginated"===this.layout.name?(i=this.layout.columnWidth,n=this.layout.height):"horizontal"===this.settings.axis?(i=this.contents.textWidth(),i%this.layout.pageWidth>0&&(i=Math.ceil(i/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(e=i/this.layout.pageWidth,this.layout.divisor>1&&"reflowable"===this.layout.name&&e%2>0&&(i+=this.layout.pageWidth))):"vertical"===this.settings.axis&&(n=this.contents.textHeight(),"paginated"===this.settings.flow&&n%this.layout.height>0&&(n=Math.ceil(n/this.layout.height)*this.layout.height)),(this._needsReframe||i!=this._width||n!=this._height)&&this.reframe(i,n),this._expanding=!1)}reframe(t,e){var i;Object(s["isNumber"])(t)&&(this.element.style.width=t+"px",this.iframe.style.width=t+"px",this._width=t),Object(s["isNumber"])(e)&&(this.element.style.height=e+"px",this.iframe.style.height=e+"px",this._height=e);let n=this.prevBounds?t-this.prevBounds.width:t,r=this.prevBounds?e-this.prevBounds.height:e;i={width:t,height:e,widthDelta:n,heightDelta:r},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let t;for(let e in this.marks)this.marks.hasOwnProperty(e)&&(t=this.marks[e],this.placeMark(t.element,t.range))}),this.onResize(this,i),this.emit(h["c"].VIEWS.RESIZED,i),this.prevBounds=i,this.elementBounds=Object(s["bounds"])(this.element)}load(t){var e=new s["defer"],i=e.promise;if(!this.iframe)return e.reject(new Error("No Iframe Available")),i;if(this.iframe.onload=function(t){this.onLoad(t,e)}.bind(this),"blobUrl"===this.settings.method)this.blobUrl=Object(s["createBlobUrl"])(t,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if("srcdoc"===this.settings.method)this.iframe.srcdoc=t,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return e.reject(new Error("No Document Available")),i;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var n=this;MSApp.execUnsafeLocalFunction((function(){n.iframe.contentDocument.write(t)}))}else this.iframe.contentDocument.write(t);this.iframe.contentDocument.close()}return i}onLoad(t,e){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 i=this.document.querySelector("link[rel='canonical']");i?i.setAttribute("href",this.section.canonical):(i=this.document.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(i)),this.contents.on(h["c"].CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(h["c"].CONTENTS.RESIZE,t=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),e.resolve(this.contents)}setLayout(t){this.layout=t,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(t){this.settings.axis=t,this.element.style.flex="horizontal"==t?"none":"initial",this.size()}setWritingMode(t){this.writingMode=t}addListeners(){}removeListeners(t){}display(t){var e=new s["defer"];return this.displayed?e.resolve(this):this.render(t).then(function(){this.emit(h["c"].VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,e.resolve(this)}.bind(this),(function(t){e.reject(t,this)})),e.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(h["c"].VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(h["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(t){this.iframe.getBoundingClientRect();var e=this.contents.locationOf(t,this.settings.ignoreClass);return{left:e.left,top:e.top}}onDisplayed(t){}onResize(t,e){}bounds(t){return!t&&this.elementBounds||(this.elementBounds=Object(s["bounds"])(this.element)),this.elementBounds}highlight(t,e={},i,n="epubjs-hl",r={}){if(!this.contents)return;const s=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},r);let o=this.contents.range(t),a=()=>{this.emit(h["c"].VIEWS.MARK_CLICKED,t,e)};e["epubcfi"]=t,this.pane||(this.pane=new l["Pane"](this.iframe,this.element));let c=new l["Highlight"](o,n,e,s),u=this.pane.addMark(c);return this.highlights[t]={mark:u,element:u.element,listeners:[a,i]},u.element.setAttribute("ref",n),u.element.addEventListener("click",a),u.element.addEventListener("touchstart",a),i&&(u.element.addEventListener("click",i),u.element.addEventListener("touchstart",i)),u}underline(t,e={},i,n="epubjs-ul",r={}){if(!this.contents)return;const s=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},r);let o=this.contents.range(t),a=()=>{this.emit(h["c"].VIEWS.MARK_CLICKED,t,e)};e["epubcfi"]=t,this.pane||(this.pane=new l["Pane"](this.iframe,this.element));let c=new l["Underline"](o,n,e,s),u=this.pane.addMark(c);return this.underlines[t]={mark:u,element:u.element,listeners:[a,i]},u.element.setAttribute("ref",n),u.element.addEventListener("click",a),u.element.addEventListener("touchstart",a),i&&(u.element.addEventListener("click",i),u.element.addEventListener("touchstart",i)),u}mark(t,e={},i){if(!this.contents)return;if(t in this.marks){let e=this.marks[t];return e}let n=this.contents.range(t);if(!n)return;let r=n.commonAncestorContainer,s=1===r.nodeType?r:r.parentNode,o=i=>{this.emit(h["c"].VIEWS.MARK_CLICKED,t,e)};n.collapsed&&1===r.nodeType?(n=new Range,n.selectNodeContents(r)):n.collapsed&&(n=new Range,n.selectNodeContents(s));let a=this.document.createElement("a");return a.setAttribute("ref","epubjs-mk"),a.style.position="absolute",a.dataset["epubcfi"]=t,e&&Object.keys(e).forEach(t=>{a.dataset[t]=e[t]}),i&&(a.addEventListener("click",i),a.addEventListener("touchstart",i)),a.addEventListener("click",o),a.addEventListener("touchstart",o),this.placeMark(a,n),this.element.appendChild(a),this.marks[t]={element:a,range:n,listeners:[o,i]},s}placeMark(t,e){let i,n,r;if("pre-paginated"===this.layout.name||"horizontal"!==this.settings.axis){let t=e.getBoundingClientRect();i=t.top,n=t.right}else{let t,o=e.getClientRects();for(var s=0;s!=o.length;s++)t=o[s],(!r||t.left{t&&(e.element.removeEventListener("click",t),e.element.removeEventListener("touchstart",t))}),delete this.highlights[t])}ununderline(t){let e;t in this.underlines&&(e=this.underlines[t],this.pane.removeMark(e.mark),e.listeners.forEach(t=>{t&&(e.element.removeEventListener("click",t),e.element.removeEventListener("touchstart",t))}),delete this.underlines[t])}unmark(t){let e;t in this.marks&&(e=this.marks[t],this.element.removeChild(e.element),e.listeners.forEach(t=>{t&&(e.element.removeEventListener("click",t),e.element.removeEventListener("touchstart",t))}),delete this.marks[t])}destroy(){for(let t in this.highlights)this.unhighlight(t);for(let t in this.underlines)this.ununderline(t);for(let t in this.marks)this.unmark(t);this.blobUrl&&Object(s["revokeBlobUrl"])(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.pane&&(this.pane.element.remove(),this.pane=void 0),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}}r()(c.prototype),e["a"]=c},e3db:function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},e58e:function(t,e,i){"use strict";var n=i("c9fc"),r=i.n(n),s=i("0b16");function o(){var t="reverse",e=a();return document.body.appendChild(e),e.scrollLeft>0?t="default":"undefined"!==typeof Element&&Element.prototype.scrollIntoView?(e.children[0].children[1].scrollIntoView(),e.scrollLeft<0&&(t="negative")):(e.scrollLeft=1,0===e.scrollLeft&&(t="negative")),document.body.removeChild(e),t}function a(){var t=document.createElement("div");t.dir="rtl",t.style.position="fixed",t.style.width="1px",t.style.height="1px",t.style.top="0px",t.style.left="0px",t.style.overflow="hidden";var e=document.createElement("div");e.style.width="2px";var i=document.createElement("span");i.style.width="1px",i.style.display="inline-block";var n=document.createElement("span");return n.style.width="1px",n.style.display="inline-block",e.appendChild(i),e.appendChild(n),t.appendChild(e),t}var h=i("3268"),l=i("9650"),c=i("0f32"),u=i.n(c);class d{constructor(t){this.settings=t||{},this.id="epubjs-container-"+Object(s["uuid"])(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(t){let e=t.height,i=t.width,n=t.overflow||!1,r=t.axis||"vertical",o=t.direction;Object(s["extend"])(this.settings,t),t.height&&Object(s["isNumber"])(t.height)&&(e=t.height+"px"),t.width&&Object(s["isNumber"])(t.width)&&(i=t.width+"px");let a=document.createElement("div");return a.id=this.id,a.classList.add("epub-container"),a.style.wordSpacing="0",a.style.lineHeight="0",a.style.verticalAlign="top",a.style.position="relative","horizontal"===r&&(a.style.display="flex",a.style.flexDirection="row",a.style.flexWrap="nowrap"),i&&(a.style.width=i),e&&(a.style.height=e),n&&("scroll"===n&&"vertical"===r?(a.style["overflow-y"]=n,a.style["overflow-x"]="hidden"):"scroll"===n&&"horizontal"===r?(a.style["overflow-y"]="hidden",a.style["overflow-x"]=n):a.style["overflow"]=n),o&&(a.dir=o,a.style["direction"]=o),o&&this.settings.fullsize&&(document.body.style["direction"]=o),a}wrap(t){var e=document.createElement("div");return e.style.visibility="hidden",e.style.overflow="hidden",e.style.width="0",e.style.height="0",e.appendChild(t),e}getElement(t){var e;if(Object(s["isElement"])(t)?e=t:"string"===typeof t&&(e=document.getElementById(t)),!e)throw new Error("Not an Element");return e}attachTo(t){var e,i=this.getElement(t);if(i)return e=this.settings.hidden?this.wrapper:this.container,i.appendChild(e),this.element=i,i}getContainer(){return this.container}onResize(t){Object(s["isNumber"])(this.settings.width)&&Object(s["isNumber"])(this.settings.height)||(this.resizeFunc=u()(t,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(t){this.orientationChangeFunc=t,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(t,e){var i;let n=t||this.settings.width,r=e||this.settings.height;null===t?(i=this.element.getBoundingClientRect(),i.width&&(t=Math.floor(i.width),this.container.style.width=t+"px")):Object(s["isNumber"])(t)?this.container.style.width=t+"px":this.container.style.width=t,null===e?(i=i||this.element.getBoundingClientRect(),i.height&&(e=i.height,this.container.style.height=e+"px")):Object(s["isNumber"])(e)?this.container.style.height=e+"px":this.container.style.height=e,Object(s["isNumber"])(t)||(t=this.container.clientWidth),Object(s["isNumber"])(e)||(e=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 o=Object(s["windowBounds"])(),a=window.getComputedStyle(document.body),h={left:parseFloat(a["padding-left"])||0,right:parseFloat(a["padding-right"])||0,top:parseFloat(a["padding-top"])||0,bottom:parseFloat(a["padding-bottom"])||0};return n||(t=o.width-h.left-h.right),(this.settings.fullsize&&!r||!r)&&(e=o.height-h.top-h.bottom),{width:t-this.containerPadding.left-this.containerPadding.right,height:e-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let t;return"visible"!==this.container.style.overflow&&(t=this.container&&this.container.getBoundingClientRect()),t&&t.width&&t.height?t:Object(s["windowBounds"])()}getSheet(){var t=document.createElement("style");return t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet}addStyleRules(t,e){var i="#"+this.id+" ",n="";this.sheet||(this.sheet=this.getSheet()),e.forEach((function(t){for(var e in t)t.hasOwnProperty(e)&&(n+=e+":"+t[e]+";")})),this.sheet.insertRule(i+t+" {"+n+"}",0)}axis(t){"horizontal"===t?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=t}direction(t){this.container&&(this.container.dir=t,this.container.style["direction"]=t),this.settings.fullsize&&(document.body.style["direction"]=t),this.settings.dir=t}overflow(t){this.container&&("scroll"===t&&"vertical"===this.settings.axis?(this.container.style["overflow-y"]=t,this.container.style["overflow-x"]="hidden"):"scroll"===t&&"horizontal"===this.settings.axis?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=t):this.container.style["overflow"]=t),this.settings.overflow=t}destroy(){this.element&&(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 f=d;class p{constructor(t){this.container=t,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(t){return this._views.indexOf(t)}slice(){return this._views.slice.apply(this._views,arguments)}get(t){return this._views[t]}append(t){return this._views.push(t),this.container&&this.container.appendChild(t.element),this.length++,t}prepend(t){return this._views.unshift(t),this.container&&this.container.insertBefore(t.element,this.container.firstChild),this.length++,t}insert(t,e){return this._views.splice(e,0,t),this.container&&(e-1&&this._views.splice(e,1),this.destroy(t),this.length--}destroy(t){t.displayed&&t.destroy(),this.container&&this.container.removeChild(t.element),t=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var t,e=this.length;if(this.length){for(var i=0;i1){if(t||0===e.index)return;if(n=e.next(),n&&!n.properties.includes("page-spread-left"))return i.call(this,n)}}display(t,e){var i=new s["defer"],n=i.promise;(e===t.href||Object(s["isNumber"])(e))&&(e=void 0);var r=this.views.find(t);if(r&&t&&"pre-paginated"!==this.layout.name){let t=r.offset();if("ltr"===this.settings.direction)this.scrollTo(t.left,t.top,!0);else{let e=r.width();this.scrollTo(t.left+e,t.top,!0)}if(e){let t=r.locationOf(e),i=r.width();this.moveTo(t,i)}return i.resolve(),n}this.clear();let o=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&t.properties.includes("page-spread-right")&&(o=!0),this.add(t,o).then(function(t){if(e){let i=t.locationOf(e),n=t.width();this.moveTo(i,n)}}.bind(this),t=>{i.reject(t)}).then(function(){return this.handleNextPrePaginated(o,t,this.add)}.bind(this)).then(function(){this.views.show(),i.resolve()}.bind(this)),n}afterDisplayed(t){this.emit(g["c"].MANAGERS.ADDED,t)}afterResized(t){this.emit(g["c"].MANAGERS.RESIZE,t.section)}moveTo(t,e){var i=0,n=0;this.isPaginated?(i=Math.floor(t.left/this.layout.delta)*this.layout.delta,i+this.layout.delta>this.container.scrollWidth&&(i=this.container.scrollWidth-this.layout.delta),n=Math.floor(t.top/this.layout.delta)*this.layout.delta,n+this.layout.delta>this.container.scrollHeight&&(n=this.container.scrollHeight-this.layout.delta)):n=t.top,"rtl"===this.settings.direction&&(i+=this.layout.delta,i-=e),this.scrollTo(i,n,!0)}add(t,e){var i=this.createView(t,e);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(g["c"].VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(g["c"].VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.display(this.request)}append(t,e){var i=this.createView(t,e);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(g["c"].VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(g["c"].VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.display(this.request)}prepend(t,e){var i=this.createView(t,e);return i.on(g["c"].VIEWS.RESIZED,t=>{this.counter(t)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(g["c"].VIEWS.AXIS,t=>{this.updateAxis(t)}),i.on(g["c"].VIEWS.WRITING_MODE,t=>{this.updateWritingMode(t)}),i.display(this.request)}counter(t){"vertical"===this.settings.axis?this.scrollBy(0,t.heightDelta,!0):this.scrollBy(t.widthDelta,0,!0)}next(){var t,e;let i=this.settings.direction;if(this.views.length){if(!this.isPaginated||"horizontal"!==this.settings.axis||i&&"ltr"!==i)if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===i)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?(e=this.container.scrollLeft,e>0?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next()):(e=this.container.scrollLeft+-1*this.layout.delta,e>-1*this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next());else if(this.isPaginated&&"vertical"===this.settings.axis){this.scrollTop=this.container.scrollTop;let e=this.container.scrollTop+this.container.offsetHeight;et).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 t,e;let i=this.settings.direction;if(this.views.length){if(!this.isPaginated||"horizontal"!==this.settings.axis||i&&"ltr"!==i)if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===i)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?(e=this.container.scrollLeft+this.container.offsetWidth,e0?this.scrollBy(0,-this.layout.height,!0):t=this.views.first().section.prev()}else t=this.views.first().section.prev();else this.scrollLeft=this.container.scrollLeft,e=this.container.scrollLeft,e>0?this.scrollBy(-this.layout.delta,0,!0):t=this.views.first().section.prev();if(t){this.clear(),this.updateLayout();let e=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&"object"!==typeof t.prev()&&(e=!0),this.prepend(t,e).then(function(){var e;if("pre-paginated"===this.layout.name&&this.layout.divisor>1&&(e=t.prev(),e))return this.prepend(e)}.bind(this),t=>t).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 t=this.visible();return t.length?t[t.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&"horizontal"===this.settings.axis?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let t=this.visible(),e=this.container.getBoundingClientRect(),i=e.height{let a,h,l,c,{index:u,href:d}=t.section,f=t.position(),p=t.width(),m=t.height();r?(a=s+e.top-f.top+o,h=a+i-o,c=this.layout.count(m,i).pages,l=i):(a=s+e.left-f.left+o,h=a+n-o,c=this.layout.count(p,n).pages,l=n);let g=Math.ceil(a/l),v=[],w=Math.ceil(h/l);if("rtl"===this.settings.direction&&!r){let t=g;g=c-w,w=c-t}v=[];for(var y=g;y<=w;y++){let t=y+1;v.push(t)}let b=this.mapping.page(t.contents,t.section.cfiBase,a,h);return{index:u,href:d,pages:v,totalPages:c,mapping:b}});return a}paginatedLocation(){let t=this.visible(),e=this.container.getBoundingClientRect(),i=0,n=0;this.settings.fullsize&&(i=window.scrollX);let r=t.map(t=>{let r,s,o,a,{index:h,href:l}=t.section,c=t.position(),u=t.width();"rtl"===this.settings.direction?(r=e.right-i,a=Math.min(Math.abs(r-c.left),this.layout.width)-n,o=c.width-(c.right-r)-n,s=o-a):(r=e.left+i,a=Math.min(c.right-r,this.layout.width)-n,s=r-c.left+n,o=s+a),n+=a;let d=this.mapping.page(t.contents,t.section.cfiBase,s,o),f=this.layout.count(u).pages,p=Math.floor(s/this.layout.pageWidth),m=[],g=Math.floor(o/this.layout.pageWidth);if(p<0&&(p=0,g+=1),"rtl"===this.settings.direction){let t=p;p=f-g,g=f-t}for(var v=p+1;v<=g;v++){let t=v;m.push(t)}return{index:h,href:l,pages:m,totalPages:f,mapping:d}});return r}isVisible(t,e,i,n){var r=t.position(),s=n||this.bounds();return"horizontal"===this.settings.axis&&r.right>s.left-e&&r.lefts.top-e&&r.top0&&"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(t){this.viewSettings.layout=t,this.mapping=new h["a"](t.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach((function(e){e&&e.setLayout(t)}))}updateWritingMode(t){this.writingMode=t}updateAxis(t,e){(e||t!==this.settings.axis)&&(this.settings.axis=t,this.stage&&this.stage.axis(t),this.viewSettings.axis=t,this.mapping&&(this.mapping=new h["a"](this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&("vertical"===t?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(t,e="auto"){let i="paginated"===t||"auto"===t;this.isPaginated=i,"scrolled-doc"===t||"scrolled-continuous"===t||"scrolled"===t?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=t,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=i?"hidden":e,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var t=[];return this.views?(this.views.forEach((function(e){const i=e&&e.contents;i&&t.push(i)})),t):t}direction(t="ltr"){this.settings.direction=t,this.stage&&this.stage.direction(t),this.viewSettings.direction=t,this.updateLayout()}isRendered(){return this.rendered}}r()(v.prototype);e["a"]=v},e76c:function(t,e,i){"use strict";t.exports=function(){}},ecf9:function(t,e,i){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},f3a6:function(t,e,i){"use strict";var n=i("62c4"),r=Array.prototype.forEach,s=Object.create,o=function(t,e){var i;for(i in t)e[i]=t[i]};t.exports=function(t){var e=s(null);return r.call(arguments,(function(t){n(t)&&o(Object(t),e)})),e}},f508:function(t,e,i){"use strict";var n=i("936a"),r=i("1793"),s=i("2031"),o=i("f3a6"),a=i("f973"),h=t.exports=function(t,e){var i,r,h,l,c;return arguments.length<2||"string"!==typeof t?(l=e,e=t,t=null):l=arguments[2],n(t)?(i=a.call(t,"c"),r=a.call(t,"e"),h=a.call(t,"w")):(i=h=!0,r=!1),c={value:e,configurable:i,enumerable:r,writable:h},l?s(o(l),c):c};h.gs=function(t,e,i){var h,l,c,u;return"string"!==typeof t?(c=i,i=e,e=t,t=null):c=arguments[3],n(e)?r(e)?n(i)?r(i)||(c=i,i=void 0):i=void 0:(c=e,e=i=void 0):e=void 0,n(t)?(h=a.call(t,"c"),l=a.call(t,"e")):(h=!0,l=!1),u={get:e,set:i,configurable:h,enumerable:l},c?s(o(c),u):u}},f604:function(t,e,i){"use strict";i("1256")},f60e:function(t,e,i){"use strict";var n=i("7bdf"),r=i("96ae"),s=Math.max;t.exports=function(t,e){var i,o,a,h=s(arguments.length,2);for(t=Object(r(t)),a=function(n){try{t[n]=e[n]}catch(r){i||(i=r)}},o=1;o-1}},f973:function(t,e,i){"use strict";t.exports=i("18ec")()?String.prototype.contains:i("f967")},ffd6:function(t,e,i){var n=i("3729"),r=i("1310"),s="[object Symbol]";function o(t){return"symbol"==typeof t||r(t)&&n(t)==s}t.exports=o}}]);