@bomjan133/react-crud-ui 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("./index-DGN44off.cjs");var Dr={exports:{}},Ln={exports:{}},ea=void 0,Fn=function(n){return n!==ea&&n!==null},ta=Fn,ia={object:!0,function:!0,undefined:!0},ra=function(n){return ta(n)?hasOwnProperty.call(ia,typeof n):!1},na=ra,sa=function(n){if(!na(n))return!1;try{return n.constructor?n.constructor.prototype===n:!1}catch{return!1}},aa=sa,oa=function(n){if(typeof n!="function"||!hasOwnProperty.call(n,"length"))return!1;try{if(typeof n.length!="number"||typeof n.call!="function"||typeof n.apply!="function")return!1}catch{return!1}return!aa(n)},ua=oa,la=/^\s*class[\s{/}]/,ha=Function.prototype.toString,fa=function(n){return!(!ua(n)||la.test(ha.call(n)))},ca=function(){var n=Object.assign,e;return typeof n!="function"?!1:(e={foo:"raz"},n(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")},cr,tn;function da(){return tn||(tn=1,cr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),cr}var pa=function(){},va=pa(),Or=function(n){return n!==va&&n!==null},dr,rn;function ga(){if(rn)return dr;rn=1;var n=Or,e=Object.keys;return dr=function(t){return e(n(t)?Object(t):t)},dr}var pr,nn;function ma(){return nn||(nn=1,pr=da()()?Object.keys:ga()),pr}var vr,sn;function ya(){if(sn)return vr;sn=1;var n=Or;return vr=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e},vr}var gr,an;function ba(){if(an)return gr;an=1;var n=ma(),e=ya(),t=Math.max;return gr=function(i,r){var s,a,o=t(arguments.length,2),u;for(i=Object(e(i)),u=function(h){try{i[h]=r[h]}catch(f){s||(s=f)}},a=1;a<o;++a)r=arguments[a],n(r).forEach(u);if(s!==void 0)throw s;return i},gr}var wa=ca()?Object.assign:ba(),_a=Or,Ea=Array.prototype.forEach,xa=Object.create,Da=function(n,e){var t;for(t in n)e[t]=n[t]},Aa=function(n){var e=xa(null);return Ea.call(arguments,function(t){_a(t)&&Da(Object(t),e)}),e},mr="razdwatrzy",Ca=function(){return typeof mr.contains!="function"?!1:mr.contains("dwa")===!0&&mr.contains("foo")===!1},yr,on;function Sa(){if(on)return yr;on=1;var n=String.prototype.indexOf;return yr=function(e){return n.call(this,e,arguments[1])>-1},yr}var Ta=Ca()?String.prototype.contains:Sa(),Li=Fn,un=fa,Pn=wa,zn=Aa,yi=Ta,ka=Ln.exports=function(n,e){var t,i,r,s,a;return arguments.length<2||typeof n!="string"?(s=e,e=n,n=null):s=arguments[2],Li(n)?(t=yi.call(n,"c"),i=yi.call(n,"e"),r=yi.call(n,"w")):(t=r=!0,i=!1),a={value:e,configurable:t,enumerable:i,writable:r},s?Pn(zn(s),a):a};ka.gs=function(n,e,t){var i,r,s,a;return typeof n!="string"?(s=t,t=e,e=n,n=null):s=arguments[3],Li(e)?un(e)?Li(t)?un(t)||(s=t,t=void 0):t=void 0:(s=e,e=t=void 0):e=void 0,Li(n)?(i=yi.call(n,"c"),r=yi.call(n,"e")):(i=!0,r=!1),a={get:e,set:t,configurable:i,enumerable:r},s?Pn(zn(s),a):a};var Na=Ln.exports,Ra=function(n){if(typeof n!="function")throw new TypeError(n+" is not a function");return n};(function(n,e){var t=Na,i=Ra,r=Function.prototype.apply,s=Function.prototype.call,a=Object.create,o=Object.defineProperty,u=Object.defineProperties,h=Object.prototype.hasOwnProperty,f={configurable:!0,enumerable:!1,writable:!0},c,b,g,C,k,d,p;c=function(y,D){var O;return i(D),h.call(this,"__ee__")?O=this.__ee__:(O=f.value=a(null),o(this,"__ee__",f),f.value=null),O[y]?typeof O[y]=="object"?O[y].push(D):O[y]=[O[y],D]:O[y]=D,this},b=function(y,D){var O,_;return i(D),_=this,c.call(this,y,O=function(){g.call(_,y,O),r.call(D,this,arguments)}),O.__eeOnceListener__=D,this},g=function(y,D){var O,_,A,S;if(i(D),!h.call(this,"__ee__"))return this;if(O=this.__ee__,!O[y])return this;if(_=O[y],typeof _=="object")for(S=0;A=_[S];++S)(A===D||A.__eeOnceListener__===D)&&(_.length===2?O[y]=_[S?0:1]:_.splice(S,1));else(_===D||_.__eeOnceListener__===D)&&delete O[y];return this},C=function(y){var D,O,_,A,S;if(h.call(this,"__ee__")&&(A=this.__ee__[y],!!A))if(typeof A=="object"){for(O=arguments.length,S=new Array(O-1),D=1;D<O;++D)S[D-1]=arguments[D];for(A=A.slice(),D=0;_=A[D];++D)r.call(_,this,S)}else switch(arguments.length){case 1:s.call(A,this);break;case 2:s.call(A,this,arguments[1]);break;case 3:s.call(A,this,arguments[1],arguments[2]);break;default:for(O=arguments.length,S=new Array(O-1),D=1;D<O;++D)S[D-1]=arguments[D];r.call(A,this,S)}},k={on:c,once:b,off:g,emit:C},d={on:t(c),once:t(b),off:t(g),emit:t(C)},p=u({},d),n.exports=e=function(y){return y==null?a(p):u(Object(y),d)},e.methods=k})(Dr,Dr.exports);var Ia=Dr.exports;const Rt=Oe.getDefaultExportFromCjs(Ia);var Ht={},Vt={};function Oa(n,e,t){if(t===void 0&&(t=Array.prototype),n&&typeof t.find=="function")return t.find.call(n,e);for(var i=0;i<n.length;i++)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];if(e.call(void 0,r,i,n))return r}}function Br(n,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(n):n}var Mn=Br({HTML:"text/html",isHTML:function(n){return n===Mn.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Un=Br({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===Un.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Vt.find=Oa;Vt.freeze=Br;Vt.MIME_TYPE=Mn;Vt.NAMESPACE=Un;var jn=Vt,Tt=jn.find,bi=jn.NAMESPACE;function Ba(n){return n!==""}function La(n){return n?n.split(/[\t\n\f\r ]+/).filter(Ba):[]}function Fa(n,e){return n.hasOwnProperty(e)||(n[e]=!0),n}function ln(n){if(!n)return[];var e=La(n);return Object.keys(e.reduce(Fa,{}))}function Pa(n){return function(e){return n&&n.indexOf(e)!==-1}}function Ai(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}function ct(n,e){var t=n.prototype;if(!(t instanceof e)){let i=function(){};i.prototype=e.prototype,i=new i,Ai(t,i),n.prototype=t=i}t.constructor!=n&&(typeof n!="function"&&console.error("unknown Class:"+n),t.constructor=n)}var dt={},Ct=dt.ELEMENT_NODE=1,oi=dt.ATTRIBUTE_NODE=2,Mi=dt.TEXT_NODE=3,qn=dt.CDATA_SECTION_NODE=4,Wn=dt.ENTITY_REFERENCE_NODE=5,za=dt.ENTITY_NODE=6,Hn=dt.PROCESSING_INSTRUCTION_NODE=7,Vn=dt.COMMENT_NODE=8,Gn=dt.DOCUMENT_NODE=9,Zn=dt.DOCUMENT_TYPE_NODE=10,Pt=dt.DOCUMENT_FRAGMENT_NODE=11,Ma=dt.NOTATION_NODE=12,nt={},Qe={};nt.INDEX_SIZE_ERR=(Qe[1]="Index size error",1);nt.DOMSTRING_SIZE_ERR=(Qe[2]="DOMString size error",2);var ft=nt.HIERARCHY_REQUEST_ERR=(Qe[3]="Hierarchy request error",3);nt.WRONG_DOCUMENT_ERR=(Qe[4]="Wrong document",4);nt.INVALID_CHARACTER_ERR=(Qe[5]="Invalid character",5);nt.NO_DATA_ALLOWED_ERR=(Qe[6]="No data allowed",6);nt.NO_MODIFICATION_ALLOWED_ERR=(Qe[7]="No modification allowed",7);var Yn=nt.NOT_FOUND_ERR=(Qe[8]="Not found",8);nt.NOT_SUPPORTED_ERR=(Qe[9]="Not supported",9);var hn=nt.INUSE_ATTRIBUTE_ERR=(Qe[10]="Attribute in use",10);nt.INVALID_STATE_ERR=(Qe[11]="Invalid state",11);nt.SYNTAX_ERR=(Qe[12]="Syntax error",12);nt.INVALID_MODIFICATION_ERR=(Qe[13]="Invalid modification",13);nt.NAMESPACE_ERR=(Qe[14]="Invalid namespace",14);nt.INVALID_ACCESS_ERR=(Qe[15]="Invalid access",15);function We(n,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Qe[n]),this.message=Qe[n],Error.captureStackTrace&&Error.captureStackTrace(this,We);return t.code=n,e&&(this.message=this.message+": "+e),t}We.prototype=Error.prototype;Ai(nt,We);function Ft(){}Ft.prototype={length:0,item:function(n){return n>=0&&n<this.length?this[n]:null},toString:function(n,e){for(var t=[],i=0;i<this.length;i++)si(this[i],t,n,e);return t.join("")},filter:function(n){return Array.prototype.filter.call(this,n)},indexOf:function(n){return Array.prototype.indexOf.call(this,n)}};function ui(n,e){this._node=n,this._refresh=e,Lr(this)}function Lr(n){var e=n._node._inc||n._node.ownerDocument._inc;if(n._inc!==e){var t=n._refresh(n._node);if(as(n,"length",t.length),!n.$$length||t.length<n.$$length)for(var i=t.length;i in n;i++)Object.prototype.hasOwnProperty.call(n,i)&&delete n[i];Ai(t,n),n._inc=e}}ui.prototype.item=function(n){return Lr(this),this[n]||null};ct(ui,Ft);function Ui(){}function Xn(n,e){for(var t=n.length;t--;)if(n[t]===e)return t}function fn(n,e,t,i){if(i?e[Xn(e,i)]=t:e[e.length++]=t,n){t.ownerElement=n;var r=n.ownerDocument;r&&(i&&Jn(r,n,i),Ua(r,n,t))}}function cn(n,e,t){var i=Xn(e,t);if(i>=0){for(var r=e.length-1;i<r;)e[i]=e[++i];if(e.length=r,n){var s=n.ownerDocument;s&&(Jn(s,n,t),t.ownerElement=null)}}else throw new We(Yn,new Error(n.tagName+"@"+t))}Ui.prototype={length:0,item:Ft.prototype.item,getNamedItem:function(n){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==n)return t}},setNamedItem:function(n){var e=n.ownerElement;if(e&&e!=this._ownerElement)throw new We(hn);var t=this.getNamedItem(n.nodeName);return fn(this._ownerElement,this,n,t),t},setNamedItemNS:function(n){var e=n.ownerElement,t;if(e&&e!=this._ownerElement)throw new We(hn);return t=this.getNamedItemNS(n.namespaceURI,n.localName),fn(this._ownerElement,this,n,t),t},removeNamedItem:function(n){var e=this.getNamedItem(n);return cn(this._ownerElement,this,e),e},removeNamedItemNS:function(n,e){var t=this.getNamedItemNS(n,e);return cn(this._ownerElement,this,t),t},getNamedItemNS:function(n,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==n)return i}return null}};function $n(){}$n.prototype={hasFeature:function(n,e){return!0},createDocument:function(n,e,t){var i=new Ci;if(i.implementation=this,i.childNodes=new Ft,i.doctype=t||null,t&&i.appendChild(t),e){var r=i.createElementNS(n,e);i.appendChild(r)}return i},createDocumentType:function(n,e,t){var i=new Ji;return i.name=n,i.nodeName=n,i.publicId=e||"",i.systemId=t||"",i}};function ke(){}ke.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(n,e){return ji(this,n,e)},replaceChild:function(n,e){ji(this,n,e,es),e&&this.removeChild(e)},removeChild:function(n){return Qn(this,n)},appendChild:function(n){return this.insertBefore(n,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(n){return Ar(this.ownerDocument||this,this,n)},normalize:function(){for(var n=this.firstChild;n;){var e=n.nextSibling;e&&e.nodeType==Mi&&n.nodeType==Mi?(this.removeChild(e),n.appendData(e.data)):(n.normalize(),n=e)}},isSupported:function(n,e){return this.ownerDocument.implementation.hasFeature(n,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(n){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]===n)return i}e=e.nodeType==oi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(n){for(var e=this;e;){var t=e._nsMap;if(t&&n in t&&Object.prototype.hasOwnProperty.call(t,n))return t[n];e=e.nodeType==oi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(n){var e=this.lookupPrefix(n);return e==null}};function Kn(n){return n=="<"&&"&lt;"||n==">"&&"&gt;"||n=="&"&&"&amp;"||n=='"'&&"&quot;"||"&#"+n.charCodeAt()+";"}Ai(dt,ke);Ai(dt,ke.prototype);function wi(n,e){if(e(n))return!0;if(n=n.firstChild)do if(wi(n,e))return!0;while(n=n.nextSibling)}function Ci(){this.ownerDocument=this}function Ua(n,e,t){n&&n._inc++;var i=t.namespaceURI;i===bi.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Jn(n,e,t,i){n&&n._inc++;var r=t.namespaceURI;r===bi.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Fr(n,e,t){if(n&&n._inc){n._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else{for(var r=e.firstChild,s=0;r;)i[s++]=r,r=r.nextSibling;i.length=s,delete i[i.length]}}}function Qn(n,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:n.firstChild=i,i?i.previousSibling=t:n.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Fr(n.ownerDocument,n),e}function ja(n){return n&&(n.nodeType===ke.DOCUMENT_NODE||n.nodeType===ke.DOCUMENT_FRAGMENT_NODE||n.nodeType===ke.ELEMENT_NODE)}function qa(n){return n&&(kt(n)||Pr(n)||zt(n)||n.nodeType===ke.DOCUMENT_FRAGMENT_NODE||n.nodeType===ke.COMMENT_NODE||n.nodeType===ke.PROCESSING_INSTRUCTION_NODE)}function zt(n){return n&&n.nodeType===ke.DOCUMENT_TYPE_NODE}function kt(n){return n&&n.nodeType===ke.ELEMENT_NODE}function Pr(n){return n&&n.nodeType===ke.TEXT_NODE}function dn(n,e){var t=n.childNodes||[];if(Tt(t,kt)||zt(e))return!1;var i=Tt(t,zt);return!(e&&i&&t.indexOf(i)>t.indexOf(e))}function pn(n,e){var t=n.childNodes||[];function i(s){return kt(s)&&s!==e}if(Tt(t,i))return!1;var r=Tt(t,zt);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function Wa(n,e,t){if(!ja(n))throw new We(ft,"Unexpected parent node type "+n.nodeType);if(t&&t.parentNode!==n)throw new We(Yn,"child not in parent");if(!qa(e)||zt(e)&&n.nodeType!==ke.DOCUMENT_NODE)throw new We(ft,"Unexpected node type "+e.nodeType+" for parent node type "+n.nodeType)}function Ha(n,e,t){var i=n.childNodes||[],r=e.childNodes||[];if(e.nodeType===ke.DOCUMENT_FRAGMENT_NODE){var s=r.filter(kt);if(s.length>1||Tt(r,Pr))throw new We(ft,"More than one element or text in fragment");if(s.length===1&&!dn(n,t))throw new We(ft,"Element in fragment can not be inserted before doctype")}if(kt(e)&&!dn(n,t))throw new We(ft,"Only one element can be added and only after doctype");if(zt(e)){if(Tt(i,zt))throw new We(ft,"Only one doctype is allowed");var a=Tt(i,kt);if(t&&i.indexOf(a)<i.indexOf(t))throw new We(ft,"Doctype can only be inserted before an element");if(!t&&a)throw new We(ft,"Doctype can not be appended since element is present")}}function es(n,e,t){var i=n.childNodes||[],r=e.childNodes||[];if(e.nodeType===ke.DOCUMENT_FRAGMENT_NODE){var s=r.filter(kt);if(s.length>1||Tt(r,Pr))throw new We(ft,"More than one element or text in fragment");if(s.length===1&&!pn(n,t))throw new We(ft,"Element in fragment can not be inserted before doctype")}if(kt(e)&&!pn(n,t))throw new We(ft,"Only one element can be added and only after doctype");if(zt(e)){if(Tt(i,function(u){return zt(u)&&u!==t}))throw new We(ft,"Only one doctype is allowed");var a=Tt(i,kt);if(t&&i.indexOf(a)<i.indexOf(t))throw new We(ft,"Doctype can only be inserted before an element")}}function ji(n,e,t,i){Wa(n,e,t),n.nodeType===ke.DOCUMENT_NODE&&(i||Ha)(n,e,t);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===Pt){var s=e.firstChild;if(s==null)return e;var a=e.lastChild}else s=a=e;var o=t?t.previousSibling:n.lastChild;s.previousSibling=o,a.nextSibling=t,o?o.nextSibling=s:n.firstChild=s,t==null?n.lastChild=a:t.previousSibling=a;do s.parentNode=n;while(s!==a&&(s=s.nextSibling));return Fr(n.ownerDocument||n,n),e.nodeType==Pt&&(e.firstChild=e.lastChild=null),e}function Va(n,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=n,e.previousSibling=n.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:n.firstChild=e,n.lastChild=e,Fr(n.ownerDocument,n,e),e}Ci.prototype={nodeName:"#document",nodeType:Gn,doctype:null,documentElement:null,_inc:1,insertBefore:function(n,e){if(n.nodeType==Pt){for(var t=n.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i}return n}return ji(this,n,e),n.ownerDocument=this,this.documentElement===null&&n.nodeType===Ct&&(this.documentElement=n),n},removeChild:function(n){return this.documentElement==n&&(this.documentElement=null),Qn(this,n)},replaceChild:function(n,e){ji(this,n,e,es),n.ownerDocument=this,e&&this.removeChild(e),kt(n)&&(this.documentElement=n)},importNode:function(n,e){return ss(this,n,e)},getElementById:function(n){var e=null;return wi(this.documentElement,function(t){if(t.nodeType==Ct&&t.getAttribute("id")==n)return e=t,!0}),e},getElementsByClassName:function(n){var e=ln(n);return new ui(this,function(t){var i=[];return e.length>0&&wi(t.documentElement,function(r){if(r!==t&&r.nodeType===Ct){var s=r.getAttribute("class");if(s){var a=n===s;if(!a){var o=ln(s);a=e.every(Pa(o))}a&&i.push(r)}}}),i})},createElement:function(n){var e=new Gt;e.ownerDocument=this,e.nodeName=n,e.tagName=n,e.localName=n,e.childNodes=new Ft;var t=e.attributes=new Ui;return t._ownerElement=e,e},createDocumentFragment:function(){var n=new Qi;return n.ownerDocument=this,n.childNodes=new Ft,n},createTextNode:function(n){var e=new zr;return e.ownerDocument=this,e.appendData(n),e},createComment:function(n){var e=new Mr;return e.ownerDocument=this,e.appendData(n),e},createCDATASection:function(n){var e=new Ur;return e.ownerDocument=this,e.appendData(n),e},createProcessingInstruction:function(n,e){var t=new qr;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=n,t.nodeValue=t.data=e,t},createAttribute:function(n){var e=new qi;return e.ownerDocument=this,e.name=n,e.nodeName=n,e.localName=n,e.specified=!0,e},createEntityReference:function(n){var e=new jr;return e.ownerDocument=this,e.nodeName=n,e},createElementNS:function(n,e){var t=new Gt,i=e.split(":"),r=t.attributes=new Ui;return t.childNodes=new Ft,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=n,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(n,e){var t=new qi,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=n,t.specified=!0,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};ct(Ci,ke);function Gt(){this._nsMap={}}Gt.prototype={nodeType:Ct,hasAttribute:function(n){return this.getAttributeNode(n)!=null},getAttribute:function(n){var e=this.getAttributeNode(n);return e&&e.value||""},getAttributeNode:function(n){return this.attributes.getNamedItem(n)},setAttribute:function(n,e){var t=this.ownerDocument.createAttribute(n);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(n){var e=this.getAttributeNode(n);e&&this.removeAttributeNode(e)},appendChild:function(n){return n.nodeType===Pt?this.insertBefore(n,null):Va(this,n)},setAttributeNode:function(n){return this.attributes.setNamedItem(n)},setAttributeNodeNS:function(n){return this.attributes.setNamedItemNS(n)},removeAttributeNode:function(n){return this.attributes.removeNamedItem(n.nodeName)},removeAttributeNS:function(n,e){var t=this.getAttributeNodeNS(n,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(n,e){return this.getAttributeNodeNS(n,e)!=null},getAttributeNS:function(n,e){var t=this.getAttributeNodeNS(n,e);return t&&t.value||""},setAttributeNS:function(n,e,t){var i=this.ownerDocument.createAttributeNS(n,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},getAttributeNodeNS:function(n,e){return this.attributes.getNamedItemNS(n,e)},getElementsByTagName:function(n){return new ui(this,function(e){var t=[];return wi(e,function(i){i!==e&&i.nodeType==Ct&&(n==="*"||i.tagName==n)&&t.push(i)}),t})},getElementsByTagNameNS:function(n,e){return new ui(this,function(t){var i=[];return wi(t,function(r){r!==t&&r.nodeType===Ct&&(n==="*"||r.namespaceURI===n)&&(e==="*"||r.localName==e)&&i.push(r)}),i})}};Ci.prototype.getElementsByTagName=Gt.prototype.getElementsByTagName;Ci.prototype.getElementsByTagNameNS=Gt.prototype.getElementsByTagNameNS;ct(Gt,ke);function qi(){}qi.prototype.nodeType=oi;ct(qi,ke);function Si(){}Si.prototype={data:"",substringData:function(n,e){return this.data.substring(n,n+e)},appendData:function(n){n=this.data+n,this.nodeValue=this.data=n,this.length=n.length},insertData:function(n,e){this.replaceData(n,0,e)},appendChild:function(n){throw new Error(Qe[ft])},deleteData:function(n,e){this.replaceData(n,e,"")},replaceData:function(n,e,t){var i=this.data.substring(0,n),r=this.data.substring(n+e);t=i+t+r,this.nodeValue=this.data=t,this.length=t.length}};ct(Si,ke);function zr(){}zr.prototype={nodeName:"#text",nodeType:Mi,splitText:function(n){var e=this.data,t=e.substring(n);e=e.substring(0,n),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};ct(zr,Si);function Mr(){}Mr.prototype={nodeName:"#comment",nodeType:Vn};ct(Mr,Si);function Ur(){}Ur.prototype={nodeName:"#cdata-section",nodeType:qn};ct(Ur,Si);function Ji(){}Ji.prototype.nodeType=Zn;ct(Ji,ke);function ts(){}ts.prototype.nodeType=Ma;ct(ts,ke);function is(){}is.prototype.nodeType=za;ct(is,ke);function jr(){}jr.prototype.nodeType=Wn;ct(jr,ke);function Qi(){}Qi.prototype.nodeName="#document-fragment";Qi.prototype.nodeType=Pt;ct(Qi,ke);function qr(){}qr.prototype.nodeType=Hn;ct(qr,ke);function rs(){}rs.prototype.serializeToString=function(n,e,t){return ns.call(n,e,t)};ke.prototype.toString=ns;function ns(n,e){var t=[],i=this.nodeType==9&&this.documentElement||this,r=i.prefix,s=i.namespaceURI;if(s&&r==null){var r=i.lookupPrefix(s);if(r==null)var a=[{namespace:s,prefix:null}]}return si(this,t,n,e,a),t.join("")}function vn(n,e,t){var i=n.prefix||"",r=n.namespaceURI;if(!r||i==="xml"&&r===bi.XML||r===bi.XMLNS)return!1;for(var s=t.length;s--;){var a=t[s];if(a.prefix===i)return a.namespace!==r}return!0}function br(n,e,t){n.push(" ",e,'="',t.replace(/[<&"]/g,Kn),'"')}function si(n,e,t,i,r){if(r||(r=[]),i)if(n=i(n),n){if(typeof n=="string"){e.push(n);return}}else return;switch(n.nodeType){case Ct:var s=n.attributes,a=s.length,p=n.firstChild,o=n.tagName;t=bi.isHTML(n.namespaceURI)||t;var u=o;if(!t&&!n.prefix&&n.namespaceURI){for(var h,f=0;f<s.length;f++)if(s.item(f).name==="xmlns"){h=s.item(f).value;break}if(!h)for(var c=r.length-1;c>=0;c--){var b=r[c];if(b.prefix===""&&b.namespace===n.namespaceURI){h=b.namespace;break}}if(h!==n.namespaceURI)for(var c=r.length-1;c>=0;c--){var b=r[c];if(b.namespace===n.namespaceURI){b.prefix&&(u=b.prefix+":"+o);break}}}e.push("<",u);for(var g=0;g<a;g++){var C=s.item(g);C.prefix=="xmlns"?r.push({prefix:C.localName,namespace:C.value}):C.nodeName=="xmlns"&&r.push({prefix:"",namespace:C.value})}for(var g=0;g<a;g++){var C=s.item(g);if(vn(C,t,r)){var k=C.prefix||"",d=C.namespaceURI;br(e,k?"xmlns:"+k:"xmlns",d),r.push({prefix:k,namespace:d})}si(C,e,t,i,r)}if(o===u&&vn(n,t,r)){var k=n.prefix||"",d=n.namespaceURI;br(e,k?"xmlns:"+k:"xmlns",d),r.push({prefix:k,namespace:d})}if(p||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(o)){if(e.push(">"),t&&/^script$/i.test(o))for(;p;)p.data?e.push(p.data):si(p,e,t,i,r.slice()),p=p.nextSibling;else for(;p;)si(p,e,t,i,r.slice()),p=p.nextSibling;e.push("</",u,">")}else e.push("/>");return;case Gn:case Pt:for(var p=n.firstChild;p;)si(p,e,t,i,r.slice()),p=p.nextSibling;return;case oi:return br(e,n.name,n.value);case Mi:return e.push(n.data.replace(/[<&]/g,Kn).replace(/]]>/g,"]]&gt;"));case qn:return e.push("<![CDATA[",n.data,"]]>");case Vn:return e.push("<!--",n.data,"-->");case Zn:var y=n.publicId,D=n.systemId;if(e.push("<!DOCTYPE ",n.name),y)e.push(" PUBLIC ",y),D&&D!="."&&e.push(" ",D),e.push(">");else if(D&&D!=".")e.push(" SYSTEM ",D,">");else{var O=n.internalSubset;O&&e.push(" [",O,"]"),e.push(">")}return;case Hn:return e.push("<?",n.target," ",n.data,"?>");case Wn:return e.push("&",n.nodeName,";");default:e.push("??",n.nodeName)}}function ss(n,e,t){var i;switch(e.nodeType){case Ct:i=e.cloneNode(!1),i.ownerDocument=n;case Pt:break;case oi:t=!0;break}if(i||(i=e.cloneNode(!1)),i.ownerDocument=n,i.parentNode=null,t)for(var r=e.firstChild;r;)i.appendChild(ss(n,r,t)),r=r.nextSibling;return i}function Ar(n,e,t){var i=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=e[r];typeof s!="object"&&s!=i[r]&&(i[r]=s)}switch(e.childNodes&&(i.childNodes=new Ft),i.ownerDocument=n,i.nodeType){case Ct:var a=e.attributes,o=i.attributes=new Ui,u=a.length;o._ownerElement=i;for(var h=0;h<u;h++)i.setAttributeNode(Ar(n,a.item(h),!0));break;case oi:t=!0}if(t)for(var f=e.firstChild;f;)i.appendChild(Ar(n,f,t)),f=f.nextSibling;return i}function as(n,e,t){n[e]=t}try{if(Object.defineProperty){let n=function(e){switch(e.nodeType){case Ct:case Pt:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(n(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};Object.defineProperty(ui.prototype,"length",{get:function(){return Lr(this),this.$$length}}),Object.defineProperty(ke.prototype,"textContent",{get:function(){return n(this)},set:function(e){switch(this.nodeType){case Ct:case Pt:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),as=function(e,t,i){e["$$"+t]=i}}}catch{}Ht.DocumentType=Ji;Ht.DOMException=We;Ht.DOMImplementation=$n;Ht.Element=Gt;Ht.Node=ke;Ht.NodeList=Ft;Ht.XMLSerializer=rs;var Ti={},os={};(function(n){var e=Vt.freeze;n.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),n.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
2
+ `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),n.entityMap=n.HTML_ENTITIES})(os);var Wr={},_i=Vt.NAMESPACE,Cr=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,gn=new RegExp("[\\-\\.0-9"+Cr.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),mn=new RegExp("^"+Cr.source+gn.source+"*(?::"+Cr.source+gn.source+"*)?$"),di=0,qt=1,Kt=2,pi=3,Jt=4,Qt=5,vi=6,Oi=7;function li(n,e){this.message=n,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,li)}li.prototype=new Error;li.prototype.name=li.name;function us(){}us.prototype={parse:function(n,e,t){var i=this.domBuilder;i.startDocument(),ls(e,e={}),Ga(n,e,t,i,this.errorHandler),i.endDocument()}};function Ga(n,e,t,i,r){function s(ue){if(ue>65535){ue-=65536;var se=55296+(ue>>10),ne=56320+(ue&1023);return String.fromCharCode(se,ne)}else return String.fromCharCode(ue)}function a(ue){var se=ue.slice(1,-1);return se in t?t[se]:se.charAt(0)==="#"?s(parseInt(se.substr(1).replace("x","0x"))):(r.error("entity not found:"+ue),ue)}function o(ue){if(ue>k){var se=n.substring(k,ue).replace(/&#?\w+;/g,a);b&&u(k),i.characters(se,0,ue-k),k=ue}}function u(ue,se){for(;ue>=f&&(se=c.exec(n));)h=se.index,f=h+se[0].length,b.lineNumber++;b.columnNumber=ue-h+1}for(var h=0,f=0,c=/.*(?:\r\n?|\n)|.*$/g,b=i.locator,g=[{currentNSMap:e}],C={},k=0;;){try{var d=n.indexOf("<",k);if(d<0){if(!n.substr(k).match(/^\s*$/)){var p=i.doc,y=p.createTextNode(n.substr(k));p.appendChild(y),i.currentElement=y}return}switch(d>k&&o(d),n.charAt(d+1)){case"/":var H=n.indexOf(">",d+3),D=n.substring(d+2,H).replace(/[ \t\n\r]+$/g,""),O=g.pop();H<0?(D=n.substring(d+2).replace(/[\s<].*/,""),r.error("end tag name: "+D+" is not complete:"+O.tagName),H=d+1+D.length):D.match(/\s</)&&(D=D.replace(/[\s<].*/,""),r.error("end tag name: "+D+" maybe not complete"),H=d+1+D.length);var _=O.localNSMap,A=O.tagName==D,S=A||O.tagName&&O.tagName.toLowerCase()==D.toLowerCase();if(S){if(i.endElement(O.uri,O.localName,D),_)for(var R in _)Object.prototype.hasOwnProperty.call(_,R)&&i.endPrefixMapping(R);A||r.fatalError("end tag name: "+D+" is not match the current start tagName:"+O.tagName)}else g.push(O);H++;break;case"?":b&&u(d),H=Ka(n,d,i);break;case"!":b&&u(d),H=$a(n,d,i,r);break;default:b&&u(d);var M=new hs,P=g[g.length-1].currentNSMap,H=Za(n,d,M,P,a,r),V=M.length;if(!M.closed&&Xa(n,H,M.tagName,C)&&(M.closed=!0,t.nbsp||r.warning("unclosed xml attribute")),b&&V){for(var te=yn(b,{}),ce=0;ce<V;ce++){var he=M[ce];u(he.offset),he.locator=yn(b,{})}i.locator=te,bn(M,i,P)&&g.push(M),i.locator=b}else bn(M,i,P)&&g.push(M);_i.isHTML(M.uri)&&!M.closed?H=Ya(n,H,M.tagName,a,i):H++}}catch(ue){if(ue instanceof li)throw ue;r.error("element parse error: "+ue),H=-1}H>k?k=H:o(Math.max(d,k)+1)}}function yn(n,e){return e.lineNumber=n.lineNumber,e.columnNumber=n.columnNumber,e}function Za(n,e,t,i,r,s){function a(b,g,C){t.attributeNames.hasOwnProperty(b)&&s.fatalError("Attribute "+b+" redefined"),t.addValue(b,g,C)}for(var o,u,h=++e,f=di;;){var c=n.charAt(h);switch(c){case"=":if(f===qt)o=n.slice(e,h),f=pi;else if(f===Kt)f=pi;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===pi||f===qt)if(f===qt&&(s.warning('attribute value must after "="'),o=n.slice(e,h)),e=h+1,h=n.indexOf(c,e),h>0)u=n.slice(e,h).replace(/&#?\w+;/g,r),a(o,u,e-1),f=Qt;else throw new Error("attribute value no end '"+c+"' match");else if(f==Jt)u=n.slice(e,h).replace(/&#?\w+;/g,r),a(o,u,e),s.warning('attribute "'+o+'" missed start quot('+c+")!!"),e=h+1,f=Qt;else throw new Error('attribute value must after "="');break;case"/":switch(f){case di:t.setTagName(n.slice(e,h));case Qt:case vi:case Oi:f=Oi,t.closed=!0;case Jt:case qt:break;case Kt:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),f==di&&t.setTagName(n.slice(e,h)),h;case">":switch(f){case di:t.setTagName(n.slice(e,h));case Qt:case vi:case Oi:break;case Jt:case qt:u=n.slice(e,h),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Kt:f===Kt&&(u=o),f==Jt?(s.warning('attribute "'+u+'" missed quot(")!'),a(o,u.replace(/&#?\w+;/g,r),e)):((!_i.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),a(u,u,e));break;case pi:throw new Error("attribute value missed!!")}return h;case"€":c=" ";default:if(c<=" ")switch(f){case di:t.setTagName(n.slice(e,h)),f=vi;break;case qt:o=n.slice(e,h),f=Kt;break;case Jt:var u=n.slice(e,h).replace(/&#?\w+;/g,r);s.warning('attribute "'+u+'" missed quot(")!!'),a(o,u,e);case Qt:f=vi;break}else switch(f){case Kt:t.tagName,(!_i.isHTML(i[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=h,f=qt;break;case Qt:s.warning('attribute space is required"'+o+'"!!');case vi:f=qt,e=h;break;case pi:f=Jt,e=h;break;case Oi:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function bn(n,e,t){for(var i=n.tagName,r=null,c=n.length;c--;){var s=n[c],a=s.qName,o=s.value,b=a.indexOf(":");if(b>0)var u=s.prefix=a.slice(0,b),h=a.slice(b+1),f=u==="xmlns"&&h;else h=a,u=null,f=a==="xmlns"&&"";s.localName=h,f!==!1&&(r==null&&(r={},ls(t,t={})),t[f]=r[f]=o,s.uri=_i.XMLNS,e.startPrefixMapping(f,o))}for(var c=n.length;c--;){s=n[c];var u=s.prefix;u&&(u==="xml"&&(s.uri=_i.XML),u!=="xmlns"&&(s.uri=t[u||""]))}var b=i.indexOf(":");b>0?(u=n.prefix=i.slice(0,b),h=n.localName=i.slice(b+1)):(u=null,h=n.localName=i);var g=n.uri=t[u||""];if(e.startElement(g,h,i,n),n.closed){if(e.endElement(g,h,i),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&e.endPrefixMapping(u)}else return n.currentNSMap=t,n.localNSMap=r,!0}function Ya(n,e,t,i,r){if(/^(?:script|textarea)$/i.test(t)){var s=n.indexOf("</"+t+">",e),a=n.substring(e+1,s);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),s):(a=a.replace(/&#?\w+;/g,i),r.characters(a,0,a.length),s)}return e+1}function Xa(n,e,t,i){var r=i[t];return r==null&&(r=n.lastIndexOf("</"+t+">"),r<e&&(r=n.lastIndexOf("</"+t)),i[t]=r),r<e}function ls(n,e){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}function $a(n,e,t,i){var r=n.charAt(e+2);switch(r){case"-":if(n.charAt(e+3)==="-"){var s=n.indexOf("-->",e+4);return s>e?(t.comment(n,e+4,s-e-4),s+3):(i.error("Unclosed comment"),-1)}else return-1;default:if(n.substr(e+3,6)=="CDATA["){var s=n.indexOf("]]>",e+9);return t.startCDATA(),t.characters(n,e+9,s-e-9),t.endCDATA(),s+3}var a=Ja(n,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var u=a[1][0],h=!1,f=!1;o>3&&(/^public$/i.test(a[2][0])?(h=a[3][0],f=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(f=a[3][0]));var c=a[o-1];return t.startDTD(u,h,f),t.endDTD(),c.index+c[0].length}}return-1}function Ka(n,e,t){var i=n.indexOf("?>",e);if(i){var r=n.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),i+2):-1}return-1}function hs(){this.attributeNames={}}hs.prototype={setTagName:function(n){if(!mn.test(n))throw new Error("invalid tagName:"+n);this.tagName=n},addValue:function(n,e,t){if(!mn.test(n))throw new Error("invalid attribute:"+n);this.attributeNames[n]=this.length,this[this.length++]={qName:n,value:e,offset:t}},length:0,getLocalName:function(n){return this[n].localName},getLocator:function(n){return this[n].locator},getQName:function(n){return this[n].qName},getURI:function(n){return this[n].uri},getValue:function(n){return this[n].value}};function Ja(n,e){var t,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(n);t=r.exec(n);)if(i.push(t),t[1])return i}Wr.XMLReader=us;Wr.ParseError=li;var Qa=Vt,Hr=Ht,wn=os,fs=Wr,eo=Hr.DOMImplementation,_n=Qa.NAMESPACE,to=fs.ParseError,io=fs.XMLReader;function cs(n){this.options=n||{locator:{}}}cs.prototype.parseFromString=function(n,e){var t=this.options,i=new io,r=t.domBuilder||new ki,s=t.errorHandler,a=t.locator,o=t.xmlns||{},u=/\/x?html?$/.test(e),h=u?wn.HTML_ENTITIES:wn.XML_ENTITIES;return a&&r.setDocumentLocator(a),i.errorHandler=ro(s,r,a),i.domBuilder=t.domBuilder||r,u&&(o[""]=_n.HTML),o.xml=o.xml||_n.XML,n&&typeof n=="string"?i.parse(n,o,h):i.errorHandler.error("invalid doc source"),r.doc};function ro(n,e,t){if(!n){if(e instanceof ki)return e;n=e}var i={},r=n instanceof Function;t=t||{};function s(a){var o=n[a];!o&&r&&(o=n.length==2?function(u){n(a,u)}:n),i[a]=o&&function(u){o("[xmldom "+a+"] "+u+Sr(t))}||function(){}}return s("warning"),s("error"),s("fatalError"),i}function ki(){this.cdata=!1}function ei(n,e){e.lineNumber=n.lineNumber,e.columnNumber=n.columnNumber}ki.prototype={startDocument:function(){this.doc=new eo().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(n,e,t,i){var r=this.doc,s=r.createElementNS(n,t||e),a=i.length;Bi(this,s),this.currentElement=s,this.locator&&ei(this.locator,s);for(var o=0;o<a;o++){var n=i.getURI(o),u=i.getValue(o),t=i.getQName(o),h=r.createAttributeNS(n,t);this.locator&&ei(i.getLocator(o),h),h.value=h.nodeValue=u,s.setAttributeNode(h)}},endElement:function(n,e,t){var i=this.currentElement;i.tagName,this.currentElement=i.parentNode},startPrefixMapping:function(n,e){},endPrefixMapping:function(n){},processingInstruction:function(n,e){var t=this.doc.createProcessingInstruction(n,e);this.locator&&ei(this.locator,t),Bi(this,t)},ignorableWhitespace:function(n,e,t){},characters:function(n,e,t){if(n=En.apply(this,arguments),n){if(this.cdata)var i=this.doc.createCDATASection(n);else var i=this.doc.createTextNode(n);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(n)&&this.doc.appendChild(i),this.locator&&ei(this.locator,i)}},skippedEntity:function(n){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(n){(this.locator=n)&&(n.lineNumber=0)},comment:function(n,e,t){n=En.apply(this,arguments);var i=this.doc.createComment(n);this.locator&&ei(this.locator,i),Bi(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(n,e,t){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(n,e,t);this.locator&&ei(this.locator,r),Bi(this,r),this.doc.doctype=r}},warning:function(n){console.warn("[xmldom warning] "+n,Sr(this.locator))},error:function(n){console.error("[xmldom error] "+n,Sr(this.locator))},fatalError:function(n){throw new to(n,this.locator)}};function Sr(n){if(n)return`
3
+ @`+(n.systemId||"")+"#[line:"+n.lineNumber+",col:"+n.columnNumber+"]"}function En(n,e,t){return typeof n=="string"?n.substr(e,t):n.length>=e+t||e?new java.lang.String(n,e,t)+"":n}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(n){ki.prototype[n]=function(){return null}});function Bi(n,e){n.currentElement?n.currentElement.appendChild(e):n.doc.appendChild(e)}Ti.__DOMHandler=ki;Ti.DOMParser=cs;Ti.DOMImplementation=Hr.DOMImplementation;Ti.XMLSerializer=Hr.XMLSerializer;var ds=Ti.DOMParser;const Vr=typeof window<"u"?window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame:!1,no=1,so=3,ps=typeof URL<"u"?URL:typeof window<"u"?window.URL||window.webkitURL||window.mozURL:void 0;function er(){var n=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t=="x"?i:i&7|8).toString(16)});return e}function ao(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function vs(n){return!!(n&&n.nodeType==1)}function Me(n){return!isNaN(parseFloat(n))&&isFinite(n)}function gs(n){let e=parseFloat(n);return Me(n)===!1?!1:typeof n=="string"&&n.indexOf(".")>-1?!0:Math.floor(e)!==e}function ii(n){var e=["Webkit","webkit","Moz","O","ms"],t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],i=n.toLowerCase(),r=e.length;if(typeof document>"u"||typeof document.body.style[i]<"u")return n;for(var s=0;s<r;s++)if(typeof document.body.style[t[s]+i]<"u")return t[s]+i;return n}function ms(n){for(var e=1,t=arguments.length;e<t;e++){var i=arguments[e];for(var r in i)n[r]===void 0&&(n[r]=i[r])}return n}function tt(n){var e=[].slice.call(arguments,1);return e.forEach(function(t){t&&Object.getOwnPropertyNames(t).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}),n}function oo(n,e,t){var i=hi(n,e,t);return e.splice(i,0,n),i}function hi(n,e,t,i,r){var s=i||0,a=r||e.length,o=parseInt(s+(a-s)/2),u;return t||(t=function(h,f){if(h>f)return 1;if(h<f)return-1;if(h==f)return 0}),a-s<=0?o:(u=t(e[o],n),a-s===1?u>=0?o:o+1:u===0?o:u===-1?hi(n,e,t,o,a):hi(n,e,t,s,o))}function Wi(n,e,t,i,r){var s=i||0,a=r||e.length,o=parseInt(s+(a-s)/2),u;return t||(t=function(h,f){if(h>f)return 1;if(h<f)return-1;if(h==f)return 0}),a-s<=0?-1:(u=t(e[o],n),a-s===1?u===0?o:-1:u===0?o:u===-1?Wi(n,e,t,o,a):Wi(n,e,t,s,o))}function Fi(n){var e=window.getComputedStyle(n),t=["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],r=0,s=0;return t.forEach(function(a){r+=parseFloat(e[a])||0}),i.forEach(function(a){s+=parseFloat(e[a])||0}),{height:s,width:r}}function Hi(n){var e=window.getComputedStyle(n),t=["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],r=0,s=0;return t.forEach(function(a){r+=parseFloat(e[a])||0}),i.forEach(function(a){s+=parseFloat(e[a])||0}),{height:s,width:r}}function Tr(n){let e,t=n.ownerDocument;if(n.nodeType==Node.TEXT_NODE){let i=t.createRange();i.selectNodeContents(n),e=i.getBoundingClientRect()}else e=n.getBoundingClientRect();return e}function Vi(){var n=window.innerWidth,e=window.innerHeight;return{top:0,left:0,right:n,bottom:e,width:n,height:e}}function Gr(n,e){for(var t=n.parentNode,i=t.childNodes,r,s=-1,a=0;a<i.length&&(r=i[a],r.nodeType===e&&s++,r!=n);a++);return s}function uo(n){return Gr(n,so)}function ys(n){return Gr(n,no)}function Ei(n){return["xml","opf","ncx"].indexOf(n)>-1}function bs(n,e){return new Blob([n],{type:e})}function Gi(n,e){var t,i=bs(n,e);return t=ps.createObjectURL(i),t}function ws(n){return ps.revokeObjectURL(n)}function kr(n,e){var t,i;if(typeof n=="string")return t=btoa(n),i="data:"+e+";base64,"+t,i}function _s(n){return Object.prototype.toString.call(n).slice(8,-1)}function Nt(n,e,t){var i,r;return typeof DOMParser>"u"||t?r=ds:r=DOMParser,n.charCodeAt(0)===65279&&(n=n.slice(1)),i=new r().parseFromString(n,e),i}function Ne(n,e){var t;if(!n)throw new Error("No Element Provided");if(typeof n.querySelector<"u")return n.querySelector(e);if(t=n.getElementsByTagName(e),t.length)return t[0]}function Mt(n,e){return typeof n.querySelector<"u"?n.querySelectorAll(e):n.getElementsByTagName(e)}function ri(n,e,t){var i,r;if(typeof n.querySelector<"u"){e+="[";for(var s in t)e+=s+"~='"+t[s]+"'";return e+="]",n.querySelector(e)}else if(i=n.getElementsByTagName(e),r=Array.prototype.slice.call(i,0).filter(function(a){for(var o in t)if(a.getAttribute(o)===t[o])return!0;return!1}),r)return r[0]}function Zi(n,e){var t=n.ownerDocument||n;typeof t.createTreeWalker<"u"?Es(n,e,NodeFilter.SHOW_TEXT):Zr(n,function(i){i&&i.nodeType===3&&e(i)})}function Es(n,e,t){var i=document.createTreeWalker(n,t,null,!1);let r;for(;r=i.nextNode();)e(r)}function Zr(n,e){if(e(n))return!0;if(n=n.firstChild,n)do{if(Zr(n,e))return!0;n=n.nextSibling}while(n)}function xs(n){return new Promise(function(e,t){var i=new FileReader;i.readAsDataURL(n),i.onloadend=function(){e(i.result)}})}function we(){this.resolve=null,this.reject=null,this.id=er(),this.promise=new Promise((n,e)=>{this.resolve=n,this.reject=e}),Object.freeze(this)}function Yi(n,e,t){var i;if(typeof n.querySelector<"u"&&(i=n.querySelector(`${e}[*|type="${t}"]`)),!i||i.length===0){i=Mt(n,e);for(var r=0;r<i.length;r++)if(i[r].getAttributeNS("http://www.idpf.org/2007/ops","type")===t||i[r].getAttribute("epub:type")===t)return i[r]}else return i}function Nr(n){for(var e=[],t=n.childNodes,i=0;i<t.length;i++){let r=t[i];r.nodeType===1&&e.push(r)}return e}function Rr(n){for(var e=[n];n;n=n.parentNode)e.unshift(n);return e}function ni(n,e,t){for(var i=[],r=n.childNodes,s=0;s<r.length;s++){let a=r[s];if(a.nodeType===1&&a.nodeName.toLowerCase()===e){if(t)return a;i.push(a)}}if(!t)return i}function lo(n,e){let t;if(!(n===null||e===""))for(t=n.parentNode;t.nodeType===1;){if(t.tagName.toLowerCase()===e)return t;t=t.parentNode}}class Ds{constructor(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}setStart(e,t){this.startContainer=e,this.startOffset=t,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}setEnd(e,t){this.endContainer=e,this.endOffset=t,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}collapse(e){this.collapsed=!0,e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}selectNode(e){let t=e.parentNode,i=Array.prototype.indexOf.call(t.childNodes,e);this.setStart(t,i),this.setEnd(t,i+1)}selectNodeContents(e){e.childNodes[e.childNodes-1];let t=e.nodeType===3?e.textContent.length:parent.childNodes.length;this.setStart(e,0),this.setEnd(e,t)}_commonAncestorContainer(e,t){var i=Rr(e||this.startContainer),r=Rr(t||this.endContainer);if(i[0]==r[0]){for(var s=0;s<i.length;s++)if(i[s]!=r[s])return i[s-1]}}_checkCollapsed(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}toString(){}}const ho=Object.freeze(Object.defineProperty({__proto__:null,RangeObject:Ds,blob2base64:xs,borders:Hi,bounds:Fi,createBase64Url:kr,createBlob:bs,createBlobUrl:Gi,defaults:ms,defer:we,documentHeight:ao,extend:tt,filterChildren:ni,findChildren:Nr,getParentByTagName:lo,indexOfElementNode:ys,indexOfNode:Gr,indexOfSorted:Wi,indexOfTextNode:uo,insert:oo,isElement:vs,isFloat:gs,isNumber:Me,isXml:Ei,locationOf:hi,nodeBounds:Tr,parents:Rr,parse:Nt,prefixed:ii,qs:Ne,qsa:Mt,qsp:ri,querySelectorByType:Yi,requestAnimationFrame:Vr,revokeBlobUrl:ws,sprint:Zi,treeWalker:Es,type:_s,uuid:er,walk:Zr,windowBounds:Vi},Symbol.toStringTag,{value:"Module"}));if(!As)var As={cwd:function(){return"/"}};function St(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+n)}function xn(n,e){for(var t="",i=-1,r=0,s,a=0;a<=n.length;++a){if(a<n.length)s=n.charCodeAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||r===1))if(i!==a-1&&r===2){if(t.length<2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){for(var o=t.length-1,u=o;u>=0&&t.charCodeAt(u)!==47;--u);if(u!==o){u===-1?t="":t=t.slice(0,u),i=a,r=0;continue}}else if(t.length===2||t.length===1){t="",i=a,r=0;continue}}e&&(t.length>0?t+="/..":t="..")}else t.length>0?t+="/"+n.slice(i+1,a):t=n.slice(i+1,a);i=a,r=0}else s===46&&r!==-1?++r:r=-1}return t}function fo(n,e){var t=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return t?t===e.root?t+i:t+n+i:i}var Pi={resolve:function(){for(var e="",t=!1,i,r=arguments.length-1;r>=-1&&!t;r--){var s;r>=0?s=arguments[r]:(i===void 0&&(i=As.cwd()),s=i),St(s),s.length!==0&&(e=s+"/"+e,t=s.charCodeAt(0)===47)}return e=xn(e,!t),t?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(St(e),e.length===0)return".";var t=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=xn(e,!t),e.length===0&&!t&&(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return St(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,t=0;t<arguments.length;++t){var i=arguments[t];St(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":Pi.normalize(e)},relative:function(e,t){if(St(e),St(t),e===t||(e=Pi.resolve(e),t=Pi.resolve(t),e===t))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var r=e.length,s=r-i,a=1;a<t.length&&t.charCodeAt(a)===47;++a);for(var o=t.length,u=o-a,h=s<u?s:u,f=-1,c=0;c<=h;++c){if(c===h){if(u>h){if(t.charCodeAt(a+c)===47)return t.slice(a+c+1);if(c===0)return t.slice(a+c)}else s>h&&(e.charCodeAt(i+c)===47?f=c:c===0&&(f=0));break}var b=e.charCodeAt(i+c),g=t.charCodeAt(a+c);if(b!==g)break;b===47&&(f=c)}var C="";for(c=i+f+1;c<=r;++c)(c===r||e.charCodeAt(c)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+t.slice(a+f):(a+=f,t.charCodeAt(a)===47&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(St(e),e.length===0)return".";for(var t=e.charCodeAt(0),i=t===47,r=-1,s=!0,a=e.length-1;a>=1;--a)if(t=e.charCodeAt(a),t===47){if(!s){r=a;break}}else s=!1;return r===-1?i?"/":".":i&&r===1?"//":e.slice(0,r)},basename:function(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');St(e);var i=0,r=-1,s=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,u=-1;for(a=e.length-1;a>=0;--a){var h=e.charCodeAt(a);if(h===47){if(!s){i=a+1;break}}else u===-1&&(s=!1,u=a+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=u))}return i===r?r=u:r===-1&&(r=e.length),e.slice(i,r)}else{for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!s){i=a+1;break}}else r===-1&&(s=!1,r=a+1);return r===-1?"":e.slice(i,r)}},extname:function(e){St(e);for(var t=-1,i=0,r=-1,s=!0,a=0,o=e.length-1;o>=0;--o){var u=e.charCodeAt(o);if(u===47){if(!s){i=o+1;break}continue}r===-1&&(s=!1,r=o+1),u===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===i+1?"":e.slice(t,r)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('Parameter "pathObject" must be an object, not '+typeof e);return fo("/",e)},parse:function(e){St(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var i=e.charCodeAt(0),r=i===47,s;r?(t.root="/",s=1):s=0;for(var a=-1,o=0,u=-1,h=!0,f=e.length-1,c=0;f>=s;--f){if(i=e.charCodeAt(f),i===47){if(!h){o=f+1;break}continue}u===-1&&(h=!1,u=f+1),i===46?a===-1?a=f:c!==1&&(c=1):a!==-1&&(c=-1)}return a===-1||u===-1||c===0||c===1&&a===u-1&&a===o+1?u!==-1&&(o===0&&r?t.base=t.name=e.slice(1,u):t.base=t.name=e.slice(o,u)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,u)):(t.name=e.slice(o,a),t.base=e.slice(o,u)),t.ext=e.slice(a,u)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",posix:null},co=Pi;const Wt=Oe.getDefaultExportFromCjs(co);class Ut{constructor(e){var t,i;t=e.indexOf("://"),t>-1&&(e=new URL(e).pathname),i=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=i.dir+"/",this.filename=i.base,this.extension=i.ext.slice(1)}parse(e){return Wt.parse(e)}isAbsolute(e){return Wt.isAbsolute(e||this.path)}isDirectory(e){return e.charAt(e.length-1)==="/"}resolve(e){return Wt.resolve(this.directory,e)}relative(e){var t=e&&e.indexOf("://")>-1;return t?e:Wt.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}}class Dt{constructor(e,t){var i=e.indexOf("://")>-1,r=e,s;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=t,!i&&t!==!1&&typeof t!="string"&&window&&window.location&&(this.base=window.location.href),i||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,r=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch{this.Url=void 0,this.base&&(s=new Ut(this.base),r=s.resolve(r))}this.Path=new Ut(r),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var t=e.indexOf("://")>-1,i;return t?e:(i=Wt.resolve(this.directory,e),this.origin+i)}relative(e){return Wt.relative(e,this.directory)}toString(){return this.href}}const ti=1,gt=3,po=9;class ye{constructor(e,t,i){var r;if(this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof ye))return new ye(e,t,i);if(typeof t=="string"?this.base=this.parseComponent(t):typeof t=="object"&&t.steps&&(this.base=t),r=this.checkType(e),r==="string")return this.str=e,tt(this,this.parse(e));if(r==="range")return tt(this,this.fromRange(e,this.base,i));if(r==="node")return tt(this,this.fromNode(e,this.base,i));if(r==="EpubCFI"&&e.path)return e;if(e)throw new TypeError("not a valid argument for EpubCFI");return this}checkType(e){return this.isCfiString(e)?"string":e&&typeof e=="object"&&(_s(e)==="Range"||typeof e.startContainer<"u")?"range":e&&typeof e=="object"&&typeof e.nodeType<"u"?"node":e&&typeof e=="object"&&e instanceof ye?"EpubCFI":!1}parse(e){var t={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},i,r,s;return typeof e!="string"?{spinePos:-1}:(e.indexOf("epubcfi(")===0&&e[e.length-1]===")"&&(e=e.slice(8,e.length-1)),i=this.getChapterComponent(e),i?(t.base=this.parseComponent(i),r=this.getPathComponent(e),t.path=this.parseComponent(r),s=this.getRange(e),s&&(t.range=!0,t.start=this.parseComponent(s[0]),t.end=this.parseComponent(s[1])),t.spinePos=t.base.steps[1].index,t):{spinePos:-1})}parseComponent(e){var t={steps:[],terminal:{offset:null,assertion:null}},i=e.split(":"),r=i[0].split("/"),s;return i.length>1&&(s=i[1],t.terminal=this.parseTerminal(s)),r[0]===""&&r.shift(),t.steps=r.map((function(a){return this.parseStep(a)}).bind(this)),t}parseStep(e){var t,i,r,s,a;if(s=e.match(/\[(.*)\]/),s&&s[1]&&(a=s[1]),i=parseInt(e),!isNaN(i))return i%2===0?(t="element",r=i/2-1):(t="text",r=(i-1)/2),{type:t,index:r,id:a||null}}parseTerminal(e){var t,i,r=e.match(/\[(.*)\]/);return r&&r[1]?(t=parseInt(e.split("[")[0]),i=r[1]):t=parseInt(e),Me(t)||(t=null),{offset:t,assertion:i}}getChapterComponent(e){var t=e.split("!");return t[0]}getPathComponent(e){var t=e.split("!");if(t[1])return t[1].split(",")[0]}getRange(e){var t=e.split(",");return t.length===3?[t[1],t[2]]:!1}getCharecterOffsetComponent(e){var t=e.split(":");return t[1]||""}joinSteps(e){return e?e.map(function(t){var i="";return t.type==="element"&&(i+=(t.index+1)*2),t.type==="text"&&(i+=1+2*t.index),t.id&&(i+="["+t.id+"]"),i}).join("/"):""}segmentString(e){var t="/";return t+=this.joinSteps(e.steps),e.terminal&&e.terminal.offset!=null&&(t+=":"+e.terminal.offset),e.terminal&&e.terminal.assertion!=null&&(t+="["+e.terminal.assertion+"]"),t}toString(){var e="epubcfi(";return e+=this.segmentString(this.base),e+="!",e+=this.segmentString(this.path),this.range&&this.start&&(e+=",",e+=this.segmentString(this.start)),this.range&&this.end&&(e+=",",e+=this.segmentString(this.end)),e+=")",e}compare(e,t){var i,r,s,a;if(typeof e=="string"&&(e=new ye(e)),typeof t=="string"&&(t=new ye(t)),e.spinePos>t.spinePos)return 1;if(e.spinePos<t.spinePos)return-1;e.range?(i=e.path.steps.concat(e.start.steps),s=e.start.terminal):(i=e.path.steps,s=e.path.terminal),t.range?(r=t.path.steps.concat(t.start.steps),a=t.start.terminal):(r=t.path.steps,a=t.path.terminal);for(var o=0;o<i.length;o++){if(!i[o])return-1;if(!r[o]||i[o].index>r[o].index)return 1;if(i[o].index<r[o].index)return-1}return i.length<r.length?-1:s.offset>a.offset?1:s.offset<a.offset?-1:0}step(e){var t=e.nodeType===gt?"text":"element";return{id:e.id,tagName:e.tagName,type:t,index:this.position(e)}}filteredStep(e,t){var i=this.filter(e,t),r;if(i)return r=i.nodeType===gt?"text":"element",{id:i.id,tagName:i.tagName,type:r,index:this.filteredPosition(i,t)}}pathTo(e,t,i){for(var r={steps:[],terminal:{offset:null,assertion:null}},s=e,a;s&&s.parentNode&&s.parentNode.nodeType!=po;)i?a=this.filteredStep(s,i):a=this.step(s),a&&r.steps.unshift(a),s=s.parentNode;return t!=null&&t>=0&&(r.terminal.offset=t,r.steps[r.steps.length-1].type!="text"&&r.steps.push({type:"text",index:0})),r}equalStep(e,t){return!e||!t?!1:e.index===t.index&&e.id===t.id&&e.type===t.type}fromRange(e,t,i){var r={range:!1,base:{},path:{},start:null,end:null},s=e.startContainer,a=e.endContainer,o=e.startOffset,u=e.endOffset,h=!1;if(i&&(h=s.ownerDocument.querySelector("."+i)!=null),typeof t=="string"?(r.base=this.parseComponent(t),r.spinePos=r.base.steps[1].index):typeof t=="object"&&(r.base=t),e.collapsed)h&&(o=this.patchOffset(s,o,i)),r.path=this.pathTo(s,o,i);else{r.range=!0,h&&(o=this.patchOffset(s,o,i)),r.start=this.pathTo(s,o,i),h&&(u=this.patchOffset(a,u,i)),r.end=this.pathTo(a,u,i),r.path={steps:[],terminal:null};var f=r.start.steps.length,c;for(c=0;c<f&&this.equalStep(r.start.steps[c],r.end.steps[c]);c++)c===f-1?r.start.terminal===r.end.terminal&&(r.path.steps.push(r.start.steps[c]),r.range=!1):r.path.steps.push(r.start.steps[c]);r.start.steps=r.start.steps.slice(r.path.steps.length),r.end.steps=r.end.steps.slice(r.path.steps.length)}return r}fromNode(e,t,i){var r={range:!1,base:{},path:{},start:null,end:null};return typeof t=="string"?(r.base=this.parseComponent(t),r.spinePos=r.base.steps[1].index):typeof t=="object"&&(r.base=t),r.path=this.pathTo(e,null,i),r}filter(e,t){var i,r,s,a,o,u=!1;return e.nodeType===gt?(u=!0,s=e.parentNode,i=e.parentNode.classList.contains(t)):(u=!1,i=e.classList.contains(t)),i&&u?(a=s.previousSibling,o=s.nextSibling,a&&a.nodeType===gt?r=a:o&&o.nodeType===gt&&(r=o),r||e):i&&!u?!1:e}patchOffset(e,t,i){if(e.nodeType!=gt)throw new Error("Anchor must be a text node");var r=e,s=t;for(e.parentNode.classList.contains(i)&&(r=e.parentNode);r.previousSibling;){if(r.previousSibling.nodeType===ti)if(r.previousSibling.classList.contains(i))s+=r.previousSibling.textContent.length;else break;else s+=r.previousSibling.textContent.length;r=r.previousSibling}return s}normalizedMap(e,t,i){var r={},s=-1,a,o=e.length,u,h;for(a=0;a<o;a++)u=e[a].nodeType,u===ti&&e[a].classList.contains(i)&&(u=gt),a>0&&u===gt&&h===gt?r[a]=s:t===u&&(s=s+1,r[a]=s),h=u;return r}position(e){var t,i;return e.nodeType===ti?(t=e.parentNode.children,t||(t=Nr(e.parentNode)),i=Array.prototype.indexOf.call(t,e)):(t=this.textNodes(e.parentNode),i=t.indexOf(e)),i}filteredPosition(e,t){var i,r,s;return e.nodeType===ti?(i=e.parentNode.children,s=this.normalizedMap(i,ti,t)):(i=e.parentNode.childNodes,e.parentNode.classList.contains(t)&&(e=e.parentNode,i=e.parentNode.childNodes),s=this.normalizedMap(i,gt,t)),r=Array.prototype.indexOf.call(i,e),s[r]}stepsToXpath(e){var t=[".","*"];return e.forEach(function(i){var r=i.index+1;i.id?t.push("*[position()="+r+" and @id='"+i.id+"']"):i.type==="text"?t.push("text()["+r+"]"):t.push("*["+r+"]")}),t.join("/")}stepsToQuerySelector(e){var t=["html"];return e.forEach(function(i){var r=i.index+1;i.id?t.push("#"+i.id):i.type==="text"||t.push("*:nth-child("+r+")")}),t.join(">")}textNodes(e,t){return Array.prototype.slice.call(e.childNodes).filter(function(i){return i.nodeType===gt?!0:!!(t&&i.classList.contains(t))})}walkToNode(e,t,i){var r=t||document,s=r.documentElement,a,o,u=e.length,h;for(h=0;h<u&&(o=e[h],o.type==="element"?o.id?s=r.getElementById(o.id):(a=s.children||Nr(s),s=a[o.index]):o.type==="text"&&(s=this.textNodes(s,i)[o.index]),!!s);h++);return s}findNode(e,t,i){var r=t||document,s,a;return!i&&typeof r.evaluate<"u"?(a=this.stepsToXpath(e),s=r.evaluate(a,r,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue):i?s=this.walkToNode(e,r,i):s=this.walkToNode(e,r),s}fixMiss(e,t,i,r){var s=this.findNode(e.slice(0,-1),i,r),a=s.childNodes,o=this.normalizedMap(a,gt,r),u,h,f=e[e.length-1].index;for(let c in o){if(!o.hasOwnProperty(c))return;if(o[c]===f)if(u=a[c],h=u.textContent.length,t>h)t=t-h;else{u.nodeType===ti?s=u.childNodes[0]:s=u;break}}return{container:s,offset:t}}toRange(e,t){var i=e||document,r,s,a,o,u,h=this,f,c,b=t?i.querySelector("."+t)!=null:!1,g;if(typeof i.createRange<"u"?r=i.createRange():r=new Ds,h.range?(s=h.start,f=h.path.steps.concat(s.steps),o=this.findNode(f,i,b?t:null),a=h.end,c=h.path.steps.concat(a.steps),u=this.findNode(c,i,b?t:null)):(s=h.path,f=h.path.steps,o=this.findNode(h.path.steps,i,b?t:null)),o)try{s.terminal.offset!=null?r.setStart(o,s.terminal.offset):r.setStart(o,0)}catch{g=this.fixMiss(f,s.terminal.offset,i,b?t:null),r.setStart(g.container,g.offset)}else return console.log("No startContainer found for",this.toString()),null;if(u)try{a.terminal.offset!=null?r.setEnd(u,a.terminal.offset):r.setEnd(u,0)}catch{g=this.fixMiss(c,h.end.terminal.offset,i,b?t:null),r.setEnd(g.container,g.offset)}return r}isCfiString(e){return typeof e=="string"&&e.indexOf("epubcfi(")===0&&e[e.length-1]===")"}generateChapterComponent(e,t,i){var r=parseInt(t),s=(e+1)*2,a="/"+s+"/";return a+=(r+1)*2,i&&(a+="["+i+"]"),a}collapse(e){this.range&&(this.range=!1,e?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}}class At{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e<arguments.length;++e)if(typeof arguments[e]=="function")this.hooks.push(arguments[e]);else for(var t=0;t<arguments[e].length;++t)this.hooks.push(arguments[e][t])}deregister(e){let t;for(let i=0;i<this.hooks.length;i++)if(t=this.hooks[i],t===e){this.hooks.splice(i,1);break}}trigger(){var e=arguments,t=this.context,i=[];return this.hooks.forEach(function(r){try{var s=r.apply(t,e)}catch(a){console.log(a)}s&&typeof s.then=="function"&&i.push(s)}),Promise.all(i)}list(){return this.hooks}clear(){return this.hooks=[]}}function Cs(n,e){var t,i,r=e.url,s=r.indexOf("://")>-1;n&&(i=Ne(n,"head"),t=Ne(i,"base"),t||(t=n.createElement("base"),i.insertBefore(t,i.firstChild)),!s&&window&&window.location&&(r=window.location.origin+r),t.setAttribute("href",r))}function vo(n,e){var t,i,r=e.canonical;n&&(t=Ne(n,"head"),i=Ne(t,"link[rel='canonical']"),i?i.setAttribute("href",r):(i=n.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",r),t.appendChild(i)))}function go(n,e){var t,i,r=e.idref;n&&(t=Ne(n,"head"),i=Ne(t,"link[property='dc.identifier']"),i?i.setAttribute("content",r):(i=n.createElement("meta"),i.setAttribute("name","dc.identifier"),i.setAttribute("content",r),t.appendChild(i)))}function mo(n,e){var t=n.querySelectorAll("a[href]");if(t.length)for(var i=Ne(n.ownerDocument,"base"),r=i?i.getAttribute("href"):void 0,s=(function(o){var u=o.getAttribute("href");if(u.indexOf("mailto:")!==0){var h=u.indexOf("://")>-1;if(h)o.setAttribute("target","_blank");else{var f;try{f=new Dt(u,r)}catch{}o.onclick=function(){return f&&f.hash?e(f.Path.path+f.hash):e(f?f.Path.path:u),!1}}}}).bind(this),a=0;a<t.length;a++)s(t[a])}function Dn(n,e,t){return e.forEach(function(i,r){i&&t[r]&&(i=i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),n=n.replace(new RegExp(i,"g"),t[r]))}),n}function xi(n,e,t,i){var r=typeof window<"u"?window.URL:!1,s=r?"blob":"arraybuffer",a=new we,o=new XMLHttpRequest,u=XMLHttpRequest.prototype,h;"overrideMimeType"in u||Object.defineProperty(u,"overrideMimeType",{value:function(){}}),t&&(o.withCredentials=!0),o.onreadystatechange=c,o.onerror=f,o.open("GET",n,!0);for(h in i)o.setRequestHeader(h,i[h]);e=="json"&&o.setRequestHeader("Accept","application/json"),e||(e=new Ut(n).extension),e=="blob"&&(o.responseType=s),Ei(e)&&o.overrideMimeType("text/xml"),e=="binary"&&(o.responseType="arraybuffer"),o.send();function f(b){a.reject(b)}function c(){if(this.readyState===XMLHttpRequest.DONE){var b=!1;if((this.responseType===""||this.responseType==="document")&&(b=this.responseXML),this.status===200||this.status===0||b){var g;if(!this.response&&!b)return a.reject({status:this.status,message:"Empty Response",stack:new Error().stack}),a.promise;if(this.status===403)return a.reject({status:this.status,response:this.response,message:"Forbidden",stack:new Error().stack}),a.promise;b?g=this.responseXML:Ei(e)?g=Nt(this.response,"text/xml"):e=="xhtml"?g=Nt(this.response,"application/xhtml+xml"):e=="html"||e=="htm"?g=Nt(this.response,"text/html"):e=="json"?g=JSON.parse(this.response):e=="blob"?r?g=this.response:g=new Blob([this.response]):g=this.response,a.resolve(g)}else a.reject({status:this.status,message:this.response,stack:new Error().stack})}}return a.promise}class yo{constructor(e,t){this.idref=e.idref,this.linear=e.linear==="yes",this.properties=e.properties,this.index=e.index,this.href=e.href,this.url=e.url,this.canonical=e.canonical,this.next=e.next,this.prev=e.prev,this.cfiBase=e.cfiBase,t?this.hooks=t:(this.hooks={},this.hooks.serialize=new At(this),this.hooks.content=new At(this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(e){var t=e||this.request||xi,i=new we,r=i.promise;return this.contents?i.resolve(this.contents):t(this.url).then((function(s){return this.document=s,this.contents=s.documentElement,this.hooks.content.trigger(this.document,this)}).bind(this)).then((function(){i.resolve(this.contents)}).bind(this)).catch(function(s){i.reject(s)}),r}base(){return Cs(this.document,this)}render(e){var t=new we,i=t.promise;return this.output,this.load(e).then((function(r){var s=typeof navigator<"u"&&navigator.userAgent||"",a=s.indexOf("Trident")>=0,o;typeof XMLSerializer>"u"||a?o=ds:o=XMLSerializer;var u=new o;return this.output=u.serializeToString(r),this.output}).bind(this)).then((function(){return this.hooks.serialize.trigger(this.output,this)}).bind(this)).then((function(){t.resolve(this.output)}).bind(this)).catch(function(r){t.reject(r)}),i}find(e){var t=this,i=[],r=e.toLowerCase(),s=function(a){for(var o=a.textContent.toLowerCase(),u=t.document.createRange(),h,f,c=-1,b,g=150;f!=-1;)f=o.indexOf(r,c+1),f!=-1&&(u=t.document.createRange(),u.setStart(a,f),u.setEnd(a,f+r.length),h=t.cfiFromRange(u),a.textContent.length<g?b=a.textContent:(b=a.textContent.substring(f-g/2,f+g/2),b="..."+b+"..."),i.push({cfi:h,excerpt:b})),c=f};return Zi(t.document,function(a){s(a)}),i}search(e,t=5){if(typeof document.createTreeWalker>"u")return this.find(e);let i=[];const r=150,s=this,a=e.toLowerCase(),o=function(c){const C=c.reduce((k,d)=>k+d.textContent,"").toLowerCase().indexOf(a);if(C!=-1){const d=C+a.length;let p=0,y=0;if(C<c[0].length){let D;for(;p<c.length-1&&(y+=c[p].length,!(d<=y));)p+=1;let O=c[0],_=c[p],A=s.document.createRange();A.setStart(O,C);let S=c.slice(0,p).reduce((M,P)=>M+P.textContent.length,0);A.setEnd(_,S>d?d:d-S),D=s.cfiFromRange(A);let R=c.slice(0,p+1).reduce((M,P)=>M+P.textContent,"");R.length>r&&(R=R.substring(C-r/2,C+r/2),R="..."+R+"..."),i.push({cfi:D,excerpt:R})}}},u=document.createTreeWalker(s.document,NodeFilter.SHOW_TEXT,null,!1);let h,f=[];for(;h=u.nextNode();)f.push(h),f.length==t&&(o(f.slice(0,t)),f=f.slice(1,t));return f.length>0&&o(f),i}reconcileLayoutSettings(e){var t={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach(function(i){var r=i.replace("rendition:",""),s=r.indexOf("-"),a,o;s!=-1&&(a=r.slice(0,s),o=r.slice(s+1),t[a]=o)}),t}cfiFromRange(e){return new ye(e,this.cfiBase).toString()}cfiFromElement(e){return new ye(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}}class bo{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new At,this.hooks.content=new At,this.hooks.content.register(Cs),this.hooks.content.register(vo),this.hooks.content.register(go),this.epubcfi=new ye,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,t,i){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||"",this.length=this.items.length,this.items.forEach((r,s)=>{var a=this.manifest[r.idref],o;r.index=s,r.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,r.index,r.id),r.href&&(r.url=t(r.href,!0),r.canonical=i(r.href)),a&&(r.href=a.href,r.url=t(r.href,!0),r.canonical=i(r.href),a.properties.length&&r.properties.push.apply(r.properties,a.properties)),r.linear==="yes"?(r.prev=(function(){let u=r.index;for(;u>0;){let h=this.get(u-1);if(h&&h.linear)return h;u-=1}}).bind(this),r.next=(function(){let u=r.index;for(;u<this.spineItems.length-1;){let h=this.get(u+1);if(h&&h.linear)return h;u+=1}}).bind(this)):(r.prev=function(){},r.next=function(){}),o=new yo(r,this.hooks),this.append(o)}),this.loaded=!0}get(e){var t=0;if(typeof e>"u")for(;t<this.spineItems.length;){let i=this.spineItems[t];if(i&&i.linear)break;t+=1}else this.epubcfi.isCfiString(e)?t=new ye(e).spinePos:typeof e=="number"||isNaN(e)===!1?t=e:typeof e=="string"&&e.indexOf("#")===0?t=this.spineById[e.substring(1)]:typeof e=="string"&&(e=e.split("#")[0],t=this.spineByHref[e]||this.spineByHref[encodeURI(e)]);return this.spineItems[t]||null}append(e){var t=this.spineItems.length;return e.index=t,this.spineItems.push(e),this.spineByHref[decodeURI(e.href)]=t,this.spineByHref[encodeURI(e.href)]=t,this.spineByHref[e.href]=t,this.spineById[e.idref]=t,t}prepend(e){return this.spineByHref[e.href]=0,this.spineById[e.idref]=0,this.spineItems.forEach(function(t,i){t.index=i}),0}remove(e){var t=this.spineItems.indexOf(e);if(t>-1)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(t,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let t=this.get(e);if(t&&t.linear)return t;e+=1}while(e<this.spineItems.length)}last(){let e=this.spineItems.length-1;do{let t=this.get(e);if(t&&t.linear)return t;e-=1}while(e>=0)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}}class Yr{constructor(e){this._q=[],this.context=e,this.tick=Vr,this.running=!1,this.paused=!1}enqueue(){var e,t,i,r=[].shift.call(arguments),s=arguments;if(!r)throw new Error("No Task Provided");return typeof r=="function"?(e=new we,t=e.promise,i={task:r,args:s,deferred:e,promise:t}):i={promise:r},this._q.push(i),this.paused==!1&&!this.running&&this.run(),i.promise}dequeue(){var e,t,i;if(this._q.length&&!this.paused){if(e=this._q.shift(),t=e.task,t)return i=t.apply(this.context,e.args),i&&typeof i.then=="function"?i.then((function(){e.deferred.resolve.apply(this.context,arguments)}).bind(this),(function(){e.deferred.reject.apply(this.context,arguments)}).bind(this)):(e.deferred.resolve.apply(this.context,i),e.promise);if(e.promise)return e.promise}else return e=new we,e.deferred.resolve(),e.promise}dump(){for(;this._q.length;)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new we),this.tick.call(window,()=>{this._q.length?this.dequeue().then((function(){this.run()}).bind(this)):(this.defered.resolve(),this.running=void 0)}),this.paused==!0&&(this.paused=!1),this.defered.promise}flush(){if(this.running)return this.running;if(this._q.length)return this.running=this.dequeue().then((function(){return this.running=void 0,this.flush()}).bind(this)),this.running}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}}const tr="0.3",zi=["keydown","keyup","keypressed","mouseup","mousedown","mousemove","click","touchend","touchstart","touchmove"],Q={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"}};class Ss{constructor(e,t,i){this.spine=e,this.request=t,this.pause=i||100,this.q=new Yr(this),this.epubcfi=new ye,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each((function(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(e){return e.load(this.request).then((function(t){var i=new we,r=this.parse(t,e.cfiBase);return this._locations=this._locations.concat(r),e.unload(),this.processingTimeout=setTimeout(()=>i.resolve(r),this.pause),i.promise}).bind(this))}parse(e,t,i){var r=[],s,a=e.ownerDocument,o=Ne(a,"body"),u=0,h,f=i||this.break,c=function(b){var g=b.length,C,k=0;if(b.textContent.trim().length===0)return!1;for(u==0&&(s=this.createRange(),s.startContainer=b,s.startOffset=0),C=f-u,C>g&&(u+=g,k=g);k<g;)if(C=f-u,u===0&&(k+=1,s=this.createRange(),s.startContainer=b,s.startOffset=k),k+C>=g)u+=g-k,k=g;else{k+=C,s.endContainer=b,s.endOffset=k;let d=new ye(s,t).toString();r.push(d),u=0}h=b};if(Zi(o,c.bind(this)),s&&s.startContainer&&h){s.endContainer=h,s.endOffset=h.length;let b=new ye(s,t).toString();r.push(b),u=0}return r}generateFromWords(e,t,i){var r=e?new ye(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each((function(s){s.linear&&(r?s.index>=r.spinePos&&this.q.enqueue(this.processWords.bind(this),s,t,r,i):this.q.enqueue(this.processWords.bind(this),s,t,r,i))}).bind(this)),this.q.run().then((function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}).bind(this))}processWords(e,t,i,r){return r&&this._locationsWords.length>=r?Promise.resolve():e.load(this.request).then((function(s){var a=new we,o=this.parseWords(s,e,t,i),u=r-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(o.length>=r?o.slice(0,u):o),e.unload(),this.processingTimeout=setTimeout(()=>a.resolve(o),this.pause),a.promise}).bind(this))}countWords(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,`
4
+ `),e.split(" ").length}parseWords(e,t,i,r){var s=t.cfiBase,a=[],o=e.ownerDocument,u=Ne(o,"body"),h=i,f=r?r.spinePos!==t.index:!0,c;r&&t.index===r.spinePos&&(c=r.findNode(r.range?r.path.steps.concat(r.start.steps):r.path.steps,e.ownerDocument));var b=function(g){if(!f)if(g===c)f=!0;else return!1;if(g.textContent.length<10&&g.textContent.trim().length===0)return!1;var C=this.countWords(g.textContent),k,d=0;if(C===0)return!1;for(k=h-this._wordCounter,k>C&&(this._wordCounter+=C,d=C);d<C;)if(k=h-this._wordCounter,d+k>=C)this._wordCounter+=C-d,d=C;else{d+=k;let p=new ye(g,s);a.push({cfi:p.toString(),wordCount:this._wordCounter}),this._wordCounter=0}};return Zi(u,b.bind(this)),a}locationFromCfi(e){let t;return ye.prototype.isCfiString(e)&&(e=new ye(e)),this._locations.length===0?-1:(t=hi(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(this._locations.length===0)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return!e||!this.total?0:e/this.total}cfiFromLocation(e){var t=-1;return typeof e!="number"&&(e=parseInt(e)),e>=0&&e<this._locations.length&&(t=this._locations[e]),t}cfiFromPercentage(e){let t;if(e>1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),e>=1){let i=new ye(this._locations[this.total]);return i.collapse(),i.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return typeof e=="string"?this._locations=JSON.parse(e):this._locations=e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if(typeof e=="string")this._currentCfi=e;else if(typeof e=="number")this._current=e;else return;this._locations.length!==0&&(typeof e=="string"?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit(Q.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}}Rt(Ss.prototype);class wo{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var t;if(!e)throw new Error("Container File Not Found");if(t=Ne(e,"rootfile"),!t)throw new Error("No RootFile Found");this.packagePath=t.getAttribute("full-path"),this.directory=Wt.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}}class An{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,i,r;if(!e)throw new Error("Package File Not Found");if(t=Ne(e,"metadata"),!t)throw new Error("No Metadata Found");if(i=Ne(e,"manifest"),!i)throw new Error("No Manifest Found");if(r=Ne(e,"spine"),!r)throw new Error("No Spine Found");return this.manifest=this.parseManifest(i),this.navPath=this.findNavPath(i),this.ncxPath=this.findNcxPath(i,r),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=ys(r),this.spine=this.parseSpine(r,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=r.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var t={};return t.title=this.getElementText(e,"title"),t.creator=this.getElementText(e,"creator"),t.description=this.getElementText(e,"description"),t.pubdate=this.getElementText(e,"date"),t.publisher=this.getElementText(e,"publisher"),t.identifier=this.getElementText(e,"identifier"),t.language=this.getElementText(e,"language"),t.rights=this.getElementText(e,"rights"),t.modified_date=this.getPropertyText(e,"dcterms:modified"),t.layout=this.getPropertyText(e,"rendition:layout"),t.orientation=this.getPropertyText(e,"rendition:orientation"),t.flow=this.getPropertyText(e,"rendition:flow"),t.viewport=this.getPropertyText(e,"rendition:viewport"),t.media_active_class=this.getPropertyText(e,"media:active-class"),t.spread=this.getPropertyText(e,"rendition:spread"),t}parseManifest(e){var t={},i=Mt(e,"item"),r=Array.prototype.slice.call(i);return r.forEach(function(s){var a=s.getAttribute("id"),o=s.getAttribute("href")||"",u=s.getAttribute("media-type")||"",h=s.getAttribute("media-overlay")||"",f=s.getAttribute("properties")||"";t[a]={href:o,type:u,overlay:h,properties:f.length?f.split(" "):[]}}),t}parseSpine(e,t){var i=[],r=Mt(e,"itemref"),s=Array.prototype.slice.call(r);return s.forEach(function(a,o){var u=a.getAttribute("idref"),h=a.getAttribute("properties")||"",f=h.length?h.split(" "):[],c={id:a.getAttribute("id"),idref:u,linear:a.getAttribute("linear")||"yes",properties:f,index:o};i.push(c)}),i}findUniqueIdentifier(e){var t=e.documentElement.getAttribute("unique-identifier");if(!t)return"";var i=e.getElementById(t);return i&&i.localName==="identifier"&&i.namespaceURI==="http://purl.org/dc/elements/1.1/"&&i.childNodes.length>0?i.childNodes[0].nodeValue.trim():""}findNavPath(e){var t=ri(e,"item",{properties:"nav"});return t?t.getAttribute("href"):!1}findNcxPath(e,t){var i=ri(e,"item",{"media-type":"application/x-dtbncx+xml"}),r;return i||(r=t.getAttribute("toc"),r&&(i=e.querySelector(`#${r}`))),i?i.getAttribute("href"):!1}findCoverPath(e){var t=Ne(e,"package");t.getAttribute("version");var i=ri(e,"item",{properties:"cover-image"});if(i)return i.getAttribute("href");var r=ri(e,"meta",{name:"cover"});if(r){var s=r.getAttribute("content"),a=e.getElementById(s);return a?a.getAttribute("href"):""}else return!1}getElementText(e,t){var i=e.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",t),r;return!i||i.length===0?"":(r=i[0],r.childNodes.length?r.childNodes[0].nodeValue:"")}getPropertyText(e,t){var i=ri(e,"meta",{property:t});return i&&i.childNodes.length?i.childNodes[0].nodeValue:""}load(e){this.metadata=e.metadata;let t=e.readingOrder||e.spine;return this.spine=t.map((i,r)=>(i.index=r,i.linear=i.linear||"yes",i)),e.resources.forEach((i,r)=>{this.manifest[r]=i,i.rel&&i.rel[0]==="cover"&&(this.coverPath=i.href)}),this.spineNodeIndex=0,this.toc=e.toc.map((i,r)=>(i.label=i.title,i)),{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}}class wr{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let t=e.nodeType,i,r;t&&(i=Ne(e,"html"),r=Ne(e,"ncx")),t?i?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):r&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var t,i=0;i<e.length;i++)t=e[i],t.href&&(this.tocByHref[t.href]=i),t.id&&(this.tocById[t.id]=i),this.length++,t.subitems.length&&this.unpack(t.subitems)}get(e){var t;return e?(e.indexOf("#")===0?t=this.tocById[e.substring(1)]:e in this.tocByHref&&(t=this.tocByHref[e]),this.getByIndex(e,t,this.toc)):this.toc}getByIndex(e,t,i){if(i.length===0)return;const r=i[t];if(r&&(e===r.id||e===r.href))return r;{let s;for(let a=0;a<i.length&&(s=this.getByIndex(e,t,i[a].subitems),!s);++a);return s}}landmark(e){var t;return e?(t=this.landmarksByType[e],this.landmarks[t]):this.landmarks}parseNav(e){var t=Yi(e,"nav","toc"),i=[];if(!t)return i;let r=ni(t,"ol",!0);return r&&(i=this.parseNavList(r)),i}parseNavList(e,t){const i=[];if(!e||!e.children)return i;for(let r=0;r<e.children.length;r++){const s=this.navItem(e.children[r],t);s&&i.push(s)}return i}navItem(e,t){let i=e.getAttribute("id")||void 0,r=ni(e,"a",!0)||ni(e,"span",!0);if(!r)return;let s=r.getAttribute("href")||"";i||(i=s);let a=r.textContent||"",o=[],u=ni(e,"ol",!0);return u&&(o=this.parseNavList(u,i)),{id:i,href:s,label:a,subitems:o,parent:t}}parseLandmarks(e){var t=Yi(e,"nav","landmarks"),i=t?Mt(t,"li"):[],r=i.length,s,a=[],o;if(!i||r===0)return a;for(s=0;s<r;++s)o=this.landmarkItem(i[s]),o&&(a.push(o),this.landmarksByType[o.type]=s);return a}landmarkItem(e){let t=ni(e,"a",!0);if(!t)return;let i=t.getAttributeNS("http://www.idpf.org/2007/ops","type")||void 0,r=t.getAttribute("href")||"",s=t.textContent||"";return{href:r,label:s,type:i}}parseNcx(e){var t=Mt(e,"navPoint"),i=t.length,r,s={},a=[],o,u;if(!t||i===0)return a;for(r=0;r<i;++r)o=this.ncxItem(t[r]),s[o.id]=o,o.parent?(u=s[o.parent],u.subitems.push(o)):a.push(o);return a}ncxItem(e){var t=e.getAttribute("id")||!1,i=Ne(e,"content"),r=i.getAttribute("src"),s=Ne(e,"navLabel"),a=s.textContent?s.textContent:"",o=[],u=e.parentNode,h;return u&&(u.nodeName==="navPoint"||u.nodeName.split(":").slice(-1)[0]==="navPoint")&&(h=u.getAttribute("id")),{id:t,href:r,label:a,subitems:o,parent:h}}load(e){return e.map(t=>(t.label=t.title,t.subitems=t.children?this.load(t.children):[],t))}forEach(e){return this.toc.forEach(e)}}var gi={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"}},_o=function(){var n,e,t,i,r={};for(n in gi)if(gi.hasOwnProperty(n)){for(e in gi[n])if(gi[n].hasOwnProperty(e))if(t=gi[n][e],typeof t=="string")r[t]=n+"/"+e;else for(i=0;i<t.length;i++)r[t[i]]=n+"/"+e}return r}(),Eo="text/plain";function xo(n){return n&&_o[n.split(".").pop().toLowerCase()]||Eo}const ai={lookup:xo};class Do{constructor(e,t){this.settings={replacements:t&&t.replacements||"base64",archive:t&&t.archive,resolver:t&&t.resolver,request:t&&t.request},this.process(e)}process(e){this.manifest=e,this.resources=Object.keys(e).map(function(t){return e[t]}),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()}split(){this.html=this.resources.filter(function(e){if(e.type==="application/xhtml+xml"||e.type==="text/html")return!0}),this.assets=this.resources.filter(function(e){if(e.type!=="application/xhtml+xml"&&e.type!=="text/html")return!0}),this.css=this.resources.filter(function(e){if(e.type==="text/css")return!0})}splitUrls(){this.urls=this.assets.map((function(e){return e.href}).bind(this)),this.cssUrls=this.css.map(function(e){return e.href})}createUrl(e){var t=new Dt(e),i=ai.lookup(t.filename);return this.settings.archive?this.settings.archive.createUrl(e,{base64:this.settings.replacements==="base64"}):this.settings.replacements==="base64"?this.settings.request(e,"blob").then(r=>xs(r)).then(r=>kr(r,i)):this.settings.request(e,"blob").then(r=>Gi(r,i))}replacements(){if(this.settings.replacements==="none")return new Promise((function(t){t(this.urls)}).bind(this));var e=this.urls.map(t=>{var i=this.settings.resolver(t);return this.createUrl(i).catch(r=>(console.error(r),null))});return Promise.all(e).then(t=>(this.replacementUrls=t.filter(i=>typeof i=="string"),t))}replaceCss(e,t){var i=[];return e=e||this.settings.archive,t=t||this.settings.resolver,this.cssUrls.forEach((function(r){var s=this.createCssFile(r,e,t).then((function(a){var o=this.urls.indexOf(r);o>-1&&(this.replacementUrls[o]=a)}).bind(this));i.push(s)}).bind(this)),Promise.all(i)}createCssFile(e){var t;if(Wt.isAbsolute(e))return new Promise(function(a){a()});var i=this.settings.resolver(e),r;this.settings.archive?r=this.settings.archive.getText(i):r=this.settings.request(i,"text");var s=this.urls.map(a=>{var o=this.settings.resolver(a),u=new Ut(i).relative(o);return u});return r?r.then(a=>(a=Dn(a,s,this.replacementUrls),this.settings.replacements==="base64"?t=kr(a,"text/css"):t=Gi(a,"text/css"),t),a=>new Promise(function(o){o()})):new Promise(function(a){a()})}relativeTo(e,t){return t=t||this.settings.resolver,this.urls.map((function(i){var r=t(i),s=new Ut(e).relative(r);return s}).bind(this))}get(e){var t=this.urls.indexOf(e);if(t!==-1)return this.replacementUrls.length?new Promise((function(i,r){i(this.replacementUrls[t])}).bind(this)):this.createUrl(e)}substitute(e,t){var i;return t?i=this.relativeTo(t):i=this.urls,Dn(e,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}}class _r{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new ye,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var t=Ne(e,"html"),i=Ne(e,"ncx");if(t)return this.parseNav(e);if(i)return this.parseNcx(e)}parseNav(e){var t=Yi(e,"nav","page-list"),i=t?Mt(t,"li"):[],r=i.length,s,a=[],o;if(!i||r===0)return a;for(s=0;s<r;++s)o=this.item(i[s]),a.push(o);return a}parseNcx(e){var t=[],i=0,r,s,a,o=0;if(s=Ne(e,"pageList"),!s||(a=Mt(s,"pageTarget"),o=a.length,!a||a.length===0))return t;for(i=0;i<o;++i)r=this.ncxItem(a[i]),t.push(r);return t}ncxItem(e){var t=Ne(e,"navLabel"),i=Ne(t,"text"),r=i.textContent,s=Ne(e,"content"),a=s.getAttribute("src"),o=parseInt(r,10);return{href:a,page:o}}item(e){var t=Ne(e,"a"),i=t.getAttribute("href")||"",r=t.textContent||"",s=parseInt(r),a=i.indexOf("epubcfi"),o,u,h;return a!=-1?(o=i.split("#"),u=o[0],h=o.length>1?o[1]:!1,{cfi:h,href:i,packageUrl:u,page:s}):{href:i,page:s}}process(e){e.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(e){var t=-1;if(this.locations.length===0)return-1;var i=Wi(e,this.locations,this.epubcfi.compare);return i!=-1?t=this.pages[i]:(i=hi(e,this.locations,this.epubcfi.compare),t=i-1>=0?this.pages[i-1]:this.pages[0],t!==void 0||(t=-1)),t}cfiFromPage(e){var t=-1;typeof e!="number"&&(e=parseInt(e));var i=this.pages.indexOf(e);return i!=-1&&(t=this.locations[i]),t}pageFromPercentage(e){var t=Math.round(this.totalPages*e);return t}percentageFromPage(e){var t=(e-this.firstPage)/this.totalPages;return Math.round(t*1e3)/1e3}percentageFromCfi(e){var t=this.pageFromCfi(e),i=this.percentageFromPage(t);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}}class Xr{constructor(e){this.settings=e,this.name=e.layout||"reflowable",this._spread=e.spread!=="none",this._minSpreadWidth=e.minSpreadWidth||800,this._evenSpreads=e.evenSpreads||!1,e.flow==="scrolled"||e.flow==="scrolled-continuous"||e.flow==="scrolled-doc"?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(e){return typeof e<"u"&&(e==="scrolled"||e==="scrolled-continuous"||e==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.update({flow:this._flow})),this._flow}spread(e,t){return e&&(this._spread=e!=="none",this.update({spread:this._spread})),t>=0&&(this._minSpreadWidth=t),this._spread}calculate(e,t,i){var r=1,s=i||0,a=e,o=t,u=Math.floor(a/12),h,f,c,b;this._spread&&a>=this._minSpreadWidth?r=2:r=1,this.name==="reflowable"&&this._flow==="paginated"&&!(i>=0)&&(s=u%2===0?u:u-1),this.name==="pre-paginated"&&(s=0),r>1?(h=a/r-s,c=h+s):(h=a,c=a),this.name==="pre-paginated"&&r>1&&(a=h),f=h*r+s,b=a,this.width=a,this.height=o,this.spreadWidth=f,this.pageWidth=c,this.delta=b,this.columnWidth=h,this.gap=s,this.divisor=r,this.update({width:a,height:o,spreadWidth:f,pageWidth:c,delta:b,columnWidth:h,gap:s,divisor:r})}format(e,t,i){var r;return this.name==="pre-paginated"?r=e.fit(this.columnWidth,this.height,t):this._flow==="paginated"?r=e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):i&&i==="horizontal"?r=e.size(null,this.height):r=e.size(this.width,null),r}count(e,t){let i,r;return this.name==="pre-paginated"?(i=1,r=1):this._flow==="paginated"?(t=t||this.delta,i=Math.ceil(e/t),r=i*this.divisor):(t=t||this.height,i=Math.ceil(e/t),r=i),{spreads:i,pages:r}}update(e){if(Object.keys(e).forEach(t=>{this.props[t]===e[t]&&delete e[t]}),Object.keys(e).length>0){let t=tt(this.props,e);this.emit(Q.LAYOUT.UPDATED,t,e)}}}Rt(Xr.prototype);class Ao{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){if(arguments.length!==0){if(arguments.length===1&&typeof arguments[0]=="object")return this.registerThemes(arguments[0]);if(arguments.length===1&&typeof arguments[0]=="string")return this.default(arguments[0]);if(arguments.length===2&&typeof arguments[1]=="string")return this.registerUrl(arguments[0],arguments[1]);if(arguments.length===2&&typeof arguments[1]=="object")return this.registerRules(arguments[0],arguments[1])}}default(e){if(e){if(typeof e=="string")return this.registerUrl("default",e);if(typeof e=="object")return this.registerRules("default",e)}}registerThemes(e){for(var t in e)e.hasOwnProperty(t)&&(typeof e[t]=="string"?this.registerUrl(t,e[t]):this.registerRules(t,e[t]))}registerCss(e,t){this._themes[e]={serialized:t},(this._injected[e]||e=="default")&&this.update(e)}registerUrl(e,t){var i=new Dt(t);this._themes[e]={url:i.toString()},(this._injected[e]||e=="default")&&this.update(e)}registerRules(e,t){this._themes[e]={rules:t},(this._injected[e]||e=="default")&&this.update(e)}select(e){var t=this._current,i;this._current=e,this.update(e),i=this.rendition.getContents(),i.forEach(r=>{r.removeClass(t),r.addClass(e)})}update(e){var t=this.rendition.getContents();t.forEach(i=>{this.add(e,i)})}inject(e){var t=[],i=this._themes,r;for(var s in i)i.hasOwnProperty(s)&&(s===this._current||s==="default")&&(r=i[s],(r.rules&&Object.keys(r.rules).length>0||r.url&&t.indexOf(r.url)===-1)&&this.add(s,e),this._injected.push(s));this._current!="default"&&e.addClass(this._current)}add(e,t){var i=this._themes[e];!i||!t||(i.url?t.addStylesheet(i.url):i.serialized?(t.addStylesheetCss(i.serialized,e),i.injected=!0):i.rules&&(t.addStylesheetRules(i.rules,e),i.injected=!0))}override(e,t,i){var r=this.rendition.getContents();this._overrides[e]={value:t,priority:i===!0},r.forEach(s=>{s.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var t=this.rendition.getContents();delete this._overrides[e],t.forEach(i=>{i.css(e)})}overrides(e){var t=this._overrides;for(var i in t)t.hasOwnProperty(i)&&e.css(i,t[i].value,t[i].priority)}fontSize(e){this.override("font-size",e)}font(e){this.override("font-family",e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}}class Xi{constructor(e,t,i,r=!1){this.layout=e,this.horizontal=i==="horizontal",this.direction=t||"ltr",this._dev=r}section(e){var t=this.findRanges(e),i=this.rangeListToCfiList(e.section.cfiBase,t);return i}page(e,t,i,r){var s=e&&e.document?e.document.body:!1,a;if(s){if(a=this.rangePairToCfiPair(t,{start:this.findStart(s,i,r),end:this.findEnd(s,i,r)}),this._dev===!0){let o=e.document,u=new ye(a.start).toRange(o),h=new ye(a.end).toRange(o),f=o.defaultView.getSelection(),c=o.createRange();f.removeAllRanges(),c.setStart(u.startContainer,u.startOffset),c.setEnd(h.endContainer,h.endOffset),f.addRange(c)}return a}}walk(e,t){if(!(e&&e.nodeType===Node.TEXT_NODE)){var i={acceptNode:function(u){return u.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},r=i.acceptNode;r.acceptNode=i.acceptNode;for(var s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,r,!1),a,o;(a=s.nextNode())&&(o=t(a),!o););return o}}findRanges(e){for(var t=[],i=e.contents.scrollWidth(),r=Math.ceil(i/this.layout.spreadWidth),s=r*this.layout.divisor,a=this.layout.columnWidth,o=this.layout.gap,u,h,f=0;f<s.pages;f++)u=(a+o)*f,h=a*(f+1)+o*f,t.push({start:this.findStart(e.document.body,u,h),end:this.findEnd(e.document.body,u,h)});return t}findStart(e,t,i){for(var r=[e],s,a,o=e;r.length;)if(s=r.shift(),a=this.walk(s,u=>{var h,f,c,b,g;if(g=Tr(u),this.horizontal&&this.direction==="ltr"){if(h=this.horizontal?g.left:g.top,f=this.horizontal?g.right:g.bottom,h>=t&&h<=i)return u;if(f>t)return u;o=u,r.push(u)}else if(this.horizontal&&this.direction==="rtl"){if(h=g.left,f=g.right,f<=i&&f>=t)return u;if(h<i)return u;o=u,r.push(u)}else{if(c=g.top,b=g.bottom,c>=t&&c<=i)return u;if(b>t)return u;o=u,r.push(u)}}),a)return this.findTextStartRange(a,t,i);return this.findTextStartRange(o,t,i)}findEnd(e,t,i){for(var r=[e],s,a=e,o;r.length;)if(s=r.shift(),o=this.walk(s,u=>{var h,f,c,b,g;if(g=Tr(u),this.horizontal&&this.direction==="ltr"){if(h=Math.round(g.left),f=Math.round(g.right),h>i&&a)return a;if(f>i)return u;a=u,r.push(u)}else if(this.horizontal&&this.direction==="rtl"){if(h=Math.round(this.horizontal?g.left:g.top),f=Math.round(this.horizontal?g.right:g.bottom),f<t&&a)return a;if(h<t)return u;a=u,r.push(u)}else{if(c=Math.round(g.top),b=Math.round(g.bottom),c>i&&a)return a;if(b>i)return u;a=u,r.push(u)}}),o)return this.findTextEndRange(o,t,i);return this.findTextEndRange(a,t,i)}findTextStartRange(e,t,i){for(var r=this.splitTextNodeIntoRanges(e),s,a,o,u,h,f=0;f<r.length;f++)if(s=r[f],a=s.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(o=a.left,o>=t)return s}else if(this.horizontal&&this.direction==="rtl"){if(h=a.right,h<=i)return s}else if(u=a.top,u>=t)return s;return r[0]}findTextEndRange(e,t,i){for(var r=this.splitTextNodeIntoRanges(e),s,a,o,u,h,f,c,b=0;b<r.length;b++){if(a=r[b],o=a.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(u=o.left,h=o.right,u>i&&s)return s;if(h>i)return a}else if(this.horizontal&&this.direction==="rtl"){if(u=o.left,h=o.right,h<t&&s)return s;if(u<t)return a}else{if(f=o.top,c=o.bottom,f>i&&s)return s;if(c>i)return a}s=a}return r[r.length-1]}splitTextNodeIntoRanges(e,t){var i=[],r=e.textContent||"",s=r.trim(),a,o=e.ownerDocument,u=t||" ",h=s.indexOf(u);if(h===-1||e.nodeType!=Node.TEXT_NODE)return a=o.createRange(),a.selectNodeContents(e),[a];for(a=o.createRange(),a.setStart(e,0),a.setEnd(e,h),i.push(a),a=!1;h!=-1;)h=s.indexOf(u,h+1),h>0&&(a&&(a.setEnd(e,h),i.push(a)),a=o.createRange(),a.setStart(e,h+1));return a&&(a.setEnd(e,s.length),i.push(a)),i}rangePairToCfiPair(e,t){var i=t.start,r=t.end;i.collapse(!0),r.collapse(!1);let s=new ye(i,e).toString(),a=new ye(r,e).toString();return{start:s,end:a}}rangeListToCfiList(e,t){for(var i=[],r,s=0;s<t.length;s++)r=this.rangePairToCfiPair(e,t[s]),i.push(r);return i}axis(e){return e&&(this.horizontal=e==="horizontal"),this.horizontal}}const Ts=typeof navigator<"u",Co=Ts&&/Chrome/.test(navigator.userAgent),Cn=Ts&&!Co&&/AppleWebKit/.test(navigator.userAgent),So=1;class ir{constructor(e,t,i,r){this.epubcfi=new ye,this.document=e,this.documentElement=this.document.documentElement,this.content=t||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=r||0,this.cfiBase=i||"",this.epubReadingSystem("epub.js",tr),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return zi}width(e){var t=this.content;return e&&Me(e)&&(e=e+"px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}height(e){var t=this.content;return e&&Me(e)&&(e=e+"px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}contentWidth(e){var t=this.content||this.document.body;return e&&Me(e)&&(e=e+"px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}contentHeight(e){var t=this.content||this.document.body;return e&&Me(e)&&(e=e+"px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}textWidth(){let e,t,i=this.document.createRange(),r=this.content||this.document.body,s=Hi(r);return i.selectNodeContents(r),e=i.getBoundingClientRect(),t=e.width,s&&s.width&&(t+=s.width),Math.round(t)}textHeight(){let e,t,i=this.document.createRange(),r=this.content||this.document.body;return i.selectNodeContents(r),e=i.getBoundingClientRect(),t=e.bottom,Math.round(t)}scrollWidth(){var e=this.documentElement.scrollWidth;return e}scrollHeight(){var e=this.documentElement.scrollHeight;return e}overflow(e){return e&&(this.documentElement.style.overflow=e),this.window.getComputedStyle(this.documentElement).overflow}overflowX(e){return e&&(this.documentElement.style.overflowX=e),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(e){return e&&(this.documentElement.style.overflowY=e),this.window.getComputedStyle(this.documentElement).overflowY}css(e,t,i){var r=this.content||this.document.body;return t?r.style.setProperty(e,t,i?"important":""):r.style.removeProperty(e),this.window.getComputedStyle(r)[e]}viewport(e){var t=this.document.querySelector("meta[name='viewport']"),i={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},r=[],s={};if(t&&t.hasAttribute("content")){let a=t.getAttribute("content"),o=a.match(/width\s*=\s*([^,]*)/),u=a.match(/height\s*=\s*([^,]*)/),h=a.match(/initial-scale\s*=\s*([^,]*)/),f=a.match(/minimum-scale\s*=\s*([^,]*)/),c=a.match(/maximum-scale\s*=\s*([^,]*)/),b=a.match(/user-scalable\s*=\s*([^,]*)/);o&&o.length&&typeof o[1]<"u"&&(i.width=o[1]),u&&u.length&&typeof u[1]<"u"&&(i.height=u[1]),h&&h.length&&typeof h[1]<"u"&&(i.scale=h[1]),f&&f.length&&typeof f[1]<"u"&&(i.minimum=f[1]),c&&c.length&&typeof c[1]<"u"&&(i.maximum=c[1]),b&&b.length&&typeof b[1]<"u"&&(i.scalable=b[1])}return s=ms(e||{},i),e&&(s.width&&r.push("width="+s.width),s.height&&r.push("height="+s.height),s.scale&&r.push("initial-scale="+s.scale),s.scalable==="no"?(r.push("minimum-scale="+s.scale),r.push("maximum-scale="+s.scale),r.push("user-scalable="+s.scalable)):(s.scalable&&r.push("user-scalable="+s.scalable),s.minimum&&r.push("minimum-scale="+s.minimum),s.maximum&&r.push("minimum-scale="+s.maximum)),t||(t=this.document.createElement("meta"),t.setAttribute("name","viewport"),this.document.querySelector("head").appendChild(t)),t.setAttribute("content",r.join(", ")),this.window.scrollTo(0,0)),s}expand(){this.emit(Q.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),typeof ResizeObserver>"u"?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let e=this.textWidth(),t=this.textHeight();(e!=this._size.width||t!=this._size.height)&&(this._size={width:e,height:t},this.onResize&&this.onResize(this._size),this.emit(Q.CONTENTS.RESIZE,this._size))}resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.active===!1?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",e.style.transitionDuration="0.001ms",e.style.transitionTimingFunction="linear",e.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,t=(function(o){o.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}).bind(this),i=0;i<e.length;i+=1){var r;try{r=e[i].cssRules}catch{return}if(!r)return;for(var s=0;s<r.length;s+=1)if(r[s].media){var a=this.window.matchMedia(r[s].media.mediaText);a.addListener(t)}}}resizeObservers(){this.observer=new ResizeObserver(e=>{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(t=>{this.resizeCheck()});let e={attributes:!0,childList:!0,characterData:!0,subtree:!0};this.observer.observe(this.document,e)}imageLoadListeners(){for(var e=this.document.querySelectorAll("img"),t,i=0;i<e.length;i++)t=e[i],typeof t.naturalWidth<"u"&&t.naturalWidth===0&&(t.onload=this.expand.bind(this))}fontLoadListeners(){!this.document||!this.document.fonts||this.document.fonts.ready.then((function(){this.resizeCheck()}).bind(this))}root(){return this.document?this.document.documentElement:null}locationOf(e,t){var i,r={left:0,top:0};if(!this.document)return r;if(this.epubcfi.isCfiString(e)){let s=new ye(e).toRange(this.document,t);if(s){try{if(!s.endContainer||s.startContainer==s.endContainer&&s.startOffset==s.endOffset){let a=s.startContainer.textContent.indexOf(" ",s.startOffset);a==-1&&(a=s.startContainer.textContent.length),s.setEnd(s.startContainer,a)}}catch(a){console.error("setting end offset to start container length failed",a)}if(s.startContainer.nodeType===Node.ELEMENT_NODE)i=s.startContainer.getBoundingClientRect(),r.left=i.left,r.top=i.top;else if(Cn){let a=s.startContainer,o=new Range;try{a.nodeType===So?i=a.getBoundingClientRect():s.startOffset+2<a.length?(o.setStart(a,s.startOffset),o.setEnd(a,s.startOffset+2),i=o.getBoundingClientRect()):s.startOffset-2>0?(o.setStart(a,s.startOffset-2),o.setEnd(a,s.startOffset),i=o.getBoundingClientRect()):i=a.parentNode.getBoundingClientRect()}catch(u){console.error(u,u.stack)}}else i=s.getBoundingClientRect()}}else if(typeof e=="string"&&e.indexOf("#")>-1){let s=e.substring(e.indexOf("#")+1),a=this.document.getElementById(s);if(a)if(Cn){let o=new Range;o.selectNode(a),i=o.getBoundingClientRect()}else i=a.getBoundingClientRect()}return i&&(r.left=i.left,r.top=i.top),r}addStylesheet(e){return new Promise((function(t,i){var r,s=!1;if(!this.document){t(!1);return}if(r=this.document.querySelector("link[href='"+e+"']"),r){t(!0);return}r=this.document.createElement("link"),r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=r.onreadystatechange=function(){!s&&(!this.readyState||this.readyState=="complete")&&(s=!0,setTimeout(()=>{t(!0)},1))},this.document.head.appendChild(r)}).bind(this))}_getStylesheetNode(e){var t;return e="epubjs-inserted-css-"+(e||""),this.document?(t=this.document.getElementById(e),t||(t=this.document.createElement("style"),t.id=e,this.document.head.appendChild(t)),t):!1}addStylesheetCss(e,t){if(!this.document||!e)return!1;var i;return i=this._getStylesheetNode(t),i.innerHTML=e,!0}addStylesheetRules(e,t){var i;if(!(!this.document||!e||e.length===0))if(i=this._getStylesheetNode(t).sheet,Object.prototype.toString.call(e)==="[object Array]")for(var r=0,s=e.length;r<s;r++){var a=1,o=e[r],u=e[r][0],h="";Object.prototype.toString.call(o[1][0])==="[object Array]"&&(o=o[1],a=0);for(var f=o.length;a<f;a++){var c=o[a];h+=c[0]+":"+c[1]+(c[2]?" !important":"")+`;
5
+ `}i.insertRule(u+"{"+h+"}",i.cssRules.length)}else Object.keys(e).forEach(g=>{const C=e[g];if(Array.isArray(C))C.forEach(k=>{const p=Object.keys(k).map(y=>`${y}:${k[y]}`).join(";");i.insertRule(`${g}{${p}}`,i.cssRules.length)});else{const d=Object.keys(C).map(p=>`${p}:${C[p]}`).join(";");i.insertRule(`${g}{${d}}`,i.cssRules.length)}})}addScript(e){return new Promise((function(t,i){var r,s=!1;if(!this.document){t(!1);return}r=this.document.createElement("script"),r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){!s&&(!this.readyState||this.readyState=="complete")&&(s=!0,setTimeout(function(){t(!0)},1))},this.document.head.appendChild(r)}).bind(this))}addClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.add(e))}removeClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.remove(e))}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),zi.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){this.document&&(zi.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}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(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout((function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}).bind(this),250)}triggerSelectedEvent(e){var t,i;e&&e.rangeCount>0&&(t=e.getRangeAt(0),t.collapsed||(i=new ye(t,this.cfiBase).toString(),this.emit(Q.CONTENTS.SELECTED,i),this.emit(Q.CONTENTS.SELECTED_RANGE,t)))}range(e,t){var i=new ye(e);return i.toRange(this.document,t)}cfiFromRange(e,t){return new ye(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new ye(e,this.cfiBase,t).toString()}map(e){var t=new Xi(e);return t.section()}size(e,t){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),e>=0&&(this.width(e),i.width=e,this.css("padding","0 "+e/12+"px")),t>=0&&(this.height(t),i.height=t),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(e,t,i,r,s){let a=ii("column-axis"),o=ii("column-gap"),u=ii("column-width"),h=ii("column-fill"),c=this.writingMode().indexOf("vertical")===0?"vertical":"horizontal";this.layoutStyle("paginated"),s==="rtl"&&c==="horizontal"&&this.direction(s),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),c==="vertical"?(this.css("padding-top",r/2+"px",!0),this.css("padding-bottom",r/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(a,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",r/2+"px",!0),this.css("padding-right",r/2+"px",!0),this.css(a,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(h,"auto"),this.css(o,r+"px"),this.css(u,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,t,i){var r="scale("+e+")",s="";this.css("transform-origin","top left"),(t>=0||i>=0)&&(s=" translate("+(t||0)+"px, "+(i||0)+"px )"),this.css("transform",r+s)}fit(e,t,i){var r=this.viewport(),s=parseInt(r.width),a=parseInt(r.height),o=e/s,u=t/a,h=o<u?o:u;if(this.layoutStyle("paginated"),this.width(s),this.height(a),this.overflow("hidden"),this.scaler(h,0,0),this.css("background-size",s*h+"px "+a*h+"px"),this.css("background-color","transparent"),i&&i.properties.includes("page-spread-left")){var f=e-s*h;this.css("margin-left",f+"px")}}direction(e){this.documentElement&&(this.documentElement.style.direction=e)}mapPage(e,t,i,r,s){var a=new Xi(t,s);return a.page(this,e,i,r)}linksHandler(){mo(this.content,e=>{this.emit(Q.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let t=ii("writing-mode");return e&&this.documentElement&&(this.documentElement.style[t]=e),this.window.getComputedStyle(this.documentElement)[t]||""}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(e,t){return navigator.epubReadingSystem={name:e,version:t,layoutStyle:this.layoutStyle(),hasFeature:function(i){switch(i){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()}}Rt(ir.prototype);class To{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,t,i,r,s,a){let o=encodeURI(t+e),h=new ye(t).spinePos,f=new ks({type:e,cfiRange:t,data:i,sectionIndex:h,cb:r,className:s,styles:a});return this._annotations[o]=f,h in this._annotationsBySectionIndex?this._annotationsBySectionIndex[h].push(o):this._annotationsBySectionIndex[h]=[o],this.rendition.views().forEach(b=>{f.sectionIndex===b.index&&f.attach(b)}),f}remove(e,t){let i=encodeURI(e+t);if(i in this._annotations){let r=this._annotations[i];if(t&&r.type!==t)return;this.rendition.views().forEach(a=>{this._removeFromAnnotationBySectionIndex(r.sectionIndex,i),r.sectionIndex===a.index&&r.detach(a)}),delete this._annotations[i]}}_removeFromAnnotationBySectionIndex(e,t){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(i=>i!==t)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,t,i,r,s){return this.add("highlight",e,t,i,r,s)}underline(e,t,i,r,s){return this.add("underline",e,t,i,r,s)}mark(e,t,i){return this.add("mark",e,t,i)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(r=>{this._annotations[r].attach(e)})}clear(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(r=>{this._annotations[r].detach(e)})}show(){}hide(){}}class ks{constructor({type:e,cfiRange:t,data:i,sectionIndex:r,cb:s,className:a,styles:o}){this.type=e,this.cfiRange=t,this.data=i,this.sectionIndex=r,this.mark=void 0,this.cb=s,this.className=a,this.styles=o}update(e){this.data=e}attach(e){let{cfiRange:t,data:i,type:r,mark:s,cb:a,className:o,styles:u}=this,h;return r==="highlight"?h=e.highlight(t,i,a,o,u):r==="underline"?h=e.underline(t,i,a,o,u):r==="mark"&&(h=e.mark(t,i,a)),this.mark=h,this.emit(Q.ANNOTATION.ATTACH,h),h}detach(e){let{cfiRange:t,type:i}=this,r;return e&&(i==="highlight"?r=e.unhighlight(t):i==="underline"?r=e.ununderline(t):i==="mark"&&(r=e.unmark(t))),this.mark=void 0,this.emit(Q.ANNOTATION.DETACH,r),r}text(){}}Rt(ks.prototype);var Lt={},rr={};Object.defineProperty(rr,"__esModule",{value:!0});rr.createElement=Ns;function Ns(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}rr.default={createElement:Ns};var Ni={};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.proxyMouse=Rs;Ni.clone=Is;Ni.default={proxyMouse:Rs};function Rs(n,e){function t(a){for(var o=e.length-1;o>=0;o--){var u=e[o],h=a.clientX,f=a.clientY;if(a.touches&&a.touches.length&&(h=a.touches[0].clientX,f=a.touches[0].clientY),!!ko(u,n,h,f)){u.dispatchEvent(Is(a));break}}}if(n.nodeName==="iframe"||n.nodeName==="IFRAME")try{this.target=n.contentDocument}catch{this.target=n}else this.target=n;for(var i=["mouseup","mousedown","click","touchstart"],r=0;r<i.length;r++){var s=i[r];this.target.addEventListener(s,function(a){return t(a)},!1)}}function Is(n){var e=Object.assign({},n,{bubbles:!1});try{return new MouseEvent(n.type,e)}catch{var t=document.createEvent("MouseEvents");return t.initMouseEvent(n.type,!1,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),t}}function ko(n,e,t,i){var r=e.getBoundingClientRect();function s(f,c,b){var g=f.top-r.top,C=f.left-r.left,k=g+f.height,d=C+f.width;return g<=b&&C<=c&&k>b&&d>c}var a=n.getBoundingClientRect();if(!s(a,t,i))return!1;for(var o=n.getClientRects(),u=0,h=o.length;u<h;u++)if(s(o[u],t,i))return!0;return!1}var $i,$r;Object.defineProperty(Lt,"__esModule",{value:!0});var Os=Lt.Underline=$r=Lt.Highlight=Lt.Mark=$i=Lt.Pane=void 0,No=function n(e,t,i){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var s=Object.getPrototypeOf(e);return s===null?void 0:n(s,t,i)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(i)}},nr=function(){function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}}(),Ro=rr,Di=Bs(Ro),Io=Ni,Oo=Bs(Io);function Bs(n){return n&&n.__esModule?n:{default:n}}function Ls(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Fs(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}function sr(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}$i=Lt.Pane=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document.body;sr(this,n),this.target=e,this.element=Di.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),Oo.default.proxyMouse(this.target,this.marks),this.container=t,this.container.appendChild(this.element),this.render()}return nr(n,[{key:"addMark",value:function(t){var i=Di.default.createElement("g");return this.element.appendChild(i),t.bind(i,this.container),this.marks.push(t),t.render(),t}},{key:"removeMark",value:function(t){var i=this.marks.indexOf(t);if(i!==-1){var r=t.unbind();this.element.removeChild(r),this.marks.splice(i,1)}}},{key:"render",value:function(){Po(this.element,Fo(this.target,this.container));var t=!0,i=!1,r=void 0;try{for(var s=this.marks[Symbol.iterator](),a;!(t=(a=s.next()).done);t=!0){var o=a.value;o.render()}}catch(u){i=!0,r=u}finally{try{!t&&s.return&&s.return()}finally{if(i)throw r}}}}]),n}();var Bo=Lt.Mark=function(){function n(){sr(this,n),this.element=null}return nr(n,[{key:"bind",value:function(t,i){this.element=t,this.container=i}},{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(){for(var t=[],i=this.element.firstChild;i;)t.push(i.getBoundingClientRect()),i=i.nextSibling;return t}},{key:"filteredRanges",value:function(){var t=Array.from(this.range.getClientRects());return t.filter(function(i){for(var r=0;r<t.length;r++){if(t[r]===i)return!0;var s=zo(t[r],i);if(s)return!1}return!0})}}]),n}(),Lo=$r=Lt.Highlight=function(n){Fs(e,n);function e(t,i,r,s){sr(this,e);var a=Ls(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a.range=t,a.className=i,a.data=r||{},a.attributes=s||{},a}return nr(e,[{key:"bind",value:function(i,r){No(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"bind",this).call(this,i,r);for(var s in this.data)this.data.hasOwnProperty(s)&&(this.element.dataset[s]=this.data[s]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&this.element.setAttribute(s,this.attributes[s]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var i=this.element.ownerDocument.createDocumentFragment(),r=this.filteredRanges(),s=this.element.getBoundingClientRect(),a=this.container.getBoundingClientRect(),o=0,u=r.length;o<u;o++){var h=r[o],f=Di.default.createElement("rect");f.setAttribute("x",h.left-s.left+a.left),f.setAttribute("y",h.top-s.top+a.top),f.setAttribute("height",h.height),f.setAttribute("width",h.width),i.appendChild(f)}this.element.appendChild(i)}}]),e}(Bo);Os=Lt.Underline=function(n){Fs(e,n);function e(t,i,r,s){return sr(this,e),Ls(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,r,s))}return nr(e,[{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var i=this.element.ownerDocument.createDocumentFragment(),r=this.filteredRanges(),s=this.element.getBoundingClientRect(),a=this.container.getBoundingClientRect(),o=0,u=r.length;o<u;o++){var h=r[o],f=Di.default.createElement("rect");f.setAttribute("x",h.left-s.left+a.left),f.setAttribute("y",h.top-s.top+a.top),f.setAttribute("height",h.height),f.setAttribute("width",h.width),f.setAttribute("fill","none");var c=Di.default.createElement("line");c.setAttribute("x1",h.left-s.left+a.left),c.setAttribute("x2",h.left-s.left+a.left+h.width),c.setAttribute("y1",h.top-s.top+a.top+h.height-1),c.setAttribute("y2",h.top-s.top+a.top+h.height-1),c.setAttribute("stroke-width",1),c.setAttribute("stroke","black"),c.setAttribute("stroke-linecap","square"),i.appendChild(f),i.appendChild(c)}this.element.appendChild(i)}}]),e}(Lo);function Fo(n,e){var t=e.getBoundingClientRect(),i=n.getBoundingClientRect();return{top:i.top-t.top,left:i.left-t.left,height:n.scrollHeight,width:n.scrollWidth}}function Po(n,e){n.style.setProperty("top",e.top+"px","important"),n.style.setProperty("left",e.left+"px","important"),n.style.setProperty("height",e.height+"px","important"),n.style.setProperty("width",e.width+"px","important")}function zo(n,e){return e.right<=n.right&&e.left>=n.left&&e.top>=n.top&&e.bottom<=n.bottom}class Ps{constructor(e,t){this.settings=tt({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1,allowPopups:!1},t||{}),this.id="epubjs-view-"+er(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new ye,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var t=document.createElement("div");return t.classList.add("epub-view"),t.style.height="0px",t.style.width="0px",t.style.overflow="hidden",t.style.position="relative",t.style.display="block",e&&e=="horizontal"?t.style.flex="none":t.style.flex="initial",t}create(){return this.iframe?this.iframe:(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.sandbox="allow-same-origin",this.settings.allowScriptedContent&&(this.iframe.sandbox+=" allow-scripts"),this.settings.allowPopups&&(this.iframe.sandbox+=" allow-popups"),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=Fi(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(e,t){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(e)),this.sectionRender.then((function(i){return this.load(i)}).bind(this)).then((function(){let i=this.contents.writingMode(),r;return this.settings.flow==="scrolled"?r=i.indexOf("vertical")===0?"horizontal":"vertical":r=i.indexOf("vertical")===0?"vertical":"horizontal",i.indexOf("vertical")===0&&this.settings.flow==="paginated"&&(this.layout.delta=this.layout.height),this.setAxis(r),this.emit(Q.VIEWS.AXIS,r),this.setWritingMode(i),this.emit(Q.VIEWS.WRITING_MODE,i),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((s,a)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),s()})}).bind(this),(function(i){return this.emit(Q.VIEWS.LOAD_ERROR,i),new Promise((r,s)=>{s(i)})}).bind(this)).then((function(){this.emit(Q.VIEWS.RENDERED,this.section)}).bind(this))}reset(){this.iframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,t){var i=e||this.settings.width,r=t||this.settings.height;this.layout.name==="pre-paginated"?this.lock("both",i,r):this.settings.axis==="horizontal"?this.lock("height",i,r):this.lock("width",i,r),this.settings.width=i,this.settings.height=r}lock(e,t,i){var r=Hi(this.element),s;this.iframe?s=Hi(this.iframe):s={width:0,height:0},e=="width"&&Me(t)&&(this.lockedWidth=t-r.width-s.width),e=="height"&&Me(i)&&(this.lockedHeight=i-r.height-s.height),e==="both"&&Me(t)&&Me(i)&&(this.lockedWidth=t-r.width-s.width,this.lockedHeight=i-r.height-s.height),this.displayed&&this.iframe&&this.expand()}expand(e){var t=this.lockedWidth,i=this.lockedHeight,r;!this.iframe||this._expanding||(this._expanding=!0,this.layout.name==="pre-paginated"?(t=this.layout.columnWidth,i=this.layout.height):this.settings.axis==="horizontal"?(t=this.contents.textWidth(),t%this.layout.pageWidth>0&&(t=Math.ceil(t/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(r=t/this.layout.pageWidth,this.layout.divisor>1&&this.layout.name==="reflowable"&&r%2>0&&(t+=this.layout.pageWidth))):this.settings.axis==="vertical"&&(i=this.contents.textHeight(),this.settings.flow==="paginated"&&i%this.layout.height>0&&(i=Math.ceil(i/this.layout.height)*this.layout.height)),(this._needsReframe||t!=this._width||i!=this._height)&&this.reframe(t,i),this._expanding=!1)}reframe(e,t){var i;Me(e)&&(this.element.style.width=e+"px",this.iframe.style.width=e+"px",this._width=e),Me(t)&&(this.element.style.height=t+"px",this.iframe.style.height=t+"px",this._height=t);let r=this.prevBounds?e-this.prevBounds.width:e,s=this.prevBounds?t-this.prevBounds.height:t;i={width:e,height:t,widthDelta:r,heightDelta:s},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let a;for(let o in this.marks)this.marks.hasOwnProperty(o)&&(a=this.marks[o],this.placeMark(a.element,a.range))}),this.onResize(this,i),this.emit(Q.VIEWS.RESIZED,i),this.prevBounds=i,this.elementBounds=Fi(this.element)}load(e){var t=new we,i=t.promise;if(!this.iframe)return t.reject(new Error("No Iframe Available")),i;if(this.iframe.onload=(function(s){this.onLoad(s,t)}).bind(this),this.settings.method==="blobUrl")this.blobUrl=Gi(e,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if(this.settings.method==="srcdoc")this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return t.reject(new Error("No Document Available")),i;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var r=this;MSApp.execUnsafeLocalFunction(function(){r.iframe.contentDocument.write(e)})}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return i}onLoad(e,t){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new ir(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(Q.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(Q.CONTENTS.RESIZE,r=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),t.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,e=="horizontal"?this.element.style.flex="none":this.element.style.flex="initial",this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(e){}display(e){var t=new we;return this.displayed?t.resolve(this):this.render(e).then((function(){this.emit(Q.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,t.resolve(this)}).bind(this),function(i){t.reject(i,this)}),t.promise}show(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit(Q.VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(Q.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){this.iframe.getBoundingClientRect();var t=this.contents.locationOf(e,this.settings.ignoreClass);return{left:t.left,top:t.top}}onDisplayed(e){}onResize(e,t){}bounds(e){return(e||!this.elementBounds)&&(this.elementBounds=Fi(this.element)),this.elementBounds}highlight(e,t={},i,r="epubjs-hl",s={}){if(!this.contents)return;const a=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},s);let o=this.contents.range(e),u=()=>{this.emit(Q.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new $i(this.iframe,this.element));let h=new $r(o,r,t,a),f=this.pane.addMark(h);return this.highlights[e]={mark:f,element:f.element,listeners:[u,i]},f.element.setAttribute("ref",r),f.element.addEventListener("click",u),f.element.addEventListener("touchstart",u),i&&(f.element.addEventListener("click",i),f.element.addEventListener("touchstart",i)),f}underline(e,t={},i,r="epubjs-ul",s={}){if(!this.contents)return;const a=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},s);let o=this.contents.range(e),u=()=>{this.emit(Q.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new $i(this.iframe,this.element));let h=new Os(o,r,t,a),f=this.pane.addMark(h);return this.underlines[e]={mark:f,element:f.element,listeners:[u,i]},f.element.setAttribute("ref",r),f.element.addEventListener("click",u),f.element.addEventListener("touchstart",u),i&&(f.element.addEventListener("click",i),f.element.addEventListener("touchstart",i)),f}mark(e,t={},i){if(!this.contents)return;if(e in this.marks)return this.marks[e];let r=this.contents.range(e);if(!r)return;let s=r.commonAncestorContainer,a=s.nodeType===1?s:s.parentNode,o=h=>{this.emit(Q.VIEWS.MARK_CLICKED,e,t)};r.collapsed&&s.nodeType===1?(r=new Range,r.selectNodeContents(s)):r.collapsed&&(r=new Range,r.selectNodeContents(a));let u=this.document.createElement("a");return u.setAttribute("ref","epubjs-mk"),u.style.position="absolute",u.dataset.epubcfi=e,t&&Object.keys(t).forEach(h=>{u.dataset[h]=t[h]}),i&&(u.addEventListener("click",i),u.addEventListener("touchstart",i)),u.addEventListener("click",o),u.addEventListener("touchstart",o),this.placeMark(u,r),this.element.appendChild(u),this.marks[e]={element:u,range:r,listeners:[o,i]},a}placeMark(e,t){let i,r,s;if(this.layout.name==="pre-paginated"||this.settings.axis!=="horizontal"){let o=t.getBoundingClientRect();i=o.top,r=o.right}else{let o=t.getClientRects(),u;for(var a=0;a!=o.length;a++)u=o[a],(!s||u.left<s)&&(s=u.left,r=Math.ceil(s/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,i=u.top)}e.style.top=`${i}px`,e.style.left=`${r}px`}unhighlight(e){let t;e in this.highlights&&(t=this.highlights[e],this.pane.removeMark(t.mark),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.highlights[e])}ununderline(e){let t;e in this.underlines&&(t=this.underlines[e],this.pane.removeMark(t.mark),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.underlines[e])}unmark(e){let t;e in this.marks&&(t=this.marks[e],this.element.removeChild(t.element),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&ws(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)}}Rt(Ps.prototype);function Mo(){var n="reverse",e=Uo();return document.body.appendChild(e),e.scrollLeft>0?n="default":typeof Element<"u"&&Element.prototype.scrollIntoView?(e.children[0].children[1].scrollIntoView(),e.scrollLeft<0&&(n="negative")):(e.scrollLeft=1,e.scrollLeft===0&&(n="negative")),document.body.removeChild(e),n}function Uo(){var n=document.createElement("div");n.dir="rtl",n.style.position="fixed",n.style.width="1px",n.style.height="1px",n.style.top="0px",n.style.left="0px",n.style.overflow="hidden";var e=document.createElement("div");e.style.width="2px";var t=document.createElement("span");t.style.width="1px",t.style.display="inline-block";var i=document.createElement("span");return i.style.width="1px",i.style.display="inline-block",e.appendChild(t),e.appendChild(i),n.appendChild(e),n}function jo(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Kr=jo,qo=typeof Oe.commonjsGlobal=="object"&&Oe.commonjsGlobal&&Oe.commonjsGlobal.Object===Object&&Oe.commonjsGlobal,Wo=qo,Ho=Wo,Vo=typeof self=="object"&&self&&self.Object===Object&&self,Go=Ho||Vo||Function("return this")(),zs=Go,Zo=zs,Yo=function(){return Zo.Date.now()},Xo=Yo,$o=/\s/;function Ko(n){for(var e=n.length;e--&&$o.test(n.charAt(e)););return e}var Jo=Ko,Qo=Jo,eu=/^\s+/;function tu(n){return n&&n.slice(0,Qo(n)+1).replace(eu,"")}var iu=tu,ru=zs,nu=ru.Symbol,Ms=nu,Sn=Ms,Us=Object.prototype,su=Us.hasOwnProperty,au=Us.toString,mi=Sn?Sn.toStringTag:void 0;function ou(n){var e=su.call(n,mi),t=n[mi];try{n[mi]=void 0;var i=!0}catch{}var r=au.call(n);return i&&(e?n[mi]=t:delete n[mi]),r}var uu=ou,lu=Object.prototype,hu=lu.toString;function fu(n){return hu.call(n)}var cu=fu,Tn=Ms,du=uu,pu=cu,vu="[object Null]",gu="[object Undefined]",kn=Tn?Tn.toStringTag:void 0;function mu(n){return n==null?n===void 0?gu:vu:kn&&kn in Object(n)?du(n):pu(n)}var yu=mu;function bu(n){return n!=null&&typeof n=="object"}var wu=bu,_u=yu,Eu=wu,xu="[object Symbol]";function Du(n){return typeof n=="symbol"||Eu(n)&&_u(n)==xu}var Au=Du,Cu=iu,Nn=Kr,Su=Au,Rn=NaN,Tu=/^[-+]0x[0-9a-f]+$/i,ku=/^0b[01]+$/i,Nu=/^0o[0-7]+$/i,Ru=parseInt;function Iu(n){if(typeof n=="number")return n;if(Su(n))return Rn;if(Nn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Nn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Cu(n);var t=ku.test(n);return t||Nu.test(n)?Ru(n.slice(2),t?2:8):Tu.test(n)?Rn:+n}var Ou=Iu,Bu=Kr,Er=Xo,In=Ou,Lu="Expected a function",Fu=Math.max,Pu=Math.min;function zu(n,e,t){var i,r,s,a,o,u,h=0,f=!1,c=!1,b=!0;if(typeof n!="function")throw new TypeError(Lu);e=In(e)||0,Bu(t)&&(f=!!t.leading,c="maxWait"in t,s=c?Fu(In(t.maxWait)||0,e):s,b="trailing"in t?!!t.trailing:b);function g(A){var S=i,R=r;return i=r=void 0,h=A,a=n.apply(R,S),a}function C(A){return h=A,o=setTimeout(p,e),f?g(A):a}function k(A){var S=A-u,R=A-h,M=e-S;return c?Pu(M,s-R):M}function d(A){var S=A-u,R=A-h;return u===void 0||S>=e||S<0||c&&R>=s}function p(){var A=Er();if(d(A))return y(A);o=setTimeout(p,k(A))}function y(A){return o=void 0,b&&i?g(A):(i=r=void 0,a)}function D(){o!==void 0&&clearTimeout(o),h=0,i=u=r=o=void 0}function O(){return o===void 0?a:y(Er())}function _(){var A=Er(),S=d(A);if(i=arguments,r=this,u=A,S){if(o===void 0)return C(u);if(c)return clearTimeout(o),o=setTimeout(p,e),g(u)}return o===void 0&&(o=setTimeout(p,e)),a}return _.cancel=D,_.flush=O,_}var js=zu;const Mu=Oe.getDefaultExportFromCjs(js);var Uu=js,ju=Kr,qu="Expected a function";function Wu(n,e,t){var i=!0,r=!0;if(typeof n!="function")throw new TypeError(qu);return ju(t)&&(i="leading"in t?!!t.leading:i,r="trailing"in t?!!t.trailing:r),Uu(n,e,{leading:i,maxWait:e,trailing:r})}var Hu=Wu;const Vu=Oe.getDefaultExportFromCjs(Hu);class Gu{constructor(e){this.settings=e||{},this.id="epubjs-container-"+er(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let t=e.height,i=e.width,r=e.overflow||!1,s=e.axis||"vertical",a=e.direction;tt(this.settings,e),e.height&&Me(e.height)&&(t=e.height+"px"),e.width&&Me(e.width)&&(i=e.width+"px");let o=document.createElement("div");return o.id=this.id,o.classList.add("epub-container"),o.style.wordSpacing="0",o.style.lineHeight="0",o.style.verticalAlign="top",o.style.position="relative",s==="horizontal"&&(o.style.display="flex",o.style.flexDirection="row",o.style.flexWrap="nowrap"),i&&(o.style.width=i),t&&(o.style.height=t),r&&(r==="scroll"&&s==="vertical"?(o.style["overflow-y"]=r,o.style["overflow-x"]="hidden"):r==="scroll"&&s==="horizontal"?(o.style["overflow-y"]="hidden",o.style["overflow-x"]=r):o.style.overflow=r),a&&(o.dir=a,o.style.direction=a),a&&this.settings.fullsize&&(document.body.style.direction=a),o}wrap(e){var t=document.createElement("div");return t.style.visibility="hidden",t.style.overflow="hidden",t.style.width="0",t.style.height="0",t.appendChild(e),t}getElement(e){var t;if(vs(e)?t=e:typeof e=="string"&&(t=document.getElementById(e)),!t)throw new Error("Not an Element");return t}attachTo(e){var t=this.getElement(e),i;if(t)return this.settings.hidden?i=this.wrapper:i=this.container,t.appendChild(i),this.element=t,t}getContainer(){return this.container}onResize(e){(!Me(this.settings.width)||!Me(this.settings.height))&&(this.resizeFunc=Vu(e,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(e,t){var i;let r=e||this.settings.width,s=t||this.settings.height;e===null?(i=this.element.getBoundingClientRect(),i.width&&(e=Math.floor(i.width),this.container.style.width=e+"px")):Me(e)?this.container.style.width=e+"px":this.container.style.width=e,t===null?(i=i||this.element.getBoundingClientRect(),i.height&&(t=i.height,this.container.style.height=t+"px")):Me(t)?this.container.style.height=t+"px":this.container.style.height=t,Me(e)||(e=this.container.clientWidth),Me(t)||(t=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};let a=Vi(),o=window.getComputedStyle(document.body),u={left:parseFloat(o["padding-left"])||0,right:parseFloat(o["padding-right"])||0,top:parseFloat(o["padding-top"])||0,bottom:parseFloat(o["padding-bottom"])||0};return r||(e=a.width-u.left-u.right),(this.settings.fullsize&&!s||!s)&&(t=a.height-u.top-u.bottom),{width:e-this.containerPadding.left-this.containerPadding.right,height:t-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return this.container.style.overflow!=="visible"&&(e=this.container&&this.container.getBoundingClientRect()),!e||!e.width||!e.height?Vi():e}getSheet(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet}addStyleRules(e,t){var i="#"+this.id+" ",r="";this.sheet||(this.sheet=this.getSheet()),t.forEach(function(s){for(var a in s)s.hasOwnProperty(a)&&(r+=a+":"+s[a]+";")}),this.sheet.insertRule(i+e+" {"+r+"}",0)}axis(e){e==="horizontal"?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&(e==="scroll"&&this.settings.axis==="vertical"?(this.container.style["overflow-y"]=e,this.container.style["overflow-x"]="hidden"):e==="scroll"&&this.settings.axis==="horizontal"?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=e):this.container.style.overflow=e),this.settings.overflow=e}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))}}class Zu{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,t){return this._views.splice(t,0,e),this.container&&(t<this.container.children.length?this.container.insertBefore(e.element,this.container.children[t]):this.container.appendChild(e.element)),this.length++,e}remove(e){var t=this._views.indexOf(e);t>-1&&this._views.splice(t,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e,t=this.length;if(this.length){for(var i=0;i<t;i++)e=this._views[i],this.destroy(e);this._views=[],this.length=0}}find(e){for(var t,i=this.length,r=0;r<i;r++)if(t=this._views[r],t.displayed&&t.section.index==e.index)return t}displayed(){for(var e=[],t,i=this.length,r=0;r<i;r++)t=this._views[r],t.displayed&&e.push(t);return e}show(){for(var e,t=this.length,i=0;i<t;i++)e=this._views[i],e.displayed&&e.show();this.hidden=!1}hide(){for(var e,t=this.length,i=0;i<t;i++)e=this._views[i],e.displayed&&e.hide();this.hidden=!0}}class Ki{constructor(e){this.name="default",this.optsSettings=e.settings,this.View=e.view,this.request=e.request,this.renditionQueue=e.queue,this.q=new Yr(this),this.settings=tt(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",ignoreClass:"",fullsize:void 0,allowScriptedContent:!1,allowPopups:!1}),tt(this.settings,e.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.rendered=!1}render(e,t){let i=e.tagName;typeof this.settings.fullsize>"u"&&i&&(i.toLowerCase()=="body"||i.toLowerCase()=="html")&&(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow="visible",this.overflow=this.settings.overflow),this.settings.size=t,this.settings.rtlScrollType=Mo(),this.stage=new Gu({width:t.width,height:t.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(e),this.container=this.stage.getContainer(),this.views=new Zu(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.stage.onOrientationChange(this.onOrientationChange.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout(),this.rendered=!0}addEventListeners(){var e;window.addEventListener("unload",(function(t){this.destroy()}).bind(this)),this.settings.fullsize?e=window:e=this.container,this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll)}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}destroy(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1}onOrientationChange(e){let{orientation:t}=window;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout((function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit(Q.MANAGERS.ORIENTATION_CHANGE,t)}).bind(this),500)}onResized(e){this.resize()}resize(e,t,i){let r=this.stage.size(e,t);if(this.winBounds=Vi(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height){this._stageSize=void 0;return}this._stageSize&&this._stageSize.width===r.width&&this._stageSize.height===r.height||(this._stageSize=r,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit(Q.MANAGERS.RESIZED,{width:this._stageSize.width,height:this._stageSize.height},i))}createView(e,t){return new this.View(e,tt(this.viewSettings,{forceRight:t}))}handleNextPrePaginated(e,t,i){let r;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1){if(e||t.index===0)return;if(r=t.next(),r&&!r.properties.includes("page-spread-left"))return i.call(this,r)}}display(e,t){var i=new we,r=i.promise;(t===e.href||Me(t))&&(t=void 0);var s=this.views.find(e);if(s&&e&&this.layout.name!=="pre-paginated"){let o=s.offset();if(this.settings.direction==="ltr")this.scrollTo(o.left,o.top,!0);else{let u=s.width();this.scrollTo(o.left+u,o.top,!0)}if(t){let u=s.locationOf(t),h=s.width();this.moveTo(u,h)}return i.resolve(),r}this.clear();let a=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(a=!0),this.add(e,a).then((function(o){if(t){let u=o.locationOf(t),h=o.width();this.moveTo(u,h)}}).bind(this),o=>{i.reject(o)}).then((function(){return this.handleNextPrePaginated(a,e,this.add)}).bind(this)).then((function(){this.views.show(),i.resolve()}).bind(this)),r}afterDisplayed(e){this.emit(Q.MANAGERS.ADDED,e)}afterResized(e){this.emit(Q.MANAGERS.RESIZE,e.section)}moveTo(e,t){var i=0,r=0;this.isPaginated?(i=Math.floor(e.left/this.layout.delta)*this.layout.delta,i+this.layout.delta>this.container.scrollWidth&&(i=this.container.scrollWidth-this.layout.delta),r=Math.floor(e.top/this.layout.delta)*this.layout.delta,r+this.layout.delta>this.container.scrollHeight&&(r=this.container.scrollHeight-this.layout.delta)):r=e.top,this.settings.direction==="rtl"&&(i=i+this.layout.delta,i=i-t),this.scrollTo(i,r,!0)}add(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(Q.VIEWS.AXIS,r=>{this.updateAxis(r)}),i.on(Q.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),i.display(this.request)}append(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(Q.VIEWS.AXIS,r=>{this.updateAxis(r)}),i.on(Q.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),i.display(this.request)}prepend(e,t){var i=this.createView(e,t);return i.on(Q.VIEWS.RESIZED,r=>{this.counter(r)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(Q.VIEWS.AXIS,r=>{this.updateAxis(r)}),i.on(Q.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),i.display(this.request)}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e,t;let i=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!i||i==="ltr")?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,t<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):this.isPaginated&&this.settings.axis==="horizontal"&&i==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft,t>0?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):(t=this.container.scrollLeft+this.layout.delta*-1,t>this.container.scrollWidth*-1?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeight<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):e=this.views.last().section.next()):e=this.views.last().section.next(),e)){this.clear(),this.updateLayout();let r=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(r=!0),this.append(e,r).then((function(){return this.handleNextPrePaginated(r,e,this.append)}).bind(this),s=>s).then((function(){!this.isPaginated&&this.settings.axis==="horizontal"&&this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"&&this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}).bind(this))}}prev(){var e,t;let i=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!i||i==="ltr")?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft,t>0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):this.isPaginated&&this.settings.axis==="horizontal"&&i==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft+this.container.offsetWidth,t<this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):(t=this.container.scrollLeft,t<0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop>0?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()):e=this.views.first().section.prev(),e)){this.clear(),this.updateLayout();let r=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&typeof e.prev()!="object"&&(r=!0),this.prepend(e,r).then((function(){var s;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1&&(s=e.prev(),s))return this.prepend(s)}).bind(this),s=>s).then((function(){this.isPaginated&&this.settings.axis==="horizontal"&&(this.settings.direction==="rtl"?this.settings.rtlScrollType==="default"?this.scrollTo(0,0,!0):this.scrollTo(this.container.scrollWidth*-1+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}).bind(this))}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&this.settings.axis==="horizontal"?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=t.height<window.innerHeight?t.height:window.innerHeight,r=t.width<window.innerWidth?t.width:window.innerWidth,s=this.settings.axis==="vertical";this.settings.direction;let a=0,o=0;return this.settings.fullsize&&(a=s?window.scrollY:window.scrollX),e.map(h=>{let{index:f,href:c}=h.section,b=h.position(),g=h.width(),C=h.height(),k,d,p,y;s?(k=a+t.top-b.top+o,d=k+i-o,y=this.layout.count(C,i).pages,p=i):(k=a+t.left-b.left+o,d=k+r-o,y=this.layout.count(g,r).pages,p=r);let D=Math.ceil(k/p),O=[],_=Math.ceil(d/p);if(this.settings.direction==="rtl"&&!s){let R=D;D=y-_,_=y-R}O=[];for(var A=D;A<=_;A++){let R=A+1;O.push(R)}let S=this.mapping.page(h.contents,h.section.cfiBase,k,d);return{index:f,href:c,pages:O,totalPages:y,mapping:S}})}paginatedLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=0,r=0;return this.settings.fullsize&&(i=window.scrollX),e.map(a=>{let{index:o,href:u}=a.section,h,f=a.position(),c=a.width(),b,g,C;this.settings.direction==="rtl"?(h=t.right-i,C=Math.min(Math.abs(h-f.left),this.layout.width)-r,g=f.width-(f.right-h)-r,b=g-C):(h=t.left+i,C=Math.min(f.right-h,this.layout.width)-r,b=h-f.left+r,g=b+C),r+=C;let k=this.mapping.page(a.contents,a.section.cfiBase,b,g),d=this.layout.count(c).pages,p=Math.floor(b/this.layout.pageWidth),y=[],D=Math.floor(g/this.layout.pageWidth);if(p<0&&(p=0,D=D+1),this.settings.direction==="rtl"){let _=p;p=d-D,D=d-_}for(var O=p+1;O<=D;O++){let _=O;y.push(_)}return{index:o,href:u,pages:y,totalPages:d,mapping:k}})}isVisible(e,t,i,r){var s=e.position(),a=r||this.bounds();return this.settings.axis==="horizontal"&&s.right>a.left-t&&s.left<a.right+i?!0:this.settings.axis==="vertical"&&s.bottom>a.top-t&&s.top<a.bottom+i}visible(){for(var e=this.bounds(),t=this.views.displayed(),i=t.length,r=[],s,a,o=0;o<i;o++)a=t[o],s=this.isVisible(a,0,0,e),s===!0&&r.push(a);return r}scrollBy(e,t,i){let r=this.settings.direction==="rtl"?-1:1;i&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(e*r,t*r):(e&&(this.container.scrollLeft+=e*r),t&&(this.container.scrollTop+=t)),this.scrolled=!0}scrollTo(e,t,i){i&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(e,t):(this.container.scrollLeft=e,this.container.scrollTop=t),this.scrolled=!0}onScroll(){let e,t;this.settings.fullsize?(e=window.scrollY,t=window.scrollX):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:(this.emit(Q.MANAGERS.SCROLL,{top:e,left:t}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout((function(){this.emit(Q.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}).bind(this),20))}bounds(){var e;return e=this.stage.bounds(),e}applyLayout(e){this.layout=e,this.updateLayout(),this.views&&this.views.length>0&&this.layout.name==="pre-paginated"&&this.display(this.views.first().section)}updateLayout(){this.stage&&(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new Xi(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach(function(t){t&&t.setLayout(e)})}updateWritingMode(e){this.writingMode=e}updateAxis(e,t){!t&&e===this.settings.axis||(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&(this.mapping=new Xi(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&(e==="vertical"?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,t="auto"){let i=e==="paginated"||e==="auto";this.isPaginated=i,e==="scrolled-doc"||e==="scrolled-continuous"||e==="scrolled"?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=e,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=i?"hidden":t,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views&&this.views.forEach(function(t){const i=t&&t.contents;i&&e.push(i)}),e}direction(e="ltr"){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}}Rt(Ki.prototype);const Yu={easeInCubic:function(n){return Math.pow(n,3)}};class Ir{constructor(e,t){this.settings=tt({duration:80,minVelocity:.2,minDistance:10,easing:Yu.easeInCubic},t||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=this.settings.duration*2,this.isVertical=this.manager.settings.axis==="vertical",!(!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(Q.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(Q.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let t=e.contents;["touchstart","touchmove","touchend"].forEach(i=>{t.on(i,r=>this.triggerViewEvent(r,t))})}triggerViewEvent(e,t){this.emit(e.type,e,t)}onScroll(e){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(e){this.resizeCanceler=!0}onTouchStart(e){let{screenX:t,screenY:i}=e.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=t,this.startTouchY=i,this.startTime=this.now()),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchMove(e){let{screenX:t,screenY:i}=e.touches[0],r=Math.abs(i-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&r<10&&(this.element.scrollLeft-=t-this.endTouchX),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchEnd(e){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let t=this.wasSwiped();t!==0?this.snap(t):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 e=this.layout.pageWidth*this.layout.divisor,t=this.endTouchX-this.startTouchX,i=Math.abs(t),r=this.endTime-this.startTime,s=t/r,a=this.settings.minVelocity;if(i<=this.settings.minDistance||i>=e)return 0;if(s>a)return-1;if(s<-a)return 1}needsSnap(){let e=this.scrollLeft,t=this.layout.pageWidth*this.layout.divisor;return e%t!==0}snap(e=0){let t=this.scrollLeft,i=this.layout.pageWidth*this.layout.divisor,r=Math.round(t/i)*i;return e&&(r+=e*i),this.smoothScrollTo(r)}smoothScrollTo(e){const t=new we,i=this.scrollLeft,r=this.now(),s=this.settings.duration,a=this.settings.easing;this.snapping=!0;function o(){const u=this.now(),h=Math.min(1,(u-r)/s);if(a(h),this.touchCanceler||this.resizeCanceler){this.resizeCanceler=!1,this.snapping=!1,t.resolve();return}h<1?(window.requestAnimationFrame(o.bind(this)),this.scrollTo(i+(e-i)*h,0)):(this.scrollTo(e,0),this.snapping=!1,t.resolve())}return o.call(this),t.promise}scrollTo(e=0,t=0){this.fullsize?window.scroll(e,t):(this.scroller.scrollLeft=e,this.scroller.scrollTop=t)}now(){return"now"in window.performance?performance.now():new Date().getTime()}destroy(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}}Rt(Ir.prototype);class Xu extends Ki{constructor(e){super(e),this.name="continuous",this.settings=tt(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,allowPopups:!1}),tt(this.settings,e.settings||{}),e.settings.gap!="undefined"&&e.settings.gap===0&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.scrollTop=0,this.scrollLeft=0}display(e,t){return Ki.prototype.display.call(this,e,t).then((function(){return this.fill()}).bind(this))}fill(e){var t=e||new we;return this.q.enqueue(()=>this.check()).then(i=>{i?this.fill(t):t.resolve()}),t.promise}moveTo(e){var t=0,i=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,t+this.settings.offsetDelta):(i=e.top,e.top+this.settings.offsetDelta),(t>0||i>0)&&this.scrollBy(t,i,!0)}afterResized(e){this.emit(Q.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var t=this.createView(e);return this.views.append(t),t.on(Q.VIEWS.RESIZED,i=>{t.expanded=!0}),t.on(Q.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(Q.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.display(this.request)}append(e){var t=this.createView(e);return t.on(Q.VIEWS.RESIZED,i=>{t.expanded=!0}),t.on(Q.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(Q.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t}prepend(e){var t=this.createView(e);return t.on(Q.VIEWS.RESIZED,i=>{this.counter(i),t.expanded=!0}),t.on(Q.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(Q.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var t=this.bounds(),i=this.views.all(),r=i.length,s=typeof e<"u"?e:this.settings.offset||0,a,o,u=new we,h=[],f=0;f<r;f++)if(o=i[f],a=this.isVisible(o,s,s,t),a===!0)if(o.displayed)o.show();else{let c=o.display(this.request).then(function(b){b.show()},b=>{o.hide()});h.push(c)}else this.q.enqueue(o.destroy.bind(o)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout((function(){this.q.enqueue(this.trim.bind(this))}).bind(this),250);return h.length?Promise.all(h).catch(c=>{u.reject(c)}):(u.resolve(),u.promise)}check(e,t){var i=new we,r=[],s=this.settings.axis==="horizontal",a=this.settings.offset||0;e&&s&&(a=e),t&&!s&&(a=t);var o=this._bounds;let u=s?this.scrollLeft:this.scrollTop,h=s?Math.floor(o.width):o.height,f=s?this.container.scrollWidth:this.container.scrollHeight,c=this.writingMode&&this.writingMode.indexOf("vertical")===0?"vertical":"horizontal",b=this.settings.rtlScrollType,g=this.settings.direction==="rtl";this.settings.fullsize?(s&&g&&b==="negative"||!s&&g&&b==="default")&&(u=u*-1):(g&&b==="default"&&c==="horizontal"&&(u=f-h-u),g&&b==="negative"&&c==="horizontal"&&(u=u*-1));let C=()=>{let D=this.views.first(),O=D&&D.section.prev();O&&r.push(this.prepend(O))},k=()=>{let D=this.views.last(),O=D&&D.section.next();O&&r.push(this.append(O))},d=u+h+a,p=u-a;d>=f&&k(),p<0&&C();let y=r.map(D=>D.display(this.request));return r.length?Promise.all(y).then(()=>this.check()).then(()=>this.update(a),D=>D):(this.q.enqueue((function(){this.update()}).bind(this)),i.resolve(!1),i.promise)}trim(){for(var e=new we,t=this.views.displayed(),i=t[0],r=t[t.length-1],s=this.views.indexOf(i),a=this.views.indexOf(r),o=this.views.slice(0,s),u=this.views.slice(a+1),h=0;h<o.length-1;h++)this.erase(o[h],o);for(var f=1;f<u.length;f++)this.erase(u[f]);return e.resolve(),e.promise}erase(e,t){var i,r;this.settings.fullsize?(i=window.scrollY,r=window.scrollX):(i=this.container.scrollTop,r=this.container.scrollLeft);var s=e.bounds();this.views.remove(e),t&&(this.settings.axis==="vertical"?this.scrollTo(0,i-s.height,!0):this.settings.direction==="rtl"?this.settings.fullsize?this.scrollTo(r+Math.floor(s.width),0,!0):this.scrollTo(r,0,!0):this.scrollTo(r-Math.floor(s.width),0,!0))}addEventListeners(e){window.addEventListener("unload",(function(t){this.ignore=!0,this.destroy()}).bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new Ir(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}addScrollListeners(){var e;this.tick=Vr;let t=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(e=window,this.scrollTop=window.scrollY*t,this.scrollLeft=window.scrollX*t):(e=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll),this._scrolled=Mu(this.scrolled.bind(this),30),this.didScroll=!1}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}onScroll(){let e,t,i=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.settings.fullsize?(e=window.scrollY*i,t=window.scrollX*i):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(e-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(t-this.prevScrollLeft),this.prevScrollTop=e,this.prevScrollLeft=t,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}).bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1}scrolled(){this.q.enqueue((function(){return this.check()}).bind(this)),this.emit(Q.MANAGERS.SCROLL,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout((function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit(Q.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}).bind(this),this.settings.afterScrolledTimeout)}next(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(e,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue((function(){return this.check()}).bind(this)))}prev(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(-e,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue((function(){return this.check()}).bind(this)))}updateFlow(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),super.updateFlow(e,"scroll"),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new Ir(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}destroy(){super.destroy(),this.snapper&&this.snapper.destroy()}}class ar{constructor(e,t){this.settings=tt(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,allowPopups:!1}),tt(this.settings,t),typeof this.settings.manager=="object"&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new At(this),this.hooks.serialize=new At(this),this.hooks.content=new At(this),this.hooks.unloaded=new At(this),this.hooks.layout=new At(this),this.hooks.render=new At(this),this.hooks.show=new At(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 Ao(this),this.annotations=new To(this),this.epubcfi=new ye,this.q=new Yr(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new we,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){var t;return typeof e=="string"&&e==="default"?t=Ki:typeof e=="string"&&e==="continuous"?t=Xu:t=e,t}requireView(e){var t;return typeof e=="string"&&e==="iframe"?t=Ps:t=e,t}start(){switch(!this.settings.layout&&(this.book.package.metadata.layout==="pre-paginated"||this.book.displayOptions.fixedLayout==="true")&&(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(Q.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(Q.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(Q.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(Q.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(Q.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(Q.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue((function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit(Q.RENDITION.ATTACHED)}).bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(this.book){this.epubcfi.isCfiString(e);var t=new we,i=t.promise,r;return this.displaying=t,this.book.locations.length()&&gs(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),r=this.book.spine.get(e),r?(this.manager.display(r,e).then(()=>{t.resolve(r),this.displaying=void 0,this.emit(Q.RENDITION.DISPLAYED,r),this.reportLocation()},s=>{this.emit(Q.RENDITION.DISPLAY_ERROR,s)}),i):(t.reject(new Error("No Section Found")),i)}}afterDisplayed(e){e.on(Q.VIEWS.MARK_CLICKED,(t,i)=>this.triggerMarkEvent(t,i,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit(Q.RENDITION.RENDERED,e.section,e)}):this.emit(Q.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit(Q.RENDITION.REMOVED,e.section,e)})}onResized(e,t){this.emit(Q.RENDITION.RESIZED,{width:e.width,height:e.height},t),this.location&&this.location.start&&this.display(t||this.location.start.cfi)}onOrientationChange(e){this.emit(Q.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,t,i){e&&(this.settings.width=e),t&&(this.settings.height=t),this.manager.resize(e,t,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(e){var t,i=this.settings.layout||e.layout||"reflowable",r=this.settings.spread||e.spread||"auto",s=this.settings.orientation||e.orientation||"auto",a=this.settings.flow||e.flow||"auto",o=e.viewport||"",u=this.settings.minSpreadWidth||e.minSpreadWidth||800,h=this.settings.direction||e.direction||"ltr";return(this.settings.width===0||this.settings.width>0)&&(this.settings.height===0||this.settings.height>0),t={layout:i,spread:r,orientation:s,flow:a,viewport:o,minSpreadWidth:u,direction:h},t}flow(e){var t=e;(e==="scrolled"||e==="scrolled-doc"||e==="scrolled-continuous")&&(t="scrolled"),(e==="auto"||e==="paginated")&&(t="paginated"),this.settings.flow=e,this._layout&&this._layout.flow(t),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(t),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new Xr(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on(Q.LAYOUT.UPDATED,(t,i)=>{this.emit(Q.RENDITION.LAYOUT,t,i)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,t){this.settings.spread=e,t&&(this.settings.minSpreadWidth=t),this._layout&&this._layout.spread(e,t),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue((function(){requestAnimationFrame((function(){var i=this.manager.currentLocation();if(i&&i.then&&typeof i.then=="function")i.then((function(r){let s=this.located(r);!s||!s.start||!s.end||(this.location=s,this.emit(Q.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(Q.RENDITION.RELOCATED,this.location))}).bind(this));else if(i){let r=this.located(i);if(!r||!r.start||!r.end)return;this.location=r,this.emit(Q.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(Q.RENDITION.RELOCATED,this.location)}}).bind(this))}).bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&typeof e.then=="function")e.then((function(t){return this.located(t)}).bind(this));else if(e)return this.located(e)}located(e){if(!e.length)return{};let t=e[0],i=e[e.length-1],r={start:{index:t.index,href:t.href,cfi:t.mapping.start,displayed:{page:t.pages[0]||1,total:t.totalPages}},end:{index:i.index,href:i.href,cfi:i.mapping.end,displayed:{page:i.pages[i.pages.length-1]||1,total:i.totalPages}}},s=this.book.locations.locationFromCfi(t.mapping.start),a=this.book.locations.locationFromCfi(i.mapping.end);s!=null&&(r.start.location=s,r.start.percentage=this.book.locations.percentageFromLocation(s)),a!=null&&(r.end.location=a,r.end.percentage=this.book.locations.percentageFromLocation(a));let o=this.book.pageList.pageFromCfi(t.mapping.start),u=this.book.pageList.pageFromCfi(i.mapping.end);return o!=-1&&(r.start.page=o),u!=-1&&(r.end.page=u),i.index===this.book.spine.last().index&&r.end.displayed.page>=r.end.displayed.total&&(r.atEnd=!0),t.index===this.book.spine.first().index&&r.start.displayed.page===1&&(r.atStart=!0),r}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(e){zi.forEach(t=>{e.on(t,i=>this.triggerViewEvent(i,e))}),e.on(Q.CONTENTS.SELECTED,t=>this.triggerSelectedEvent(t,e))}triggerViewEvent(e,t){this.emit(e.type,e,t)}triggerSelectedEvent(e,t){this.emit(Q.RENDITION.SELECTED,e,t)}triggerMarkEvent(e,t,i){this.emit(Q.RENDITION.MARK_CLICKED,e,t,i)}getRange(e,t){var i=new ye(e),r=this.manager.visible().filter(function(s){if(i.spinePos===s.index)return!0});if(r.length)return r[0].contents.range(i,t)}adjustImages(e){if(this._layout.name==="pre-paginated")return new Promise(function(s){s()});let t=e.window.getComputedStyle(e.content,null),i=(e.content.offsetHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)))*.95,r=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+"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-r+"px":"100%")+"!important","max-height":i+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise(function(s,a){setTimeout(function(){s()},1)})}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(e){e&&e.on(Q.CONTENTS.LINK_CLICKED,t=>{let i=this.book.path.relative(t);this.display(i)})}injectStylesheet(e,t){let i=e.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",this.settings.stylesheet),e.getElementsByTagName("head")[0].appendChild(i)}injectScript(e,t){let i=e.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",this.settings.script),i.textContent=" ",e.getElementsByTagName("head")[0].appendChild(i)}injectIdentifier(e,t){let i=this.book.packaging.metadata.identifier,r=e.createElement("meta");r.setAttribute("name","dc.relation.ispartof"),i&&r.setAttribute("content",i),e.getElementsByTagName("head")[0].appendChild(r)}}Rt(ar.prototype);var qs={exports:{}};/*!
6
+
7
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
8
+ <http://stuartk.com/jszip>
9
+
10
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
11
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
12
+
13
+ JSZip uses the library pako released under the MIT license :
14
+ https://github.com/nodeca/pako/blob/main/LICENSE
15
+ */(function(n,e){(function(t){n.exports=t()})(function(){return function t(i,r,s){function a(h,f){if(!r[h]){if(!i[h]){var c=typeof Oe.commonjsRequire=="function"&&Oe.commonjsRequire;if(!f&&c)return c(h,!0);if(o)return o(h,!0);var b=new Error("Cannot find module '"+h+"'");throw b.code="MODULE_NOT_FOUND",b}var g=r[h]={exports:{}};i[h][0].call(g.exports,function(C){var k=i[h][1][C];return a(k||C)},g,g.exports,t,i,r,s)}return r[h].exports}for(var o=typeof Oe.commonjsRequire=="function"&&Oe.commonjsRequire,u=0;u<s.length;u++)a(s[u]);return a}({1:[function(t,i,r){var s=t("./utils"),a=t("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(u){for(var h=[],f,c,b,g,C,k,d,p=0,y=u.length,D=y,O=s.getTypeOf(u)!=="string";p<u.length;)D=y-p,O?(f=u[p++],c=p<y?u[p++]:0,b=p<y?u[p++]:0):(f=u.charCodeAt(p++),c=p<y?u.charCodeAt(p++):0,b=p<y?u.charCodeAt(p++):0),g=f>>2,C=(f&3)<<4|c>>4,k=D>1?(c&15)<<2|b>>6:64,d=D>2?b&63:64,h.push(o.charAt(g)+o.charAt(C)+o.charAt(k)+o.charAt(d));return h.join("")},r.decode=function(u){var h,f,c,b,g,C,k,d=0,p=0,y="data:";if(u.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");u=u.replace(/[^A-Za-z0-9+/=]/g,"");var D=u.length*3/4;if(u.charAt(u.length-1)===o.charAt(64)&&D--,u.charAt(u.length-2)===o.charAt(64)&&D--,D%1!==0)throw new Error("Invalid base64 input, bad content length.");var O;for(a.uint8array?O=new Uint8Array(D|0):O=new Array(D|0);d<u.length;)b=o.indexOf(u.charAt(d++)),g=o.indexOf(u.charAt(d++)),C=o.indexOf(u.charAt(d++)),k=o.indexOf(u.charAt(d++)),h=b<<2|g>>4,f=(g&15)<<4|C>>2,c=(C&3)<<6|k,O[p++]=h,C!==64&&(O[p++]=f),k!==64&&(O[p++]=c);return O}},{"./support":30,"./utils":32}],2:[function(t,i,r){var s=t("./external"),a=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),u=t("./stream/DataLengthProbe");function h(f,c,b,g,C){this.compressedSize=f,this.uncompressedSize=c,this.crc32=b,this.compression=g,this.compressedContent=C}h.prototype={getContentWorker:function(){var f=new a(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),c=this;return f.on("end",function(){if(this.streamInfo.data_length!==c.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new a(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(f,c,b){return f.pipe(new o).pipe(new u("uncompressedSize")).pipe(c.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",c)},i.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,i,r){var s=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,i,r){var s=t("./utils");function a(){for(var f,c=[],b=0;b<256;b++){f=b;for(var g=0;g<8;g++)f=f&1?3988292384^f>>>1:f>>>1;c[b]=f}return c}var o=a();function u(f,c,b,g){var C=o,k=g+b;f=f^-1;for(var d=g;d<k;d++)f=f>>>8^C[(f^c[d])&255];return f^-1}function h(f,c,b,g){var C=o,k=g+b;f=f^-1;for(var d=g;d<k;d++)f=f>>>8^C[(f^c.charCodeAt(d))&255];return f^-1}i.exports=function(c,b){if(typeof c>"u"||!c.length)return 0;var g=s.getTypeOf(c)!=="string";return g?u(b|0,c,c.length,0):h(b|0,c,c.length,0)}},{"./utils":32}],5:[function(t,i,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,i,r){var s=null;typeof Promise<"u"?s=Promise:s=t("lie"),i.exports={Promise:s}},{lie:37}],7:[function(t,i,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=t("pako"),o=t("./utils"),u=t("./stream/GenericWorker"),h=s?"uint8array":"array";r.magic="\b\0";function f(c,b){u.call(this,"FlateWorker/"+c),this._pako=null,this._pakoAction=c,this._pakoOptions=b,this.meta={}}o.inherits(f,u),f.prototype.processChunk=function(c){this.meta=c.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(h,c.data),!1)},f.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var c=this;this._pako.onData=function(b){c.push({data:b,meta:c.meta})}},r.compressWorker=function(c){return new f("Deflate",c)},r.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,i,r){var s=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),u=t("../crc32"),h=t("../signature"),f=function(p,y){var D="",O;for(O=0;O<y;O++)D+=String.fromCharCode(p&255),p=p>>>8;return D},c=function(p,y){var D=p;return p||(D=y?16893:33204),(D&65535)<<16},b=function(p){return(p||0)&63},g=function(p,y,D,O,_,A){var S=p.file,R=p.compression,M=A!==o.utf8encode,P=s.transformTo("string",A(S.name)),H=s.transformTo("string",o.utf8encode(S.name)),V=S.comment,te=s.transformTo("string",A(V)),ce=s.transformTo("string",o.utf8encode(V)),he=H.length!==S.name.length,ue=ce.length!==V.length,se,ne,me="",Re="",De="",le=S.dir,Se=S.date,_e={crc32:0,compressedSize:0,uncompressedSize:0};(!y||D)&&(_e.crc32=p.crc32,_e.compressedSize=p.compressedSize,_e.uncompressedSize=p.uncompressedSize);var $e=0;y&&($e|=8),!M&&(he||ue)&&($e|=2048);var He=0,Fe=0;le&&(He|=16),_==="UNIX"?(Fe=798,He|=c(S.unixPermissions,le)):(Fe=20,He|=b(S.dosPermissions)),se=Se.getUTCHours(),se=se<<6,se=se|Se.getUTCMinutes(),se=se<<5,se=se|Se.getUTCSeconds()/2,ne=Se.getUTCFullYear()-1980,ne=ne<<4,ne=ne|Se.getUTCMonth()+1,ne=ne<<5,ne=ne|Se.getUTCDate(),he&&(Re=f(1,1)+f(u(P),4)+H,me+="up"+f(Re.length,2)+Re),ue&&(De=f(1,1)+f(u(te),4)+ce,me+="uc"+f(De.length,2)+De);var ve="";ve+=`
16
+ \0`,ve+=f($e,2),ve+=R.magic,ve+=f(se,2),ve+=f(ne,2),ve+=f(_e.crc32,4),ve+=f(_e.compressedSize,4),ve+=f(_e.uncompressedSize,4),ve+=f(P.length,2),ve+=f(me.length,2);var Ge=h.LOCAL_FILE_HEADER+ve+P+me,Pe=h.CENTRAL_FILE_HEADER+f(Fe,2)+ve+f(te.length,2)+"\0\0\0\0"+f(He,4)+f(O,4)+P+me+te;return{fileRecord:Ge,dirRecord:Pe}},C=function(p,y,D,O,_){var A="",S=s.transformTo("string",_(O));return A=h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+f(p,2)+f(p,2)+f(y,4)+f(D,4)+f(S.length,2)+S,A},k=function(p){var y="";return y=h.DATA_DESCRIPTOR+f(p.crc32,4)+f(p.compressedSize,4)+f(p.uncompressedSize,4),y};function d(p,y,D,O){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=D,this.encodeFileName=O,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(d,a),d.prototype.push=function(p){var y=p.meta.percent||0,D=this.entriesCount,O=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,a.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:D?(y+100*(D-O-1))/D:100}}))},d.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var y=this.streamFiles&&!p.file.dir;if(y){var D=g(p,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:D.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(p){this.accumulate=!1;var y=this.streamFiles&&!p.file.dir,D=g(p,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(D.dirRecord),y)this.push({data:k(p),meta:{percent:100}});else for(this.push({data:D.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var p=this.bytesWritten,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var D=this.bytesWritten-p,O=C(this.dirRecords.length,D,p,this.zipComment,this.encodeFileName);this.push({data:O,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(p){this._sources.push(p);var y=this;return p.on("data",function(D){y.processChunk(D)}),p.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),p.on("error",function(D){y.error(D)}),this},d.prototype.resume=function(){if(!a.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},d.prototype.error=function(p){var y=this._sources;if(!a.prototype.error.call(this,p))return!1;for(var D=0;D<y.length;D++)try{y[D].error(p)}catch{}return!0},d.prototype.lock=function(){a.prototype.lock.call(this);for(var p=this._sources,y=0;y<p.length;y++)p[y].lock()},i.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,i,r){var s=t("../compressions"),a=t("./ZipFileWorker"),o=function(u,h){var f=u||h,c=s[f];if(!c)throw new Error(f+" is not a valid compression method !");return c};r.generateWorker=function(u,h,f){var c=new a(h.streamFiles,f,h.platform,h.encodeFileName),b=0;try{u.forEach(function(g,C){b++;var k=o(C.options.compression,h.compression),d=C.options.compressionOptions||h.compressionOptions||{},p=C.dir,y=C.date;C._compressWorker(k,d).withStreamInfo("file",{name:g,dir:p,date:y,comment:C.comment||"",unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions}).pipe(c)}),c.entriesCount=b}catch(g){c.error(g)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,i,r){function s(){if(!(this instanceof s))return new s;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var a=new s;for(var o in this)typeof this[o]!="function"&&(a[o]=this[o]);return a}}s.prototype=t("./object"),s.prototype.loadAsync=t("./load"),s.support=t("./support"),s.defaults=t("./defaults"),s.version="3.10.1",s.loadAsync=function(a,o){return new s().loadAsync(a,o)},s.external=t("./external"),i.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,i,r){var s=t("./utils"),a=t("./external"),o=t("./utf8"),u=t("./zipEntries"),h=t("./stream/Crc32Probe"),f=t("./nodejsUtils");function c(b){return new a.Promise(function(g,C){var k=b.decompressed.getContentWorker().pipe(new h);k.on("error",function(d){C(d)}).on("end",function(){k.streamInfo.crc32!==b.decompressed.crc32?C(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}i.exports=function(b,g){var C=this;return g=s.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),f.isNode&&f.isStream(b)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",b,!0,g.optimizedBinaryString,g.base64).then(function(k){var d=new u(g);return d.load(k),d}).then(function(d){var p=[a.Promise.resolve(d)],y=d.files;if(g.checkCRC32)for(var D=0;D<y.length;D++)p.push(c(y[D]));return a.Promise.all(p)}).then(function(d){for(var p=d.shift(),y=p.files,D=0;D<y.length;D++){var O=y[D],_=O.fileNameStr,A=s.resolve(O.fileNameStr);C.file(A,O.decompressed,{binary:!0,optimizedBinaryString:!0,date:O.date,dir:O.dir,comment:O.fileCommentStr.length?O.fileCommentStr:null,unixPermissions:O.unixPermissions,dosPermissions:O.dosPermissions,createFolders:g.createFolders}),O.dir||(C.file(A).unsafeOriginalName=_)}return p.zipComment.length&&(C.comment=p.zipComment),C})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,i,r){var s=t("../utils"),a=t("../stream/GenericWorker");function o(u,h){a.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(h)}s.inherits(o,a),o.prototype._bindStream=function(u){var h=this;this._stream=u,u.pause(),u.on("data",function(f){h.push({data:f,meta:{percent:0}})}).on("error",function(f){h.isPaused?this.generatedError=f:h.error(f)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},o.prototype.pause=function(){return a.prototype.pause.call(this)?(this._stream.pause(),!0):!1},o.prototype.resume=function(){return a.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},i.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,i,r){var s=t("readable-stream").Readable,a=t("../utils");a.inherits(o,s);function o(u,h,f){s.call(this,h),this._helper=u;var c=this;u.on("data",function(b,g){c.push(b)||c._helper.pause(),f&&f(g)}).on("error",function(b){c.emit("error",b)}).on("end",function(){c.push(null)})}o.prototype._read=function(){this._helper.resume()},i.exports=o},{"../utils":32,"readable-stream":16}],14:[function(t,i,r){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,a);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,a)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var a=new Buffer(s);return a.fill(0),a},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(t,i,r){var s=t("./utf8"),a=t("./utils"),o=t("./stream/GenericWorker"),u=t("./stream/StreamHelper"),h=t("./defaults"),f=t("./compressedObject"),c=t("./zipObject"),b=t("./generate"),g=t("./nodejsUtils"),C=t("./nodejs/NodejsStreamInputAdapter"),k=function(_,A,S){var R=a.getTypeOf(A),M,P=a.extend(S||{},h);P.date=P.date||new Date,P.compression!==null&&(P.compression=P.compression.toUpperCase()),typeof P.unixPermissions=="string"&&(P.unixPermissions=parseInt(P.unixPermissions,8)),P.unixPermissions&&P.unixPermissions&16384&&(P.dir=!0),P.dosPermissions&&P.dosPermissions&16&&(P.dir=!0),P.dir&&(_=p(_)),P.createFolders&&(M=d(_))&&y.call(this,M,!0);var H=R==="string"&&P.binary===!1&&P.base64===!1;(!S||typeof S.binary>"u")&&(P.binary=!H);var V=A instanceof f&&A.uncompressedSize===0;(V||P.dir||!A||A.length===0)&&(P.base64=!1,P.binary=!0,A="",P.compression="STORE",R="string");var te=null;A instanceof f||A instanceof o?te=A:g.isNode&&g.isStream(A)?te=new C(_,A):te=a.prepareContent(_,A,P.binary,P.optimizedBinaryString,P.base64);var ce=new c(_,te,P);this.files[_]=ce},d=function(_){_.slice(-1)==="/"&&(_=_.substring(0,_.length-1));var A=_.lastIndexOf("/");return A>0?_.substring(0,A):""},p=function(_){return _.slice(-1)!=="/"&&(_+="/"),_},y=function(_,A){return A=typeof A<"u"?A:h.createFolders,_=p(_),this.files[_]||k.call(this,_,null,{dir:!0,createFolders:A}),this.files[_]};function D(_){return Object.prototype.toString.call(_)==="[object RegExp]"}var O={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(_){var A,S,R;for(A in this.files)R=this.files[A],S=A.slice(this.root.length,A.length),S&&A.slice(0,this.root.length)===this.root&&_(S,R)},filter:function(_){var A=[];return this.forEach(function(S,R){_(S,R)&&A.push(R)}),A},file:function(_,A,S){if(arguments.length===1)if(D(_)){var R=_;return this.filter(function(P,H){return!H.dir&&R.test(P)})}else{var M=this.files[this.root+_];return M&&!M.dir?M:null}else _=this.root+_,k.call(this,_,A,S);return this},folder:function(_){if(!_)return this;if(D(_))return this.filter(function(M,P){return P.dir&&_.test(M)});var A=this.root+_,S=y.call(this,A),R=this.clone();return R.root=S.name,R},remove:function(_){_=this.root+_;var A=this.files[_];if(A||(_.slice(-1)!=="/"&&(_+="/"),A=this.files[_]),A&&!A.dir)delete this.files[_];else for(var S=this.filter(function(M,P){return P.name.slice(0,_.length)===_}),R=0;R<S.length;R++)delete this.files[S[R].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(_){var A,S={};try{if(S=a.extend(_||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode}),S.type=S.type.toLowerCase(),S.compression=S.compression.toUpperCase(),S.type==="binarystring"&&(S.type="string"),!S.type)throw new Error("No output type specified.");a.checkSupport(S.type),(S.platform==="darwin"||S.platform==="freebsd"||S.platform==="linux"||S.platform==="sunos")&&(S.platform="UNIX"),S.platform==="win32"&&(S.platform="DOS");var R=S.comment||this.comment||"";A=b.generateWorker(this,S,R)}catch(M){A=new o("error"),A.error(M)}return new u(A,S.type||"string",S.mimeType)},generateAsync:function(_,A){return this.generateInternalStream(_).accumulate(A)},generateNodeStream:function(_,A){return _=_||{},_.type||(_.type="nodebuffer"),this.generateInternalStream(_).toNodejsStream(A)}};i.exports=O},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,i,r){i.exports=t("stream")},{stream:void 0}],17:[function(t,i,r){var s=t("./DataReader"),a=t("../utils");function o(u){s.call(this,u);for(var h=0;h<this.data.length;h++)u[h]=u[h]&255}a.inherits(o,s),o.prototype.byteAt=function(u){return this.data[this.zero+u]},o.prototype.lastIndexOfSignature=function(u){for(var h=u.charCodeAt(0),f=u.charCodeAt(1),c=u.charCodeAt(2),b=u.charCodeAt(3),g=this.length-4;g>=0;--g)if(this.data[g]===h&&this.data[g+1]===f&&this.data[g+2]===c&&this.data[g+3]===b)return g-this.zero;return-1},o.prototype.readAndCheckSignature=function(u){var h=u.charCodeAt(0),f=u.charCodeAt(1),c=u.charCodeAt(2),b=u.charCodeAt(3),g=this.readData(4);return h===g[0]&&f===g[1]&&c===g[2]&&b===g[3]},o.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var h=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=o},{"../utils":32,"./DataReader":18}],18:[function(t,i,r){var s=t("../utils");function a(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var u=0,h;for(this.checkOffset(o),h=this.index+o-1;h>=this.index;h--)u=(u<<8)+this.byteAt(h);return this.index+=o,u},readString:function(o){return s.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC((o>>25&127)+1980,(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(o&31)<<1))}},i.exports=a},{"../utils":32}],19:[function(t,i,r){var s=t("./Uint8ArrayReader"),a=t("../utils");function o(u){s.call(this,u)}a.inherits(o,s),o.prototype.readData=function(u){this.checkOffset(u);var h=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,i,r){var s=t("./DataReader"),a=t("../utils");function o(u){s.call(this,u)}a.inherits(o,s),o.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},o.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},o.prototype.readAndCheckSignature=function(u){var h=this.readData(4);return u===h},o.prototype.readData=function(u){this.checkOffset(u);var h=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,i,r){var s=t("./ArrayReader"),a=t("../utils");function o(u){s.call(this,u)}a.inherits(o,s),o.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var h=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,i,r){var s=t("../utils"),a=t("../support"),o=t("./ArrayReader"),u=t("./StringReader"),h=t("./NodeBufferReader"),f=t("./Uint8ArrayReader");i.exports=function(c){var b=s.getTypeOf(c);return s.checkSupport(b),b==="string"&&!a.uint8array?new u(c):b==="nodebuffer"?new h(c):a.uint8array?new f(s.transformTo("uint8array",c)):new o(s.transformTo("array",c))}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,i,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,i,r){var s=t("./GenericWorker"),a=t("../utils");function o(u){s.call(this,"ConvertWorker to "+u),this.destType=u}a.inherits(o,s),o.prototype.processChunk=function(u){this.push({data:a.transformTo(this.destType,u.data),meta:u.meta})},i.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,i,r){var s=t("./GenericWorker"),a=t("../crc32"),o=t("../utils");function u(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o.inherits(u,s),u.prototype.processChunk=function(h){this.streamInfo.crc32=a(h.data,this.streamInfo.crc32||0),this.push(h)},i.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,i,r){var s=t("../utils"),a=t("./GenericWorker");function o(u){a.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}s.inherits(o,a),o.prototype.processChunk=function(u){if(u){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+u.data.length}a.prototype.processChunk.call(this,u)},i.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,i,r){var s=t("../utils"),a=t("./GenericWorker"),o=16*1024;function u(h){a.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,h.then(function(c){f.dataIsReady=!0,f.data=c,f.max=c&&c.length||0,f.type=s.getTypeOf(c),f.isPaused||f._tickAndRepeat()},function(c){f.error(c)})}s.inherits(u,a),u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return a.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0):!1},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var h=o,f=null,c=Math.min(this.max,this.index+h);if(this.index>=this.max)return this.end();switch(this.type){case"string":f=this.data.substring(this.index,c);break;case"uint8array":f=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":f=this.data.slice(this.index,c);break}return this.index=c,this.push({data:f,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(t,i,r){function s(a){this.name=a||"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}s.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return this.isFinished?!1:(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,o){return this._listeners[a].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,o){if(this._listeners[a])for(var u=0;u<this._listeners[a].length;u++)this._listeners[a][u].call(this,o)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var o=this;return a.on("data",function(u){o.processChunk(u)}),a.on("end",function(){o.end()}),a.on("error",function(u){o.error(u)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var a=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,o){return this.extraStreamInfo[a]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},i.exports=s},{}],29:[function(t,i,r){var s=t("../utils"),a=t("./ConvertWorker"),o=t("./GenericWorker"),u=t("../base64"),h=t("../support"),f=t("../external"),c=null;if(h.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(d,p,y){switch(d){case"blob":return s.newBlob(s.transformTo("arraybuffer",p),y);case"base64":return u.encode(p);default:return s.transformTo(d,p)}}function g(d,p){var y,D=0,O=null,_=0;for(y=0;y<p.length;y++)_+=p[y].length;switch(d){case"string":return p.join("");case"array":return Array.prototype.concat.apply([],p);case"uint8array":for(O=new Uint8Array(_),y=0;y<p.length;y++)O.set(p[y],D),D+=p[y].length;return O;case"nodebuffer":return Buffer.concat(p);default:throw new Error("concat : unsupported type '"+d+"'")}}function C(d,p){return new f.Promise(function(y,D){var O=[],_=d._internalType,A=d._outputType,S=d._mimeType;d.on("data",function(R,M){O.push(R),p&&p(M)}).on("error",function(R){O=[],D(R)}).on("end",function(){try{var R=b(A,g(_,O),S);y(R)}catch(M){D(M)}O=[]}).resume()})}function k(d,p,y){var D=p;switch(p){case"blob":case"arraybuffer":D="uint8array";break;case"base64":D="string";break}try{this._internalType=D,this._outputType=p,this._mimeType=y,s.checkSupport(D),this._worker=d.pipe(new a(D)),d.lock()}catch(O){this._worker=new o("error"),this._worker.error(O)}}k.prototype={accumulate:function(d){return C(this,d)},on:function(d,p){var y=this;return d==="data"?this._worker.on(d,function(D){p.call(y,D.data,D.meta)}):this._worker.on(d,function(){s.delay(p,arguments,y)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:this._outputType!=="nodebuffer"},d)}},i.exports=k},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var s=new ArrayBuffer(0);try{r.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var a=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,o=new a;o.append(s),r.blob=o.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(t,i,r){for(var s=t("./utils"),a=t("./support"),o=t("./nodejsUtils"),u=t("./stream/GenericWorker"),h=new Array(256),f=0;f<256;f++)h[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;h[254]=h[254]=1;var c=function(d){var p,y,D,O,_,A=d.length,S=0;for(O=0;O<A;O++)y=d.charCodeAt(O),(y&64512)===55296&&O+1<A&&(D=d.charCodeAt(O+1),(D&64512)===56320&&(y=65536+(y-55296<<10)+(D-56320),O++)),S+=y<128?1:y<2048?2:y<65536?3:4;for(a.uint8array?p=new Uint8Array(S):p=new Array(S),_=0,O=0;_<S;O++)y=d.charCodeAt(O),(y&64512)===55296&&O+1<A&&(D=d.charCodeAt(O+1),(D&64512)===56320&&(y=65536+(y-55296<<10)+(D-56320),O++)),y<128?p[_++]=y:y<2048?(p[_++]=192|y>>>6,p[_++]=128|y&63):y<65536?(p[_++]=224|y>>>12,p[_++]=128|y>>>6&63,p[_++]=128|y&63):(p[_++]=240|y>>>18,p[_++]=128|y>>>12&63,p[_++]=128|y>>>6&63,p[_++]=128|y&63);return p},b=function(d,p){var y;for(p=p||d.length,p>d.length&&(p=d.length),y=p-1;y>=0&&(d[y]&192)===128;)y--;return y<0||y===0?p:y+h[d[y]]>p?y:p},g=function(d){var p,y,D,O,_=d.length,A=new Array(_*2);for(y=0,p=0;p<_;){if(D=d[p++],D<128){A[y++]=D;continue}if(O=h[D],O>4){A[y++]=65533,p+=O-1;continue}for(D&=O===2?31:O===3?15:7;O>1&&p<_;)D=D<<6|d[p++]&63,O--;if(O>1){A[y++]=65533;continue}D<65536?A[y++]=D:(D-=65536,A[y++]=55296|D>>10&1023,A[y++]=56320|D&1023)}return A.length!==y&&(A.subarray?A=A.subarray(0,y):A.length=y),s.applyFromCharCode(A)};r.utf8encode=function(p){return a.nodebuffer?o.newBufferFrom(p,"utf-8"):c(p)},r.utf8decode=function(p){return a.nodebuffer?s.transformTo("nodebuffer",p).toString("utf-8"):(p=s.transformTo(a.uint8array?"uint8array":"array",p),g(p))};function C(){u.call(this,"utf-8 decode"),this.leftOver=null}s.inherits(C,u),C.prototype.processChunk=function(d){var p=s.transformTo(a.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var y=p;p=new Uint8Array(y.length+this.leftOver.length),p.set(this.leftOver,0),p.set(y,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var D=b(p),O=p;D!==p.length&&(a.uint8array?(O=p.subarray(0,D),this.leftOver=p.subarray(D,p.length)):(O=p.slice(0,D),this.leftOver=p.slice(D,p.length))),this.push({data:r.utf8decode(O),meta:d.meta})},C.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=C;function k(){u.call(this,"utf-8 encode")}s.inherits(k,u),k.prototype.processChunk=function(d){this.push({data:r.utf8encode(d.data),meta:d.meta})},r.Utf8EncodeWorker=k},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,i,r){var s=t("./support"),a=t("./base64"),o=t("./nodejsUtils"),u=t("./external");t("setimmediate");function h(d){var p=null;return s.uint8array?p=new Uint8Array(d.length):p=new Array(d.length),c(d,p)}r.newBlob=function(d,p){r.checkSupport("blob");try{return new Blob([d],{type:p})}catch{try{var y=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,D=new y;return D.append(d),D.getBlob(p)}catch{throw new Error("Bug : can't construct the Blob.")}}};function f(d){return d}function c(d,p){for(var y=0;y<d.length;++y)p[y]=d.charCodeAt(y)&255;return p}var b={stringifyByChunk:function(d,p,y){var D=[],O=0,_=d.length;if(_<=y)return String.fromCharCode.apply(null,d);for(;O<_;)p==="array"||p==="nodebuffer"?D.push(String.fromCharCode.apply(null,d.slice(O,Math.min(O+y,_)))):D.push(String.fromCharCode.apply(null,d.subarray(O,Math.min(O+y,_)))),O+=y;return D.join("")},stringifyByChar:function(d){for(var p="",y=0;y<d.length;y++)p+=String.fromCharCode(d[y]);return p},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}}()}};function g(d){var p=65536,y=r.getTypeOf(d),D=!0;if(y==="uint8array"?D=b.applyCanBeUsed.uint8array:y==="nodebuffer"&&(D=b.applyCanBeUsed.nodebuffer),D)for(;p>1;)try{return b.stringifyByChunk(d,y,p)}catch{p=Math.floor(p/2)}return b.stringifyByChar(d)}r.applyFromCharCode=g;function C(d,p){for(var y=0;y<d.length;y++)p[y]=d[y];return p}var k={};k.string={string:f,array:function(d){return c(d,new Array(d.length))},arraybuffer:function(d){return k.string.uint8array(d).buffer},uint8array:function(d){return c(d,new Uint8Array(d.length))},nodebuffer:function(d){return c(d,o.allocBuffer(d.length))}},k.array={string:g,array:f,arraybuffer:function(d){return new Uint8Array(d).buffer},uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return o.newBufferFrom(d)}},k.arraybuffer={string:function(d){return g(new Uint8Array(d))},array:function(d){return C(new Uint8Array(d),new Array(d.byteLength))},arraybuffer:f,uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return o.newBufferFrom(new Uint8Array(d))}},k.uint8array={string:g,array:function(d){return C(d,new Array(d.length))},arraybuffer:function(d){return d.buffer},uint8array:f,nodebuffer:function(d){return o.newBufferFrom(d)}},k.nodebuffer={string:g,array:function(d){return C(d,new Array(d.length))},arraybuffer:function(d){return k.nodebuffer.uint8array(d).buffer},uint8array:function(d){return C(d,new Uint8Array(d.length))},nodebuffer:f},r.transformTo=function(d,p){if(p||(p=""),!d)return p;r.checkSupport(d);var y=r.getTypeOf(p),D=k[y][d](p);return D},r.resolve=function(d){for(var p=d.split("/"),y=[],D=0;D<p.length;D++){var O=p[D];O==="."||O===""&&D!==0&&D!==p.length-1||(O===".."?y.pop():y.push(O))}return y.join("/")},r.getTypeOf=function(d){if(typeof d=="string")return"string";if(Object.prototype.toString.call(d)==="[object Array]")return"array";if(s.nodebuffer&&o.isBuffer(d))return"nodebuffer";if(s.uint8array&&d instanceof Uint8Array)return"uint8array";if(s.arraybuffer&&d instanceof ArrayBuffer)return"arraybuffer"},r.checkSupport=function(d){var p=s[d.toLowerCase()];if(!p)throw new Error(d+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(d){var p="",y,D;for(D=0;D<(d||"").length;D++)y=d.charCodeAt(D),p+="\\x"+(y<16?"0":"")+y.toString(16).toUpperCase();return p},r.delay=function(d,p,y){setImmediate(function(){d.apply(y||null,p||[])})},r.inherits=function(d,p){var y=function(){};y.prototype=p.prototype,d.prototype=new y},r.extend=function(){var d={},p,y;for(p=0;p<arguments.length;p++)for(y in arguments[p])Object.prototype.hasOwnProperty.call(arguments[p],y)&&typeof d[y]>"u"&&(d[y]=arguments[p][y]);return d},r.prepareContent=function(d,p,y,D,O){var _=u.Promise.resolve(p).then(function(A){var S=s.blob&&(A instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(A))!==-1);return S&&typeof FileReader<"u"?new u.Promise(function(R,M){var P=new FileReader;P.onload=function(H){R(H.target.result)},P.onerror=function(H){M(H.target.error)},P.readAsArrayBuffer(A)}):A});return _.then(function(A){var S=r.getTypeOf(A);return S?(S==="arraybuffer"?A=r.transformTo("uint8array",A):S==="string"&&(O?A=a.decode(A):y&&D!==!0&&(A=h(A))),A):u.Promise.reject(new Error("Can't read the data of '"+d+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,i,r){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./signature"),u=t("./zipEntry"),h=t("./support");function f(c){this.files=[],this.loadOptions=c}f.prototype={checkSignature:function(c){if(!this.reader.readAndCheckSignature(c)){this.reader.index-=4;var b=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(b)+", expected "+a.pretty(c)+")")}},isSignature:function(c,b){var g=this.reader.index;this.reader.setIndex(c);var C=this.reader.readString(4),k=C===b;return this.reader.setIndex(g),k},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var c=this.reader.readData(this.zipCommentLength),b=h.uint8array?"uint8array":"array",g=a.transformTo(b,c);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var c=this.zip64EndOfCentralSize-44,b=0,g,C,k;b<c;)g=this.reader.readInt(2),C=this.reader.readInt(4),k=this.reader.readData(C),this.zip64ExtensibleData[g]={id:g,length:C,value:k}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var c,b;for(c=0;c<this.files.length;c++)b=this.files[c],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var c;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)c=new u({zip64:this.zip64},this.loadOptions),c.readCentralPart(this.reader),this.files.push(c);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var c=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(c<0){var b=!this.isSignature(0,o.LOCAL_FILE_HEADER);throw b?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(c);var g=c;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,c=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),c<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(c),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var C=this.centralDirOffset+this.centralDirSize;this.zip64&&(C+=20,C+=12+this.zip64EndOfCentralSize);var k=g-C;if(k>0)this.isSignature(g,o.CENTRAL_FILE_HEADER)||(this.reader.zero=k);else if(k<0)throw new Error("Corrupted zip: missing "+Math.abs(k)+" bytes.")},prepareReader:function(c){this.reader=s(c)},load:function(c){this.prepareReader(c),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,i,r){var s=t("./reader/readerFor"),a=t("./utils"),o=t("./compressedObject"),u=t("./crc32"),h=t("./utf8"),f=t("./compressions"),c=t("./support"),b=0,g=3,C=function(d){for(var p in f)if(Object.prototype.hasOwnProperty.call(f,p)&&f[p].magic===d)return f[p];return null};function k(d,p){this.options=d,this.loadOptions=p}k.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(d){var p,y;if(d.skip(22),this.fileNameLength=d.readInt(2),y=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(y),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(p=C(this.compressionMethod),p===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,p,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var p=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(p),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),d===b&&(this.dosPermissions=this.externalFileAttributes&63),d===g&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=s(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var p=d.index+this.extraFieldsLength,y,D,O;for(this.extraFields||(this.extraFields={});d.index+4<p;)y=d.readInt(2),D=d.readInt(2),O=d.readData(D),this.extraFields[y]={id:y,length:D,value:O};d.setIndex(p)},handleUTF8:function(){var d=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var y=a.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(y)}var D=this.findExtraFieldUnicodeComment();if(D!==null)this.fileCommentStr=D;else{var O=a.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(O)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var p=s(d.value);return p.readInt(1)!==1||u(this.fileName)!==p.readInt(4)?null:h.utf8decode(p.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var p=s(d.value);return p.readInt(1)!==1||u(this.fileComment)!==p.readInt(4)?null:h.utf8decode(p.readData(d.length-5))}return null}},i.exports=k},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,i,r){var s=t("./stream/StreamHelper"),a=t("./stream/DataWorker"),o=t("./utf8"),u=t("./compressedObject"),h=t("./stream/GenericWorker"),f=function(C,k,d){this.name=C,this.dir=d.dir,this.date=d.date,this.comment=d.comment,this.unixPermissions=d.unixPermissions,this.dosPermissions=d.dosPermissions,this._data=k,this._dataBinary=d.binary,this.options={compression:d.compression,compressionOptions:d.compressionOptions}};f.prototype={internalStream:function(C){var k=null,d="string";try{if(!C)throw new Error("No output type specified.");d=C.toLowerCase();var p=d==="string"||d==="text";(d==="binarystring"||d==="text")&&(d="string"),k=this._decompressWorker();var y=!this._dataBinary;y&&!p&&(k=k.pipe(new o.Utf8EncodeWorker)),!y&&p&&(k=k.pipe(new o.Utf8DecodeWorker))}catch(D){k=new h("error"),k.error(D)}return new s(k,d,"")},async:function(C,k){return this.internalStream(C).accumulate(k)},nodeStream:function(C,k){return this.internalStream(C||"nodebuffer").toNodejsStream(k)},_compressWorker:function(C,k){if(this._data instanceof u&&this._data.compression.magic===C.magic)return this._data.getCompressedWorker();var d=this._decompressWorker();return this._dataBinary||(d=d.pipe(new o.Utf8EncodeWorker)),u.createWorkerFrom(d,C,k)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof h?this._data:new a(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],b=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<c.length;g++)f.prototype[c[g]]=b;i.exports=f},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,i,r){(function(s){var a=s.MutationObserver||s.WebKitMutationObserver,o;if(a){var u=0,h=new a(C),f=s.document.createTextNode("");h.observe(f,{characterData:!0}),o=function(){f.data=u=++u%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var c=new s.MessageChannel;c.port1.onmessage=C,o=function(){c.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?o=function(){var d=s.document.createElement("script");d.onreadystatechange=function(){C(),d.onreadystatechange=null,d.parentNode.removeChild(d),d=null},s.document.documentElement.appendChild(d)}:o=function(){setTimeout(C,0)};var b,g=[];function C(){b=!0;for(var d,p,y=g.length;y;){for(p=g,g=[],d=-1;++d<y;)p[d]();y=g.length}b=!1}i.exports=k;function k(d){g.push(d)===1&&!b&&o()}}).call(this,typeof Oe.commonjsGlobal<"u"?Oe.commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,i,r){var s=t("immediate");function a(){}var o={},u=["REJECTED"],h=["FULFILLED"],f=["PENDING"];i.exports=c;function c(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,_!==a&&k(this,_)}c.prototype.finally=function(_){if(typeof _!="function")return this;var A=this.constructor;return this.then(S,R);function S(M){function P(){return M}return A.resolve(_()).then(P)}function R(M){function P(){throw M}return A.resolve(_()).then(P)}},c.prototype.catch=function(_){return this.then(null,_)},c.prototype.then=function(_,A){if(typeof _!="function"&&this.state===h||typeof A!="function"&&this.state===u)return this;var S=new this.constructor(a);if(this.state!==f){var R=this.state===h?_:A;g(S,R,this.outcome)}else this.queue.push(new b(S,_,A));return S};function b(_,A,S){this.promise=_,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof S=="function"&&(this.onRejected=S,this.callRejected=this.otherCallRejected)}b.prototype.callFulfilled=function(_){o.resolve(this.promise,_)},b.prototype.otherCallFulfilled=function(_){g(this.promise,this.onFulfilled,_)},b.prototype.callRejected=function(_){o.reject(this.promise,_)},b.prototype.otherCallRejected=function(_){g(this.promise,this.onRejected,_)};function g(_,A,S){s(function(){var R;try{R=A(S)}catch(M){return o.reject(_,M)}R===_?o.reject(_,new TypeError("Cannot resolve promise with itself")):o.resolve(_,R)})}o.resolve=function(_,A){var S=d(C,A);if(S.status==="error")return o.reject(_,S.value);var R=S.value;if(R)k(_,R);else{_.state=h,_.outcome=A;for(var M=-1,P=_.queue.length;++M<P;)_.queue[M].callFulfilled(A)}return _},o.reject=function(_,A){_.state=u,_.outcome=A;for(var S=-1,R=_.queue.length;++S<R;)_.queue[S].callRejected(A);return _};function C(_){var A=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof A=="function")return function(){A.apply(_,arguments)}}function k(_,A){var S=!1;function R(V){S||(S=!0,o.reject(_,V))}function M(V){S||(S=!0,o.resolve(_,V))}function P(){A(M,R)}var H=d(P);H.status==="error"&&R(H.value)}function d(_,A){var S={};try{S.value=_(A),S.status="success"}catch(R){S.status="error",S.value=R}return S}c.resolve=p;function p(_){return _ instanceof this?_:o.resolve(new this(a),_)}c.reject=y;function y(_){var A=new this(a);return o.reject(A,_)}c.all=D;function D(_){var A=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=_.length,R=!1;if(!S)return this.resolve([]);for(var M=new Array(S),P=0,H=-1,V=new this(a);++H<S;)te(_[H],H);return V;function te(ce,he){A.resolve(ce).then(ue,function(se){R||(R=!0,o.reject(V,se))});function ue(se){M[he]=se,++P===S&&!R&&(R=!0,o.resolve(V,M))}}}c.race=O;function O(_){var A=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=_.length,R=!1;if(!S)return this.resolve([]);for(var M=-1,P=new this(a);++M<S;)H(_[M]);return P;function H(V){A.resolve(V).then(function(te){R||(R=!0,o.resolve(P,te))},function(te){R||(R=!0,o.reject(P,te))})}}},{immediate:36}],38:[function(t,i,r){var s=t("./lib/utils/common").assign,a=t("./lib/deflate"),o=t("./lib/inflate"),u=t("./lib/zlib/constants"),h={};s(h,a,o,u),i.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,i,r){var s=t("./zlib/deflate"),a=t("./utils/common"),o=t("./utils/strings"),u=t("./zlib/messages"),h=t("./zlib/zstream"),f=Object.prototype.toString,c=0,b=4,g=0,C=1,k=2,d=-1,p=0,y=8;function D(S){if(!(this instanceof D))return new D(S);this.options=a.assign({level:d,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},S||{});var R=this.options;R.raw&&R.windowBits>0?R.windowBits=-R.windowBits:R.gzip&&R.windowBits>0&&R.windowBits<16&&(R.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var M=s.deflateInit2(this.strm,R.level,R.method,R.windowBits,R.memLevel,R.strategy);if(M!==g)throw new Error(u[M]);if(R.header&&s.deflateSetHeader(this.strm,R.header),R.dictionary){var P;if(typeof R.dictionary=="string"?P=o.string2buf(R.dictionary):f.call(R.dictionary)==="[object ArrayBuffer]"?P=new Uint8Array(R.dictionary):P=R.dictionary,M=s.deflateSetDictionary(this.strm,P),M!==g)throw new Error(u[M]);this._dict_set=!0}}D.prototype.push=function(S,R){var M=this.strm,P=this.options.chunkSize,H,V;if(this.ended)return!1;V=R===~~R?R:R===!0?b:c,typeof S=="string"?M.input=o.string2buf(S):f.call(S)==="[object ArrayBuffer]"?M.input=new Uint8Array(S):M.input=S,M.next_in=0,M.avail_in=M.input.length;do{if(M.avail_out===0&&(M.output=new a.Buf8(P),M.next_out=0,M.avail_out=P),H=s.deflate(M,V),H!==C&&H!==g)return this.onEnd(H),this.ended=!0,!1;(M.avail_out===0||M.avail_in===0&&(V===b||V===k))&&(this.options.to==="string"?this.onData(o.buf2binstring(a.shrinkBuf(M.output,M.next_out))):this.onData(a.shrinkBuf(M.output,M.next_out)))}while((M.avail_in>0||M.avail_out===0)&&H!==C);return V===b?(H=s.deflateEnd(this.strm),this.onEnd(H),this.ended=!0,H===g):(V===k&&(this.onEnd(g),M.avail_out=0),!0)},D.prototype.onData=function(S){this.chunks.push(S)},D.prototype.onEnd=function(S){S===g&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg};function O(S,R){var M=new D(R);if(M.push(S,!0),M.err)throw M.msg||u[M.err];return M.result}function _(S,R){return R=R||{},R.raw=!0,O(S,R)}function A(S,R){return R=R||{},R.gzip=!0,O(S,R)}r.Deflate=D,r.deflate=O,r.deflateRaw=_,r.gzip=A},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,i,r){var s=t("./zlib/inflate"),a=t("./utils/common"),o=t("./utils/strings"),u=t("./zlib/constants"),h=t("./zlib/messages"),f=t("./zlib/zstream"),c=t("./zlib/gzheader"),b=Object.prototype.toString;function g(d){if(!(this instanceof g))return new g(d);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},d||{});var p=this.options;p.raw&&p.windowBits>=0&&p.windowBits<16&&(p.windowBits=-p.windowBits,p.windowBits===0&&(p.windowBits=-15)),p.windowBits>=0&&p.windowBits<16&&!(d&&d.windowBits)&&(p.windowBits+=32),p.windowBits>15&&p.windowBits<48&&(p.windowBits&15||(p.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var y=s.inflateInit2(this.strm,p.windowBits);if(y!==u.Z_OK)throw new Error(h[y]);this.header=new c,s.inflateGetHeader(this.strm,this.header)}g.prototype.push=function(d,p){var y=this.strm,D=this.options.chunkSize,O=this.options.dictionary,_,A,S,R,M,P,H=!1;if(this.ended)return!1;A=p===~~p?p:p===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof d=="string"?y.input=o.binstring2buf(d):b.call(d)==="[object ArrayBuffer]"?y.input=new Uint8Array(d):y.input=d,y.next_in=0,y.avail_in=y.input.length;do{if(y.avail_out===0&&(y.output=new a.Buf8(D),y.next_out=0,y.avail_out=D),_=s.inflate(y,u.Z_NO_FLUSH),_===u.Z_NEED_DICT&&O&&(typeof O=="string"?P=o.string2buf(O):b.call(O)==="[object ArrayBuffer]"?P=new Uint8Array(O):P=O,_=s.inflateSetDictionary(this.strm,P)),_===u.Z_BUF_ERROR&&H===!0&&(_=u.Z_OK,H=!1),_!==u.Z_STREAM_END&&_!==u.Z_OK)return this.onEnd(_),this.ended=!0,!1;y.next_out&&(y.avail_out===0||_===u.Z_STREAM_END||y.avail_in===0&&(A===u.Z_FINISH||A===u.Z_SYNC_FLUSH))&&(this.options.to==="string"?(S=o.utf8border(y.output,y.next_out),R=y.next_out-S,M=o.buf2string(y.output,S),y.next_out=R,y.avail_out=D-R,R&&a.arraySet(y.output,y.output,S,R,0),this.onData(M)):this.onData(a.shrinkBuf(y.output,y.next_out))),y.avail_in===0&&y.avail_out===0&&(H=!0)}while((y.avail_in>0||y.avail_out===0)&&_!==u.Z_STREAM_END);return _===u.Z_STREAM_END&&(A=u.Z_FINISH),A===u.Z_FINISH?(_=s.inflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===u.Z_OK):(A===u.Z_SYNC_FLUSH&&(this.onEnd(u.Z_OK),y.avail_out=0),!0)},g.prototype.onData=function(d){this.chunks.push(d)},g.prototype.onEnd=function(d){d===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=d,this.msg=this.strm.msg};function C(d,p){var y=new g(p);if(y.push(d,!0),y.err)throw y.msg||h[y.err];return y.result}function k(d,p){return p=p||{},p.raw=!0,C(d,p)}r.Inflate=g,r.inflate=C,r.inflateRaw=k,r.ungzip=C},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,i,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(u){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var f=h.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var c in f)f.hasOwnProperty(c)&&(u[c]=f[c])}}return u},r.shrinkBuf=function(u,h){return u.length===h?u:u.subarray?u.subarray(0,h):(u.length=h,u)};var a={arraySet:function(u,h,f,c,b){if(h.subarray&&u.subarray){u.set(h.subarray(f,f+c),b);return}for(var g=0;g<c;g++)u[b+g]=h[f+g]},flattenChunks:function(u){var h,f,c,b,g,C;for(c=0,h=0,f=u.length;h<f;h++)c+=u[h].length;for(C=new Uint8Array(c),b=0,h=0,f=u.length;h<f;h++)g=u[h],C.set(g,b),b+=g.length;return C}},o={arraySet:function(u,h,f,c,b){for(var g=0;g<c;g++)u[b+g]=h[f+g]},flattenChunks:function(u){return[].concat.apply([],u)}};r.setTyped=function(u){u?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,a)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(s)},{}],42:[function(t,i,r){var s=t("./common"),a=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var u=new s.Buf8(256),h=0;h<256;h++)u[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;u[254]=u[254]=1,r.string2buf=function(c){var b,g,C,k,d,p=c.length,y=0;for(k=0;k<p;k++)g=c.charCodeAt(k),(g&64512)===55296&&k+1<p&&(C=c.charCodeAt(k+1),(C&64512)===56320&&(g=65536+(g-55296<<10)+(C-56320),k++)),y+=g<128?1:g<2048?2:g<65536?3:4;for(b=new s.Buf8(y),d=0,k=0;d<y;k++)g=c.charCodeAt(k),(g&64512)===55296&&k+1<p&&(C=c.charCodeAt(k+1),(C&64512)===56320&&(g=65536+(g-55296<<10)+(C-56320),k++)),g<128?b[d++]=g:g<2048?(b[d++]=192|g>>>6,b[d++]=128|g&63):g<65536?(b[d++]=224|g>>>12,b[d++]=128|g>>>6&63,b[d++]=128|g&63):(b[d++]=240|g>>>18,b[d++]=128|g>>>12&63,b[d++]=128|g>>>6&63,b[d++]=128|g&63);return b};function f(c,b){if(b<65537&&(c.subarray&&o||!c.subarray&&a))return String.fromCharCode.apply(null,s.shrinkBuf(c,b));for(var g="",C=0;C<b;C++)g+=String.fromCharCode(c[C]);return g}r.buf2binstring=function(c){return f(c,c.length)},r.binstring2buf=function(c){for(var b=new s.Buf8(c.length),g=0,C=b.length;g<C;g++)b[g]=c.charCodeAt(g);return b},r.buf2string=function(c,b){var g,C,k,d,p=b||c.length,y=new Array(p*2);for(C=0,g=0;g<p;){if(k=c[g++],k<128){y[C++]=k;continue}if(d=u[k],d>4){y[C++]=65533,g+=d-1;continue}for(k&=d===2?31:d===3?15:7;d>1&&g<p;)k=k<<6|c[g++]&63,d--;if(d>1){y[C++]=65533;continue}k<65536?y[C++]=k:(k-=65536,y[C++]=55296|k>>10&1023,y[C++]=56320|k&1023)}return f(y,C)},r.utf8border=function(c,b){var g;for(b=b||c.length,b>c.length&&(b=c.length),g=b-1;g>=0&&(c[g]&192)===128;)g--;return g<0||g===0?b:g+u[c[g]]>b?g:b}},{"./common":41}],43:[function(t,i,r){function s(a,o,u,h){for(var f=a&65535|0,c=a>>>16&65535|0,b=0;u!==0;){b=u>2e3?2e3:u,u-=b;do f=f+o[h++]|0,c=c+f|0;while(--b);f%=65521,c%=65521}return f|c<<16|0}i.exports=s},{}],44:[function(t,i,r){i.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,i,r){function s(){for(var u,h=[],f=0;f<256;f++){u=f;for(var c=0;c<8;c++)u=u&1?3988292384^u>>>1:u>>>1;h[f]=u}return h}var a=s();function o(u,h,f,c){var b=a,g=c+f;u^=-1;for(var C=c;C<g;C++)u=u>>>8^b[(u^h[C])&255];return u^-1}i.exports=o},{}],46:[function(t,i,r){var s=t("../utils/common"),a=t("./trees"),o=t("./adler32"),u=t("./crc32"),h=t("./messages"),f=0,c=1,b=3,g=4,C=5,k=0,d=1,p=-2,y=-3,D=-5,O=-1,_=1,A=2,S=3,R=4,M=0,P=2,H=8,V=9,te=15,ce=8,he=29,ue=256,se=ue+1+he,ne=30,me=19,Re=2*se+1,De=15,le=3,Se=258,_e=Se+le+1,$e=32,He=42,Fe=69,ve=73,Ge=91,Pe=103,Ae=113,Be=666,Ee=1,Ke=2,Ue=3,ot=4,xe=3;function Ze(l,U){return l.msg=h[U],U}function mt(l){return(l<<1)-(l>4?9:0)}function it(l){for(var U=l.length;--U>=0;)l[U]=0}function et(l){var U=l.state,j=U.pending;j>l.avail_out&&(j=l.avail_out),j!==0&&(s.arraySet(l.output,U.pending_buf,U.pending_out,j,l.next_out),l.next_out+=j,U.pending_out+=j,l.total_out+=j,l.avail_out-=j,U.pending-=j,U.pending===0&&(U.pending_out=0))}function Ie(l,U){a._tr_flush_block(l,l.block_start>=0?l.block_start:-1,l.strstart-l.block_start,U),l.block_start=l.strstart,et(l.strm)}function de(l,U){l.pending_buf[l.pending++]=U}function st(l,U){l.pending_buf[l.pending++]=U>>>8&255,l.pending_buf[l.pending++]=U&255}function It(l,U,j,m){var N=l.avail_in;return N>m&&(N=m),N===0?0:(l.avail_in-=N,s.arraySet(U,l.input,l.next_in,N,j),l.state.wrap===1?l.adler=o(l.adler,U,N,j):l.state.wrap===2&&(l.adler=u(l.adler,U,N,j)),l.next_in+=N,l.total_in+=N,N)}function yt(l,U){var j=l.max_chain_length,m=l.strstart,N,z,ae=l.prev_length,ee=l.nice_match,ie=l.strstart>l.w_size-_e?l.strstart-(l.w_size-_e):0,ge=l.window,_t=l.w_mask,Le=l.prev,be=l.strstart+Se,je=ge[m+ae-1],Je=ge[m+ae];l.prev_length>=l.good_match&&(j>>=2),ee>l.lookahead&&(ee=l.lookahead);do if(N=U,!(ge[N+ae]!==Je||ge[N+ae-1]!==je||ge[N]!==ge[m]||ge[++N]!==ge[m+1])){m+=2,N++;do;while(ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&ge[++m]===ge[++N]&&m<be);if(z=Se-(be-m),m=be-Se,z>ae){if(l.match_start=U,ae=z,z>=ee)break;je=ge[m+ae-1],Je=ge[m+ae]}}while((U=Le[U&_t])>ie&&--j!==0);return ae<=l.lookahead?ae:l.lookahead}function at(l){var U=l.w_size,j,m,N,z,ae;do{if(z=l.window_size-l.lookahead-l.strstart,l.strstart>=U+(U-_e)){s.arraySet(l.window,l.window,U,U,0),l.match_start-=U,l.strstart-=U,l.block_start-=U,m=l.hash_size,j=m;do N=l.head[--j],l.head[j]=N>=U?N-U:0;while(--m);m=U,j=m;do N=l.prev[--j],l.prev[j]=N>=U?N-U:0;while(--m);z+=U}if(l.strm.avail_in===0)break;if(m=It(l.strm,l.window,l.strstart+l.lookahead,z),l.lookahead+=m,l.lookahead+l.insert>=le)for(ae=l.strstart-l.insert,l.ins_h=l.window[ae],l.ins_h=(l.ins_h<<l.hash_shift^l.window[ae+1])&l.hash_mask;l.insert&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[ae+le-1])&l.hash_mask,l.prev[ae&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=ae,ae++,l.insert--,!(l.lookahead+l.insert<le)););}while(l.lookahead<_e&&l.strm.avail_in!==0)}function Ot(l,U){var j=65535;for(j>l.pending_buf_size-5&&(j=l.pending_buf_size-5);;){if(l.lookahead<=1){if(at(l),l.lookahead===0&&U===f)return Ee;if(l.lookahead===0)break}l.strstart+=l.lookahead,l.lookahead=0;var m=l.block_start+j;if((l.strstart===0||l.strstart>=m)&&(l.lookahead=l.strstart-m,l.strstart=m,Ie(l,!1),l.strm.avail_out===0)||l.strstart-l.block_start>=l.w_size-_e&&(Ie(l,!1),l.strm.avail_out===0))return Ee}return l.insert=0,U===g?(Ie(l,!0),l.strm.avail_out===0?Ue:ot):(l.strstart>l.block_start&&(Ie(l,!1),l.strm.avail_out===0),Ee)}function bt(l,U){for(var j,m;;){if(l.lookahead<_e){if(at(l),l.lookahead<_e&&U===f)return Ee;if(l.lookahead===0)break}if(j=0,l.lookahead>=le&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+le-1])&l.hash_mask,j=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),j!==0&&l.strstart-j<=l.w_size-_e&&(l.match_length=yt(l,j)),l.match_length>=le)if(m=a._tr_tally(l,l.strstart-l.match_start,l.match_length-le),l.lookahead-=l.match_length,l.match_length<=l.max_lazy_match&&l.lookahead>=le){l.match_length--;do l.strstart++,l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+le-1])&l.hash_mask,j=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart;while(--l.match_length!==0);l.strstart++}else l.strstart+=l.match_length,l.match_length=0,l.ins_h=l.window[l.strstart],l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+1])&l.hash_mask;else m=a._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++;if(m&&(Ie(l,!1),l.strm.avail_out===0))return Ee}return l.insert=l.strstart<le-1?l.strstart:le-1,U===g?(Ie(l,!0),l.strm.avail_out===0?Ue:ot):l.last_lit&&(Ie(l,!1),l.strm.avail_out===0)?Ee:Ke}function ut(l,U){for(var j,m,N;;){if(l.lookahead<_e){if(at(l),l.lookahead<_e&&U===f)return Ee;if(l.lookahead===0)break}if(j=0,l.lookahead>=le&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+le-1])&l.hash_mask,j=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),l.prev_length=l.match_length,l.prev_match=l.match_start,l.match_length=le-1,j!==0&&l.prev_length<l.max_lazy_match&&l.strstart-j<=l.w_size-_e&&(l.match_length=yt(l,j),l.match_length<=5&&(l.strategy===_||l.match_length===le&&l.strstart-l.match_start>4096)&&(l.match_length=le-1)),l.prev_length>=le&&l.match_length<=l.prev_length){N=l.strstart+l.lookahead-le,m=a._tr_tally(l,l.strstart-1-l.prev_match,l.prev_length-le),l.lookahead-=l.prev_length-1,l.prev_length-=2;do++l.strstart<=N&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+le-1])&l.hash_mask,j=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart);while(--l.prev_length!==0);if(l.match_available=0,l.match_length=le-1,l.strstart++,m&&(Ie(l,!1),l.strm.avail_out===0))return Ee}else if(l.match_available){if(m=a._tr_tally(l,0,l.window[l.strstart-1]),m&&Ie(l,!1),l.strstart++,l.lookahead--,l.strm.avail_out===0)return Ee}else l.match_available=1,l.strstart++,l.lookahead--}return l.match_available&&(m=a._tr_tally(l,0,l.window[l.strstart-1]),l.match_available=0),l.insert=l.strstart<le-1?l.strstart:le-1,U===g?(Ie(l,!0),l.strm.avail_out===0?Ue:ot):l.last_lit&&(Ie(l,!1),l.strm.avail_out===0)?Ee:Ke}function Bt(l,U){for(var j,m,N,z,ae=l.window;;){if(l.lookahead<=Se){if(at(l),l.lookahead<=Se&&U===f)return Ee;if(l.lookahead===0)break}if(l.match_length=0,l.lookahead>=le&&l.strstart>0&&(N=l.strstart-1,m=ae[N],m===ae[++N]&&m===ae[++N]&&m===ae[++N])){z=l.strstart+Se;do;while(m===ae[++N]&&m===ae[++N]&&m===ae[++N]&&m===ae[++N]&&m===ae[++N]&&m===ae[++N]&&m===ae[++N]&&m===ae[++N]&&N<z);l.match_length=Se-(z-N),l.match_length>l.lookahead&&(l.match_length=l.lookahead)}if(l.match_length>=le?(j=a._tr_tally(l,1,l.match_length-le),l.lookahead-=l.match_length,l.strstart+=l.match_length,l.match_length=0):(j=a._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++),j&&(Ie(l,!1),l.strm.avail_out===0))return Ee}return l.insert=0,U===g?(Ie(l,!0),l.strm.avail_out===0?Ue:ot):l.last_lit&&(Ie(l,!1),l.strm.avail_out===0)?Ee:Ke}function wt(l,U){for(var j;;){if(l.lookahead===0&&(at(l),l.lookahead===0)){if(U===f)return Ee;break}if(l.match_length=0,j=a._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++,j&&(Ie(l,!1),l.strm.avail_out===0))return Ee}return l.insert=0,U===g?(Ie(l,!0),l.strm.avail_out===0?Ue:ot):l.last_lit&&(Ie(l,!1),l.strm.avail_out===0)?Ee:Ke}function Ye(l,U,j,m,N){this.good_length=l,this.max_lazy=U,this.nice_length=j,this.max_chain=m,this.func=N}var lt;lt=[new Ye(0,0,0,0,Ot),new Ye(4,4,8,4,bt),new Ye(4,5,16,8,bt),new Ye(4,6,32,32,bt),new Ye(4,4,16,16,ut),new Ye(8,16,32,32,ut),new Ye(8,16,128,128,ut),new Ye(8,32,128,256,ut),new Ye(32,128,258,1024,ut),new Ye(32,258,258,4096,ut)];function jt(l){l.window_size=2*l.w_size,it(l.head),l.max_lazy_match=lt[l.level].max_lazy,l.good_match=lt[l.level].good_length,l.nice_match=lt[l.level].nice_length,l.max_chain_length=lt[l.level].max_chain,l.strstart=0,l.block_start=0,l.lookahead=0,l.insert=0,l.match_length=l.prev_length=le-1,l.match_available=0,l.ins_h=0}function E(){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=H,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 s.Buf16(Re*2),this.dyn_dtree=new s.Buf16((2*ne+1)*2),this.bl_tree=new s.Buf16((2*me+1)*2),it(this.dyn_ltree),it(this.dyn_dtree),it(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(De+1),this.heap=new s.Buf16(2*se+1),it(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*se+1),it(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 G(l){var U;return!l||!l.state?Ze(l,p):(l.total_in=l.total_out=0,l.data_type=P,U=l.state,U.pending=0,U.pending_out=0,U.wrap<0&&(U.wrap=-U.wrap),U.status=U.wrap?He:Ae,l.adler=U.wrap===2?0:1,U.last_flush=f,a._tr_init(U),k)}function X(l){var U=G(l);return U===k&&jt(l.state),U}function re(l,U){return!l||!l.state||l.state.wrap!==2?p:(l.state.gzhead=U,k)}function I(l,U,j,m,N,z){if(!l)return p;var ae=1;if(U===O&&(U=6),m<0?(ae=0,m=-m):m>15&&(ae=2,m-=16),N<1||N>V||j!==H||m<8||m>15||U<0||U>9||z<0||z>R)return Ze(l,p);m===8&&(m=9);var ee=new E;return l.state=ee,ee.strm=l,ee.wrap=ae,ee.gzhead=null,ee.w_bits=m,ee.w_size=1<<ee.w_bits,ee.w_mask=ee.w_size-1,ee.hash_bits=N+7,ee.hash_size=1<<ee.hash_bits,ee.hash_mask=ee.hash_size-1,ee.hash_shift=~~((ee.hash_bits+le-1)/le),ee.window=new s.Buf8(ee.w_size*2),ee.head=new s.Buf16(ee.hash_size),ee.prev=new s.Buf16(ee.w_size),ee.lit_bufsize=1<<N+6,ee.pending_buf_size=ee.lit_bufsize*4,ee.pending_buf=new s.Buf8(ee.pending_buf_size),ee.d_buf=1*ee.lit_bufsize,ee.l_buf=3*ee.lit_bufsize,ee.level=U,ee.strategy=z,ee.method=j,X(l)}function q(l,U){return I(l,U,H,te,ce,M)}function v(l,U){var j,m,N,z;if(!l||!l.state||U>C||U<0)return l?Ze(l,p):p;if(m=l.state,!l.output||!l.input&&l.avail_in!==0||m.status===Be&&U!==g)return Ze(l,l.avail_out===0?D:p);if(m.strm=l,j=m.last_flush,m.last_flush=U,m.status===He)if(m.wrap===2)l.adler=0,de(m,31),de(m,139),de(m,8),m.gzhead?(de(m,(m.gzhead.text?1:0)+(m.gzhead.hcrc?2:0)+(m.gzhead.extra?4:0)+(m.gzhead.name?8:0)+(m.gzhead.comment?16:0)),de(m,m.gzhead.time&255),de(m,m.gzhead.time>>8&255),de(m,m.gzhead.time>>16&255),de(m,m.gzhead.time>>24&255),de(m,m.level===9?2:m.strategy>=A||m.level<2?4:0),de(m,m.gzhead.os&255),m.gzhead.extra&&m.gzhead.extra.length&&(de(m,m.gzhead.extra.length&255),de(m,m.gzhead.extra.length>>8&255)),m.gzhead.hcrc&&(l.adler=u(l.adler,m.pending_buf,m.pending,0)),m.gzindex=0,m.status=Fe):(de(m,0),de(m,0),de(m,0),de(m,0),de(m,0),de(m,m.level===9?2:m.strategy>=A||m.level<2?4:0),de(m,xe),m.status=Ae);else{var ae=H+(m.w_bits-8<<4)<<8,ee=-1;m.strategy>=A||m.level<2?ee=0:m.level<6?ee=1:m.level===6?ee=2:ee=3,ae|=ee<<6,m.strstart!==0&&(ae|=$e),ae+=31-ae%31,m.status=Ae,st(m,ae),m.strstart!==0&&(st(m,l.adler>>>16),st(m,l.adler&65535)),l.adler=1}if(m.status===Fe)if(m.gzhead.extra){for(N=m.pending;m.gzindex<(m.gzhead.extra.length&65535)&&!(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>N&&(l.adler=u(l.adler,m.pending_buf,m.pending-N,N)),et(l),N=m.pending,m.pending===m.pending_buf_size));)de(m,m.gzhead.extra[m.gzindex]&255),m.gzindex++;m.gzhead.hcrc&&m.pending>N&&(l.adler=u(l.adler,m.pending_buf,m.pending-N,N)),m.gzindex===m.gzhead.extra.length&&(m.gzindex=0,m.status=ve)}else m.status=ve;if(m.status===ve)if(m.gzhead.name){N=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>N&&(l.adler=u(l.adler,m.pending_buf,m.pending-N,N)),et(l),N=m.pending,m.pending===m.pending_buf_size)){z=1;break}m.gzindex<m.gzhead.name.length?z=m.gzhead.name.charCodeAt(m.gzindex++)&255:z=0,de(m,z)}while(z!==0);m.gzhead.hcrc&&m.pending>N&&(l.adler=u(l.adler,m.pending_buf,m.pending-N,N)),z===0&&(m.gzindex=0,m.status=Ge)}else m.status=Ge;if(m.status===Ge)if(m.gzhead.comment){N=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>N&&(l.adler=u(l.adler,m.pending_buf,m.pending-N,N)),et(l),N=m.pending,m.pending===m.pending_buf_size)){z=1;break}m.gzindex<m.gzhead.comment.length?z=m.gzhead.comment.charCodeAt(m.gzindex++)&255:z=0,de(m,z)}while(z!==0);m.gzhead.hcrc&&m.pending>N&&(l.adler=u(l.adler,m.pending_buf,m.pending-N,N)),z===0&&(m.status=Pe)}else m.status=Pe;if(m.status===Pe&&(m.gzhead.hcrc?(m.pending+2>m.pending_buf_size&&et(l),m.pending+2<=m.pending_buf_size&&(de(m,l.adler&255),de(m,l.adler>>8&255),l.adler=0,m.status=Ae)):m.status=Ae),m.pending!==0){if(et(l),l.avail_out===0)return m.last_flush=-1,k}else if(l.avail_in===0&&mt(U)<=mt(j)&&U!==g)return Ze(l,D);if(m.status===Be&&l.avail_in!==0)return Ze(l,D);if(l.avail_in!==0||m.lookahead!==0||U!==f&&m.status!==Be){var ie=m.strategy===A?wt(m,U):m.strategy===S?Bt(m,U):lt[m.level].func(m,U);if((ie===Ue||ie===ot)&&(m.status=Be),ie===Ee||ie===Ue)return l.avail_out===0&&(m.last_flush=-1),k;if(ie===Ke&&(U===c?a._tr_align(m):U!==C&&(a._tr_stored_block(m,0,0,!1),U===b&&(it(m.head),m.lookahead===0&&(m.strstart=0,m.block_start=0,m.insert=0))),et(l),l.avail_out===0))return m.last_flush=-1,k}return U!==g?k:m.wrap<=0?d:(m.wrap===2?(de(m,l.adler&255),de(m,l.adler>>8&255),de(m,l.adler>>16&255),de(m,l.adler>>24&255),de(m,l.total_in&255),de(m,l.total_in>>8&255),de(m,l.total_in>>16&255),de(m,l.total_in>>24&255)):(st(m,l.adler>>>16),st(m,l.adler&65535)),et(l),m.wrap>0&&(m.wrap=-m.wrap),m.pending!==0?k:d)}function Z(l){var U;return!l||!l.state?p:(U=l.state.status,U!==He&&U!==Fe&&U!==ve&&U!==Ge&&U!==Pe&&U!==Ae&&U!==Be?Ze(l,p):(l.state=null,U===Ae?Ze(l,y):k))}function fe(l,U){var j=U.length,m,N,z,ae,ee,ie,ge,_t;if(!l||!l.state||(m=l.state,ae=m.wrap,ae===2||ae===1&&m.status!==He||m.lookahead))return p;for(ae===1&&(l.adler=o(l.adler,U,j,0)),m.wrap=0,j>=m.w_size&&(ae===0&&(it(m.head),m.strstart=0,m.block_start=0,m.insert=0),_t=new s.Buf8(m.w_size),s.arraySet(_t,U,j-m.w_size,m.w_size,0),U=_t,j=m.w_size),ee=l.avail_in,ie=l.next_in,ge=l.input,l.avail_in=j,l.next_in=0,l.input=U,at(m);m.lookahead>=le;){N=m.strstart,z=m.lookahead-(le-1);do m.ins_h=(m.ins_h<<m.hash_shift^m.window[N+le-1])&m.hash_mask,m.prev[N&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=N,N++;while(--z);m.strstart=N,m.lookahead=le-1,at(m)}return m.strstart+=m.lookahead,m.block_start=m.strstart,m.insert=m.lookahead,m.lookahead=0,m.match_length=m.prev_length=le-1,m.match_available=0,l.next_in=ie,l.input=ge,l.avail_in=ee,m.wrap=ae,k}r.deflateInit=q,r.deflateInit2=I,r.deflateReset=X,r.deflateResetKeep=G,r.deflateSetHeader=re,r.deflate=v,r.deflateEnd=Z,r.deflateSetDictionary=fe,r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,i,r){function s(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}i.exports=s},{}],48:[function(t,i,r){var s=30,a=12;i.exports=function(u,h){var f,c,b,g,C,k,d,p,y,D,O,_,A,S,R,M,P,H,V,te,ce,he,ue,se,ne;f=u.state,c=u.next_in,se=u.input,b=c+(u.avail_in-5),g=u.next_out,ne=u.output,C=g-(h-u.avail_out),k=g+(u.avail_out-257),d=f.dmax,p=f.wsize,y=f.whave,D=f.wnext,O=f.window,_=f.hold,A=f.bits,S=f.lencode,R=f.distcode,M=(1<<f.lenbits)-1,P=(1<<f.distbits)-1;e:do{A<15&&(_+=se[c++]<<A,A+=8,_+=se[c++]<<A,A+=8),H=S[_&M];t:for(;;){if(V=H>>>24,_>>>=V,A-=V,V=H>>>16&255,V===0)ne[g++]=H&65535;else if(V&16){te=H&65535,V&=15,V&&(A<V&&(_+=se[c++]<<A,A+=8),te+=_&(1<<V)-1,_>>>=V,A-=V),A<15&&(_+=se[c++]<<A,A+=8,_+=se[c++]<<A,A+=8),H=R[_&P];i:for(;;){if(V=H>>>24,_>>>=V,A-=V,V=H>>>16&255,V&16){if(ce=H&65535,V&=15,A<V&&(_+=se[c++]<<A,A+=8,A<V&&(_+=se[c++]<<A,A+=8)),ce+=_&(1<<V)-1,ce>d){u.msg="invalid distance too far back",f.mode=s;break e}if(_>>>=V,A-=V,V=g-C,ce>V){if(V=ce-V,V>y&&f.sane){u.msg="invalid distance too far back",f.mode=s;break e}if(he=0,ue=O,D===0){if(he+=p-V,V<te){te-=V;do ne[g++]=O[he++];while(--V);he=g-ce,ue=ne}}else if(D<V){if(he+=p+D-V,V-=D,V<te){te-=V;do ne[g++]=O[he++];while(--V);if(he=0,D<te){V=D,te-=V;do ne[g++]=O[he++];while(--V);he=g-ce,ue=ne}}}else if(he+=D-V,V<te){te-=V;do ne[g++]=O[he++];while(--V);he=g-ce,ue=ne}for(;te>2;)ne[g++]=ue[he++],ne[g++]=ue[he++],ne[g++]=ue[he++],te-=3;te&&(ne[g++]=ue[he++],te>1&&(ne[g++]=ue[he++]))}else{he=g-ce;do ne[g++]=ne[he++],ne[g++]=ne[he++],ne[g++]=ne[he++],te-=3;while(te>2);te&&(ne[g++]=ne[he++],te>1&&(ne[g++]=ne[he++]))}}else if(V&64){u.msg="invalid distance code",f.mode=s;break e}else{H=R[(H&65535)+(_&(1<<V)-1)];continue i}break}}else if(V&64)if(V&32){f.mode=a;break e}else{u.msg="invalid literal/length code",f.mode=s;break e}else{H=S[(H&65535)+(_&(1<<V)-1)];continue t}break}}while(c<b&&g<k);te=A>>3,c-=te,A-=te<<3,_&=(1<<A)-1,u.next_in=c,u.next_out=g,u.avail_in=c<b?5+(b-c):5-(c-b),u.avail_out=g<k?257+(k-g):257-(g-k),f.hold=_,f.bits=A}},{}],49:[function(t,i,r){var s=t("../utils/common"),a=t("./adler32"),o=t("./crc32"),u=t("./inffast"),h=t("./inftrees"),f=0,c=1,b=2,g=4,C=5,k=6,d=0,p=1,y=2,D=-2,O=-3,_=-4,A=-5,S=8,R=1,M=2,P=3,H=4,V=5,te=6,ce=7,he=8,ue=9,se=10,ne=11,me=12,Re=13,De=14,le=15,Se=16,_e=17,$e=18,He=19,Fe=20,ve=21,Ge=22,Pe=23,Ae=24,Be=25,Ee=26,Ke=27,Ue=28,ot=29,xe=30,Ze=31,mt=32,it=852,et=592,Ie=15,de=Ie;function st(I){return(I>>>24&255)+(I>>>8&65280)+((I&65280)<<8)+((I&255)<<24)}function It(){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 s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function yt(I){var q;return!I||!I.state?D:(q=I.state,I.total_in=I.total_out=q.total=0,I.msg="",q.wrap&&(I.adler=q.wrap&1),q.mode=R,q.last=0,q.havedict=0,q.dmax=32768,q.head=null,q.hold=0,q.bits=0,q.lencode=q.lendyn=new s.Buf32(it),q.distcode=q.distdyn=new s.Buf32(et),q.sane=1,q.back=-1,d)}function at(I){var q;return!I||!I.state?D:(q=I.state,q.wsize=0,q.whave=0,q.wnext=0,yt(I))}function Ot(I,q){var v,Z;return!I||!I.state||(Z=I.state,q<0?(v=0,q=-q):(v=(q>>4)+1,q<48&&(q&=15)),q&&(q<8||q>15))?D:(Z.window!==null&&Z.wbits!==q&&(Z.window=null),Z.wrap=v,Z.wbits=q,at(I))}function bt(I,q){var v,Z;return I?(Z=new It,I.state=Z,Z.window=null,v=Ot(I,q),v!==d&&(I.state=null),v):D}function ut(I){return bt(I,de)}var Bt=!0,wt,Ye;function lt(I){if(Bt){var q;for(wt=new s.Buf32(512),Ye=new s.Buf32(32),q=0;q<144;)I.lens[q++]=8;for(;q<256;)I.lens[q++]=9;for(;q<280;)I.lens[q++]=7;for(;q<288;)I.lens[q++]=8;for(h(c,I.lens,0,288,wt,0,I.work,{bits:9}),q=0;q<32;)I.lens[q++]=5;h(b,I.lens,0,32,Ye,0,I.work,{bits:5}),Bt=!1}I.lencode=wt,I.lenbits=9,I.distcode=Ye,I.distbits=5}function jt(I,q,v,Z){var fe,l=I.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new s.Buf8(l.wsize)),Z>=l.wsize?(s.arraySet(l.window,q,v-l.wsize,l.wsize,0),l.wnext=0,l.whave=l.wsize):(fe=l.wsize-l.wnext,fe>Z&&(fe=Z),s.arraySet(l.window,q,v-Z,fe,l.wnext),Z-=fe,Z?(s.arraySet(l.window,q,v-Z,Z,0),l.wnext=Z,l.whave=l.wsize):(l.wnext+=fe,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=fe))),0}function E(I,q){var v,Z,fe,l,U,j,m,N,z,ae,ee,ie,ge,_t,Le=0,be,je,Je,rt,Yt,Xt,ze,ht,Xe=new s.Buf8(4),Et,pt,Ri=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return D;v=I.state,v.mode===me&&(v.mode=Re),U=I.next_out,fe=I.output,m=I.avail_out,l=I.next_in,Z=I.input,j=I.avail_in,N=v.hold,z=v.bits,ae=j,ee=m,ht=d;e:for(;;)switch(v.mode){case R:if(v.wrap===0){v.mode=Re;break}for(;z<16;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(v.wrap&2&&N===35615){v.check=0,Xe[0]=N&255,Xe[1]=N>>>8&255,v.check=o(v.check,Xe,2,0),N=0,z=0,v.mode=M;break}if(v.flags=0,v.head&&(v.head.done=!1),!(v.wrap&1)||(((N&255)<<8)+(N>>8))%31){I.msg="incorrect header check",v.mode=xe;break}if((N&15)!==S){I.msg="unknown compression method",v.mode=xe;break}if(N>>>=4,z-=4,ze=(N&15)+8,v.wbits===0)v.wbits=ze;else if(ze>v.wbits){I.msg="invalid window size",v.mode=xe;break}v.dmax=1<<ze,I.adler=v.check=1,v.mode=N&512?se:me,N=0,z=0;break;case M:for(;z<16;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(v.flags=N,(v.flags&255)!==S){I.msg="unknown compression method",v.mode=xe;break}if(v.flags&57344){I.msg="unknown header flags set",v.mode=xe;break}v.head&&(v.head.text=N>>8&1),v.flags&512&&(Xe[0]=N&255,Xe[1]=N>>>8&255,v.check=o(v.check,Xe,2,0)),N=0,z=0,v.mode=P;case P:for(;z<32;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}v.head&&(v.head.time=N),v.flags&512&&(Xe[0]=N&255,Xe[1]=N>>>8&255,Xe[2]=N>>>16&255,Xe[3]=N>>>24&255,v.check=o(v.check,Xe,4,0)),N=0,z=0,v.mode=H;case H:for(;z<16;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}v.head&&(v.head.xflags=N&255,v.head.os=N>>8),v.flags&512&&(Xe[0]=N&255,Xe[1]=N>>>8&255,v.check=o(v.check,Xe,2,0)),N=0,z=0,v.mode=V;case V:if(v.flags&1024){for(;z<16;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}v.length=N,v.head&&(v.head.extra_len=N),v.flags&512&&(Xe[0]=N&255,Xe[1]=N>>>8&255,v.check=o(v.check,Xe,2,0)),N=0,z=0}else v.head&&(v.head.extra=null);v.mode=te;case te:if(v.flags&1024&&(ie=v.length,ie>j&&(ie=j),ie&&(v.head&&(ze=v.head.extra_len-v.length,v.head.extra||(v.head.extra=new Array(v.head.extra_len)),s.arraySet(v.head.extra,Z,l,ie,ze)),v.flags&512&&(v.check=o(v.check,Z,ie,l)),j-=ie,l+=ie,v.length-=ie),v.length))break e;v.length=0,v.mode=ce;case ce:if(v.flags&2048){if(j===0)break e;ie=0;do ze=Z[l+ie++],v.head&&ze&&v.length<65536&&(v.head.name+=String.fromCharCode(ze));while(ze&&ie<j);if(v.flags&512&&(v.check=o(v.check,Z,ie,l)),j-=ie,l+=ie,ze)break e}else v.head&&(v.head.name=null);v.length=0,v.mode=he;case he:if(v.flags&4096){if(j===0)break e;ie=0;do ze=Z[l+ie++],v.head&&ze&&v.length<65536&&(v.head.comment+=String.fromCharCode(ze));while(ze&&ie<j);if(v.flags&512&&(v.check=o(v.check,Z,ie,l)),j-=ie,l+=ie,ze)break e}else v.head&&(v.head.comment=null);v.mode=ue;case ue:if(v.flags&512){for(;z<16;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(N!==(v.check&65535)){I.msg="header crc mismatch",v.mode=xe;break}N=0,z=0}v.head&&(v.head.hcrc=v.flags>>9&1,v.head.done=!0),I.adler=v.check=0,v.mode=me;break;case se:for(;z<32;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}I.adler=v.check=st(N),N=0,z=0,v.mode=ne;case ne:if(v.havedict===0)return I.next_out=U,I.avail_out=m,I.next_in=l,I.avail_in=j,v.hold=N,v.bits=z,y;I.adler=v.check=1,v.mode=me;case me:if(q===C||q===k)break e;case Re:if(v.last){N>>>=z&7,z-=z&7,v.mode=Ke;break}for(;z<3;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}switch(v.last=N&1,N>>>=1,z-=1,N&3){case 0:v.mode=De;break;case 1:if(lt(v),v.mode=Fe,q===k){N>>>=2,z-=2;break e}break;case 2:v.mode=_e;break;case 3:I.msg="invalid block type",v.mode=xe}N>>>=2,z-=2;break;case De:for(N>>>=z&7,z-=z&7;z<32;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if((N&65535)!==(N>>>16^65535)){I.msg="invalid stored block lengths",v.mode=xe;break}if(v.length=N&65535,N=0,z=0,v.mode=le,q===k)break e;case le:v.mode=Se;case Se:if(ie=v.length,ie){if(ie>j&&(ie=j),ie>m&&(ie=m),ie===0)break e;s.arraySet(fe,Z,l,ie,U),j-=ie,l+=ie,m-=ie,U+=ie,v.length-=ie;break}v.mode=me;break;case _e:for(;z<14;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(v.nlen=(N&31)+257,N>>>=5,z-=5,v.ndist=(N&31)+1,N>>>=5,z-=5,v.ncode=(N&15)+4,N>>>=4,z-=4,v.nlen>286||v.ndist>30){I.msg="too many length or distance symbols",v.mode=xe;break}v.have=0,v.mode=$e;case $e:for(;v.have<v.ncode;){for(;z<3;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}v.lens[Ri[v.have++]]=N&7,N>>>=3,z-=3}for(;v.have<19;)v.lens[Ri[v.have++]]=0;if(v.lencode=v.lendyn,v.lenbits=7,Et={bits:v.lenbits},ht=h(f,v.lens,0,19,v.lencode,0,v.work,Et),v.lenbits=Et.bits,ht){I.msg="invalid code lengths set",v.mode=xe;break}v.have=0,v.mode=He;case He:for(;v.have<v.nlen+v.ndist;){for(;Le=v.lencode[N&(1<<v.lenbits)-1],be=Le>>>24,je=Le>>>16&255,Je=Le&65535,!(be<=z);){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(Je<16)N>>>=be,z-=be,v.lens[v.have++]=Je;else{if(Je===16){for(pt=be+2;z<pt;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(N>>>=be,z-=be,v.have===0){I.msg="invalid bit length repeat",v.mode=xe;break}ze=v.lens[v.have-1],ie=3+(N&3),N>>>=2,z-=2}else if(Je===17){for(pt=be+3;z<pt;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}N>>>=be,z-=be,ze=0,ie=3+(N&7),N>>>=3,z-=3}else{for(pt=be+7;z<pt;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}N>>>=be,z-=be,ze=0,ie=11+(N&127),N>>>=7,z-=7}if(v.have+ie>v.nlen+v.ndist){I.msg="invalid bit length repeat",v.mode=xe;break}for(;ie--;)v.lens[v.have++]=ze}}if(v.mode===xe)break;if(v.lens[256]===0){I.msg="invalid code -- missing end-of-block",v.mode=xe;break}if(v.lenbits=9,Et={bits:v.lenbits},ht=h(c,v.lens,0,v.nlen,v.lencode,0,v.work,Et),v.lenbits=Et.bits,ht){I.msg="invalid literal/lengths set",v.mode=xe;break}if(v.distbits=6,v.distcode=v.distdyn,Et={bits:v.distbits},ht=h(b,v.lens,v.nlen,v.ndist,v.distcode,0,v.work,Et),v.distbits=Et.bits,ht){I.msg="invalid distances set",v.mode=xe;break}if(v.mode=Fe,q===k)break e;case Fe:v.mode=ve;case ve:if(j>=6&&m>=258){I.next_out=U,I.avail_out=m,I.next_in=l,I.avail_in=j,v.hold=N,v.bits=z,u(I,ee),U=I.next_out,fe=I.output,m=I.avail_out,l=I.next_in,Z=I.input,j=I.avail_in,N=v.hold,z=v.bits,v.mode===me&&(v.back=-1);break}for(v.back=0;Le=v.lencode[N&(1<<v.lenbits)-1],be=Le>>>24,je=Le>>>16&255,Je=Le&65535,!(be<=z);){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(je&&!(je&240)){for(rt=be,Yt=je,Xt=Je;Le=v.lencode[Xt+((N&(1<<rt+Yt)-1)>>rt)],be=Le>>>24,je=Le>>>16&255,Je=Le&65535,!(rt+be<=z);){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}N>>>=rt,z-=rt,v.back+=rt}if(N>>>=be,z-=be,v.back+=be,v.length=Je,je===0){v.mode=Ee;break}if(je&32){v.back=-1,v.mode=me;break}if(je&64){I.msg="invalid literal/length code",v.mode=xe;break}v.extra=je&15,v.mode=Ge;case Ge:if(v.extra){for(pt=v.extra;z<pt;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}v.length+=N&(1<<v.extra)-1,N>>>=v.extra,z-=v.extra,v.back+=v.extra}v.was=v.length,v.mode=Pe;case Pe:for(;Le=v.distcode[N&(1<<v.distbits)-1],be=Le>>>24,je=Le>>>16&255,Je=Le&65535,!(be<=z);){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(!(je&240)){for(rt=be,Yt=je,Xt=Je;Le=v.distcode[Xt+((N&(1<<rt+Yt)-1)>>rt)],be=Le>>>24,je=Le>>>16&255,Je=Le&65535,!(rt+be<=z);){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}N>>>=rt,z-=rt,v.back+=rt}if(N>>>=be,z-=be,v.back+=be,je&64){I.msg="invalid distance code",v.mode=xe;break}v.offset=Je,v.extra=je&15,v.mode=Ae;case Ae:if(v.extra){for(pt=v.extra;z<pt;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}v.offset+=N&(1<<v.extra)-1,N>>>=v.extra,z-=v.extra,v.back+=v.extra}if(v.offset>v.dmax){I.msg="invalid distance too far back",v.mode=xe;break}v.mode=Be;case Be:if(m===0)break e;if(ie=ee-m,v.offset>ie){if(ie=v.offset-ie,ie>v.whave&&v.sane){I.msg="invalid distance too far back",v.mode=xe;break}ie>v.wnext?(ie-=v.wnext,ge=v.wsize-ie):ge=v.wnext-ie,ie>v.length&&(ie=v.length),_t=v.window}else _t=fe,ge=U-v.offset,ie=v.length;ie>m&&(ie=m),m-=ie,v.length-=ie;do fe[U++]=_t[ge++];while(--ie);v.length===0&&(v.mode=ve);break;case Ee:if(m===0)break e;fe[U++]=v.length,m--,v.mode=ve;break;case Ke:if(v.wrap){for(;z<32;){if(j===0)break e;j--,N|=Z[l++]<<z,z+=8}if(ee-=m,I.total_out+=ee,v.total+=ee,ee&&(I.adler=v.check=v.flags?o(v.check,fe,ee,U-ee):a(v.check,fe,ee,U-ee)),ee=m,(v.flags?N:st(N))!==v.check){I.msg="incorrect data check",v.mode=xe;break}N=0,z=0}v.mode=Ue;case Ue:if(v.wrap&&v.flags){for(;z<32;){if(j===0)break e;j--,N+=Z[l++]<<z,z+=8}if(N!==(v.total&4294967295)){I.msg="incorrect length check",v.mode=xe;break}N=0,z=0}v.mode=ot;case ot:ht=p;break e;case xe:ht=O;break e;case Ze:return _;case mt:default:return D}return I.next_out=U,I.avail_out=m,I.next_in=l,I.avail_in=j,v.hold=N,v.bits=z,(v.wsize||ee!==I.avail_out&&v.mode<xe&&(v.mode<Ke||q!==g))&&jt(I,I.output,I.next_out,ee-I.avail_out),ae-=I.avail_in,ee-=I.avail_out,I.total_in+=ae,I.total_out+=ee,v.total+=ee,v.wrap&&ee&&(I.adler=v.check=v.flags?o(v.check,fe,ee,I.next_out-ee):a(v.check,fe,ee,I.next_out-ee)),I.data_type=v.bits+(v.last?64:0)+(v.mode===me?128:0)+(v.mode===Fe||v.mode===le?256:0),(ae===0&&ee===0||q===g)&&ht===d&&(ht=A),ht}function G(I){if(!I||!I.state)return D;var q=I.state;return q.window&&(q.window=null),I.state=null,d}function X(I,q){var v;return!I||!I.state||(v=I.state,!(v.wrap&2))?D:(v.head=q,q.done=!1,d)}function re(I,q){var v=q.length,Z,fe,l;return!I||!I.state||(Z=I.state,Z.wrap!==0&&Z.mode!==ne)?D:Z.mode===ne&&(fe=1,fe=a(fe,q,v,0),fe!==Z.check)?O:(l=jt(I,q,v,v),l?(Z.mode=Ze,_):(Z.havedict=1,d))}r.inflateReset=at,r.inflateReset2=Ot,r.inflateResetKeep=yt,r.inflateInit=ut,r.inflateInit2=bt,r.inflate=E,r.inflateEnd=G,r.inflateGetHeader=X,r.inflateSetDictionary=re,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,i,r){var s=t("../utils/common"),a=15,o=852,u=592,h=0,f=1,c=2,b=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],C=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],k=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];i.exports=function(p,y,D,O,_,A,S,R){var M=R.bits,P=0,H=0,V=0,te=0,ce=0,he=0,ue=0,se=0,ne=0,me=0,Re,De,le,Se,_e,$e=null,He=0,Fe,ve=new s.Buf16(a+1),Ge=new s.Buf16(a+1),Pe=null,Ae=0,Be,Ee,Ke;for(P=0;P<=a;P++)ve[P]=0;for(H=0;H<O;H++)ve[y[D+H]]++;for(ce=M,te=a;te>=1&&ve[te]===0;te--);if(ce>te&&(ce=te),te===0)return _[A++]=1<<24|64<<16|0,_[A++]=1<<24|64<<16|0,R.bits=1,0;for(V=1;V<te&&ve[V]===0;V++);for(ce<V&&(ce=V),se=1,P=1;P<=a;P++)if(se<<=1,se-=ve[P],se<0)return-1;if(se>0&&(p===h||te!==1))return-1;for(Ge[1]=0,P=1;P<a;P++)Ge[P+1]=Ge[P]+ve[P];for(H=0;H<O;H++)y[D+H]!==0&&(S[Ge[y[D+H]]++]=H);if(p===h?($e=Pe=S,Fe=19):p===f?($e=b,He-=257,Pe=g,Ae-=257,Fe=256):($e=C,Pe=k,Fe=-1),me=0,H=0,P=V,_e=A,he=ce,ue=0,le=-1,ne=1<<ce,Se=ne-1,p===f&&ne>o||p===c&&ne>u)return 1;for(;;){Be=P-ue,S[H]<Fe?(Ee=0,Ke=S[H]):S[H]>Fe?(Ee=Pe[Ae+S[H]],Ke=$e[He+S[H]]):(Ee=96,Ke=0),Re=1<<P-ue,De=1<<he,V=De;do De-=Re,_[_e+(me>>ue)+De]=Be<<24|Ee<<16|Ke|0;while(De!==0);for(Re=1<<P-1;me&Re;)Re>>=1;if(Re!==0?(me&=Re-1,me+=Re):me=0,H++,--ve[P]===0){if(P===te)break;P=y[D+S[H]]}if(P>ce&&(me&Se)!==le){for(ue===0&&(ue=ce),_e+=V,he=P-ue,se=1<<he;he+ue<te&&(se-=ve[he+ue],!(se<=0));)he++,se<<=1;if(ne+=1<<he,p===f&&ne>o||p===c&&ne>u)return 1;le=me&Se,_[le]=ce<<24|he<<16|_e-A|0}}return me!==0&&(_[_e+me]=P-ue<<24|64<<16|0),R.bits=ce,0}},{"../utils/common":41}],51:[function(t,i,r){i.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,i,r){var s=t("../utils/common"),a=4,o=0,u=1,h=2;function f(E){for(var G=E.length;--G>=0;)E[G]=0}var c=0,b=1,g=2,C=3,k=258,d=29,p=256,y=p+1+d,D=30,O=19,_=2*y+1,A=15,S=16,R=7,M=256,P=16,H=17,V=18,te=[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],ce=[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],he=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],se=512,ne=new Array((y+2)*2);f(ne);var me=new Array(D*2);f(me);var Re=new Array(se);f(Re);var De=new Array(k-C+1);f(De);var le=new Array(d);f(le);var Se=new Array(D);f(Se);function _e(E,G,X,re,I){this.static_tree=E,this.extra_bits=G,this.extra_base=X,this.elems=re,this.max_length=I,this.has_stree=E&&E.length}var $e,He,Fe;function ve(E,G){this.dyn_tree=E,this.max_code=0,this.stat_desc=G}function Ge(E){return E<256?Re[E]:Re[256+(E>>>7)]}function Pe(E,G){E.pending_buf[E.pending++]=G&255,E.pending_buf[E.pending++]=G>>>8&255}function Ae(E,G,X){E.bi_valid>S-X?(E.bi_buf|=G<<E.bi_valid&65535,Pe(E,E.bi_buf),E.bi_buf=G>>S-E.bi_valid,E.bi_valid+=X-S):(E.bi_buf|=G<<E.bi_valid&65535,E.bi_valid+=X)}function Be(E,G,X){Ae(E,X[G*2],X[G*2+1])}function Ee(E,G){var X=0;do X|=E&1,E>>>=1,X<<=1;while(--G>0);return X>>>1}function Ke(E){E.bi_valid===16?(Pe(E,E.bi_buf),E.bi_buf=0,E.bi_valid=0):E.bi_valid>=8&&(E.pending_buf[E.pending++]=E.bi_buf&255,E.bi_buf>>=8,E.bi_valid-=8)}function Ue(E,G){var X=G.dyn_tree,re=G.max_code,I=G.stat_desc.static_tree,q=G.stat_desc.has_stree,v=G.stat_desc.extra_bits,Z=G.stat_desc.extra_base,fe=G.stat_desc.max_length,l,U,j,m,N,z,ae=0;for(m=0;m<=A;m++)E.bl_count[m]=0;for(X[E.heap[E.heap_max]*2+1]=0,l=E.heap_max+1;l<_;l++)U=E.heap[l],m=X[X[U*2+1]*2+1]+1,m>fe&&(m=fe,ae++),X[U*2+1]=m,!(U>re)&&(E.bl_count[m]++,N=0,U>=Z&&(N=v[U-Z]),z=X[U*2],E.opt_len+=z*(m+N),q&&(E.static_len+=z*(I[U*2+1]+N)));if(ae!==0){do{for(m=fe-1;E.bl_count[m]===0;)m--;E.bl_count[m]--,E.bl_count[m+1]+=2,E.bl_count[fe]--,ae-=2}while(ae>0);for(m=fe;m!==0;m--)for(U=E.bl_count[m];U!==0;)j=E.heap[--l],!(j>re)&&(X[j*2+1]!==m&&(E.opt_len+=(m-X[j*2+1])*X[j*2],X[j*2+1]=m),U--)}}function ot(E,G,X){var re=new Array(A+1),I=0,q,v;for(q=1;q<=A;q++)re[q]=I=I+X[q-1]<<1;for(v=0;v<=G;v++){var Z=E[v*2+1];Z!==0&&(E[v*2]=Ee(re[Z]++,Z))}}function xe(){var E,G,X,re,I,q=new Array(A+1);for(X=0,re=0;re<d-1;re++)for(le[re]=X,E=0;E<1<<te[re];E++)De[X++]=re;for(De[X-1]=re,I=0,re=0;re<16;re++)for(Se[re]=I,E=0;E<1<<ce[re];E++)Re[I++]=re;for(I>>=7;re<D;re++)for(Se[re]=I<<7,E=0;E<1<<ce[re]-7;E++)Re[256+I++]=re;for(G=0;G<=A;G++)q[G]=0;for(E=0;E<=143;)ne[E*2+1]=8,E++,q[8]++;for(;E<=255;)ne[E*2+1]=9,E++,q[9]++;for(;E<=279;)ne[E*2+1]=7,E++,q[7]++;for(;E<=287;)ne[E*2+1]=8,E++,q[8]++;for(ot(ne,y+1,q),E=0;E<D;E++)me[E*2+1]=5,me[E*2]=Ee(E,5);$e=new _e(ne,te,p+1,y,A),He=new _e(me,ce,0,D,A),Fe=new _e(new Array(0),he,0,O,R)}function Ze(E){var G;for(G=0;G<y;G++)E.dyn_ltree[G*2]=0;for(G=0;G<D;G++)E.dyn_dtree[G*2]=0;for(G=0;G<O;G++)E.bl_tree[G*2]=0;E.dyn_ltree[M*2]=1,E.opt_len=E.static_len=0,E.last_lit=E.matches=0}function mt(E){E.bi_valid>8?Pe(E,E.bi_buf):E.bi_valid>0&&(E.pending_buf[E.pending++]=E.bi_buf),E.bi_buf=0,E.bi_valid=0}function it(E,G,X,re){mt(E),Pe(E,X),Pe(E,~X),s.arraySet(E.pending_buf,E.window,G,X,E.pending),E.pending+=X}function et(E,G,X,re){var I=G*2,q=X*2;return E[I]<E[q]||E[I]===E[q]&&re[G]<=re[X]}function Ie(E,G,X){for(var re=E.heap[X],I=X<<1;I<=E.heap_len&&(I<E.heap_len&&et(G,E.heap[I+1],E.heap[I],E.depth)&&I++,!et(G,re,E.heap[I],E.depth));)E.heap[X]=E.heap[I],X=I,I<<=1;E.heap[X]=re}function de(E,G,X){var re,I,q=0,v,Z;if(E.last_lit!==0)do re=E.pending_buf[E.d_buf+q*2]<<8|E.pending_buf[E.d_buf+q*2+1],I=E.pending_buf[E.l_buf+q],q++,re===0?Be(E,I,G):(v=De[I],Be(E,v+p+1,G),Z=te[v],Z!==0&&(I-=le[v],Ae(E,I,Z)),re--,v=Ge(re),Be(E,v,X),Z=ce[v],Z!==0&&(re-=Se[v],Ae(E,re,Z)));while(q<E.last_lit);Be(E,M,G)}function st(E,G){var X=G.dyn_tree,re=G.stat_desc.static_tree,I=G.stat_desc.has_stree,q=G.stat_desc.elems,v,Z,fe=-1,l;for(E.heap_len=0,E.heap_max=_,v=0;v<q;v++)X[v*2]!==0?(E.heap[++E.heap_len]=fe=v,E.depth[v]=0):X[v*2+1]=0;for(;E.heap_len<2;)l=E.heap[++E.heap_len]=fe<2?++fe:0,X[l*2]=1,E.depth[l]=0,E.opt_len--,I&&(E.static_len-=re[l*2+1]);for(G.max_code=fe,v=E.heap_len>>1;v>=1;v--)Ie(E,X,v);l=q;do v=E.heap[1],E.heap[1]=E.heap[E.heap_len--],Ie(E,X,1),Z=E.heap[1],E.heap[--E.heap_max]=v,E.heap[--E.heap_max]=Z,X[l*2]=X[v*2]+X[Z*2],E.depth[l]=(E.depth[v]>=E.depth[Z]?E.depth[v]:E.depth[Z])+1,X[v*2+1]=X[Z*2+1]=l,E.heap[1]=l++,Ie(E,X,1);while(E.heap_len>=2);E.heap[--E.heap_max]=E.heap[1],Ue(E,G),ot(X,fe,E.bl_count)}function It(E,G,X){var re,I=-1,q,v=G[0*2+1],Z=0,fe=7,l=4;for(v===0&&(fe=138,l=3),G[(X+1)*2+1]=65535,re=0;re<=X;re++)q=v,v=G[(re+1)*2+1],!(++Z<fe&&q===v)&&(Z<l?E.bl_tree[q*2]+=Z:q!==0?(q!==I&&E.bl_tree[q*2]++,E.bl_tree[P*2]++):Z<=10?E.bl_tree[H*2]++:E.bl_tree[V*2]++,Z=0,I=q,v===0?(fe=138,l=3):q===v?(fe=6,l=3):(fe=7,l=4))}function yt(E,G,X){var re,I=-1,q,v=G[0*2+1],Z=0,fe=7,l=4;for(v===0&&(fe=138,l=3),re=0;re<=X;re++)if(q=v,v=G[(re+1)*2+1],!(++Z<fe&&q===v)){if(Z<l)do Be(E,q,E.bl_tree);while(--Z!==0);else q!==0?(q!==I&&(Be(E,q,E.bl_tree),Z--),Be(E,P,E.bl_tree),Ae(E,Z-3,2)):Z<=10?(Be(E,H,E.bl_tree),Ae(E,Z-3,3)):(Be(E,V,E.bl_tree),Ae(E,Z-11,7));Z=0,I=q,v===0?(fe=138,l=3):q===v?(fe=6,l=3):(fe=7,l=4)}}function at(E){var G;for(It(E,E.dyn_ltree,E.l_desc.max_code),It(E,E.dyn_dtree,E.d_desc.max_code),st(E,E.bl_desc),G=O-1;G>=3&&E.bl_tree[ue[G]*2+1]===0;G--);return E.opt_len+=3*(G+1)+5+5+4,G}function Ot(E,G,X,re){var I;for(Ae(E,G-257,5),Ae(E,X-1,5),Ae(E,re-4,4),I=0;I<re;I++)Ae(E,E.bl_tree[ue[I]*2+1],3);yt(E,E.dyn_ltree,G-1),yt(E,E.dyn_dtree,X-1)}function bt(E){var G=4093624447,X;for(X=0;X<=31;X++,G>>>=1)if(G&1&&E.dyn_ltree[X*2]!==0)return o;if(E.dyn_ltree[9*2]!==0||E.dyn_ltree[10*2]!==0||E.dyn_ltree[13*2]!==0)return u;for(X=32;X<p;X++)if(E.dyn_ltree[X*2]!==0)return u;return o}var ut=!1;function Bt(E){ut||(xe(),ut=!0),E.l_desc=new ve(E.dyn_ltree,$e),E.d_desc=new ve(E.dyn_dtree,He),E.bl_desc=new ve(E.bl_tree,Fe),E.bi_buf=0,E.bi_valid=0,Ze(E)}function wt(E,G,X,re){Ae(E,(c<<1)+(re?1:0),3),it(E,G,X)}function Ye(E){Ae(E,b<<1,3),Be(E,M,ne),Ke(E)}function lt(E,G,X,re){var I,q,v=0;E.level>0?(E.strm.data_type===h&&(E.strm.data_type=bt(E)),st(E,E.l_desc),st(E,E.d_desc),v=at(E),I=E.opt_len+3+7>>>3,q=E.static_len+3+7>>>3,q<=I&&(I=q)):I=q=X+5,X+4<=I&&G!==-1?wt(E,G,X,re):E.strategy===a||q===I?(Ae(E,(b<<1)+(re?1:0),3),de(E,ne,me)):(Ae(E,(g<<1)+(re?1:0),3),Ot(E,E.l_desc.max_code+1,E.d_desc.max_code+1,v+1),de(E,E.dyn_ltree,E.dyn_dtree)),Ze(E),re&&mt(E)}function jt(E,G,X){return E.pending_buf[E.d_buf+E.last_lit*2]=G>>>8&255,E.pending_buf[E.d_buf+E.last_lit*2+1]=G&255,E.pending_buf[E.l_buf+E.last_lit]=X&255,E.last_lit++,G===0?E.dyn_ltree[X*2]++:(E.matches++,G--,E.dyn_ltree[(De[X]+p+1)*2]++,E.dyn_dtree[Ge(G)*2]++),E.last_lit===E.lit_bufsize-1}r._tr_init=Bt,r._tr_stored_block=wt,r._tr_flush_block=lt,r._tr_tally=jt,r._tr_align=Ye},{"../utils/common":41}],53:[function(t,i,r){function s(){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}i.exports=s},{}],54:[function(t,i,r){(function(s){(function(a,o){if(a.setImmediate)return;var u=1,h={},f=!1,c=a.document,b;function g(R){typeof R!="function"&&(R=new Function(""+R));for(var M=new Array(arguments.length-1),P=0;P<M.length;P++)M[P]=arguments[P+1];var H={callback:R,args:M};return h[u]=H,b(u),u++}function C(R){delete h[R]}function k(R){var M=R.callback,P=R.args;switch(P.length){case 0:M();break;case 1:M(P[0]);break;case 2:M(P[0],P[1]);break;case 3:M(P[0],P[1],P[2]);break;default:M.apply(o,P);break}}function d(R){if(f)setTimeout(d,0,R);else{var M=h[R];if(M){f=!0;try{k(M)}finally{C(R),f=!1}}}}function p(){b=function(R){process.nextTick(function(){d(R)})}}function y(){if(a.postMessage&&!a.importScripts){var R=!0,M=a.onmessage;return a.onmessage=function(){R=!1},a.postMessage("","*"),a.onmessage=M,R}}function D(){var R="setImmediate$"+Math.random()+"$",M=function(P){P.source===a&&typeof P.data=="string"&&P.data.indexOf(R)===0&&d(+P.data.slice(R.length))};a.addEventListener?a.addEventListener("message",M,!1):a.attachEvent("onmessage",M),b=function(P){a.postMessage(R+P,"*")}}function O(){var R=new MessageChannel;R.port1.onmessage=function(M){var P=M.data;d(P)},b=function(M){R.port2.postMessage(M)}}function _(){var R=c.documentElement;b=function(M){var P=c.createElement("script");P.onreadystatechange=function(){d(M),P.onreadystatechange=null,R.removeChild(P),P=null},R.appendChild(P)}}function A(){b=function(R){setTimeout(d,0,R)}}var S=Object.getPrototypeOf&&Object.getPrototypeOf(a);S=S&&S.setTimeout?S:a,{}.toString.call(a.process)==="[object process]"?p():y()?D():a.MessageChannel?O():c&&"onreadystatechange"in c.createElement("script")?_():A(),S.setImmediate=g,S.clearImmediate=C})(typeof self>"u"?typeof s>"u"?this:s:self)}).call(this,typeof Oe.commonjsGlobal<"u"?Oe.commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(qs);var $u=qs.exports;const Ku=Oe.getDefaultExportFromCjs($u);class Ju{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new Ku}catch{throw new Error("JSZip lib not loaded")}}open(e,t){return this.zip.loadAsync(e,{base64:t})}openUrl(e,t){return xi(e,"binary").then((function(i){return this.zip.loadAsync(i,{base64:t})}).bind(this))}request(e,t){var i=new we,r,s=new Ut(e);return t||(t=s.extension),t=="blob"?r=this.getBlob(e):r=this.getText(e),r?r.then((function(a){let o=this.handleResponse(a,t);i.resolve(o)}).bind(this)):i.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),i.promise}handleResponse(e,t){var i;return t=="json"?i=JSON.parse(e):Ei(t)?i=Nt(e,"text/xml"):t=="xhtml"?i=Nt(e,"application/xhtml+xml"):t=="html"||t=="htm"?i=Nt(e,"text/html"):i=e,i}getBlob(e,t){var i=window.decodeURIComponent(e.substr(1)),r=this.zip.file(i);if(r)return t=t||ai.lookup(r.name),r.async("uint8array").then(function(s){return new Blob([s],{type:t})})}getText(e,t){var i=window.decodeURIComponent(e.substr(1)),r=this.zip.file(i);if(r)return r.async("string").then(function(s){return s})}getBase64(e,t){var i=window.decodeURIComponent(e.substr(1)),r=this.zip.file(i);if(r)return t=t||ai.lookup(r.name),r.async("base64").then(function(s){return"data:"+t+";base64,"+s})}createUrl(e,t){var i=new we,r=window.URL||window.webkitURL||window.mozURL,s,a,o=t&&t.base64;return e in this.urlCache?(i.resolve(this.urlCache[e]),i.promise):(o?(a=this.getBase64(e),a&&a.then((function(u){this.urlCache[e]=u,i.resolve(u)}).bind(this))):(a=this.getBlob(e),a&&a.then((function(u){s=r.createObjectURL(u),this.urlCache[e]=s,i.resolve(s)}).bind(this))),a||i.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),i.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.zip=void 0,this.urlCache={}}}var Ws={exports:{}};/*!
17
+ localForage -- Offline Storage, Improved
18
+ Version 1.10.0
19
+ https://localforage.github.io/localForage
20
+ (c) 2013-2017 Mozilla, Apache License 2.0
21
+ */(function(n,e){(function(t){n.exports=t()})(function(){return function t(i,r,s){function a(h,f){if(!r[h]){if(!i[h]){var c=typeof Oe.commonjsRequire=="function"&&Oe.commonjsRequire;if(!f&&c)return c(h,!0);if(o)return o(h,!0);var b=new Error("Cannot find module '"+h+"'");throw b.code="MODULE_NOT_FOUND",b}var g=r[h]={exports:{}};i[h][0].call(g.exports,function(C){var k=i[h][1][C];return a(k||C)},g,g.exports,t,i,r,s)}return r[h].exports}for(var o=typeof Oe.commonjsRequire=="function"&&Oe.commonjsRequire,u=0;u<s.length;u++)a(s[u]);return a}({1:[function(t,i,r){(function(s){var a=s.MutationObserver||s.WebKitMutationObserver,o;if(a){var u=0,h=new a(C),f=s.document.createTextNode("");h.observe(f,{characterData:!0}),o=function(){f.data=u=++u%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var c=new s.MessageChannel;c.port1.onmessage=C,o=function(){c.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?o=function(){var d=s.document.createElement("script");d.onreadystatechange=function(){C(),d.onreadystatechange=null,d.parentNode.removeChild(d),d=null},s.document.documentElement.appendChild(d)}:o=function(){setTimeout(C,0)};var b,g=[];function C(){b=!0;for(var d,p,y=g.length;y;){for(p=g,g=[],d=-1;++d<y;)p[d]();y=g.length}b=!1}i.exports=k;function k(d){g.push(d)===1&&!b&&o()}}).call(this,typeof Oe.commonjsGlobal<"u"?Oe.commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,i,r){var s=t(1);function a(){}var o={},u=["REJECTED"],h=["FULFILLED"],f=["PENDING"];i.exports=c;function c(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,_!==a&&k(this,_)}c.prototype.catch=function(_){return this.then(null,_)},c.prototype.then=function(_,A){if(typeof _!="function"&&this.state===h||typeof A!="function"&&this.state===u)return this;var S=new this.constructor(a);if(this.state!==f){var R=this.state===h?_:A;g(S,R,this.outcome)}else this.queue.push(new b(S,_,A));return S};function b(_,A,S){this.promise=_,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof S=="function"&&(this.onRejected=S,this.callRejected=this.otherCallRejected)}b.prototype.callFulfilled=function(_){o.resolve(this.promise,_)},b.prototype.otherCallFulfilled=function(_){g(this.promise,this.onFulfilled,_)},b.prototype.callRejected=function(_){o.reject(this.promise,_)},b.prototype.otherCallRejected=function(_){g(this.promise,this.onRejected,_)};function g(_,A,S){s(function(){var R;try{R=A(S)}catch(M){return o.reject(_,M)}R===_?o.reject(_,new TypeError("Cannot resolve promise with itself")):o.resolve(_,R)})}o.resolve=function(_,A){var S=d(C,A);if(S.status==="error")return o.reject(_,S.value);var R=S.value;if(R)k(_,R);else{_.state=h,_.outcome=A;for(var M=-1,P=_.queue.length;++M<P;)_.queue[M].callFulfilled(A)}return _},o.reject=function(_,A){_.state=u,_.outcome=A;for(var S=-1,R=_.queue.length;++S<R;)_.queue[S].callRejected(A);return _};function C(_){var A=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof A=="function")return function(){A.apply(_,arguments)}}function k(_,A){var S=!1;function R(V){S||(S=!0,o.reject(_,V))}function M(V){S||(S=!0,o.resolve(_,V))}function P(){A(M,R)}var H=d(P);H.status==="error"&&R(H.value)}function d(_,A){var S={};try{S.value=_(A),S.status="success"}catch(R){S.status="error",S.value=R}return S}c.resolve=p;function p(_){return _ instanceof this?_:o.resolve(new this(a),_)}c.reject=y;function y(_){var A=new this(a);return o.reject(A,_)}c.all=D;function D(_){var A=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=_.length,R=!1;if(!S)return this.resolve([]);for(var M=new Array(S),P=0,H=-1,V=new this(a);++H<S;)te(_[H],H);return V;function te(ce,he){A.resolve(ce).then(ue,function(se){R||(R=!0,o.reject(V,se))});function ue(se){M[he]=se,++P===S&&!R&&(R=!0,o.resolve(V,M))}}}c.race=O;function O(_){var A=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=_.length,R=!1;if(!S)return this.resolve([]);for(var M=-1,P=new this(a);++M<S;)H(_[M]);return P;function H(V){A.resolve(V).then(function(te){R||(R=!0,o.resolve(P,te))},function(te){R||(R=!0,o.reject(P,te))})}}},{1:1}],3:[function(t,i,r){(function(s){typeof s.Promise!="function"&&(s.Promise=t(2))}).call(this,typeof Oe.commonjsGlobal<"u"?Oe.commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,i,r){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w};function a(w,T){if(!(w instanceof T))throw new TypeError("Cannot call a class as a function")}function o(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var u=o();function h(){try{if(!u||!u.open)return!1;var w=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),T=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!w||T)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(w,T){w=w||[],T=T||{};try{return new Blob(w,T)}catch(B){if(B.name!=="TypeError")throw B;for(var x=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,L=new x,F=0;F<w.length;F+=1)L.append(w[F]);return L.getBlob(T.type)}}typeof Promise>"u"&&t(3);var c=Promise;function b(w,T){T&&w.then(function(x){T(null,x)},function(x){T(x)})}function g(w,T,x){typeof T=="function"&&w.then(T),typeof x=="function"&&w.catch(x)}function C(w){return typeof w!="string"&&(console.warn(w+" used as a key, but it is not a string."),w=String(w)),w}function k(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",p=void 0,y={},D=Object.prototype.toString,O="readonly",_="readwrite";function A(w){for(var T=w.length,x=new ArrayBuffer(T),L=new Uint8Array(x),F=0;F<T;F++)L[F]=w.charCodeAt(F);return x}function S(w){return new c(function(T){var x=w.transaction(d,_),L=f([""]);x.objectStore(d).put(L,"key"),x.onabort=function(F){F.preventDefault(),F.stopPropagation(),T(!1)},x.oncomplete=function(){var F=navigator.userAgent.match(/Chrome\/(\d+)/),B=navigator.userAgent.match(/Edge\//);T(B||!F||parseInt(F[1],10)>=43)}}).catch(function(){return!1})}function R(w){return typeof p=="boolean"?c.resolve(p):S(w).then(function(T){return p=T,p})}function M(w){var T=y[w.name],x={};x.promise=new c(function(L,F){x.resolve=L,x.reject=F}),T.deferredOperations.push(x),T.dbReady?T.dbReady=T.dbReady.then(function(){return x.promise}):T.dbReady=x.promise}function P(w){var T=y[w.name],x=T.deferredOperations.pop();if(x)return x.resolve(),x.promise}function H(w,T){var x=y[w.name],L=x.deferredOperations.pop();if(L)return L.reject(T),L.promise}function V(w,T){return new c(function(x,L){if(y[w.name]=y[w.name]||le(),w.db)if(T)M(w),w.db.close();else return x(w.db);var F=[w.name];T&&F.push(w.version);var B=u.open.apply(u,F);T&&(B.onupgradeneeded=function(W){var Y=B.result;try{Y.createObjectStore(w.storeName),W.oldVersion<=1&&Y.createObjectStore(d)}catch($){if($.name==="ConstraintError")console.warn('The database "'+w.name+'" has been upgraded from version '+W.oldVersion+" to version "+W.newVersion+', but the storage "'+w.storeName+'" already exists.');else throw $}}),B.onerror=function(W){W.preventDefault(),L(B.error)},B.onsuccess=function(){var W=B.result;W.onversionchange=function(Y){Y.target.close()},x(W),P(w)}})}function te(w){return V(w,!1)}function ce(w){return V(w,!0)}function he(w,T){if(!w.db)return!0;var x=!w.db.objectStoreNames.contains(w.storeName),L=w.version<w.db.version,F=w.version>w.db.version;if(L&&(w.version!==T&&console.warn('The database "'+w.name+`" can't be downgraded from version `+w.db.version+" to version "+w.version+"."),w.version=w.db.version),F||x){if(x){var B=w.db.version+1;B>w.version&&(w.version=B)}return!0}return!1}function ue(w){return new c(function(T,x){var L=new FileReader;L.onerror=x,L.onloadend=function(F){var B=btoa(F.target.result||"");T({__local_forage_encoded_blob:!0,data:B,type:w.type})},L.readAsBinaryString(w)})}function se(w){var T=A(atob(w.data));return f([T],{type:w.type})}function ne(w){return w&&w.__local_forage_encoded_blob}function me(w){var T=this,x=T._initReady().then(function(){var L=y[T._dbInfo.name];if(L&&L.dbReady)return L.dbReady});return g(x,w,w),x}function Re(w){M(w);for(var T=y[w.name],x=T.forages,L=0;L<x.length;L++){var F=x[L];F._dbInfo.db&&(F._dbInfo.db.close(),F._dbInfo.db=null)}return w.db=null,te(w).then(function(B){return w.db=B,he(w)?ce(w):B}).then(function(B){w.db=T.db=B;for(var W=0;W<x.length;W++)x[W]._dbInfo.db=B}).catch(function(B){throw H(w,B),B})}function De(w,T,x,L){L===void 0&&(L=1);try{var F=w.db.transaction(w.storeName,T);x(null,F)}catch(B){if(L>0&&(!w.db||B.name==="InvalidStateError"||B.name==="NotFoundError"))return c.resolve().then(function(){if(!w.db||B.name==="NotFoundError"&&!w.db.objectStoreNames.contains(w.storeName)&&w.version<=w.db.version)return w.db&&(w.version=w.db.version+1),ce(w)}).then(function(){return Re(w).then(function(){De(w,T,x,L-1)})}).catch(x);x(B)}}function le(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Se(w){var T=this,x={db:null};if(w)for(var L in w)x[L]=w[L];var F=y[x.name];F||(F=le(),y[x.name]=F),F.forages.push(T),T._initReady||(T._initReady=T.ready,T.ready=me);var B=[];function W(){return c.resolve()}for(var Y=0;Y<F.forages.length;Y++){var $=F.forages[Y];$!==T&&B.push($._initReady().catch(W))}var K=F.forages.slice(0);return c.all(B).then(function(){return x.db=F.db,te(x)}).then(function(J){return x.db=J,he(x,T._defaultConfig.version)?ce(x):J}).then(function(J){x.db=F.db=J,T._dbInfo=x;for(var oe=0;oe<K.length;oe++){var pe=K[oe];pe!==T&&(pe._dbInfo.db=x.db,pe._dbInfo.version=x.version)}})}function _e(w,T){var x=this;w=C(w);var L=new c(function(F,B){x.ready().then(function(){De(x._dbInfo,O,function(W,Y){if(W)return B(W);try{var $=Y.objectStore(x._dbInfo.storeName),K=$.get(w);K.onsuccess=function(){var J=K.result;J===void 0&&(J=null),ne(J)&&(J=se(J)),F(J)},K.onerror=function(){B(K.error)}}catch(J){B(J)}})}).catch(B)});return b(L,T),L}function $e(w,T){var x=this,L=new c(function(F,B){x.ready().then(function(){De(x._dbInfo,O,function(W,Y){if(W)return B(W);try{var $=Y.objectStore(x._dbInfo.storeName),K=$.openCursor(),J=1;K.onsuccess=function(){var oe=K.result;if(oe){var pe=oe.value;ne(pe)&&(pe=se(pe));var Ce=w(pe,oe.key,J++);Ce!==void 0?F(Ce):oe.continue()}else F()},K.onerror=function(){B(K.error)}}catch(oe){B(oe)}})}).catch(B)});return b(L,T),L}function He(w,T,x){var L=this;w=C(w);var F=new c(function(B,W){var Y;L.ready().then(function(){return Y=L._dbInfo,D.call(T)==="[object Blob]"?R(Y.db).then(function($){return $?T:ue(T)}):T}).then(function($){De(L._dbInfo,_,function(K,J){if(K)return W(K);try{var oe=J.objectStore(L._dbInfo.storeName);$===null&&($=void 0);var pe=oe.put($,w);J.oncomplete=function(){$===void 0&&($=null),B($)},J.onabort=J.onerror=function(){var Ce=pe.error?pe.error:pe.transaction.error;W(Ce)}}catch(Ce){W(Ce)}})}).catch(W)});return b(F,x),F}function Fe(w,T){var x=this;w=C(w);var L=new c(function(F,B){x.ready().then(function(){De(x._dbInfo,_,function(W,Y){if(W)return B(W);try{var $=Y.objectStore(x._dbInfo.storeName),K=$.delete(w);Y.oncomplete=function(){F()},Y.onerror=function(){B(K.error)},Y.onabort=function(){var J=K.error?K.error:K.transaction.error;B(J)}}catch(J){B(J)}})}).catch(B)});return b(L,T),L}function ve(w){var T=this,x=new c(function(L,F){T.ready().then(function(){De(T._dbInfo,_,function(B,W){if(B)return F(B);try{var Y=W.objectStore(T._dbInfo.storeName),$=Y.clear();W.oncomplete=function(){L()},W.onabort=W.onerror=function(){var K=$.error?$.error:$.transaction.error;F(K)}}catch(K){F(K)}})}).catch(F)});return b(x,w),x}function Ge(w){var T=this,x=new c(function(L,F){T.ready().then(function(){De(T._dbInfo,O,function(B,W){if(B)return F(B);try{var Y=W.objectStore(T._dbInfo.storeName),$=Y.count();$.onsuccess=function(){L($.result)},$.onerror=function(){F($.error)}}catch(K){F(K)}})}).catch(F)});return b(x,w),x}function Pe(w,T){var x=this,L=new c(function(F,B){if(w<0){F(null);return}x.ready().then(function(){De(x._dbInfo,O,function(W,Y){if(W)return B(W);try{var $=Y.objectStore(x._dbInfo.storeName),K=!1,J=$.openKeyCursor();J.onsuccess=function(){var oe=J.result;if(!oe){F(null);return}w===0||K?F(oe.key):(K=!0,oe.advance(w))},J.onerror=function(){B(J.error)}}catch(oe){B(oe)}})}).catch(B)});return b(L,T),L}function Ae(w){var T=this,x=new c(function(L,F){T.ready().then(function(){De(T._dbInfo,O,function(B,W){if(B)return F(B);try{var Y=W.objectStore(T._dbInfo.storeName),$=Y.openKeyCursor(),K=[];$.onsuccess=function(){var J=$.result;if(!J){L(K);return}K.push(J.key),J.continue()},$.onerror=function(){F($.error)}}catch(J){F(J)}})}).catch(F)});return b(x,w),x}function Be(w,T){T=k.apply(this,arguments);var x=this.config();w=typeof w!="function"&&w||{},w.name||(w.name=w.name||x.name,w.storeName=w.storeName||x.storeName);var L=this,F;if(!w.name)F=c.reject("Invalid arguments");else{var B=w.name===x.name&&L._dbInfo.db,W=B?c.resolve(L._dbInfo.db):te(w).then(function(Y){var $=y[w.name],K=$.forages;$.db=Y;for(var J=0;J<K.length;J++)K[J]._dbInfo.db=Y;return Y});w.storeName?F=W.then(function(Y){if(Y.objectStoreNames.contains(w.storeName)){var $=Y.version+1;M(w);var K=y[w.name],J=K.forages;Y.close();for(var oe=0;oe<J.length;oe++){var pe=J[oe];pe._dbInfo.db=null,pe._dbInfo.version=$}var Ce=new c(function(Te,Ve){var qe=u.open(w.name,$);qe.onerror=function(vt){var ci=qe.result;ci.close(),Ve(vt)},qe.onupgradeneeded=function(){var vt=qe.result;vt.deleteObjectStore(w.storeName)},qe.onsuccess=function(){var vt=qe.result;vt.close(),Te(vt)}});return Ce.then(function(Te){K.db=Te;for(var Ve=0;Ve<J.length;Ve++){var qe=J[Ve];qe._dbInfo.db=Te,P(qe._dbInfo)}}).catch(function(Te){throw(H(w,Te)||c.resolve()).catch(function(){}),Te})}}):F=W.then(function(Y){M(w);var $=y[w.name],K=$.forages;Y.close();for(var J=0;J<K.length;J++){var oe=K[J];oe._dbInfo.db=null}var pe=new c(function(Ce,Te){var Ve=u.deleteDatabase(w.name);Ve.onerror=function(){var qe=Ve.result;qe&&qe.close(),Te(Ve.error)},Ve.onblocked=function(){console.warn('dropInstance blocked for database "'+w.name+'" until all open connections are closed')},Ve.onsuccess=function(){var qe=Ve.result;qe&&qe.close(),Ce(qe)}});return pe.then(function(Ce){$.db=Ce;for(var Te=0;Te<K.length;Te++){var Ve=K[Te];P(Ve._dbInfo)}}).catch(function(Ce){throw(H(w,Ce)||c.resolve()).catch(function(){}),Ce})})}return b(F,T),F}var Ee={_driver:"asyncStorage",_initStorage:Se,_support:h(),iterate:$e,getItem:_e,setItem:He,removeItem:Fe,clear:ve,length:Ge,key:Pe,keys:Ae,dropInstance:Be};function Ke(){return typeof openDatabase=="function"}var Ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ot="~~local_forage_type~",xe=/^~~local_forage_type~([^~]+)~/,Ze="__lfsc__:",mt=Ze.length,it="arbf",et="blob",Ie="si08",de="ui08",st="uic8",It="si16",yt="si32",at="ur16",Ot="ui32",bt="fl32",ut="fl64",Bt=mt+it.length,wt=Object.prototype.toString;function Ye(w){var T=w.length*.75,x=w.length,L,F=0,B,W,Y,$;w[w.length-1]==="="&&(T--,w[w.length-2]==="="&&T--);var K=new ArrayBuffer(T),J=new Uint8Array(K);for(L=0;L<x;L+=4)B=Ue.indexOf(w[L]),W=Ue.indexOf(w[L+1]),Y=Ue.indexOf(w[L+2]),$=Ue.indexOf(w[L+3]),J[F++]=B<<2|W>>4,J[F++]=(W&15)<<4|Y>>2,J[F++]=(Y&3)<<6|$&63;return K}function lt(w){var T=new Uint8Array(w),x="",L;for(L=0;L<T.length;L+=3)x+=Ue[T[L]>>2],x+=Ue[(T[L]&3)<<4|T[L+1]>>4],x+=Ue[(T[L+1]&15)<<2|T[L+2]>>6],x+=Ue[T[L+2]&63];return T.length%3===2?x=x.substring(0,x.length-1)+"=":T.length%3===1&&(x=x.substring(0,x.length-2)+"=="),x}function jt(w,T){var x="";if(w&&(x=wt.call(w)),w&&(x==="[object ArrayBuffer]"||w.buffer&&wt.call(w.buffer)==="[object ArrayBuffer]")){var L,F=Ze;w instanceof ArrayBuffer?(L=w,F+=it):(L=w.buffer,x==="[object Int8Array]"?F+=Ie:x==="[object Uint8Array]"?F+=de:x==="[object Uint8ClampedArray]"?F+=st:x==="[object Int16Array]"?F+=It:x==="[object Uint16Array]"?F+=at:x==="[object Int32Array]"?F+=yt:x==="[object Uint32Array]"?F+=Ot:x==="[object Float32Array]"?F+=bt:x==="[object Float64Array]"?F+=ut:T(new Error("Failed to get type for BinaryArray"))),T(F+lt(L))}else if(x==="[object Blob]"){var B=new FileReader;B.onload=function(){var W=ot+w.type+"~"+lt(this.result);T(Ze+et+W)},B.readAsArrayBuffer(w)}else try{T(JSON.stringify(w))}catch(W){console.error("Couldn't convert value into a JSON string: ",w),T(null,W)}}function E(w){if(w.substring(0,mt)!==Ze)return JSON.parse(w);var T=w.substring(Bt),x=w.substring(mt,Bt),L;if(x===et&&xe.test(T)){var F=T.match(xe);L=F[1],T=T.substring(F[0].length)}var B=Ye(T);switch(x){case it:return B;case et:return f([B],{type:L});case Ie:return new Int8Array(B);case de:return new Uint8Array(B);case st:return new Uint8ClampedArray(B);case It:return new Int16Array(B);case at:return new Uint16Array(B);case yt:return new Int32Array(B);case Ot:return new Uint32Array(B);case bt:return new Float32Array(B);case ut:return new Float64Array(B);default:throw new Error("Unkown type: "+x)}}var G={serialize:jt,deserialize:E,stringToBuffer:Ye,bufferToString:lt};function X(w,T,x,L){w.executeSql("CREATE TABLE IF NOT EXISTS "+T.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],x,L)}function re(w){var T=this,x={db:null};if(w)for(var L in w)x[L]=typeof w[L]!="string"?w[L].toString():w[L];var F=new c(function(B,W){try{x.db=openDatabase(x.name,String(x.version),x.description,x.size)}catch(Y){return W(Y)}x.db.transaction(function(Y){X(Y,x,function(){T._dbInfo=x,B()},function($,K){W(K)})},W)});return x.serializer=G,F}function I(w,T,x,L,F,B){w.executeSql(x,L,F,function(W,Y){Y.code===Y.SYNTAX_ERR?W.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[T.storeName],function($,K){K.rows.length?B($,Y):X($,T,function(){$.executeSql(x,L,F,B)},B)},B):B(W,Y)},B)}function q(w,T){var x=this;w=C(w);var L=new c(function(F,B){x.ready().then(function(){var W=x._dbInfo;W.db.transaction(function(Y){I(Y,W,"SELECT * FROM "+W.storeName+" WHERE key = ? LIMIT 1",[w],function($,K){var J=K.rows.length?K.rows.item(0).value:null;J&&(J=W.serializer.deserialize(J)),F(J)},function($,K){B(K)})})}).catch(B)});return b(L,T),L}function v(w,T){var x=this,L=new c(function(F,B){x.ready().then(function(){var W=x._dbInfo;W.db.transaction(function(Y){I(Y,W,"SELECT * FROM "+W.storeName,[],function($,K){for(var J=K.rows,oe=J.length,pe=0;pe<oe;pe++){var Ce=J.item(pe),Te=Ce.value;if(Te&&(Te=W.serializer.deserialize(Te)),Te=w(Te,Ce.key,pe+1),Te!==void 0){F(Te);return}}F()},function($,K){B(K)})})}).catch(B)});return b(L,T),L}function Z(w,T,x,L){var F=this;w=C(w);var B=new c(function(W,Y){F.ready().then(function(){T===void 0&&(T=null);var $=T,K=F._dbInfo;K.serializer.serialize(T,function(J,oe){oe?Y(oe):K.db.transaction(function(pe){I(pe,K,"INSERT OR REPLACE INTO "+K.storeName+" (key, value) VALUES (?, ?)",[w,J],function(){W($)},function(Ce,Te){Y(Te)})},function(pe){if(pe.code===pe.QUOTA_ERR){if(L>0){W(Z.apply(F,[w,$,x,L-1]));return}Y(pe)}})})}).catch(Y)});return b(B,x),B}function fe(w,T,x){return Z.apply(this,[w,T,x,1])}function l(w,T){var x=this;w=C(w);var L=new c(function(F,B){x.ready().then(function(){var W=x._dbInfo;W.db.transaction(function(Y){I(Y,W,"DELETE FROM "+W.storeName+" WHERE key = ?",[w],function(){F()},function($,K){B(K)})})}).catch(B)});return b(L,T),L}function U(w){var T=this,x=new c(function(L,F){T.ready().then(function(){var B=T._dbInfo;B.db.transaction(function(W){I(W,B,"DELETE FROM "+B.storeName,[],function(){L()},function(Y,$){F($)})})}).catch(F)});return b(x,w),x}function j(w){var T=this,x=new c(function(L,F){T.ready().then(function(){var B=T._dbInfo;B.db.transaction(function(W){I(W,B,"SELECT COUNT(key) as c FROM "+B.storeName,[],function(Y,$){var K=$.rows.item(0).c;L(K)},function(Y,$){F($)})})}).catch(F)});return b(x,w),x}function m(w,T){var x=this,L=new c(function(F,B){x.ready().then(function(){var W=x._dbInfo;W.db.transaction(function(Y){I(Y,W,"SELECT key FROM "+W.storeName+" WHERE id = ? LIMIT 1",[w+1],function($,K){var J=K.rows.length?K.rows.item(0).key:null;F(J)},function($,K){B(K)})})}).catch(B)});return b(L,T),L}function N(w){var T=this,x=new c(function(L,F){T.ready().then(function(){var B=T._dbInfo;B.db.transaction(function(W){I(W,B,"SELECT key FROM "+B.storeName,[],function(Y,$){for(var K=[],J=0;J<$.rows.length;J++)K.push($.rows.item(J).key);L(K)},function(Y,$){F($)})})}).catch(F)});return b(x,w),x}function z(w){return new c(function(T,x){w.transaction(function(L){L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(F,B){for(var W=[],Y=0;Y<B.rows.length;Y++)W.push(B.rows.item(Y).name);T({db:w,storeNames:W})},function(F,B){x(B)})},function(L){x(L)})})}function ae(w,T){T=k.apply(this,arguments);var x=this.config();w=typeof w!="function"&&w||{},w.name||(w.name=w.name||x.name,w.storeName=w.storeName||x.storeName);var L=this,F;return w.name?F=new c(function(B){var W;w.name===x.name?W=L._dbInfo.db:W=openDatabase(w.name,"","",0),w.storeName?B({db:W,storeNames:[w.storeName]}):B(z(W))}).then(function(B){return new c(function(W,Y){B.db.transaction(function($){function K(Ce){return new c(function(Te,Ve){$.executeSql("DROP TABLE IF EXISTS "+Ce,[],function(){Te()},function(qe,vt){Ve(vt)})})}for(var J=[],oe=0,pe=B.storeNames.length;oe<pe;oe++)J.push(K(B.storeNames[oe]));c.all(J).then(function(){W()}).catch(function(Ce){Y(Ce)})},function($){Y($)})})}):F=c.reject("Invalid arguments"),b(F,T),F}var ee={_driver:"webSQLStorage",_initStorage:re,_support:Ke(),iterate:v,getItem:q,setItem:fe,removeItem:l,clear:U,length:j,key:m,keys:N,dropInstance:ae};function ie(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ge(w,T){var x=w.name+"/";return w.storeName!==T.storeName&&(x+=w.storeName+"/"),x}function _t(){var w="_localforage_support_test";try{return localStorage.setItem(w,!0),localStorage.removeItem(w),!1}catch{return!0}}function Le(){return!_t()||localStorage.length>0}function be(w){var T=this,x={};if(w)for(var L in w)x[L]=w[L];return x.keyPrefix=ge(w,T._defaultConfig),Le()?(T._dbInfo=x,x.serializer=G,c.resolve()):c.reject()}function je(w){var T=this,x=T.ready().then(function(){for(var L=T._dbInfo.keyPrefix,F=localStorage.length-1;F>=0;F--){var B=localStorage.key(F);B.indexOf(L)===0&&localStorage.removeItem(B)}});return b(x,w),x}function Je(w,T){var x=this;w=C(w);var L=x.ready().then(function(){var F=x._dbInfo,B=localStorage.getItem(F.keyPrefix+w);return B&&(B=F.serializer.deserialize(B)),B});return b(L,T),L}function rt(w,T){var x=this,L=x.ready().then(function(){for(var F=x._dbInfo,B=F.keyPrefix,W=B.length,Y=localStorage.length,$=1,K=0;K<Y;K++){var J=localStorage.key(K);if(J.indexOf(B)===0){var oe=localStorage.getItem(J);if(oe&&(oe=F.serializer.deserialize(oe)),oe=w(oe,J.substring(W),$++),oe!==void 0)return oe}}});return b(L,T),L}function Yt(w,T){var x=this,L=x.ready().then(function(){var F=x._dbInfo,B;try{B=localStorage.key(w)}catch{B=null}return B&&(B=B.substring(F.keyPrefix.length)),B});return b(L,T),L}function Xt(w){var T=this,x=T.ready().then(function(){for(var L=T._dbInfo,F=localStorage.length,B=[],W=0;W<F;W++){var Y=localStorage.key(W);Y.indexOf(L.keyPrefix)===0&&B.push(Y.substring(L.keyPrefix.length))}return B});return b(x,w),x}function ze(w){var T=this,x=T.keys().then(function(L){return L.length});return b(x,w),x}function ht(w,T){var x=this;w=C(w);var L=x.ready().then(function(){var F=x._dbInfo;localStorage.removeItem(F.keyPrefix+w)});return b(L,T),L}function Xe(w,T,x){var L=this;w=C(w);var F=L.ready().then(function(){T===void 0&&(T=null);var B=T;return new c(function(W,Y){var $=L._dbInfo;$.serializer.serialize(T,function(K,J){if(J)Y(J);else try{localStorage.setItem($.keyPrefix+w,K),W(B)}catch(oe){(oe.name==="QuotaExceededError"||oe.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Y(oe),Y(oe)}})})});return b(F,x),F}function Et(w,T){if(T=k.apply(this,arguments),w=typeof w!="function"&&w||{},!w.name){var x=this.config();w.name=w.name||x.name,w.storeName=w.storeName||x.storeName}var L=this,F;return w.name?F=new c(function(B){w.storeName?B(ge(w,L._defaultConfig)):B(w.name+"/")}).then(function(B){for(var W=localStorage.length-1;W>=0;W--){var Y=localStorage.key(W);Y.indexOf(B)===0&&localStorage.removeItem(Y)}}):F=c.reject("Invalid arguments"),b(F,T),F}var pt={_driver:"localStorageWrapper",_initStorage:be,_support:ie(),iterate:rt,getItem:Je,setItem:Xe,removeItem:ht,clear:je,length:ze,key:Yt,keys:Xt,dropInstance:Et},Ri=function(T,x){return T===x||typeof T=="number"&&typeof x=="number"&&isNaN(T)&&isNaN(x)},Vs=function(T,x){for(var L=T.length,F=0;F<L;){if(Ri(T[F],x))return!0;F++}return!1},Jr=Array.isArray||function(w){return Object.prototype.toString.call(w)==="[object Array]"},fi={},Qr={},$t={INDEXEDDB:Ee,WEBSQL:ee,LOCALSTORAGE:pt},Gs=[$t.INDEXEDDB._driver,$t.WEBSQL._driver,$t.LOCALSTORAGE._driver],Ii=["dropInstance"],ur=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ii),Zs={description:"",driver:Gs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ys(w,T){w[T]=function(){var x=arguments;return w.ready().then(function(){return w[T].apply(w,x)})}}function lr(){for(var w=1;w<arguments.length;w++){var T=arguments[w];if(T)for(var x in T)T.hasOwnProperty(x)&&(Jr(T[x])?arguments[0][x]=T[x].slice():arguments[0][x]=T[x])}return arguments[0]}var Xs=function(){function w(T){a(this,w);for(var x in $t)if($t.hasOwnProperty(x)){var L=$t[x],F=L._driver;this[x]=F,fi[F]||this.defineDriver(L)}this._defaultConfig=lr({},Zs),this._config=lr({},this._defaultConfig,T),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return w.prototype.config=function(x){if((typeof x>"u"?"undefined":s(x))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var L in x){if(L==="storeName"&&(x[L]=x[L].replace(/\W/g,"_")),L==="version"&&typeof x[L]!="number")return new Error("Database version must be a number.");this._config[L]=x[L]}return"driver"in x&&x.driver?this.setDriver(this._config.driver):!0}else return typeof x=="string"?this._config[x]:this._config},w.prototype.defineDriver=function(x,L,F){var B=new c(function(W,Y){try{var $=x._driver,K=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!x._driver){Y(K);return}for(var J=ur.concat("_initStorage"),oe=0,pe=J.length;oe<pe;oe++){var Ce=J[oe],Te=!Vs(Ii,Ce);if((Te||x[Ce])&&typeof x[Ce]!="function"){Y(K);return}}var Ve=function(){for(var ci=function(Js){return function(){var Qs=new Error("Method "+Js+" is not implemented by the current driver"),en=c.reject(Qs);return b(en,arguments[arguments.length-1]),en}},hr=0,Ks=Ii.length;hr<Ks;hr++){var fr=Ii[hr];x[fr]||(x[fr]=ci(fr))}};Ve();var qe=function(ci){fi[$]&&console.info("Redefining LocalForage driver: "+$),fi[$]=x,Qr[$]=ci,W()};"_support"in x?x._support&&typeof x._support=="function"?x._support().then(qe,Y):qe(!!x._support):qe(!0)}catch(vt){Y(vt)}});return g(B,L,F),B},w.prototype.driver=function(){return this._driver||null},w.prototype.getDriver=function(x,L,F){var B=fi[x]?c.resolve(fi[x]):c.reject(new Error("Driver not found."));return g(B,L,F),B},w.prototype.getSerializer=function(x){var L=c.resolve(G);return g(L,x),L},w.prototype.ready=function(x){var L=this,F=L._driverSet.then(function(){return L._ready===null&&(L._ready=L._initDriver()),L._ready});return g(F,x,x),F},w.prototype.setDriver=function(x,L,F){var B=this;Jr(x)||(x=[x]);var W=this._getSupportedDrivers(x);function Y(){B._config.driver=B.driver()}function $(oe){return B._extend(oe),Y(),B._ready=B._initStorage(B._config),B._ready}function K(oe){return function(){var pe=0;function Ce(){for(;pe<oe.length;){var Te=oe[pe];return pe++,B._dbInfo=null,B._ready=null,B.getDriver(Te).then($).catch(Ce)}Y();var Ve=new Error("No available storage method found.");return B._driverSet=c.reject(Ve),B._driverSet}return Ce()}}var J=this._driverSet!==null?this._driverSet.catch(function(){return c.resolve()}):c.resolve();return this._driverSet=J.then(function(){var oe=W[0];return B._dbInfo=null,B._ready=null,B.getDriver(oe).then(function(pe){B._driver=pe._driver,Y(),B._wrapLibraryMethodsWithReady(),B._initDriver=K(W)})}).catch(function(){Y();var oe=new Error("No available storage method found.");return B._driverSet=c.reject(oe),B._driverSet}),g(this._driverSet,L,F),this._driverSet},w.prototype.supports=function(x){return!!Qr[x]},w.prototype._extend=function(x){lr(this,x)},w.prototype._getSupportedDrivers=function(x){for(var L=[],F=0,B=x.length;F<B;F++){var W=x[F];this.supports(W)&&L.push(W)}return L},w.prototype._wrapLibraryMethodsWithReady=function(){for(var x=0,L=ur.length;x<L;x++)Ys(this,ur[x])},w.prototype.createInstance=function(x){return new w(x)},w}(),$s=new Xs;i.exports=$s},{3:3}]},{},[4])(4)})})(Ws);var Qu=Ws.exports;const On=Oe.getDefaultExportFromCjs(Qu);class Hs{constructor(e,t,i){this.urlCache={},this.storage=void 0,this.name=e,this.requester=t||xi,this.resolver=i,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let e;typeof On>"u"&&(e=On),this.storage=e.createInstance({name:this.name})}catch{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(e){let t=navigator.onLine;this.online=t,t?this.emit("online",this):this.emit("offline",this)}add(e,t){let i=e.resources.map(r=>{let{href:s}=r,a=this.resolver(s),o=window.encodeURIComponent(a);return this.storage.getItem(o).then(u=>!u||t?this.requester(a,"binary").then(h=>this.storage.setItem(o,h)):u)});return Promise.all(i)}put(e,t,i){let r=window.encodeURIComponent(e);return this.storage.getItem(r).then(s=>s||this.requester(e,"binary",t,i).then(a=>this.storage.setItem(r,a)))}request(e,t,i,r){return this.online?this.requester(e,t,i,r).then(s=>(this.put(e),s)):this.retrieve(e,t)}retrieve(e,t){new we;var i,r=new Ut(e);return t||(t=r.extension),t=="blob"?i=this.getBlob(e):i=this.getText(e),i.then(s=>{var a=new we,o;return s?(o=this.handleResponse(s,t),a.resolve(o)):a.reject({message:"File not found in storage: "+e,stack:new Error().stack}),a.promise})}handleResponse(e,t){var i;return t=="json"?i=JSON.parse(e):Ei(t)?i=Nt(e,"text/xml"):t=="xhtml"?i=Nt(e,"application/xhtml+xml"):t=="html"||t=="htm"?i=Nt(e,"text/html"):i=e,i}getBlob(e,t){let i=window.encodeURIComponent(e);return this.storage.getItem(i).then(function(r){if(r)return t=t||ai.lookup(e),new Blob([r],{type:t})})}getText(e,t){let i=window.encodeURIComponent(e);return t=t||ai.lookup(e),this.storage.getItem(i).then(function(r){var s=new we,a=new FileReader,o;if(r)return o=new Blob([r],{type:t}),a.addEventListener("loadend",()=>{s.resolve(a.result)}),a.readAsText(o,t),s.promise})}getBase64(e,t){let i=window.encodeURIComponent(e);return t=t||ai.lookup(e),this.storage.getItem(i).then(r=>{var s=new we,a=new FileReader,o;if(r)return o=new Blob([r],{type:t}),a.addEventListener("loadend",()=>{s.resolve(a.result)}),a.readAsDataURL(o,t),s.promise})}createUrl(e,t){var i=new we,r=window.URL||window.webkitURL||window.mozURL,s,a,o=t&&t.base64;return e in this.urlCache?(i.resolve(this.urlCache[e]),i.promise):(o?(a=this.getBase64(e),a&&a.then((function(u){this.urlCache[e]=u,i.resolve(u)}).bind(this))):(a=this.getBlob(e),a&&a.then((function(u){s=r.createObjectURL(u),this.urlCache[e]=s,i.resolve(s)}).bind(this))),a||i.reject({message:"File not found in storage: "+e,stack:new Error().stack}),i.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.urlCache={},this.removeListeners()}}Rt(Hs.prototype);class xr{constructor(e){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",e&&this.parse(e)}parse(e){if(!e)return this;const t=Ne(e,"display_options");return t?(Mt(t,"option").forEach(r=>{let s="";switch(r.childNodes.length&&(s=r.childNodes[0].nodeValue),r.attributes.name.value){case"interactive":this.interactive=s;break;case"fixed-layout":this.fixedLayout=s;break;case"open-to-spread":this.openToSpread=s;break;case"orientation-lock":this.orientationLock=s;break}}),this):this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}}const Bn="META-INF/container.xml",el="META-INF/com.apple.ibooks.display-options.xml",xt={BINARY:"binary",BASE64:"base64",EPUB:"epub",OPF:"opf",MANIFEST:"json",DIRECTORY:"directory"};class or{constructor(e,t){typeof t>"u"&&typeof e!="string"&&!(e instanceof Blob)&&!(e instanceof ArrayBuffer)&&(t=e,e=void 0),this.settings=tt(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}),tt(this.settings,t),this.opening=new we,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new we,spine:new we,metadata:new we,cover:new we,navigation:new we,pageList:new we,resources:new we,displayOptions:new we},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||xi,this.spine=new bo,this.locations=new Ss(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),e&&this.open(e,this.settings.openAs).catch(i=>{var r=new Error("Cannot load book at "+e);this.emit(Q.BOOK.OPEN_FAILED,r)})}open(e,t){var i,r=t||this.determineType(e);return r===xt.BINARY?(this.archived=!0,this.url=new Dt("/",""),i=this.openEpub(e)):r===xt.BASE64?(this.archived=!0,this.url=new Dt("/",""),i=this.openEpub(e,r)):r===xt.EPUB?(this.archived=!0,this.url=new Dt("/",""),i=this.request(e,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))):r==xt.OPF?(this.url=new Dt(e),i=this.openPackaging(this.url.Path.toString())):r==xt.MANIFEST?(this.url=new Dt(e),i=this.openManifest(this.url.Path.toString())):(this.url=new Dt(e),i=this.openContainer(Bn).then(this.openPackaging.bind(this))),i}openEpub(e,t){return this.unarchive(e,t||this.settings.encoding).then(()=>this.openContainer(Bn)).then(i=>this.openPackaging(i))}openContainer(e){return this.load(e).then(t=>(this.container=new wo(t),this.resolve(this.container.packagePath)))}openPackaging(e){return this.path=new Ut(e),this.load(e).then(t=>(this.packaging=new An(t),this.unpack(this.packaging)))}openManifest(e){return this.path=new Ut(e),this.load(e).then(t=>(this.packaging=new An,this.packaging.load(t),this.unpack(this.packaging)))}load(e){var t=this.resolve(e);return this.archived?this.archive.request(t):this.request(t,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(e,t){if(e){var i=e,r=e.indexOf("://")>-1;return r?e:(this.path&&(i=this.path.resolve(e)),t!=!1&&this.url&&(i=this.url.resolve(i)),i)}}canonical(e){var t=e;return e?(this.settings.canonical?t=this.settings.canonical(e):t=this.resolve(e,!0),t):""}determineType(e){var t,i,r;if(this.settings.encoding==="base64")return xt.BASE64;if(typeof e!="string")return xt.BINARY;if(t=new Dt(e),i=t.path(),r=i.extension,r&&(r=r.replace(/\?.*$/,"")),!r)return xt.DIRECTORY;if(r==="epub")return xt.EPUB;if(r==="opf")return xt.OPF;if(r==="json")return xt.MANIFEST}unpack(e){this.package=e,this.packaging.metadata.layout===""?this.load(this.url.resolve(el)).then(t=>{this.displayOptions=new xr(t),this.loading.displayOptions.resolve(this.displayOptions)}).catch(t=>{this.displayOptions=new xr,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new xr,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new Do(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&&this.settings.replacements!="none"?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(e){let t=e.navPath||e.ncxPath,i=e.toc;return i?new Promise((r,s)=>{this.navigation=new wr(i),e.pageList&&(this.pageList=new _r(e.pageList)),r(this.navigation)}):t?this.load(t,"xml").then(r=>(this.navigation=new wr(r),this.pageList=new _r(r),this.navigation)):new Promise((r,s)=>{this.navigation=new wr,this.pageList=new _r,r(this.navigation)})}section(e){return this.spine.get(e)}renderTo(e,t){return this.rendition=new ar(this,t),this.rendition.attachTo(e),this.rendition}setRequestCredentials(e){this.settings.requestCredentials=e}setRequestHeaders(e){this.settings.requestHeaders=e}unarchive(e,t){return this.archive=new Ju,this.archive.open(e,t)}store(e){let t=this.settings.replacements&&this.settings.replacements!=="none",i=this.url,r=this.settings.requestMethod||xi.bind(this);return this.storage=new Hs(e,r,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 s=(a,o)=>{o.output=this.resources.substitute(a,o.url)};this.resources.settings.replacements=t||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new Dt("/",""),this.spine.hooks.serialize.register(s)}),this.storage.on("online",()=>{this.url=i,this.spine.hooks.serialize.deregister(s)})}),this.storage}coverUrl(){return this.loaded.cover.then(()=>this.cover?this.archived?this.archive.createUrl(this.cover):this.cover:null)}replacements(){return this.spine.hooks.serialize.register((e,t)=>{t.output=this.resources.substitute(e,t.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(e){var t=new ye(e),i=this.spine.get(t.spinePos),r=this.load.bind(this);return i?i.load(r).then(function(s){var a=t.toRange(i.document);return a}):new Promise((s,a)=>{a("CFI could not be found")})}key(e){var t=e||this.packaging.metadata.identifier||this.url.filename;return`epubjs:${tr}:${t}`}destroy(){this.opened=void 0,this.loading=void 0,this.loaded=void 0,this.ready=void 0,this.isOpen=!1,this.isRendered=!1,this.spine&&this.spine.destroy(),this.locations&&this.locations.destroy(),this.pageList&&this.pageList.destroy(),this.archive&&this.archive.destroy(),this.resources&&this.resources.destroy(),this.container&&this.container.destroy(),this.packaging&&this.packaging.destroy(),this.rendition&&this.rendition.destroy(),this.displayOptions&&this.displayOptions.destroy(),this.spine=void 0,this.locations=void 0,this.pageList=void 0,this.archive=void 0,this.resources=void 0,this.container=void 0,this.packaging=void 0,this.rendition=void 0,this.navigation=void 0,this.url=void 0,this.path=void 0,this.archived=!1}}Rt(or.prototype);function Zt(n,e){return new or(n,e)}Zt.VERSION=tr;typeof global<"u"&&(global.EPUBJS_VERSION=tr);Zt.Book=or;Zt.Rendition=ar;Zt.Contents=ir;Zt.CFI=ye;Zt.utils=ho;exports.Book=or;exports.Contents=ir;exports.EpubCFI=ye;exports.Layout=Xr;exports.Rendition=ar;exports.default=Zt;
22
+ //# sourceMappingURL=index-DEnRTqSW.cjs.map