UNPKG

universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines 495 kB
/*! For license information please see 6982.f90704b8cbf93ee9a050.js.LICENSE.txt */
(self.webpackChunkUV=self.webpackChunkUV||[]).push([[6982],{6982:(t,e,n)=>{"use strict";n.r(e),n.d(e,{uv_ebook_reader:()=>yc,uv_ebook_toc:()=>wc});var i,r=n(6233),o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}h((i=i.apply(t,e||[])).next())}))},a=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function c(t,e){return t(e={exports:{}},e.exports),e.exports}var l=function(t){return null!=t},f={object:!0,function:!0,undefined:!0},d=/^\s*class[\s{/}]/,p=Function.prototype.toString,m=function(t){return!!function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!function(t){if(!function(t){return!!l(t)&&hasOwnProperty.call(f,typeof t)}(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}(t)}(t)&&!d.test(p.call(t))},g=function(t){return null!=t},v=Object.keys,y=function(){try{return!0}catch(t){return!1}}()?Object.keys:function(t){return v(g(t)?Object(t):t)},w=Math.max,b=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}()?Object.assign:function(t,e){var n,i,r,o=w(arguments.length,2);for(t=Object(function(t){if(!g(t))throw new TypeError("Cannot use null or undefined");return t}(t)),r=function(i){try{t[i]=e[i]}catch(t){n||(n=t)}},i=1;i<o;++i)y(e=arguments[i]).forEach(r);if(void 0!==n)throw n;return t},_=Array.prototype.forEach,x=Object.create,k=function(t){var e=x(null);return _.call(arguments,(function(t){g(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)})),e},E="razdwatrzy",S=String.prototype.indexOf,C="function"==typeof E.contains&&!0===E.contains("dwa")&&!1===E.contains("foo")?String.prototype.contains:function(t){return S.call(this,t,arguments[1])>-1},T=c((function(t){var e=t.exports=function(t,e){var n,i,r,o,s;return arguments.length<2||"string"!=typeof t?(o=e,e=t,t=null):o=arguments[2],l(t)?(n=C.call(t,"c"),i=C.call(t,"e"),r=C.call(t,"w")):(n=r=!0,i=!1),s={value:e,configurable:n,enumerable:i,writable:r},o?b(k(o),s):s};e.gs=function(t,e,n){var i,r,o,s;return"string"!=typeof t?(o=n,n=e,e=t,t=null):o=arguments[3],l(e)?m(e)?l(n)?m(n)||(o=n,n=void 0):n=void 0:(o=e,e=n=void 0):e=void 0,l(t)?(i=C.call(t,"c"),r=C.call(t,"e")):(i=!0,r=!1),s={get:e,set:n,configurable:i,enumerable:r},o?b(k(o),s):s}})),A=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t},N=c((function(t,e){var n,i,r,o,s,a,h,u=Function.prototype.apply,c=Function.prototype.call,l=Object.create,f=Object.defineProperty,d=Object.defineProperties,p=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var n;return A(e),p.call(this,"__ee__")?n=this.__ee__:(n=m.value=l(null),f(this,"__ee__",m),m.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},i=function(t,e){var i,o;return A(e),o=this,n.call(this,t,i=function(){r.call(o,t,i),u.call(e,this,arguments)}),i.__eeOnceListener__=e,this},r=function(t,e){var n,i,r,o;if(A(e),!p.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(i=n[t]))for(o=0;r=i[o];++o)r!==e&&r.__eeOnceListener__!==e||(2===i.length?n[t]=i[o?0:1]:i.splice(o,1));else i!==e&&i.__eeOnceListener__!==e||delete n[t];return this},o=function(t){var e,n,i,r,o;if(p.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)u.call(i,this,o)}else switch(arguments.length){case 1:c.call(r,this);break;case 2:c.call(r,this,arguments[1]);break;case 3:c.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];u.call(r,this,o)}},s={on:n,once:i,off:r,emit:o},a={on:T(n),once:T(i),off:T(r),emit:T(o)},h=d({},a),t.exports=e=function(t){return null==t?l(h):d(Object(t),a)},e.methods=s})),R="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),I="undefined"!=typeof URL?URL:"undefined"!=typeof window?window.URL||window.webkitURL||window.mozURL:void 0;function O(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:7&n|8).toString(16)}))}function z(t){return!(!t||1!=t.nodeType)}function D(t){return!isNaN(parseFloat(t))&&isFinite(t)}function L(t){var e=parseFloat(t);return!1!==D(t)&&("string"==typeof t&&t.indexOf(".")>-1||Math.floor(e)!==e)}function B(t){var e=["-webkit-","-webkit-","-moz-","-o-","-ms-"],n=t.toLowerCase();if("undefined"==typeof document||void 0!==document.body.style[n])return t;for(var i=0;i<5;i++)if(void 0!==document.body.style[e[i]+n])return e[i]+n;return t}function P(t){for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e];for(var r in i)void 0===t[r]&&(t[r]=i[r])}return t}function j(t){return[].slice.call(arguments,1).forEach((function(e){e&&Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))})),t}function U(t,e,n,i,r){var o,s=i||0,a=r||e.length,h=parseInt(s+(a-s)/2);return n||(n=function(t,e){return t>e?1:t<e?-1:t==e?0:void 0}),a-s<=0?h:(o=n(e[h],t),a-s==1?o>=0?h:h+1:0===o?h:-1===o?U(t,e,n,h,a):U(t,e,n,s,h))}function F(t,e,n,i,r){var o,s=i||0,a=r||e.length,h=parseInt(s+(a-s)/2);return n||(n=function(t,e){return t>e?1:t<e?-1:t==e?0:void 0}),a-s<=0?-1:(o=n(e[h],t),a-s==1?0===o?h:-1:0===o?h:-1===o?F(t,e,n,h,a):F(t,e,n,s,h))}function M(t){var e=window.getComputedStyle(t),n=0,i=0;return["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach((function(t){n+=parseFloat(e[t])||0})),["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach((function(t){i+=parseFloat(e[t])||0})),{height:i,width:n}}function W(t){var e=window.getComputedStyle(t),n=0,i=0;return["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"].forEach((function(t){n+=parseFloat(e[t])||0})),["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"].forEach((function(t){i+=parseFloat(e[t])||0})),{height:i,width:n}}function q(t){var e,n=t.ownerDocument;if(t.nodeType==Node.TEXT_NODE){var i=n.createRange();i.selectNodeContents(t),e=i.getBoundingClientRect()}else e=t.getBoundingClientRect();return e}function H(){var t=window.innerWidth,e=window.innerHeight;return{top:0,left:0,right:t,bottom:e,width:t,height:e}}function Z(t,e){for(var n,i=t.parentNode.childNodes,r=-1,o=0;o<i.length&&((n=i[o]).nodeType===e&&r++,n!=t);o++);return r}function Y(t){return Z(t,1)}function V(t){return["xml","opf","ncx"].indexOf(t)>-1}function X(t,e){return new Blob([t],{type:e})}function K(t,e){var n=X(t,e);return I.createObjectURL(n)}function $(t){return I.revokeObjectURL(t)}function G(t,e){if("string"==typeof t)return"data:"+e+";base64,"+btoa(encodeURIComponent(t))}function J(t){return Object.prototype.toString.call(t).slice(8,-1)}function Q(t,e,i){var r;return r="undefined"==typeof DOMParser||i?n(9788).S:DOMParser,65279===t.charCodeAt(0)&&(t=t.slice(1)),(new r).parseFromString(t,e)}function tt(t,e){var n;if(!t)throw new Error("No Element Provided");return void 0!==t.querySelector?t.querySelector(e):(n=t.getElementsByTagName(e)).length?n[0]:void 0}function et(t,e){return void 0!==t.querySelector?t.querySelectorAll(e):t.getElementsByTagName(e)}function nt(t,e,n){var i,r;if(void 0!==t.querySelector){for(var o in e+="[",n)e+=o+"~='"+n[o]+"'";return e+="]",t.querySelector(e)}if(i=t.getElementsByTagName(e),r=Array.prototype.slice.call(i,0).filter((function(t){for(var e in n)if(t.getAttribute(e)===n[e])return!0;return!1})),r)return r[0]}function it(t,e){void 0!==(t.ownerDocument||t).createTreeWalker?rt(t,e,NodeFilter.SHOW_TEXT):ot(t,(function(t){t&&3===t.nodeType&&e(t)}))}function rt(t,e,n){for(var i,r=document.createTreeWalker(t,n,null,!1);i=r.nextNode();)e(i)}function ot(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(ot(t,e))return!0;t=t.nextSibling}while(t)}function st(t){return new Promise((function(e,n){var i=new FileReader;i.readAsDataURL(t),i.onloadend=function(){e(i.result)}}))}function at(){var t=this;this.resolve=null,this.reject=null,this.id=O(),this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n})),Object.freeze(this)}function ht(t,e,n){var i;if(void 0!==t.querySelector&&(i=t.querySelector(e+'[*|type="'+n+'"]')),i&&0!==i.length)return i;i=et(t,e);for(var r=0;r<i.length;r++)if(i[r].getAttributeNS("http://www.idpf.org/2007/ops","type")===n||i[r].getAttribute("epub:type")===n)return i[r]}function ut(t){for(var e=[],n=t.childNodes,i=0;i<n.length;i++){var r=n[i];1===r.nodeType&&e.push(r)}return e}function ct(t){for(var e=[t];t;t=t.parentNode)e.unshift(t);return e}function lt(t,e,n){for(var i=[],r=t.childNodes,o=0;o<r.length;o++){var s=r[o];if(1===s.nodeType&&s.nodeName.toLowerCase()===e){if(n)return s;i.push(s)}}if(!n)return i}function ft(t,e){var n;if(null!==t&&""!==e)for(n=t.parentNode;1===n.nodeType;){if(n.tagName.toLowerCase()===e)return n;n=n.parentNode}}var dt=function(){function t(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}return t.prototype.setStart=function(t,e){this.startContainer=t,this.startOffset=e,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()},t.prototype.setEnd=function(t,e){this.endContainer=t,this.endOffset=e,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()},t.prototype.collapse=function(t){this.collapsed=!0,t?(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)},t.prototype.selectNode=function(t){var e=t.parentNode,n=Array.prototype.indexOf.call(e.childNodes,t);this.setStart(e,n),this.setEnd(e,n+1)},t.prototype.selectNodeContents=function(t){var e=3===t.nodeType?t.textContent.length:parent.childNodes.length;this.setStart(t,0),this.setEnd(t,e)},t.prototype._commonAncestorContainer=function(t,e){var n=ct(t||this.startContainer),i=ct(e||this.endContainer);if(n[0]==i[0])for(var r=0;r<n.length;r++)if(n[r]!=i[r])return n[r-1]},t.prototype._checkCollapsed=function(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1},t.prototype.toString=function(){},t}(),pt=Object.freeze({__proto__:null,requestAnimationFrame:R,uuid:O,documentHeight:function(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)},isElement:z,isNumber:D,isFloat:L,prefixed:B,defaults:P,extend:j,insert:function(t,e,n){var i=U(t,e,n);return e.splice(i,0,t),i},locationOf:U,indexOfSorted:F,bounds:M,borders:W,nodeBounds:q,windowBounds:H,indexOfNode:Z,indexOfTextNode:function(t){return Z(t,3)},indexOfElementNode:Y,isXml:V,createBlob:X,createBlobUrl:K,revokeBlobUrl:$,createBase64Url:G,type:J,parse:Q,qs:tt,qsa:et,qsp:nt,sprint:it,treeWalker:rt,walk:ot,blob2base64:st,defer:at,querySelectorByType:ht,findChildren:ut,parents:ct,filterChildren:lt,getParentByTagName:ft,RangeObject:dt});if(!mt)var mt={cwd:function(){return"/"}};function gt(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+t)}function vt(t,e){for(var n,i="",r=-1,o=0,s=0;s<=t.length;++s){if(s<t.length)n=t.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(r===s-1||1===o);else if(r!==s-1&&2===o){if(i.length<2||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){for(var a=i.length-1,h=a;h>=0&&47!==i.charCodeAt(h);--h);if(h!==a){i=-1===h?"":i.slice(0,h),r=s,o=0;continue}}else if(2===i.length||1===i.length){i="",r=s,o=0;continue}e&&(i.length>0?i+="/..":i="..")}else i.length>0?i+="/"+t.slice(r+1,s):i=t.slice(r+1,s);r=s,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var yt={resolve:function(){for(var t,e="",n=!1,i=arguments.length-1;i>=-1&&!n;i--){var r;i>=0?r=arguments[i]:(void 0===t&&(t=mt.cwd()),r=t),gt(r),0!==r.length&&(e=r+"/"+e,n=47===r.charCodeAt(0))}return e=vt(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(gt(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=vt(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return gt(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];gt(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":yt.normalize(t)},relative:function(t,e){if(gt(t),gt(e),t===e)return"";if((t=yt.resolve(t))===(e=yt.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var i=t.length,r=i-n,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var s=e.length-o,a=r<s?r:s,h=-1,u=0;u<=a;++u){if(u===a){if(s>a){if(47===e.charCodeAt(o+u))return e.slice(o+u+1);if(0===u)return e.slice(o+u)}else r>a&&(47===t.charCodeAt(n+u)?h=u:0===u&&(h=0));break}var c=t.charCodeAt(n+u);if(c!==e.charCodeAt(o+u))break;47===c&&(h=u)}var l="";for(u=n+h+1;u<=i;++u)u!==i&&47!==t.charCodeAt(u)||(0===l.length?l+="..":l+="/..");return l.length>0?l+e.slice(o+h):(o+=h,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(gt(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');gt(t);var n,i=0,r=-1,o=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,a=-1;for(n=t.length-1;n>=0;--n){var h=t.charCodeAt(n);if(47===h){if(!o){i=n+1;break}}else-1===a&&(o=!1,a=n+1),s>=0&&(h===e.charCodeAt(s)?-1==--s&&(r=n):(s=-1,r=a))}return i===r?r=a:-1===r&&(r=t.length),t.slice(i,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":t.slice(i,r)},extname:function(t){gt(t);for(var e=-1,n=0,i=-1,r=!0,o=0,s=t.length-1;s>=0;--s){var a=t.charCodeAt(s);if(47!==a)-1===i&&(r=!1,i=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=s+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof t);return function(t,e){var n=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+i:n+"/"+i:i}(0,t)},parse:function(t){gt(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,i=t.charCodeAt(0),r=47===i;r?(e.root="/",n=1):n=0;for(var o=-1,s=0,a=-1,h=!0,u=t.length-1,c=0;u>=n;--u)if(47!==(i=t.charCodeAt(u)))-1===a&&(h=!1,a=u+1),46===i?-1===o?o=u:1!==c&&(c=1):-1!==o&&(c=-1);else if(!h){s=u+1;break}return-1===o||-1===a||0===c||1===c&&o===a-1&&o===s+1?-1!==a&&(e.base=e.name=0===s&&r?t.slice(1,a):t.slice(s,a)):(0===s&&r?(e.name=t.slice(1,o),e.base=t.slice(1,a)):(e.name=t.slice(s,o),e.base=t.slice(s,a)),e.ext=t.slice(o,a)),s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",posix:null},wt=yt,bt=function(){function t(t){var e;t.indexOf("://")>-1&&(t=new URL(t).pathname),e=this.parse(t),this.path=t,this.isDirectory(t)?this.directory=t:this.directory=e.dir+"/",this.filename=e.base,this.extension=e.ext.slice(1)}return t.prototype.parse=function(t){return wt.parse(t)},t.prototype.isAbsolute=function(t){return wt.isAbsolute(t||this.path)},t.prototype.isDirectory=function(t){return"/"===t.charAt(t.length-1)},t.prototype.resolve=function(t){return wt.resolve(this.directory,t)},t.prototype.relative=function(t){return t&&t.indexOf("://")>-1?t:wt.relative(this.directory,t)},t.prototype.splitPath=function(t){return this.splitPathRe.exec(t).slice(1)},t.prototype.toString=function(){return this.path},t}(),_t=function(){function t(t,e){var n=t.indexOf("://")>-1,i=t;if(this.Url=void 0,this.href=t,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=e,!n&&!1!==e&&"string"!=typeof e&&window&&window.location&&(this.base=window.location.href),n||this.base)try{this.base?this.Url=new URL(t,this.base):this.Url=new URL(t),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,i=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(t){this.Url=void 0,this.base&&(i=new bt(this.base).resolve(i))}this.Path=new bt(i),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}return t.prototype.path=function(){return this.Path},t.prototype.resolve=function(t){var e;return t.indexOf("://")>-1?t:(e=wt.resolve(this.directory,t),this.origin+e)},t.prototype.relative=function(t){return wt.relative(t,this.directory)},t.prototype.toString=function(){return this.href},t}(),xt=function(){function t(e,n,i){var r;if(this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof t))return new t(e,n,i);if("string"==typeof n?this.base=this.parseComponent(n):"object"==typeof n&&n.steps&&(this.base=n),"string"===(r=this.checkType(e)))return this.str=e,j(this,this.parse(e));if("range"===r)return j(this,this.fromRange(e,this.base,i));if("node"===r)return j(this,this.fromNode(e,this.base,i));if("EpubCFI"===r&&e.path)return e;if(e)throw new TypeError("not a valid argument for EpubCFI");return this}return t.prototype.checkType=function(e){return this.isCfiString(e)?"string":!e||"object"!=typeof e||"Range"!==J(e)&&void 0===e.startContainer?e&&"object"==typeof e&&void 0!==e.nodeType?"node":!!(e&&"object"==typeof e&&e instanceof t)&&"EpubCFI":"range"},t.prototype.parse=function(t){var e,n,i,r={spinePos:-1,range:!1,base:{},path:{},start:null,end:null};return"string"!=typeof t?{spinePos:-1}:(0===t.indexOf("epubcfi(")&&")"===t[t.length-1]&&(t=t.slice(8,t.length-1)),(e=this.getChapterComponent(t))?(r.base=this.parseComponent(e),n=this.getPathComponent(t),r.path=this.parseComponent(n),(i=this.getRange(t))&&(r.range=!0,r.start=this.parseComponent(i[0]),r.end=this.parseComponent(i[1])),r.spinePos=r.base.steps[1].index,r):{spinePos:-1})},t.prototype.parseComponent=function(t){var e,n={steps:[],terminal:{offset:null,assertion:null}},i=t.split(":"),r=i[0].split("/");return i.length>1&&(e=i[1],n.terminal=this.parseTerminal(e)),""===r[0]&&r.shift(),n.steps=r.map(function(t){return this.parseStep(t)}.bind(this)),n},t.prototype.parseStep=function(t){var e,n,i,r,o;if((r=t.match(/\[(.*)\]/))&&r[1]&&(o=r[1]),n=parseInt(t),!isNaN(n))return n%2==0?(e="element",i=n/2-1):(e="text",i=(n-1)/2),{type:e,index:i,id:o||null}},t.prototype.parseTerminal=function(t){var e,n,i=t.match(/\[(.*)\]/);return i&&i[1]?(e=parseInt(t.split("[")[0]),n=i[1]):e=parseInt(t),D(e)||(e=null),{offset:e,assertion:n}},t.prototype.getChapterComponent=function(t){return t.split("!")[0]},t.prototype.getPathComponent=function(t){var e=t.split("!");if(e[1])return e[1].split(",")[0]},t.prototype.getRange=function(t){var e=t.split(",");return 3===e.length&&[e[1],e[2]]},t.prototype.getCharecterOffsetComponent=function(t){return t.split(":")[1]||""},t.prototype.joinSteps=function(t){return t?t.map((function(t){var e="";return"element"===t.type&&(e+=2*(t.index+1)),"text"===t.type&&(e+=1+2*t.index),t.id&&(e+="["+t.id+"]"),e})).join("/"):""},t.prototype.segmentString=function(t){var e="/";return e+=this.joinSteps(t.steps),t.terminal&&null!=t.terminal.offset&&(e+=":"+t.terminal.offset),t.terminal&&null!=t.terminal.assertion&&(e+="["+t.terminal.assertion+"]"),e},t.prototype.toString=function(){var t="epubcfi(";return t+=this.segmentString(this.base),t+="!",t+=this.segmentString(this.path),this.range&&this.start&&(t+=",",t+=this.segmentString(this.start)),this.range&&this.end&&(t+=",",t+=this.segmentString(this.end)),t+")"},t.prototype.compare=function(e,n){var i,r,o,s;if("string"==typeof e&&(e=new t(e)),"string"==typeof n&&(n=new t(n)),e.spinePos>n.spinePos)return 1;if(e.spinePos<n.spinePos)return-1;e.range?(i=e.path.steps.concat(e.start.steps),o=e.start.terminal):(i=e.path.steps,o=e.path.terminal),n.range?(r=n.path.steps.concat(n.start.steps),s=n.start.terminal):(r=n.path.steps,s=n.path.terminal);for(var a=0;a<i.length;a++){if(!i[a])return-1;if(!r[a])return 1;if(i[a].index>r[a].index)return 1;if(i[a].index<r[a].index)return-1}return i.length<r.length?-1:o.offset>s.offset?1:o.offset<s.offset?-1:0},t.prototype.step=function(t){var e=3===t.nodeType?"text":"element";return{id:t.id,tagName:t.tagName,type:e,index:this.position(t)}},t.prototype.filteredStep=function(t,e){var n,i=this.filter(t,e);if(i)return n=3===i.nodeType?"text":"element",{id:i.id,tagName:i.tagName,type:n,index:this.filteredPosition(i,e)}},t.prototype.pathTo=function(t,e,n){for(var i,r={steps:[],terminal:{offset:null,assertion:null}},o=t;o&&o.parentNode&&9!=o.parentNode.nodeType;)(i=n?this.filteredStep(o,n):this.step(o))&&r.steps.unshift(i),o=o.parentNode;return null!=e&&e>=0&&(r.terminal.offset=e,"text"!=r.steps[r.steps.length-1].type&&r.steps.push({type:"text",index:0})),r},t.prototype.equalStep=function(t,e){return!(!t||!e)&&t.index===e.index&&t.id===e.id&&t.type===e.type},t.prototype.fromRange=function(t,e,n){var i={range:!1,base:{},path:{},start:null,end:null},r=t.startContainer,o=t.endContainer,s=t.startOffset,a=t.endOffset,h=!1;if(n&&(h=null!=r.ownerDocument.querySelector("."+n)),"string"==typeof e?(i.base=this.parseComponent(e),i.spinePos=i.base.steps[1].index):"object"==typeof e&&(i.base=e),t.collapsed)h&&(s=this.patchOffset(r,s,n)),i.path=this.pathTo(r,s,n);else{i.range=!0,h&&(s=this.patchOffset(r,s,n)),i.start=this.pathTo(r,s,n),h&&(a=this.patchOffset(o,a,n)),i.end=this.pathTo(o,a,n),i.path={steps:[],terminal:null};var u,c=i.start.steps.length;for(u=0;u<c&&this.equalStep(i.start.steps[u],i.end.steps[u]);u++)u===c-1?i.start.terminal===i.end.terminal&&(i.path.steps.push(i.start.steps[u]),i.range=!1):i.path.steps.push(i.start.steps[u]);i.start.steps=i.start.steps.slice(i.path.steps.length),i.end.steps=i.end.steps.slice(i.path.steps.length)}return i},t.prototype.fromNode=function(t,e,n){var i={range:!1,base:{},path:{},start:null,end:null};return"string"==typeof e?(i.base=this.parseComponent(e),i.spinePos=i.base.steps[1].index):"object"==typeof e&&(i.base=e),i.path=this.pathTo(t,null,n),i},t.prototype.filter=function(t,e){var n,i,r,o,s,a=!1;return 3===t.nodeType?(a=!0,r=t.parentNode,n=t.parentNode.classList.contains(e)):(a=!1,n=t.classList.contains(e)),n&&a?(o=r.previousSibling,s=r.nextSibling,o&&3===o.nodeType?i=o:s&&3===s.nodeType&&(i=s),i||t):!(n&&!a)&&t},t.prototype.patchOffset=function(t,e,n){if(3!=t.nodeType)throw new Error("Anchor must be a text node");var i=t,r=e;for(t.parentNode.classList.contains(n)&&(i=t.parentNode);i.previousSibling;){if(1===i.previousSibling.nodeType){if(!i.previousSibling.classList.contains(n))break;r+=i.previousSibling.textContent.length}else r+=i.previousSibling.textContent.length;i=i.previousSibling}return r},t.prototype.normalizedMap=function(t,e,n){var i,r,o,s={},a=-1,h=t.length;for(i=0;i<h;i++)1===(r=t[i].nodeType)&&t[i].classList.contains(n)&&(r=3),i>0&&3===r&&3===o?s[i]=a:e===r&&(a+=1,s[i]=a),o=r;return s},t.prototype.position=function(t){var e,n;return 1===t.nodeType?((e=t.parentNode.children)||(e=ut(t.parentNode)),n=Array.prototype.indexOf.call(e,t)):n=(e=this.textNodes(t.parentNode)).indexOf(t),n},t.prototype.filteredPosition=function(t,e){var n,i;return 1===t.nodeType?(n=t.parentNode.children,i=this.normalizedMap(n,1,e)):(n=t.parentNode.childNodes,t.parentNode.classList.contains(e)&&(n=(t=t.parentNode).parentNode.childNodes),i=this.normalizedMap(n,3,e)),i[Array.prototype.indexOf.call(n,t)]},t.prototype.stepsToXpath=function(t){var e=[".","*"];return t.forEach((function(t){var n=t.index+1;t.id?e.push("*[position()="+n+" and @id='"+t.id+"']"):"text"===t.type?e.push("text()["+n+"]"):e.push("*["+n+"]")})),e.join("/")},t.prototype.stepsToQuerySelector=function(t){var e=["html"];return t.forEach((function(t){var n=t.index+1;t.id?e.push("#"+t.id):"text"===t.type||e.push("*:nth-child("+n+")")})),e.join(">")},t.prototype.textNodes=function(t,e){return Array.prototype.slice.call(t.childNodes).filter((function(t){return 3===t.nodeType||!(!e||!t.classList.contains(e))}))},t.prototype.walkToNode=function(t,e,n){var i,r,o=e||document,s=o.documentElement,a=t.length;for(r=0;r<a&&("element"===(i=t[r]).type?s=i.id?o.getElementById(i.id):(s.children||ut(s))[i.index]:"text"===i.type&&(s=this.textNodes(s,n)[i.index]),s);r++);return s},t.prototype.findNode=function(t,e,n){var i,r,o=e||document;return n||void 0===o.evaluate?i=n?this.walkToNode(t,o,n):this.walkToNode(t,o):(r=this.stepsToXpath(t),i=o.evaluate(r,o,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue),i},t.prototype.fixMiss=function(t,e,n,i){var r,o,s=this.findNode(t.slice(0,-1),n,i),a=s.childNodes,h=this.normalizedMap(a,3,i),u=t[t.length-1].index;for(var c in h){if(!h.hasOwnProperty(c))return;if(h[c]===u){if(!(e>(o=(r=a[c]).textContent.length))){s=1===r.nodeType?r.childNodes[0]:r;break}e-=o}}return{container:s,offset:e}},t.prototype.toRange=function(t,e){var n,i,r,o,s,a,h,u,c=t||document,l=this,f=!!e&&null!=c.querySelector("."+e);if(n=void 0!==c.createRange?c.createRange():new dt,l.range?(i=l.start,a=l.path.steps.concat(i.steps),o=this.findNode(a,c,f?e:null),r=l.end,h=l.path.steps.concat(r.steps),s=this.findNode(h,c,f?e:null)):(i=l.path,a=l.path.steps,o=this.findNode(l.path.steps,c,f?e:null)),!o)return console.log("No startContainer found for",this.toString()),null;try{null!=i.terminal.offset?n.setStart(o,i.terminal.offset):n.setStart(o,0)}catch(t){u=this.fixMiss(a,i.terminal.offset,c,f?e:null),n.setStart(u.container,u.offset)}if(s)try{null!=r.terminal.offset?n.setEnd(s,r.terminal.offset):n.setEnd(s,0)}catch(t){u=this.fixMiss(h,l.end.terminal.offset,c,f?e:null),n.setEnd(u.container,u.offset)}return n},t.prototype.isCfiString=function(t){return"string"==typeof t&&0===t.indexOf("epubcfi(")&&")"===t[t.length-1]},t.prototype.generateChapterComponent=function(t,e,n){var i="/"+2*(t+1)+"/";return i+=2*(parseInt(e)+1),n&&(i+="["+n+"]"),i},t.prototype.collapse=function(t){this.range&&(this.range=!1,t?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))},t}(),kt=function(){function t(t){this.context=t||this,this.hooks=[]}return t.prototype.register=function(){for(var t=0;t<arguments.length;++t)if("function"==typeof arguments[t])this.hooks.push(arguments[t]);else for(var e=0;e<arguments[t].length;++e)this.hooks.push(arguments[t][e])},t.prototype.deregister=function(t){for(var e=0;e<this.hooks.length;e++)if(this.hooks[e]===t){this.hooks.splice(e,1);break}},t.prototype.trigger=function(){var t=arguments,e=this.context,n=[];return this.hooks.forEach((function(i){var r=i.apply(e,t);r&&"function"==typeof r.then&&n.push(r)})),Promise.all(n)},t.prototype.list=function(){return this.hooks},t.prototype.clear=function(){return this.hooks=[]},t}();function Et(t,e){var n,i,r=e.url,o=r.indexOf("://")>-1;t&&(i=tt(t,"head"),(n=tt(i,"base"))||(n=t.createElement("base"),i.insertBefore(n,i.firstChild)),!o&&window&&window.location&&(r=window.location.origin+r),n.setAttribute("href",r))}function St(t,e){var n,i,r=e.canonical;t&&(n=tt(t,"head"),(i=tt(n,"link[rel='canonical']"))?i.setAttribute("href",r):((i=t.createElement("link")).setAttribute("rel","canonical"),i.setAttribute("href",r),n.appendChild(i)))}function Ct(t,e){var n,i,r=e.idref;t&&(n=tt(t,"head"),(i=tt(n,"link[property='dc.identifier']"))?i.setAttribute("content",r):((i=t.createElement("meta")).setAttribute("name","dc.identifier"),i.setAttribute("content",r),n.appendChild(i)))}function Tt(t,e,n){return e.forEach((function(e,i){e&&n[i]&&(t=t.replace(new RegExp(e,"g"),n[i]))})),t}var At=/[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]/,Nt=new RegExp("[\\-\\.0-9"+At.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Rt=new RegExp("^"+At.source+Nt.source+"*(?::"+At.source+Nt.source+"*)?$");function It(){}function Ot(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function zt(t,e,n,i,r,o){for(var s,a=++e,h=0;;){var u=t.charAt(a);switch(u){case"=":if(1===h)s=t.slice(e,a),h=3;else{if(2!==h)throw new Error("attribute equal must after attrName");h=3}break;case"'":case'"':if(3===h||1===h){if(1===h&&(o.warning('attribute value must after "="'),s=t.slice(e,a)),e=a+1,!((a=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");c=t.slice(e,a).replace(/&#?\w+;/g,r),n.add(s,c,e-1),h=5}else{if(4!=h)throw new Error('attribute value must after "="');c=t.slice(e,a).replace(/&#?\w+;/g,r),n.add(s,c,e),o.warning('attribute "'+s+'" missed start quot('+u+")!!"),e=a+1,h=5}break;case"/":switch(h){case 0:n.setTagName(t.slice(e,a));case 5:case 6:case 7:h=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==h&&n.setTagName(t.slice(e,a)),a;case">":switch(h){case 0:n.setTagName(t.slice(e,a));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(e,a)).slice(-1)&&(n.closed=!0,c=c.slice(0,-1));case 2:2===h&&(c=s),4==h?(o.warning('attribute "'+c+'" missed quot(")!!'),n.add(s,c.replace(/&#?\w+;/g,r),e)):("http://www.w3.org/1999/xhtml"===i[""]&&c.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),n.add(c,c,e));break;case 3:throw new Error("attribute value missed!!")}return a;case"€":u=" ";default:if(u<=" ")switch(h){case 0:n.setTagName(t.slice(e,a)),h=6;break;case 1:s=t.slice(e,a),h=2;break;case 4:var c=t.slice(e,a).replace(/&#?\w+;/g,r);o.warning('attribute "'+c+'" missed quot(")!!'),n.add(s,c,e);case 5:h=6}else switch(h){case 2:"http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),n.add(s,s,e),e=a,h=1;break;case 5:o.warning('attribute space is required"'+s+'"!!');case 6:h=1,e=a;break;case 3:h=4,e=a;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}a++}}function Dt(t,e,n){for(var i=t.tagName,r=null,o=t.length;o--;){var s=t[o],a=s.qName,h=s.value;if((f=a.indexOf(":"))>0)var u=s.prefix=a.slice(0,f),c=a.slice(f+1),l="xmlns"===u&&c;else c=a,u=null,l="xmlns"===a&&"";s.localName=c,!1!==l&&(null==r&&(r={},Pt(n,n={})),n[l]=r[l]=h,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(l,h))}for(o=t.length;o--;)(u=(s=t[o]).prefix)&&("xml"===u&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(s.uri=n[u||""]));var f;(f=i.indexOf(":"))>0?(u=t.prefix=i.slice(0,f),c=t.localName=i.slice(f+1)):(u=null,c=t.localName=i);var d=t.uri=n[u||""];if(e.startElement(d,c,i,t),!t.closed)return t.currentNSMap=n,t.localNSMap=r,!0;if(e.endElement(d,c,i),r)for(u in r)e.endPrefixMapping(u)}function Lt(t,e,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),o)}return e+1}function Bt(t,e,n,i){var r=i[n];return null==r&&((r=t.lastIndexOf("</"+n+">"))<e&&(r=t.lastIndexOf("</"+n)),i[n]=r),r<e}function Pt(t,e){for(var n in t)e[n]=t[n]}function jt(t,e,n,i){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(r=t.indexOf("--\x3e",e+4))>e?(n.comment(t,e+4,r-e-4),r+3):(i.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var r=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,r-e-9),n.endCDATA(),r+3}var o=function(t,e){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(t);n=r.exec(t);)if(i.push(n),n[1])return i}(t,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],h=s>3&&/^public$/i.test(o[2][0])&&o[3][0],u=s>4&&o[4][0],c=o[s-1];return n.startDTD(a,h&&h.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),c.index+c[0].length}return-1}function Ut(t,e,n){var i=t.indexOf("?>",e);if(i){var r=t.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(n.processingInstruction(r[1],r[2]),i+2):-1}return-1}function Ft(t){}function Mt(t,e){return t.__proto__=e,t}It.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),Pt(e,e={}),function(t,e,n,i,r){function o(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(r.error("entity not found:"+t),t)}function s(e){if(e>p){var n=t.substring(p,e).replace(/&#?\w+;/g,o);l&&a(p),i.characters(n,0,e-p),p=e}}function a(e,n){for(;e>=u&&(n=c.exec(t));)h=n.index,u=h+n[0].length,l.lineNumber++;l.columnNumber=e-h+1}for(var h=0,u=0,c=/.*(?:\r\n?|\n)|.*$/g,l=i.locator,f=[{currentNSMap:e}],d={},p=0;;){try{var m=t.indexOf("<",p);if(m<0){if(!t.substr(p).match(/^\s*$/)){var g=i.doc,v=g.createTextNode(t.substr(p));g.appendChild(v),i.currentElement=v}return}switch(m>p&&s(m),t.charAt(m+1)){case"/":var y=t.indexOf(">",m+3),w=t.substring(m+2,y),b=f.pop();y<0?(w=t.substring(m+2).replace(/[\s<].*/,""),r.error("end tag name: "+w+" is not complete:"+b.tagName),y=m+1+w.length):w.match(/\s</)&&(w=w.replace(/[\s<].*/,""),r.error("end tag name: "+w+" maybe not complete"),y=m+1+w.length);var _=b.localNSMap,x=b.tagName==w;if(x||b.tagName&&b.tagName.toLowerCase()==w.toLowerCase()){if(i.endElement(b.uri,b.localName,w),_)for(var k in _)i.endPrefixMapping(k);x||r.fatalError("end tag name: "+w+" is not match the current start tagName:"+b.tagName)}else f.push(b);y++;break;case"?":l&&a(m),y=Ut(t,m,i);break;case"!":l&&a(m),y=jt(t,m,i,r);break;default:l&&a(m);var E=new Ft,S=f[f.length-1].currentNSMap,C=(y=zt(t,m,E,S,o,r),E.length);if(!E.closed&&Bt(t,y,E.tagName,d)&&(E.closed=!0,n.nbsp||r.warning("unclosed xml attribute")),l&&C){for(var T=Ot(l,{}),A=0;A<C;A++){var N=E[A];a(N.offset),N.locator=Ot(l,{})}i.locator=T,Dt(E,i,S)&&f.push(E),i.locator=l}else Dt(E,i,S)&&f.push(E);"http://www.w3.org/1999/xhtml"!==E.uri||E.closed?y++:y=Lt(t,y,E.tagName,o,i)}}catch(t){r.error("element parse error: "+t),y=-1}y>p?p=y:s(Math.max(m,p)+1)}}(t,e,n,i,this.errorHandler),i.endDocument()}},Ft.prototype={setTagName:function(t){if(!Rt.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},add:function(t,e,n){if(!Rt.test(t))throw new Error("invalid attribute:"+t);this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},Mt({},Mt.prototype)instanceof Mt||(Mt=function(t,e){function n(){}for(e in n.prototype=e,n=new n,t)n[e]=t[e];return n});var Wt=It;function qt(t,e){for(var n in t)e[n]=t[n]}function Ht(t,e){var n=t.prototype;if(Object.create){var i=Object.create(e.prototype);n.__proto__=i}if(!(n instanceof e)){function r(){}r.prototype=e.prototype,qt(n,r=new r),t.prototype=n=r}n.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),n.constructor=t)}var Zt={},Yt=Zt.ELEMENT_NODE=1,Vt=Zt.ATTRIBUTE_NODE=2,Xt=Zt.TEXT_NODE=3,Kt=Zt.CDATA_SECTION_NODE=4,$t=Zt.ENTITY_REFERENCE_NODE=5,Gt=Zt.ENTITY_NODE=6,Jt=Zt.PROCESSING_INSTRUCTION_NODE=7,Qt=Zt.COMMENT_NODE=8,te=Zt.DOCUMENT_NODE=9,ee=Zt.DOCUMENT_TYPE_NODE=10,ne=Zt.DOCUMENT_FRAGMENT_NODE=11,ie=Zt.NOTATION_NODE=12,re={},oe={},se=(re.INDEX_SIZE_ERR=(oe[1]="Index size error",1),re.DOMSTRING_SIZE_ERR=(oe[2]="DOMString size error",2),re.HIERARCHY_REQUEST_ERR=(oe[3]="Hierarchy request error",3)),ae=(re.WRONG_DOCUMENT_ERR=(oe[4]="Wrong document",4),re.INVALID_CHARACTER_ERR=(oe[5]="Invalid character",5),re.NO_DATA_ALLOWED_ERR=(oe[6]="No data allowed",6),re.NO_MODIFICATION_ALLOWED_ERR=(oe[7]="No modification allowed",7),re.NOT_FOUND_ERR=(oe[8]="Not found",8)),he=(re.NOT_SUPPORTED_ERR=(oe[9]="Not supported",9),re.INUSE_ATTRIBUTE_ERR=(oe[10]="Attribute in use",10));function ue(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,oe[t]),this.message=oe[t],Error.captureStackTrace&&Error.captureStackTrace(this,ue);return n.code=t,e&&(this.message=this.message+": "+e),n}function ce(){}function le(t,e){this._node=t,this._refresh=e,fe(this)}function fe(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var n=t._refresh(t._node);He(t,"length",n.length),qt(n,t),t._inc=e}}function de(){}function pe(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function me(t,e,n,i){if(i?e[pe(e,i)]=n:e[e.length++]=n,t){n.ownerElement=t;var r=t.ownerDocument;r&&(i&&xe(r,t,i),function(t,e,n){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(e._nsMap[n.prefix?n.localName:""]=n.value)}(r,t,n))}}function ge(t,e,n){var i=pe(e,n);if(!(i>=0))throw ue(ae,new Error(t.tagName+"@"+n));for(var r=e.length-1;i<r;)e[i]=e[++i];if(e.length=r,t){var o=t.ownerDocument;o&&(xe(o,t,n),n.ownerElement=null)}}function ve(t){if(this._features={},t)for(var e in t)this._features=t[e]}function ye(){}function we(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function be(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(be(t,e))return!0}while(t=t.nextSibling)}function _e(){}function xe(t,e,n,i){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete e._nsMap[n.prefix?n.localName:""]}function ke(t,e,n){if(t&&t._inc){t._inc++;var i=e.childNodes;if(n)i[i.length++]=n;else{for(var r=e.firstChild,o=0;r;)i[o++]=r,r=r.nextSibling;i.length=o}}}function Ee(t,e){var n=e.previousSibling,i=e.nextSibling;return n?n.nextSibling=i:t.firstChild=i,i?i.previousSibling=n:t.lastChild=n,ke(t.ownerDocument,t),e}function Se(t,e,n){var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===ne){var r=e.firstChild;if(null==r)return e;var o=e.lastChild}else r=o=e;var s=n?n.previousSibling:t.lastChild;r.previousSibling=s,o.nextSibling=n,s?s.nextSibling=r:t.firstChild=r,null==n?t.lastChild=o:n.previousSibling=o;do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));return ke(t.ownerDocument||t,t),e.nodeType==ne&&(e.firstChild=e.lastChild=null),e}function Ce(){this._nsMap={}}function Te(){}function Ae(){}function Ne(){}function Re(){}function Ie(){}function Oe(){}function ze(){}function De(){}function Le(){}function Be(){}function Pe(){}function je(){}function Ue(t,e){var n=[],i=9==this.nodeType?this.documentElement:this,r=i.prefix,o=i.namespaceURI;if(o&&null==r&&null==(r=i.lookupPrefix(o)))var s=[{namespace:o,prefix:null}];return Me(this,n,t,e,s),n.join("")}function Fe(t,e,n){var i=t.prefix||"",r=t.namespaceURI;if(!i&&!r)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var o=n.length;o--;){var s=n[o];if(s.prefix==i)return s.namespace!=r}return!0}function Me(t,e,n,i,r){if(i){if(!(t=i(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case Yt:r||(r=[]);var o=t.attributes,s=o.length,a=t.firstChild,h=t.tagName;n="http://www.w3.org/1999/xhtml"===t.namespaceURI||n,e.push("<",h);for(var u=0;u<s;u++)"xmlns"==(c=o.item(u)).prefix?r.push({prefix:c.localName,namespace:c.value}):"xmlns"==c.nodeName&&r.push({prefix:"",namespace:c.value});for(u=0;u<s;u++){var c;if(Fe(c=o.item(u),0,r)){var l=c.prefix||"",f=c.namespaceURI,d=l?" xmlns:"+l:" xmlns";e.push(d,'="',f,'"'),r.push({prefix:l,namespace:f})}Me(c,e,n,i,r)}if(Fe(t,0,r)&&(l=t.prefix||"",f=t.namespaceURI,d=l?" xmlns:"+l:" xmlns",e.push(d,'="',f,'"'),r.push({prefix:l,namespace:f})),a||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){if(e.push(">"),n&&/^script$/i.test(h))for(;a;)a.data?e.push(a.data):Me(a,e,n,i,r),a=a.nextSibling;else for(;a;)Me(a,e,n,i,r),a=a.nextSibling;e.push("</",h,">")}else e.push("/>");return;case te:case ne:for(a=t.firstChild;a;)Me(a,e,n,i,r),a=a.nextSibling;return;case Vt:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,we),'"');case Xt:return e.push(t.data.replace(/[<&]/g,we));case Kt:return e.push("<![CDATA[",t.data,"]]>");case Qt:return e.push("\x3c!--",t.data,"--\x3e");case ee:var p=t.publicId,m=t.systemId;if(e.push("<!DOCTYPE ",t.name),p)e.push(' PUBLIC "',p),m&&"."!=m&&e.push('" "',m),e.push('">');else if(m&&"."!=m)e.push(' SYSTEM "',m,'">');else{var g=t.internalSubset;g&&e.push(" [",g,"]"),e.push(">")}return;case Jt:return e.push("<?",t.target," ",t.data,"?>");case $t:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function We(t,e,n){var i;switch(e.nodeType){case Yt:(i=e.cloneNode(!1)).ownerDocument=t;case ne:break;case Vt:n=!0}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,n)for(var r=e.firstChild;r;)i.appendChild(We(t,r,n)),r=r.nextSibling;return i}function qe(t,e,n){var i=new e.constructor;for(var r in e){var o=e[r];"object"!=typeof o&&o!=i[r]&&(i[r]=o)}switch(e.childNodes&&(i.childNodes=new ce),i.ownerDocument=t,i.nodeType){case Yt:var s=e.attributes,a=i.attributes=new de,h=s.length;a._ownerElement=i;for(var u=0;u<h;u++)i.setAttributeNode(qe(t,s.item(u),!0));break;case Vt:n=!0}if(n)for(var c=e.firstChild;c;)i.appendChild(qe(t,c,n)),c=c.nextSibling;return i}function He(t,e,n){t[e]=n}re.INVALID_STATE_ERR=(oe[11]="Invalid state",11),re.SYNTAX_ERR=(oe[12]="Syntax error",12),re.INVALID_MODIFICATION_ERR=(oe[13]="Invalid modification",13),re.NAMESPACE_ERR=(oe[14]="Invalid namespace",14),re.INVALID_ACCESS_ERR=(oe[15]="Invalid access",15),ue.prototype=Error.prototype,qt(re,ue),ce.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],i=0;i<this.length;i++)Me(this[i],n,t,e);return n.join("")}},le.prototype.item=function(t){return fe(this),this[t]},Ht(le,ce),de.prototype={length:0,item:ce.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new ue(he);var n=this.getNamedItem(t.nodeName);return me(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new ue(he);return e=this.getNamedItemNS(t.namespaceURI,t.localName),me(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return ge(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return ge(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var i=this[n];if(i.localName==e&&i.namespaceURI==t)return i}return null}},ve.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];return!(!n||e&&!(e in n))},createDocument:function(t,e,n){var i=new _e;if(i.implementation=this,i.childNodes=new ce,i.doctype=n,n&&i.appendChild(n),e){var r=i.createElementNS(t,e);i.appendChild(r)}return i},createDocumentType:function(t,e,n){var i=new Oe;return i.name=t,i.nodeName=t,i.publicId=e,i.systemId=n,i}},ye.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(t,e){return Se(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return Ee(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return qe(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==Xt&&t.nodeType==Xt?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var i in n)if(n[i]==t)return i;e=e.nodeType==Vt?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==Vt?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},qt(Zt,ye),qt(Zt,ye.prototype),_e.prototype={nodeName:"#document",nodeType:te,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==ne){for(var n=t.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,e),n=i}return t}return null==this.documentElement&&t.nodeType==Yt&&(this.documentElement=t),Se(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),Ee(this,t)},importNode:function(t,e){return We(this,t,e)},getElementById:function(t){var e=null;return be(this.documentElement,(function(n){if(n.nodeType==Yt&&n.getAttribute("id")==t)return e=n,!0})),e},createElement:function(t){var e=new Ce;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new ce,(e.attributes=new de)._ownerElement=e,e},createDocumentFragment:function(){var t=new Be;return t.ownerDocument=this,t.childNodes=new ce,t},createTextNode:function(t){var e=new Ne;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new Re;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new Ie;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new Pe;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new Te;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new Le;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new Ce,i=e.split(":"),r=n.attributes=new de;return n.childNodes=new ce,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=e,r._ownerElement=n,n},createAttributeNS:function(t,e){var n=new Te,i=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=e,n}},Ht(_e,ye),Ce.prototype={nodeType:Yt,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===ne?this.insertBefore(t,null):function(t,e){var n=e.parentNode;if(n){var i=t.lastChild;n.removeChild(e),i=t.lastChild}return i=t.lastChild,e.parentNode=t,e.previousSibling=i,e.nextSibling=null,i?i.nextSibling=e:t.firstChild=e,t.lastChild=e,ke(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var i=this.ownerDocument.createAttributeNS(t,e);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new le(this,(function(e){var n=[];return be(e,(function(i){i===e||i.nodeType!=Yt||"*"!==t&&i.tagName!=t||n.push(i)})),n}))},getElementsByTagNameNS:function(t,e){return new le(this,(function(n){var i=[];return be(n,(function(r){r===n||r.nodeType!==Yt||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||i.push(r)})),i}))}},_e.prototype.getElementsByTagName=Ce.prototype.getElementsByTagName,_e.prototype.getElementsByTagNameNS=Ce.prototype.getElementsByTagNameNS,Ht(Ce,ye),Te.prototype.nodeType=Vt,Ht(Te,ye),Ae.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(oe[se])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){n=this.data.substring(0,t)+n+this.data.substring(t+e),this.nodeValue=this.data=n,this.length=n.length}},Ht(Ae,ye),Ne.prototype={nodeName:"#text",nodeType:Xt,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},Ht(Ne,Ae),Re.prototype={nodeName:"#comment",nodeType:Qt},Ht(Re,Ae),Ie.prototype={nodeName:"#cdata-section",nodeType:Kt},Ht(Ie,Ae),Oe.prototype.nodeType=ee,Ht(Oe,ye),ze.prototype.nodeType=ie,Ht(ze,ye),De.prototype.nodeType=Gt,Ht(De,ye),Le.prototype.nodeType=$t,Ht(Le,ye),Be.prototype.nodeName="#document-fragment",Be.prototype.nodeType=ne,Ht(Be,ye),Pe.prototype.nodeType=Jt,Ht(Pe,ye),je.prototype.serializeToString=function(t,e,n){return Ue.call(t,e,n)},ye.prototype.toString=Ue;try{if(Object.defineProperty){function bc(t){switch(t.nodeType){case Yt:case ne:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(bc(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(le.prototype,"length",{get:function(){return fe(this),this.$$length}}),Object.defineProperty(ye.prototype,"textContent",{get:function(){return bc(this)},set:function(t){switch(this.nodeType){case Yt:case ne:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),He=function(t,e,n){t["$$"+e]=n}}}catch(_c){}var Ze=ve,Ye=je,Ve=c((function(t,e){function n(t){this.options=t||{locator:{}}}function i(){this.cdata=!1}function r(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function o(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function s(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function a(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}n.prototype.parseFromString=function(t,e){var n=this.options,r=new h,s=n.domBuilder||new i,a=n.errorHandler,u=n.locator,c=n.xmlns||{},l={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&s.setDocumentLocator(u),r.errorHandler=function(t,e,n){if(!t){if(e instanceof i)return e;t=e}var r={},s=t instanceof Function;function a(e){var i=t[e];!i&&s&&(i=2==t.length?function(n){t(e,n)}:t),r[e]=i&&function(t){i("[xmldom "+e+"]\t"+t+o(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),r}(a,s,u),r.domBuilder=n.domBuilder||s,/\/x?html?$/.test(e)&&(l.nbsp=" ",l.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t?r.parse(t,c,l):r.errorHandler.error("invalid doc source"),s.doc},i.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,i){var o=this.doc,s=o.createElementNS(t,n||e),h=i.length;a(this,s),this.currentElement=s,this.locator&&r(this.locator,s);for(var u=0;u<h;u++){t=i.getURI(u);var c=i.getValue(u),l=(n=i.getQName(u),o.createAttributeNS(t,n));this.locator&&r(i.getLocator(u),l),l.value=l.nodeValue=c,s.setAttributeNode(l)}},endElement:function(t,e,n){var i=this.currentElement;this.currentElement=i.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&r(this.locator,n),a(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=s.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(t);else i=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(t)&&this.doc.appendChild(i),this.locator&&r(this.locator,i)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=s.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&r(this.locator,i),a(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var o=i.createDocumentType(t,e,n);this.locator&&r(this.locator,o),a(this,o)}},warning:function(t){console.warn("[xmldom warning]\t"+t,o(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,o(this.locator))},fatalError:function(t){throw console.error("[xmldom fatalError]\t"+t,o(this.locator)),t}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){i.prototype[t]=function(){return null}}));var h=Wt,u=e.DOMImplementation=Ze;e.XMLSerializer=Ye,e.DOMParser=n})),Xe=Ve.XMLSerializer,Ke=function(){function t(t,e){this.idref=t.idref,this.linear="yes"===t.linear,this.properties=t.properties,this.index=t.index,this.href=t.href,this.url=t.url,this.canonical=t.canonical,this.next=t.next,this.prev=t.prev,this.cfiBase=t.cfiBase,e?this.hooks=e:(this.hooks={},this.hooks.serialize=new kt(this),this.hooks.content=new kt(this)),this.document=void 0,this.contents=void 0,this.output=void 0}return t.prototype.load=function(t){var e=t||this.request,n=new at,i=n.promise;return this.contents?n.resolve(this.contents):e(this.url).then(function(t){return this.document=t,this.contents=t.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){n.resolve(this.contents)}.bind(this)).catch((function(t){n.reject(t)})),i},t.prototype.base=function(){return Et(this.document,this)},t.prototype.render=function(t){var e=new at,n=e.promise;return this.load(t).then(function(t){var e=("undefined"!=typeof navigator&&navigator.userAgent||"").indexOf("Trident")>=0,n=new("undefined"==typeof XMLSerializer||e?Xe:XMLSerializer);return this.output=n.serializeToString(t),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){e.resolve(this.output)}.bind(this)).catch((function(t){e.reject(t)})),n},t.prototype.find=function(t){var e=this,n=[],i=t.toLowerCase();return it(e.document,(function(t){!function(t){for(var r,o,s,a=t.textContent.toLowerCase(),h=e.document.createRange(),u=-1;-1!=o;)-1!=(o=a.indexOf(i,u+1))&&((h=e.document.createRange()).setStart(t,o),h.setEnd(t,o+i.length),r=e.cfiFromRange(h),s=t.textContent.length<150?t.textContent:"..."+(s=t.textContent.substring(o-75,o+75))+"...",n.push({cfi:r,excerpt:s})),u=o}(t)})),n},t.prototype.reconcileLayoutSettings=function(t){var e={layout:t.layout,spread:t.spread,orientation:t.orientation};return this.properties.forEach((function(t){var n,i,r=t.replace("rendition:",""),o=r.indexOf("-");-1!=o&&(n=r.slice(0,o),i=r.slice(o+1),e[n]=i)})),e},t.prototype.cfiFromRange=function(t){return new xt(t,this.cfiBase).toString()},t.prototype.cfiFromElement=function(t){return new xt(t,this.cfiBase).toString()},t.prototype.unload=function(){this.document=void 0,this.contents=void 0,this.output=void 0},t.prototype.destroy=function(){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},t}(),$e=function(){function t(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new kt,this.hooks.content=new kt,this.hooks.content.register(Et),this.hooks.content.register(St),this.hooks.content.register(Ct),this.epubcfi=new xt,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}return t.prototype.unpack=function(t,e,n){var i=this;this.items=t.spine,this.manifest=t.manifest,this.spineNodeIndex=t.spineNodeIndex,this.baseUrl=t.baseUrl||t.basePath||"",this.length=this.items.length,this.items.forEach((function(t,r){var o,s=i.manifest[t.idref];t.index=r,t.cfiBase=i.epubcfi.generateChapterComponent(i.spineNodeIndex,t.index,t.idref),t.href&&(t.url=e(t.href,!0),t.canonical=n(t.href)),s&&(t.href=s.href,t.url=e(t.href,!0),t.canonical=n(t.href),s.properties.length&&t.properties.push.apply(t.properties,s.properties)),"yes"===t.linear?(t.prev=function(){for(var e=t.index;e>0;){var n=this.get(e-1);if(n&&n.linear)return n;e-=1}}.bind(i),t.next=function(){for(var e=t.index;e<this.spineItems.length-1;){var n=this.get(e+1);if(n&&n.linear)return n;e+=1}}.bind(i)):(t.prev=function(){},t.next=function(){}),o=new Ke(t,i.hooks),i.append(o)})),this.loaded=!0},t.prototype.get=function(t){var e=0;if(void 0===t)for(;e<this.spineItems.length;){var n=this.spineItems[e];if(n&&n.linear)break;e+=1}else this.epubcfi.isCfiString(t)?e=new xt(t).spinePos:"number"==typeof t||!1===isNaN(t)?e=t:"string"==typeof t&&0===t.indexOf("#")?e=this.spineById[t.substring(1)]:"string"==typeof t&&((t=t.split("#")[0]).startsWith("../")&&(t=t.split("../")[1]),e=this.spineByHref[t]||this.spineByHref[encodeURI(t)]||Object.keys(this.spineByHref).findIndex((function(e){return-1!==e.indexOf(t)})));return this.spineItems[e]||null},t.prototype.append=function(t){var e=this.spineItems.length;return t.index=e,this.spineItems.push(t),this.spineByHref[decodeURI(t.href)]=e,this.spineByHref[encodeURI(t.href)]=e,this.spineByHref[t.href]=e,this.spineById[t.idref]=e,e},t.prototype.prepend=function(t){return this.spineByHref[t.href]=0,this.spineById[t.idref]=0,this.spineItems.forEach((function(t,e){t.index=e})),0},t.prototype.remove=function(t){var e=this.spineItems.indexOf(t);if(e>-1)return delete this.spineByHref[t.href],delete this.spineById[t.idref],this.spineItems.splice(e,1)},t.prototype.each=function(){return this.spineItems.forEach.apply(this.spineItems,arguments)},t.prototype.first=function(){var t=0;do{var e=this.get(t);if(e&&e.linear)return e;t+=1}while(t<this.spineItems.length)},t.prototype.last=function(){var t=this.spineItems.length-1;do{var e=this.get(t);if(e&&e.linear)return e;t-=1}while(t>=0)},t.prototype.destroy=function(){this.each((function(t){return t.destroy()})),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0},t}(),Ge=function(){function t(t){this._q=[],this.context=t,this.tick=R,this.running=!1,this.paused=!1}return t.prototype.enqueue=function(){var t,e,n=[].shift.call(arguments),i=arguments;if(!n)throw new Error("No Task Provided");return e="function"==typeof n?{task:n,args:i,deferred:t=new at,promise:t.promise}:{promise:n},this._q.push(e),0!=this.paused||this.running||this.run(),e.promise},t.prototype.dequeue=function(){var t,e,n;return!this._q.length||this.paused?((t=new at).deferred.resolve(),t.promise):(e=(t=this._q.shift()).task)?(n=e.apply(this.context,t.args))&&"function"==typeof n.then?n.then(function(){t.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){t.deferred.reject.apply(this.context,arguments)}.bind(this)):(t.deferred.resolve.apply(this.context,n),t.promise):t.promise?t.promise:void 0},t.prototype.dump=function(){for(;this._q.length;)this.dequeue()},t.prototype.run=function(){var t=this;return this.running||(this.running=!0,this.defered=new at),this.tick.call(window,(function(){t._q.length?t.dequeue().then(function(){this.run()}.bind(t)):(t.defered.resolve(),t.running=void 0)})),1==this.paused&&(this.paused=!1),this.defered.promise},t.prototype.flush=function(){return this.running?this.running:this._q.length?(this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running):void 0},t.prototype.clear=function(){this._q=[]},t.prototype.length=function(){return this._q.length},t.prototype.pause=function(){this.paused=!0},t.prototype.stop=function(){this._q=[],this.running=!1,this.paused=!0},t}(),Je="0.3",Qe=["keydown","keyup","keypressed","mouseup","mousedown","click","touchend","touchstart","touchmove"],tn="openFailed",en="expand",nn="resize",rn="selected",on="selectedRange",sn="linkClicked",an="changed",hn="resize",un="resized",cn="orientationchange",ln="added",fn="scroll",dn="scrolled",pn="removed",mn="axis",gn="loaderror",vn="rendered",yn="resized",wn="displayed",bn="shown",_n="hidden",xn="markClicked",kn="started",En="attached",Sn="displayed",Cn="displayerror",Tn="rendered",An="removed",Nn="resized",Rn="orientationchange",In="locationChanged",On="relocated",zn="markClicked",Dn="selected",Ln="layout",Bn="updated",Pn="attach",jn="detach",Un=function(){function t(t,e,n){this.spine=t,this.request=e,this.pause=n||100,this.q=new Ge(this),this.epubcfi=new xt,this._locations=[],this.total=0,this.break=150,this._current=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}return t.prototype.generate=function(t){return t&&(this.break=t),this.q.pause(),this.spine.each(function(t){t.linear&&this.q.enqueue(this.process.bind(this),t)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))},t.prototype.createRange=function(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}},t.prototype.process=function(t){return t.load(this.request).then(function(e){var n=new at,i=this.parse(e,t.cfiBase);return this._locations=this._locations.concat(i),t.unload(),this.processingTimeout=setTimeout((function(){return n.resolve(i)}),this.pause),n.promise}.bind(this))},t.prototype.parse=function(t,e,n){var i,r,o=[],s=tt(t.ownerDocument,"body"),a=0,h=n||this.break;if(it(s,function(t){var n,s=t.length,u=0;if(0===t.textContent.trim().length)return!1;for(0==a&&((i=this.createRange()).startContainer=t,i.startOffset=0),(n=h-a)>s&&(a+=s,u=s);u<s;)if(n=h-a,0===a&&(u+=1,(i=this.createRange()).startContainer=t,i.startOffset=u),u+n>=s)a+=s-u,u=s;else{u+=n,i.endContainer=t,i.endOffset=u;var c=new xt(i,e).toString();o.push(c),a=0}r=t}.bind(this)),i&&i.startContainer&&r){i.endContainer=r,i.endOffset=r.length;var u=new xt(i,e).toString();o.push(u),a=0}return o},t.prototype.locationFromCfi=function(t){var e;return xt.prototype.isCfiString(t)&&(t=new xt(t)),0===this._locations.length?-1:(e=U(t,this._locations,this.epubcfi.compare))>this.total?this.total:e},t.prototype.percentageFromCfi=function(t){if(0===this._locations.length)return null;var e=this.locationFromCfi(t);return this.percentageFromLocation(e)},t.prototype.percentageFromLocation=function(t){return t&&this.total?t/this.total:0},t.prototype.cfiFromLocation=function(t){var e=-1;return"number"!=typeof t&&(t=parseInt(t)),t>=0&&t<this._locations.length&&(e=this._locations[t]),e},t.prototype.cfiFromPercentage=function(t){var e;if(t>1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),t>=1){var n=new xt(this._locations[this.total]);return n.collapse(),n.toString()}return e=Math.ceil(this.total*t),this.cfiFromLocation(e)},t.prototype.load=function(t){return this._locations="string"==typeof t?JSON.parse(t):t,this.total=this._locations.length-1,this._locations},t.prototype.save=function(){return JSON.stringify(this._locations)},t.prototype.getCurrent=function(){return this._current},t.prototype.setCurrent=function(t){var e;if("string"==typeof t)this._currentCfi=t;else{if("number"!=typeof t)return;this._current=t}0!==this._locations.length&&("string"==typeof t?(e=this.locationFromCfi(t),this._current=e):e=t,this.emit(an,{percentage:this.percentageFromLocation(e)}))},Object.defineProperty(t.prototype,"currentLocation",{get:function(){return this._current},set:function(t){this.setCurrent(t)},enumerable:!0,configurable:!0}),t.prototype.length=function(){return this._locations.length},t.prototype.destroy=function(){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)},t}();N(Un.prototype);var Fn=function(){function t(t){this.packagePath="",this.directory="",this.encoding="",t&&this.parse(t)}return t.prototype.parse=function(t){var e;if(!t)throw new Error("Container File Not Found");if(!(e=tt(t,"rootfile")))throw new Error("No RootFile Found");this.packagePath=e.getAttribute("full-path"),this.directory=wt.dirname(this.packagePath),this.encoding=t.xmlEncoding},t.prototype.destroy=function(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0},t}(),Mn=function(){function t(t){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},t&&this.parse(t)}return t.prototype.parse=function(t){var e,n,i;if(!t)throw new Error("Package File Not Found");if(!(e=tt(t,"metadata")))throw new Error("No Metadata Found");if(!(n=tt(t,"manifest")))throw new Error("No Manifest Found");if(!(i=tt(t,"spine")))throw new Error("No Spine Found");return this.manifest=this.parseManifest(n),this.navPath=this.findNavPath(n),this.ncxPath=this.findNcxPath(n,i),this.coverPath=this.findCoverPath(t),this.spineNodeIndex=Y(i),this.spine=this.parseSpine(i,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(t),this.metadata=this.parseMetadata(e),this.metadata.direction=i.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}},t.prototype.parseMetadata=function(t){var e={};return e.title=this.getElementText(t,"title"),e.creator=this.getElementText(t,"creator"),e.description=this.getElementText(t,"description"),e.pubdate=this.getElementText(t,"date"),e.publisher=this.getElementText(t,"publisher"),e.identifier=this.getElementText(t,"identifier"),e.language=this.getElementText(t,"language"),e.rights=this.getElementText(t,"rights"),e.modified_date=this.getPropertyText(t,"dcterms:modified"),e.layout=this.getPropertyText(t,"rendition:layout"),e.orientation=this.getPropertyText(t,"rendition:orientation"),e.flow=this.getPropertyText(t,"rendition:flow"),e.viewport=this.getPropertyText(t,"rendition:viewport"),e.media_active_class=this.getPropertyText(t,"media:active-class"),e},t.prototype.parseManifest=function(t){var e={},n=et(t,"item");return Array.prototype.slice.call(n).forEach((function(t){var n=t.getAttribute("id"),i=t.getAttribute("href")||"",r=t.getAttribute("media-type")||"",o=t.getAttribute("media-overlay")||"",s=t.getAttribute("properties")||"";e[n]={href:i,type:r,overlay:o,properties:s.length?s.split(" "):[]}})),e},t.prototype.parseSpine=function(t,e){var n=[],i=et(t,"itemref");return Array.prototype.slice.call(i).forEach((function(t,e){var i=t.getAttribute("idref"),r=t.getAttribute("properties")||"",o=r.length?r.split(" "):[],s={idref:i,linear:t.getAttribute("linear")||"yes",properties:o,index:e};n.push(s)})),n},t.prototype.findUniqueIdentifier=function(t){var e=t.documentElement.getAttribute("unique-identifier");if(!e)return"";var n=t.getElementById(e);return n&&"identifier"===n.localName&&"http://purl.org/dc/elements/1.1/"===n.namespaceURI&&n.childNodes.length>0?n.childNodes[0].nodeValue.trim():""},t.prototype.findNavPath=function(t){var e=nt(t,"item",{properties:"nav"});return!!e&&e.getAttribute("href")},t.prototype.findNcxPath=function(t,e){var n,i=nt(t,"item",{"media-type":"application/x-dtbncx+xml"});return i||(n=e.getAttribute("toc"))&&(i=t.querySelector("#"+n)),!!i&&i.getAttribute("href")},t.prototype.findCoverPath=function(t){if("2.0"===tt(t,"package").getAttribute("version")){var e=nt(t,"meta",{name:"cover"});if(e){var n=e.getAttribute("content"),i=t.getElementById(n);return i?i.getAttribute("href"):""}return!1}var r=nt(t,"item",{properties:"cover-image"});return r?r.getAttribute("href"):""},t.prototype.getElementText=function(t,e){var n,i=t.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",e);return i&&0!==i.length&&(n=i[0]).childNodes.length?n.childNodes[0].nodeValue:""},t.prototype.getPropertyText=function(t,e){var n=nt(t,"meta",{property:e});return n&&n.childNodes.length?n.childNodes[0].nodeValue:""},t.prototype.load=function(t){var e=this;this.metadata=t.metadata;var n=t.readingOrder||t.spine;return this.spine=n.map((function(t,e){return t.index=e,t.linear=t.linear||"yes",t})),t.resources.forEach((function(t,n){e.manifest[n]=t,t.rel&&"cover"===t.rel[0]&&(e.coverPath=t.href)})),this.spineNodeIndex=0,this.toc=t.toc.map((function(t,e){return t.label=t.title,t})),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}},t.prototype.destroy=function(){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},t}(),Wn=function(){function t(t){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,t&&this.parse(t)}return t.prototype.parse=function(t){var e,n,i=t.nodeType;i&&(e=tt(t,"html"),n=tt(t,"ncx")),i?e?(this.toc=this.parseNav(t),this.landmarks=this.parseLandmarks(t)):n&&(this.toc=this.parseNcx(t)):this.toc=this.load(t),this.length=0,this.unpack(this.toc)},t.prototype.unpack=function(t){for(var e,n=0;n<t.length;n++)(e=t[n]).href&&(this.tocByHref[e.href]=n),e.id&&(this.tocById[e.id]=n),this.length++,e.subitems.length&&this.unpack(e.subitems)},t.prototype.get=function(t){var e;return t?(0===t.indexOf("#")?e=this.tocById[t.substring(1)]:t in this.tocByHref&&(e=this.tocByHref[t]),this.toc[e]):this.toc},t.prototype.landmark=function(t){var e;return t?(e=this.landmarksByType[t],this.landmarks[e]):this.landmarks},t.prototype.parseNav=function(t){var e,n,i=ht(t,"nav","toc"),r=i?et(i,"li"):[],o=r.length,s={},a=[];if(!r||0===o)return a;for(e=0;e<o;++e)(n=this.navItem(r[e]))&&(s[n.id]=n,n.parent?s[n.parent].subitems.push(n):a.push(n));return a},t.prototype.navItem=function(t){var e=t.getAttribute("id")||void 0,n=lt(t,"a",!0);if(n){var i=n.getAttribute("href")||"";e||(e=i);var r,o=n.textContent||"",s=ft(t,"li");for(s&&((r=s.getAttribute("id"))||(r=(a=lt(s,"a",!0))&&a.getAttribute("href")));!r&&s;){var a;(s=ft(s,"li"))&&((r=s.getAttribute("id"))||(r=(a=lt(s,"a",!0))&&a.getAttribute("href")))}return{id:e,href:i,label:o,subitems:[],parent:r}}},t.prototype.parseLandmarks=function(t){var e,n,i=ht(t,"nav","landmarks"),r=i?et(i,"li"):[],o=r.length,s=[];if(!r||0===o)return s;for(e=0;e<o;++e)(n=this.landmarkItem(r[e]))&&(s.push(n),this.landmarksByType[n.type]=e);return s},t.prototype.landmarkItem=function(t){var e=lt(t,"a",!0);if(e){var n=e.getAttributeNS("http://www.idpf.org/2007/ops","type")||void 0;return{href:e.getAttribute("href")||"",label:e.textContent||"",type:n}}},t.prototype.parseNcx=function(t){var e,n,i=et(t,"navPoint"),r=i.length,o={},s=[];if(!i||0===r)return s;for(e=0;e<r;++e)o[(n=this.ncxItem(i[e])).id]=n,n.parent?o[n.parent].subitems.push(n):s.push(n);return s},t.prototype.ncxItem=function(t){var e,n=t.getAttribute("id")||!1,i=tt(t,"content").getAttribute("src"),r=tt(t,"navLabel"),o=r.textContent?r.textContent:"",s=t.parentNode;return!s||"navPoint"!==s.nodeName&&"navPoint"!==s.nodeName.split(":").slice(-1)[0]||(e=s.getAttribute("id")),{id:n,href:i,label:o,subitems:[],parent:e}},t.prototype.load=function(t){var e=this;return t.map((function(t){return t.label=t.title,t.subitems=t.children?e.load(t.children):[],t}))},t.prototype.forEach=function(t){return this.toc.forEach(t)},t}(),qn={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"}},Hn=function(){var t,e,n,i,r={};for(t in qn)if(qn.hasOwnProperty(t))for(e in qn[t])if(qn[t].hasOwnProperty(e))if("string"==typeof(n=qn[t][e]))r[n]=t+"/"+e;else for(i=0;i<n.length;i++)r[n[i]]=t+"/"+e;return r}(),Zn=function(t){return t&&Hn[t.split(".").pop().toLowerCase()]||"text/plain"},Yn=function(){function t(t,e){this.settings={replacements:e&&e.replacements||"base64",archive:e&&e.archive,resolver:e&&e.resolver,request:e&&e.request},this.process(t)}return t.prototype.process=function(t){this.manifest=t,this.resources=Object.keys(t).map((function(e){return t[e]})),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()},t.prototype.split=function(){this.html=this.resources.filter((function(t){if("application/xhtml+xml"===t.type||"text/html"===t.type)return!0})),this.assets=this.resources.filter((function(t){if("application/xhtml+xml"!==t.type&&"text/html"!==t.type)return!0})),this.css=this.resources.filter((function(t){if("text/css"===t.type)return!0}))},t.prototype.splitUrls=function(){this.urls=this.assets.map(function(t){return t.href}.bind(this)),this.cssUrls=this.css.map((function(t){return t.href}))},t.prototype.createUrl=function(t){var e=new _t(t),n=Zn(e.filename);return this.settings.archive?this.settings.archive.createUrl(t,{base64:"base64"===this.settings.replacements}):"base64"===this.settings.replacements?this.settings.request(t,"blob").then((function(t){return st(t)})).then((function(t){return G(t,n)})):this.settings.request(t,"blob").then((function(t){return K(t,n)}))},t.prototype.replacements=function(){var t=this;if("none"===this.settings.replacements)return new Promise(function(t){t(this.urls)}.bind(this));var e=this.urls.map((function(e){var n=t.settings.resolver(e);return t.createUrl(n).catch((function(t){return console.error(t),null}))}));return Promise.all(e).then((function(e){return t.replacementUrls=e.filter((function(t){return"string"==typeof t})),e}))},t.prototype.replaceCss=function(t,e){var n=[];return t=t||this.settings.archive,e=e||this.settings.resolver,this.cssUrls.forEach(function(i){var r=this.createCssFile(i,t,e).then(function(t){var e=this.urls.indexOf(i);e>-1&&(this.replacementUrls[e]=t)}.bind(this));n.push(r)}.bind(this)),Promise.all(n)},t.prototype.createCssFile=function(t){var e=this;if(wt.isAbsolute(t))return new Promise((function(t){t()}));var n,i=this.settings.resolver(t);n=this.settings.archive?this.settings.archive.getText(i):this.settings.request(i,"text");var r=this.urls.map((function(t){var n=e.settings.resolver(t);return new bt(i).relative(n)}));return n?n.then((function(t){return t=Tt(t,r,e.replacementUrls),"base64"===e.settings.replacements?G(t,"text/css"):K(t,"text/css")}),(function(t){return new Promise((function(t){t()}))})):new Promise((function(t){t()}))},t.prototype.relativeTo=function(t,e){return e=e||this.settings.resolver,this.urls.map(function(n){var i=e(n);return new bt(t).relative(i)}.bind(this))},t.prototype.get=function(t){var e=this.urls.indexOf(t);if(-1!==e)return this.replacementUrls.length?new Promise(function(t,n){t(this.replacementUrls[e])}.bind(this)):this.createUrl(t)},t.prototype.substitute=function(t,e){return Tt(t,e?this.relativeTo(e):this.urls,this.replacementUrls)},t.prototype.destroy=function(){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},t}(),Vn=function(){function t(t){this.pages=[],this.locations=[],this.epubcfi=new xt,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,t&&(this.pageList=this.parse(t)),this.pageList&&this.pageList.length&&this.process(this.pageList)}return t.prototype.parse=function(t){var e=tt(t,"html"),n=tt(t,"ncx");return e?this.parseNav(t):n?this.parseNcx(t):void 0},t.prototype.parseNav=function(t){var e,n,i=ht(t,"nav","page-list"),r=i?et(i,"li"):[],o=r.length,s=[];if(!r||0===o)return s;for(e=0;e<o;++e)n=this.item(r[e]),s.push(n);return s},t.prototype.parseNcx=function(t){var e,n,i,r,o=[],s=0;if(!(n=tt(t,"pageList")))return o;if(r=(i=et(n,"pageTarget")).length,!i||0===i.length)return o;for(s=0;s<r;++s)e=this.ncxItem(i[s]),o.push(e);return o},t.prototype.ncxItem=function(t){var e=tt(t,"navLabel"),n=tt(e,"text").textContent;return{href:tt(t,"content").getAttribute("src"),page:parseInt(n,10)}},t.prototype.item=function(t){var e,n,i=tt(t,"a"),r=i.getAttribute("href")||"",o=i.textContent||"",s=parseInt(o);return-1!=r.indexOf("epubcfi")?(n=(e=r.split("#"))[0],{cfi:e.length>1&&e[1],href:r,packageUrl:n,page:s}):{href:r,page:s}},t.prototype.process=function(t){t.forEach((function(t){this.pages.push(t.page),t.cfi&&this.locations.push(t.cfi)}),this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage},t.prototype.pageFromCfi=function(t){var e=-1;if(0===this.locations.length)return-1;var n=F(t,this.locations,this.epubcfi.compare);return-1!=n?e=this.pages[n]:void 0!==(e=(n=U(t,this.locations,this.epubcfi.compare))-1>=0?this.pages[n-1]:this.pages[0])||(e=-1),e},t.prototype.cfiFromPage=function(t){var e=-1;"number"!=typeof t&&(t=parseInt(t));var n=this.pages.indexOf(t);return-1!=n&&(e=this.locations[n]),e},t.prototype.pageFromPercentage=function(t){return Math.round(this.totalPages*t)},t.prototype.percentageFromPage=function(t){var e=(t-this.firstPage)/this.totalPages;return Math.round(1e3*e)/1e3},t.prototype.percentageFromCfi=function(t){var e=this.pageFromCfi(t);return this.percentageFromPage(e)},t.prototype.destroy=function(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0},t}(),Xn=function(){function t(t){this.settings=t,this.name=t.layout||"reflowable",this._spread="none"!==t.spread,this._minSpreadWidth=t.minSpreadWidth||800,this._evenSpreads=t.evenSpreads||!1,"scrolled"===t.flow||"scrolled-continuous"===t.flow||"scrolled-doc"===t.flow?this._flow="scrolled":this._flow="paginated",this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1,this.props={name:this.name,spread:this._spread,flow:this._flow,width:0,height:0,spreadWidth:0,delta:0,columnWidth:0,gap:0,divisor:1}}return t.prototype.flow=function(t){return void 0!==t&&(this._flow="scrolled"===t||"scrolled-continuous"===t||"scrolled-doc"===t?"scrolled":"paginated",this.update({flow:this._flow})),this._flow},t.prototype.spread=function(t,e){return t&&(this._spread="none"!==t,this.update({spread:this._spread})),e>=0&&(this._minSpreadWidth=e),this._spread},t.prototype.calculate=function(t,e,n){var i,r,o,s,a,h=n||0,u=t,c=e,l=Math.floor(u/12);a=this._spread&&u>=this._minSpreadWidth?2:1,"reflowable"!==this.name||"paginated"!==this._flow||n>=0||(h=l%2==0?l:l-1),"pre-paginated"===this.name&&(h=0),a>1?o=(i=u/a-h)+h:(i=u,o=u),"pre-paginated"===this.name&&a>1&&(u=i),r=i*a+h,s=u,this.width=u,this.height=c,this.spreadWidth=r,this.pageWidth=o,this.delta=s,this.columnWidth=i,this.gap=h,this.divisor=a,this.update({width:u,height:c,spreadWidth:r,pageWidth:o,delta:s,columnWidth:i,gap:h,divisor:a})},t.prototype.format=function(t){return"pre-paginated"===this.name?t.fit(this.columnWidth,this.height):"paginated"===this._flow?t.columns(this.width,this.height,this.columnWidth,this.gap):t.size(this.width,null)},t.prototype.count=function(t,e){var n,i;return"pre-paginated"===this.name?(n=1,i=1):"paginated"===this._flow?(e=e||this.delta,i=(n=Math.ceil(t/e))*this.divisor):(e=e||this.height,i=n=Math.ceil(t/e)),{spreads:n,pages:i}},t.prototype.update=function(t){var e=this;if(Object.keys(t).forEach((function(n){e.props[n]===t[n]&&delete t[n]})),Object.keys(t).length>0){var n=j(this.props,t);this.emit(Bn,n,t)}},t}();N(Xn.prototype);var Kn=function(){function t(t){this.rendition=t,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}return t.prototype.register=function(){if(0!==arguments.length)return 1===arguments.length&&"object"==typeof arguments[0]?this.registerThemes(arguments[0]):1===arguments.length&&"string"==typeof arguments[0]?this.default(arguments[0]):2===arguments.length&&"string"==typeof arguments[1]?this.registerUrl(arguments[0],arguments[1]):2===arguments.length&&"object"==typeof arguments[1]?this.registerRules(arguments[0],arguments[1]):void 0},t.prototype.default=function(t){if(t)return"string"==typeof t?this.registerUrl("default",t):"object"==typeof t?this.registerRules("default",t):void 0},t.prototype.registerThemes=function(t){for(var e in t)t.hasOwnProperty(e)&&("string"==typeof t[e]?this.registerUrl(e,t[e]):this.registerRules(e,t[e]))},t.prototype.registerUrl=function(t,e){var n=new _t(e);this._themes[t]={url:n.toString()},this._injected[t]&&this.update(t)},t.prototype.registerRules=function(t,e){this._themes[t]={rules:e},this._injected[t]&&this.update(t)},t.prototype.select=function(t){var e=this._current;this._current=t,this.update(t),this.rendition.getContents().forEach((function(n){n.removeClass(e),n.addClass(t)}))},t.prototype.update=function(t){var e=this;this.rendition.getContents().forEach((function(n){e.add(t,n)}))},t.prototype.inject=function(t){var e,n=[],i=this._themes;for(var r in i)!i.hasOwnProperty(r)||r!==this._current&&"default"!==r||(((e=i[r]).rules&&Object.keys(e.rules).length>0||e.url&&-1===n.indexOf(e.url))&&this.add(r,t),this._injected.push(r));"default"!=this._current&&t.addClass(this._current)},t.prototype.add=function(t,e){var n=this._themes[t];n&&e&&(n.url?e.addStylesheet(n.url):n.serialized||n.rules&&(e.addStylesheetRules(n.rules),n.injected=!0))},t.prototype.override=function(t,e,n){var i=this,r=this.rendition.getContents();this._overrides[t]={value:e,priority:!0===n},r.forEach((function(e){e.css(t,i._overrides[t].value,i._overrides[t].priority)}))},t.prototype.removeOverride=function(t){var e=this.rendition.getContents();delete this._overrides[t],e.forEach((function(e){e.css(t)}))},t.prototype.overrides=function(t){var e=this._overrides;for(var n in e)e.hasOwnProperty(n)&&t.css(n,e[n].value,e[n].priority)},t.prototype.fontSize=function(t){this.override("font-size",t)},t.prototype.font=function(t){this.override("font-family",t,!0)},t.prototype.destroy=function(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0},t}(),$n=function(){function t(t,e,n,i){this.layout=t,this.horizontal="horizontal"===n,this.direction=e||"ltr",this._dev=i}return t.prototype.section=function(t){var e=this.findRanges(t);return this.rangeListToCfiList(t.section.cfiBase,e)},t.prototype.page=function(t,e,n,i){var r,o=!(!t||!t.document)&&t.document.body;if(o){if(r=this.rangePairToCfiPair(e,{start:this.findStart(o,n,i),end:this.findEnd(o,n,i)}),!0===this._dev){var s=t.document,a=new xt(r.start).toRange(s),h=new xt(r.end).toRange(s),u=s.defaultView.getSelection(),c=s.createRange();u.removeAllRanges(),c.setStart(a.startContainer,a.startOffset),c.setEnd(h.endContainer,h.endOffset),u.addRange(c)}return r}},t.prototype.walk=function(t,e){if(!t||t.nodeType!==Node.TEXT_NODE){var n=function(t){return t.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},i=n;i.acceptNode=n;for(var r,o,s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,i,!1);(r=s.nextNode())&&!(o=e(r)););return o}},t.prototype.findRanges=function(t){for(var e,n,i=[],r=t.contents.scrollWidth(),o=Math.ceil(r/this.layout.spreadWidth)*this.layout.divisor,s=this.layout.columnWidth,a=this.layout.gap,h=0;h<o.pages;h++)e=(s+a)*h,n=s*(h+1)+a*h,i.push({start:this.findStart(t.document.body,e,n),end:this.findEnd(t.document.body,e,n)});return i},t.prototype.findStart=function(t,e,n){for(var i,r,o=this,s=[t],a=t;s.length;)if(i=s.shift(),r=this.walk(i,(function(t){var i,r,h,u,c;if(c=q(t),o.horizontal&&"ltr"===o.direction){if(i=o.horizontal?c.left:c.top,r=o.horizontal?c.right:c.bottom,i>=e&&i<=n)return t;if(r>e)return t;a=t,s.push(t)}else if(o.horizontal&&"rtl"===o.direction){if(i=c.left,(r=c.right)<=n&&r>=e)return t;if(i<n)return t;a=t,s.push(t)}else{if(h=c.top,u=c.bottom,h>=e&&h<=n)return t;if(u>e)return t;a=t,s.push(t)}})))return this.findTextStartRange(r,e,n);return this.findTextStartRange(a,e,n)},t.prototype.findEnd=function(t,e,n){for(var i,r,o=this,s=[t],a=t;s.length;)if(i=s.shift(),r=this.walk(i,(function(t){var i,r,h,u,c;if(c=q(t),o.horizontal&&"ltr"===o.direction){if(i=Math.round(c.left),r=Math.round(c.right),i>n&&a)return a;if(r>n)return t;a=t,s.push(t)}else if(o.horizontal&&"rtl"===o.direction){if(i=Math.round(o.horizontal?c.left:c.top),(r=Math.round(o.horizontal?c.right:c.bottom))<e&&a)return a;if(i<e)return t;a=t,s.push(t)}else{if(h=Math.round(c.top),u=Math.round(c.bottom),h>n&&a)return a;if(u>n)return t;a=t,s.push(t)}})))return this.findTextEndRange(r,e,n);return this.findTextEndRange(a,e,n)},t.prototype.findTextStartRange=function(t,e,n){for(var i,r,o=this.splitTextNodeIntoRanges(t),s=0;s<o.length;s++)if(r=(i=o[s]).getBoundingClientRect(),this.horizontal&&"ltr"===this.direction){if(r.left>=e)return i}else if(this.horizontal&&"rtl"===this.direction){if(r.right<=n)return i}else if(r.top>=e)return i;return o[0]},t.prototype.findTextEndRange=function(t,e,n){for(var i,r,o,s,a,h,u,c=this.splitTextNodeIntoRanges(t),l=0;l<c.length;l++){if(o=(r=c[l]).getBoundingClientRect(),this.horizontal&&"ltr"===this.direction){if(s=o.left,a=o.right,s>n&&i)return i;if(a>n)return r}else if(this.horizontal&&"rtl"===this.direction){if(s=o.left,(a=o.right)<e&&i)return i;if(s<e)return r}else{if(h=o.top,u=o.bottom,h>n&&i)return i;if(u>n)return r}i=r}return c[c.length-1]},t.prototype.splitTextNodeIntoRanges=function(t,e){var n,i=[],r=(t.textContent||"").trim(),o=t.ownerDocument,s=e||" ",a=r.indexOf(s);if(-1===a||t.nodeType!=Node.TEXT_NODE)return(n=o.createRange()).selectNodeContents(t),[n];for((n=o.createRange()).setStart(t,0),n.setEnd(t,a),i.push(n),n=!1;-1!=a;)(a=r.indexOf(s,a+1))>0&&(n&&(n.setEnd(t,a),i.push(n)),(n=o.createRange()).setStart(t,a+1));return n&&(n.setEnd(t,r.length),i.push(n)),i},t.prototype.rangePairToCfiPair=function(t,e){var n=e.start,i=e.end;return n.collapse(!0),i.collapse(!1),{start:new xt(n,t).toString(),end:new xt(i,t).toString()}},t.prototype.rangeListToCfiList=function(t,e){for(var n,i=[],r=0;r<e.length;r++)n=this.rangePairToCfiPair(t,e[r]),i.push(n);return i},t.prototype.axis=function(t){return t&&(this.horizontal="horizontal"===t),this.horizontal},t}(),Gn="undefined"!=typeof navigator,Jn=Gn&&/Chrome/.test(navigator.userAgent),Qn=Gn&&!Jn&&/AppleWebKit/.test(navigator.userAgent),ti=function(){function t(t,e,n,i){this.epubcfi=new xt,this.document=t,this.documentElement=this.document.documentElement,this.content=e||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=i||0,this.cfiBase=n||"",this.epubReadingSystem("epub.js",Je),this.listeners()}return Object.defineProperty(t,"listenedEvents",{get:function(){return Qe},enumerable:!0,configurable:!0}),t.prototype.width=function(t){var e=this.content;return t&&D(t)&&(t+="px"),t&&(e.style.width=t),this.window.getComputedStyle(e).width},t.prototype.height=function(t){var e=this.content;return t&&D(t)&&(t+="px"),t&&(e.style.height=t),this.window.getComputedStyle(e).height},t.prototype.contentWidth=function(t){var e=this.content||this.document.body;return t&&D(t)&&(t+="px"),t&&(e.style.width=t),this.window.getComputedStyle(e).width},t.prototype.contentHeight=function(t){var e=this.content||this.document.body;return t&&D(t)&&(t+="px"),t&&(e.style.height=t),this.window.getComputedStyle(e).height},t.prototype.textWidth=function(){var t,e=this.document.createRange(),n=this.content||this.document.body,i=W(n);return e.selectNodeContents(n),t=e.getBoundingClientRect().width,i&&i.width&&(t+=i.width),Math.round(t)},t.prototype.textHeight=function(){var t,e,n=this.document.createRange(),i=this.content||this.document.body,r=W(i);return n.selectNodeContents(i),(e=(t=n.getBoundingClientRect()).height)&&r.height&&(e+=r.height),e&&t.top&&(e+=t.top),Math.round(e)},t.prototype.scrollWidth=function(){return this.documentElement.scrollWidth},t.prototype.scrollHeight=function(){return this.documentElement.scrollHeight},t.prototype.overflow=function(t){return t&&(this.documentElement.style.overflow=t),this.window.getComputedStyle(this.documentElement).overflow},t.prototype.overflowX=function(t){return t&&(this.documentElement.style.overflowX=t),this.window.getComputedStyle(this.documentElement).overflowX},t.prototype.overflowY=function(t){return t&&(this.documentElement.style.overflowY=t),this.window.getComputedStyle(this.documentElement).overflowY},t.prototype.css=function(t,e,n){var i=this.content||this.document.body;return e?i.style.setProperty(t,e,n?"important":""):i.style.removeProperty(t),this.window.getComputedStyle(i)[t]},t.prototype.viewport=function(t){var e,n=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=[];if(n&&n.hasAttribute("content")){var o=n.getAttribute("content"),s=o.match(/width\s*=\s*([^,]*)/),a=o.match(/height\s*=\s*([^,]*)/),h=o.match(/initial-scale\s*=\s*([^,]*)/),u=o.match(/minimum-scale\s*=\s*([^,]*)/),c=o.match(/maximum-scale\s*=\s*([^,]*)/),l=o.match(/user-scalable\s*=\s*([^,]*)/);s&&s.length&&void 0!==s[1]&&(i.width=s[1]),a&&a.length&&void 0!==a[1]&&(i.height=a[1]),h&&h.length&&void 0!==h[1]&&(i.scale=h[1]),u&&u.length&&void 0!==u[1]&&(i.minimum=u[1]),c&&c.length&&void 0!==c[1]&&(i.maximum=c[1]),l&&l.length&&void 0!==l[1]&&(i.scalable=l[1])}return e=P(t||{},i),t&&(e.width&&r.push("width="+e.width),e.height&&r.push("height="+e.height),e.scale&&r.push("initial-scale="+e.scale),"no"===e.scalable?(r.push("minimum-scale="+e.scale),r.push("maximum-scale="+e.scale),r.push("user-scalable="+e.scalable)):(e.scalable&&r.push("user-scalable="+e.scalable),e.minimum&&r.push("minimum-scale="+e.minimum),e.maximum&&r.push("minimum-scale="+e.maximum)),n||((n=this.document.createElement("meta")).setAttribute("name","viewport"),this.document.querySelector("head").appendChild(n)),n.setAttribute("content",r.join(", ")),this.window.scrollTo(0,0)),e},t.prototype.expand=function(){this.emit(en)},t.prototype.listeners=function(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),this.resizeListeners(),this.linksHandler()},t.prototype.removeListeners=function(){this.removeEventListeners(),this.removeSelectionListeners(),clearTimeout(this.expanding)},t.prototype.resizeCheck=function(){var t=this.textWidth(),e=this.textHeight();t==this._size.width&&e==this._size.height||(this._size={width:t,height:e},this.onResize&&this.onResize(this._size),this.emit(nn,this._size))},t.prototype.resizeListeners=function(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this))},t.prototype.transitionListeners=function(){var t=this.content;t.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",t.style.transitionDuration="0.001ms",t.style.transitionTimingFunction="linear",t.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)},t.prototype.mediaQueryListeners=function(){for(var t=this.document.styleSheets,e=function(t){t.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),n=0;n<t.length;n+=1){var i;try{i=t[n].cssRules}catch(t){return}if(!i)return;for(var r=0;r<i.length;r+=1)i[r].media&&this.window.matchMedia(i[r].media.mediaText).addListener(e)}},t.prototype.resizeObservers=function(){var t=this;this.observer=new MutationObserver((function(e){t.resizeCheck()})),this.observer.observe(this.document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})},t.prototype.imageLoadListeners=function(){for(var t,e=this.document.querySelectorAll("img"),n=0;n<e.length;n++)void 0!==(t=e[n]).naturalWidth&&0===t.naturalWidth&&(t.onload=this.expand.bind(this))},t.prototype.fontLoadListeners=function(){this.document&&this.document.fonts&&this.document.fonts.ready.then(function(){this.resizeCheck()}.bind(this))},t.prototype.root=function(){return this.document?this.document.documentElement:null},t.prototype.locationOf=function(t,e){var n,i={left:0,top:0};if(!this.document)return i;if(this.epubcfi.isCfiString(t)){var r=new xt(t).toRange(this.document,e);if(r){try{if(!r.endContainer||r.startContainer==r.endContainer&&r.startOffset==r.endOffset){var o=r.startContainer.textContent.indexOf(" ",r.startOffset);-1==o&&(o=r.startContainer.textContent.length),r.setEnd(r.startContainer,o)}}catch(t){console.error("setting end offset to start container length failed",t)}if(r.startContainer.nodeType===Node.ELEMENT_NODE)n=r.startContainer.getBoundingClientRect(),i.left=n.left,i.top=n.top;else if(Qn){var s=r.startContainer,a=new Range;try{1===s.nodeType?n=s.getBoundingClientRect():r.startOffset+2<s.length?(a.setStart(s,r.startOffset),a.setEnd(s,r.startOffset+2),n=a.getBoundingClientRect()):r.startOffset-2>0?(a.setStart(s,r.startOffset-2),a.setEnd(s,r.startOffset),n=a.getBoundingClientRect()):n=s.parentNode.getBoundingClientRect()}catch(t){console.error(t,t.stack)}}else n=r.getBoundingClientRect()}}else if("string"==typeof t&&t.indexOf("#")>-1){var h=t.substring(t.indexOf("#")+1),u=this.document.getElementById(h);u&&(Qn?((a=new Range).selectNode(u),n=a.getBoundingClientRect()):n=u.getBoundingClientRect())}return n&&(i.left=n.left,i.top=n.top),i},t.prototype.addStylesheet=function(t){return new Promise(function(e,n){var i,r=!1;this.document?(i=this.document.querySelector("link[href='"+t+"']"))?e(!0):((i=this.document.createElement("link")).type="text/css",i.rel="stylesheet",i.href=t,i.onload=i.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout((function(){e(!0)}),1))},this.document.head.appendChild(i)):e(!1)}.bind(this))},t.prototype.addStylesheetRules=function(t){var e,n,i="epubjs-inserted-css";if(this.document&&t&&0!==t.length)if((e=this.document.getElementById("#"+i))||((e=this.document.createElement("style")).id=i),this.document.head.appendChild(e),n=e.sheet,"[object Array]"===Object.prototype.toString.call(t))for(var r=0,o=t.length;r<o;r++){var s=1,a=t[r],h=t[r][0],u="";"[object Array]"===Object.prototype.toString.call(a[1][0])&&(a=a[1],s=0);for(var c=a.length;s<c;s++){var l=a[s];u+=l[0]+":"+l[1]+(l[2]?" !important":"")+";\n"}n.insertRule(h+"{"+u+"}",n.cssRules.length)}else Object.keys(t).forEach((function(e){var i=t[e];if(Array.isArray(i))i.forEach((function(t){var i=Object.keys(t).map((function(e){return e+":"+t[e]})).join(";");n.insertRule(e+"{"+i+"}",n.cssRules.length)}));else{var r=Object.keys(i).map((function(t){return t+":"+i[t]})).join(";");n.insertRule(e+"{"+r+"}",n.cssRules.length)}}))},t.prototype.addScript=function(t){return new Promise(function(e,n){var i,r=!1;this.document?((i=this.document.createElement("script")).type="text/javascript",i.async=!0,i.src=t,i.onload=i.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout((function(){e(!0)}),1))},this.document.head.appendChild(i)):e(!1)}.bind(this))},t.prototype.addClass=function(t){var e;this.document&&(e=this.content||this.document.body)&&e.classList.add(t)},t.prototype.removeClass=function(t){var e;this.document&&(e=this.content||this.document.body)&&e.classList.remove(t)},t.prototype.addEventListeners=function(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),Qe.forEach((function(t){this.document.addEventListener(t,this._triggerEvent,{passive:!0})}),this))},t.prototype.removeEventListeners=function(){this.document&&(Qe.forEach((function(t){this.document.removeEventListener(t,this._triggerEvent,{passive:!0})}),this),this._triggerEvent=void 0)},t.prototype.triggerEvent=function(t){this.emit(t.type,t)},t.prototype.addSelectionListeners=function(){this.document&&(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))},t.prototype.removeSelectionListeners=function(){this.document&&(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)},t.prototype.onSelectionChange=function(t){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}.bind(this),250)},t.prototype.triggerSelectedEvent=function(t){var e,n;t&&t.rangeCount>0&&((e=t.getRangeAt(0)).collapsed||(n=new xt(e,this.cfiBase).toString(),this.emit(rn,n),this.emit(on,e)))},t.prototype.range=function(t,e){return new xt(t).toRange(this.document,e)},t.prototype.cfiFromRange=function(t,e){return new xt(t,this.cfiBase,e).toString()},t.prototype.cfiFromNode=function(t,e){return new xt(t,this.cfiBase,e).toString()},t.prototype.map=function(t){return new $n(t).section()},t.prototype.size=function(t,e){var n={scale:1,scalable:"no"};this.layoutStyle("scrolling"),t>=0&&(this.width(t),n.width=t,this.css("padding","0 "+t/12+"px")),e>=0&&(this.height(e),n.height=e),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(n)},t.prototype.columns=function(t,e,n,i){var r=B("column-axis"),o=B("column-gap"),s=B("column-width"),a=B("column-fill"),h=0===this.writingMode().indexOf("vertical")?"vertical":"horizontal";this.layoutStyle("paginated"),"rtl"===this.content.dir&&this.direction("rtl"),this.width(t),this.height(e),this.viewport({width:t,height:e,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),"vertical"===h?(this.css("padding-top",i/2+"px",!0),this.css("padding-bottom",i/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",i/2+"px",!0),this.css("padding-right",i/2+"px",!0)),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(r,"horizontal"),this.css(a,"auto"),this.css(o,i+"px"),this.css(s,n+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")},t.prototype.scaler=function(t,e,n){var i="scale("+t+")",r="";this.css("transform-origin","top left"),(e>=0||n>=0)&&(r=" translate("+(e||0)+"px, "+(n||0)+"px )"),this.css("transform",i+r)},t.prototype.fit=function(t,e){var n=this.viewport(),i=parseInt(n.width),r=parseInt(n.height),o=t/i,s=e/r,a=o<s?o:s;this.layoutStyle("paginated"),this.width(i),this.height(r),this.overflow("hidden"),this.scaler(a,0,0),this.css("background-size",i*a+"px "+r*a+"px"),this.css("background-color","transparent")},t.prototype.direction=function(t){this.documentElement&&(this.documentElement.style.direction=t)},t.prototype.mapPage=function(t,e,n,i,r){return new $n(e,r).page(this,t,n,i)},t.prototype.linksHandler=function(){var t=this;!function(t,e){var n=t.querySelectorAll("a[href]");if(n.length)for(var i=tt(t.ownerDocument,"base"),r=i?i.getAttribute("href"):void 0,o=function(t){var n=t.getAttribute("href");if(0!==n.indexOf("mailto:"))if(n.indexOf("://")>-1)t.setAttribute("target","_blank");else{var i;try{i=new _t(n,r)}catch(t){}t.onclick=function(){return i&&i.hash?e(i.Path.path+i.hash):e(i?i.Path.path:n),!1}}}.bind(this),s=0;s<n.length;s++)o(n[s])}(this.content,(function(e){t.emit(sn,e)}))},t.prototype.writingMode=function(t){var e=B("writing-mode");return t&&this.documentElement&&(this.documentElement.style[e]=t),this.window.getComputedStyle(this.documentElement)[e]||""},t.prototype.layoutStyle=function(t){return t&&(this._layoutStyle=t,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"},t.prototype.epubReadingSystem=function(t,e){return navigator.epubReadingSystem={name:t,version:e,layoutStyle:this.layoutStyle(),hasFeature:function(t){switch(t){case"dom-manipulation":case"layout-changes":case"touch-events":case"mouse-events":case"keyboard-events":return!0;default:return!1}}},navigator.epubReadingSystem},t.prototype.destroy=function(){this.observer&&this.observer.disconnect(),this.document.removeEventListener("transitionend",this._resizeCheck),this.removeListeners()},t}();N(ti.prototype);var ei=function(){function t(t){this.rendition=t,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}return t.prototype.add=function(t,e,n,i,r,o){var s=encodeURI(e+t),a=new xt(e).spinePos,h=new ni({type:t,cfiRange:e,data:n,sectionIndex:a,cb:i,className:r,styles:o});return this._annotations[s]=h,a in this._annotationsBySectionIndex?this._annotationsBySectionIndex[a].push(s):this._annotationsBySectionIndex[a]=[s],this.rendition.views().forEach((function(t){h.sectionIndex===t.index&&h.attach(t)})),h},t.prototype.remove=function(t,e){var n=this,i=encodeURI(t+e);if(i in this._annotations){var r=this._annotations[i];if(e&&r.type!==e)return;this.rendition.views().forEach((function(t){n._removeFromAnnotationBySectionIndex(r.sectionIndex,i),r.sectionIndex===t.index&&r.detach(t)})),delete this._annotations[i]}},t.prototype._removeFromAnnotationBySectionIndex=function(t,e){this._annotationsBySectionIndex[t]=this._annotationsAt(t).filter((function(t){return t!==e}))},t.prototype._annotationsAt=function(t){return this._annotationsBySectionIndex[t]},t.prototype.highlight=function(t,e,n,i,r){return this.add("highlight",t,e,n,i,r)},t.prototype.underline=function(t,e,n,i,r){return this.add("underline",t,e,n,i,r)},t.prototype.mark=function(t,e,n){return this.add("mark",t,e,n)},t.prototype.each=function(){return this._annotations.forEach.apply(this._annotations,arguments)},t.prototype.inject=function(t){var e=this,n=t.index;n in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[n].forEach((function(n){e._annotations[n].attach(t)}))},t.prototype.clear=function(t){var e=this,n=t.index;n in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[n].forEach((function(n){e._annotations[n].detach(t)}))},t.prototype.show=function(){},t.prototype.hide=function(){},t}(),ni=function(){function t(t){var e=t.type,n=t.cfiRange,i=t.data,r=t.sectionIndex,o=t.cb,s=t.className,a=t.styles;this.type=e,this.cfiRange=n,this.data=i,this.sectionIndex=r,this.mark=void 0,this.cb=o,this.className=s,this.styles=a}return t.prototype.update=function(t){this.data=t},t.prototype.attach=function(t){var e,n=this,i=n.cfiRange,r=n.data,o=n.type,s=(n.mark,n.cb),a=n.className,h=n.styles;return"highlight"===o?e=t.highlight(i,r,s,a,h):"underline"===o?e=t.underline(i,r,s,a,h):"mark"===o&&(e=t.mark(i,r,s)),this.mark=e,this.emit(Pn,e),e},t.prototype.detach=function(t){var e,n=this.cfiRange,i=this.type;return t&&("highlight"===i?e=t.unhighlight(n):"underline"===i?e=t.ununderline(n):"mark"===i&&(e=t.unmark(n))),this.mark=void 0,this.emit(jn,e),e},t.prototype.text=function(){},t}();N(ni.prototype);var ii=c((function(t,e){function n(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}Object.defineProperty(e,"__esModule",{value:!0}),e.createElement=n,e.default={createElement:n}}));u(ii);var ri=c((function(t,e){function n(t,e){function n(n){for(var o=e.length-1;o>=0;o--){var s=e[o],a=n.clientX,h=n.clientY;if(n.touches&&n.touches.length&&(a=n.touches[0].clientX,h=n.touches[0].clientY),r(s,t,a,h)){s.dispatchEvent(i(n));break}}}if("iframe"===t.nodeName||"IFRAME"===t.nodeName)try{this.target=t.contentDocument}catch(e){this.target=t}else this.target=t;for(var o=["mouseup","mousedown","click","touchstart"],s=0;s<o.length;s++){var a=o[s];this.target.addEventListener(a,(function(t){return n(t)}),!1)}}function i(t){var e=Object.assign({},t,{bubbles:!1});try{return new MouseEvent(t.type,e)}catch(i){var n=document.createEvent("MouseEvents");return n.initMouseEvent(t.type,!1,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),n}}function r(t,e,n,i){var r=e.getBoundingClientRect();function o(t,e,n){var i=t.top-r.top,o=t.left-r.left,s=i+t.height,a=o+t.width;return i<=n&&o<=e&&s>n&&a>e}if(!o(t.getBoundingClientRect(),n,i))return!1;for(var s=t.getClientRects(),a=0,h=s.length;a<h;a++)if(o(s[a],n,i))return!0;return!1}Object.defineProperty(e,"__esModule",{value:!0}),e.proxyMouse=n,e.clone=i,e.default={proxyMouse:n}}));u(ri);var oi=c((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Underline=e.Highlight=e.Mark=e.Pane=void 0;var n=function t(e,n,i){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=s(ii),o=s(ri);function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.Pane=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body;u(this,t),this.target=e,this.element=r.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),o.default.proxyMouse(this.target,this.marks),this.container=n,this.container.appendChild(this.element),this.render()}return i(t,[{key:"addMark",value:function(t){var e=r.default.createElement("g");return this.element.appendChild(e),t.bind(e,this.container),this.marks.push(t),t.render(),t}},{key:"removeMark",value:function(t){var e=this.marks.indexOf(t);if(-1!==e){var n=t.unbind();this.element.removeChild(n),this.marks.splice(e,1)}}},{key:"render",value:function(){var t,e,n,i;!function(t,e){t.style.setProperty("top",e.top+"px","important"),t.style.setProperty("left",e.left+"px","important"),t.style.setProperty("height",e.height+"px","important"),t.style.setProperty("width",e.width+"px","important")}(this.element,(t=this.target,e=this.container,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),{top:i.top-n.top,left:i.left-n.left,height:t.scrollHeight,width:t.scrollWidth}));var r=!0,o=!1,s=void 0;try{for(var a,h=this.marks[Symbol.iterator]();!(r=(a=h.next()).done);r=!0)a.value.render()}catch(t){o=!0,s=t}finally{try{!r&&h.return&&h.return()}finally{if(o)throw s}}}}]),t}();var c=e.Mark=function(){function t(){u(this,t),this.element=null}return i(t,[{key:"bind",value:function(t,e){this.element=t,this.container=e}},{key:"unbind",value:function(){var t=this.element;return this.element=null,t}},{key:"render",value:function(){}},{key:"dispatchEvent",value:function(t){this.element&&this.element.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this.element.getBoundingClientRect()}},{key:"getClientRects",value:function(){for(var t=[],e=this.element.firstChild;e;)t.push(e.getBoundingClientRect()),e=e.nextSibling;return t}},{key:"filteredRanges",value:function(){var t=Array.from(this.range.getClientRects());return t.filter((function(e){for(var n=0;n<t.length;n++){if(t[n]===e)return!0;if(i=t[n],(r=e).right<=i.right&&r.left>=i.left&&r.top>=i.top&&r.bottom<=i.bottom)return!1}var i,r;return!0}))}}]),t}(),l=e.Highlight=function(t){function e(t,n,i,r){u(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.range=t,o.className=n,o.data=i||{},o.attributes=r||{},o}return h(e,t),i(e,[{key:"bind",value:function(t,i){for(var r in n(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"bind",this).call(this,t,i),this.data)this.data.hasOwnProperty(r)&&(this.element.dataset[r]=this.data[r]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&this.element.setAttribute(r,this.attributes[r]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var t=this.element.ownerDocument.createDocumentFragment(),e=this.filteredRanges(),n=this.element.getBoundingClientRect(),i=this.container.getBoundingClientRect(),o=0,s=e.length;o<s;o++){var a=e[o],h=r.default.createElement("rect");h.setAttribute("x",a.left-n.left+i.left),h.setAttribute("y",a.top-n.top+i.top),h.setAttribute("height",a.height),h.setAttribute("width",a.width),t.appendChild(h)}this.element.appendChild(t)}}]),e}(c);e.Underline=function(t){function e(t,n,i,r){return u(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i,r))}return h(e,t),i(e,[{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var t=this.element.ownerDocument.createDocumentFragment(),e=this.filteredRanges(),n=this.element.getBoundingClientRect(),i=this.container.getBoundingClientRect(),o=0,s=e.length;o<s;o++){var a=e[o],h=r.default.createElement("rect");h.setAttribute("x",a.left-n.left+i.left),h.setAttribute("y",a.top-n.top+i.top),h.setAttribute("height",a.height),h.setAttribute("width",a.width),h.setAttribute("fill","none");var u=r.default.createElement("line");u.setAttribute("x1",a.left-n.left+i.left),u.setAttribute("x2",a.left-n.left+i.left+a.width),u.setAttribute("y1",a.top-n.top+i.top+a.height-1),u.setAttribute("y2",a.top-n.top+i.top+a.height-1),u.setAttribute("stroke-width",1),u.setAttribute("stroke","black"),u.setAttribute("stroke-linecap","square"),t.appendChild(h),t.appendChild(u)}this.element.appendChild(t)}}]),e}(l)}));u(oi);var si=oi.Underline,ai=oi.Highlight,hi=oi.Pane,ui=function(){function t(t,e){this.settings=j({ignoreClass:"",axis:e.layout&&"scrolled"===e.layout.props.flow?"vertical":"horizontal",direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0},e||{}),this.id="epubjs-view-"+O(),this.section=t,this.index=t.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new xt,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}return t.prototype.container=function(t){var e=document.createElement("div");return e.classList.add("epub-view"),e.style.height="0px",e.style.width="0px",e.style.overflow="hidden",e.style.position="relative",e.style.display="block",e.style.flex=t&&"horizontal"==t?"none":"initial",e},t.prototype.create=function(){return this.iframe||(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.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=M(this.element),"srcdoc"in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write")),this.iframe},t.prototype.render=function(t,e){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(t)),this.sectionRender.then(function(t){return this.load(t)}.bind(this)).then(function(){var t=this;this.layout.format(this.contents);var e=0===this.contents.writingMode().indexOf("vertical")?"vertical":"horizontal";return this.setAxis(e),this.emit(mn,e),this.addListeners(),new Promise((function(e,n){t.expand(),e()}))}.bind(this),function(t){return this.emit(gn,t),new Promise((function(e,n){n(t)}))}.bind(this)).then(function(){this.emit(vn,this.section)}.bind(this))},t.prototype.reset=function(){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},t.prototype.size=function(t,e){var n=t||this.settings.width,i=e||this.settings.height;"pre-paginated"===this.layout.name?this.lock("both",n,i):"horizontal"===this.settings.axis?this.lock("height",n,i):this.lock("width",n,i),this.settings.width=n,this.settings.height=i},t.prototype.lock=function(t,e,n){var i,r=W(this.element);i=this.iframe?W(this.iframe):{width:0,height:0},"width"==t&&D(e)&&(this.lockedWidth=e-r.width-i.width),"height"==t&&D(n)&&(this.lockedHeight=n-r.height-i.height),"both"===t&&D(e)&&D(n)&&(this.lockedWidth=e-r.width-i.width,this.lockedHeight=n-r.height-i.height),this.displayed&&this.iframe&&this.expand()},t.prototype.expand=function(t){var e,n=this.lockedWidth,i=this.lockedHeight;this.iframe&&!this._expanding&&(this._expanding=!0,"pre-paginated"===this.layout.name?(n=this.layout.columnWidth,i=this.layout.height):"horizontal"===this.settings.axis?((n=this.contents.textWidth())%this.layout.pageWidth>0&&(n=Math.ceil(n/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(e=n/this.layout.pageWidth,this.layout.divisor>1&&"reflowable"===this.layout.name&&e%2>0&&(n+=this.layout.pageWidth))):"vertical"===this.settings.axis&&(i=this.contents.textHeight()),(this._needsReframe||n!=this._width||i!=this._height)&&this.reframe(n,i),this._expanding=!1)},t.prototype.reframe=function(t,e){var n,i=this;D(t)&&(this.element.style.width=t+"px",this.iframe.style.width=t+"px",this._width=t),D(e)&&(this.element.style.height=e+"px",this.iframe.style.height=e+"px",this._height=e),n={width:t,height:e,widthDelta:this.prevBounds?t-this.prevBounds.width:t,heightDelta:this.prevBounds?e-this.prevBounds.height:e},this.pane&&this.pane.render(),requestAnimationFrame((function(){var t;for(var e in i.marks)i.marks.hasOwnProperty(e)&&(t=i.marks[e],i.placeMark(t.element,t.range))})),this.onResize(this,n),this.emit(yn,n),this.prevBounds=n,this.elementBounds=M(this.element)},t.prototype.load=function(t){var e=new at,n=e.promise;if(!this.iframe)return e.reject(new Error("No Iframe Available")),n;if(this.iframe.onload=function(t){this.onLoad(t,e)}.bind(this),"blobUrl"===this.settings.method)this.blobUrl=K(t,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if("srcdoc"===this.settings.method)this.iframe.srcdoc=t,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return e.reject(new Error("No Document Available")),n;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var i=this;MSApp.execUnsafeLocalFunction((function(){i.iframe.contentDocument.write(t)}))}else this.iframe.contentDocument.write(t);this.iframe.contentDocument.close()}return n},t.prototype.onLoad=function(t,e){var n=this;this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new ti(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")).setAttribute("rel","canonical"),i.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(i)),this.contents.on(en,(function(){n.displayed&&n.iframe&&(n.expand(),n.contents&&n.layout.format(n.contents))})),this.contents.on(nn,(function(t){n.displayed&&n.iframe&&(n.expand(),n.contents&&n.layout.format(n.contents))})),e.resolve(this.contents)},t.prototype.setLayout=function(t){this.layout=t,this.contents&&(this.layout.format(this.contents),this.expand())},t.prototype.setAxis=function(t){"scrolled"===this.layout.props.flow&&(t="vertical"),this.settings.axis=t,this.element.style.flex="horizontal"==t?"none":"initial",this.size()},t.prototype.addListeners=function(){},t.prototype.removeListeners=function(t){},t.prototype.display=function(t){var e=new at;return this.displayed?e.resolve(this):this.render(t).then(function(){this.emit(wn,this),this.onDisplayed(this),this.displayed=!0,e.resolve(this)}.bind(this),(function(t){e.reject(t,this)})),e.promise},t.prototype.show=function(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.style.transform=null),this.emit(bn,this)},t.prototype.hide=function(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(_n,this)},t.prototype.offset=function(){return{top:this.element.offsetTop,left:this.element.offsetLeft}},t.prototype.width=function(){return this._width},t.prototype.height=function(){return this._height},t.prototype.position=function(){return this.element.getBoundingClientRect()},t.prototype.locationOf=function(t){this.iframe.getBoundingClientRect();var e=this.contents.locationOf(t,this.settings.ignoreClass);return{left:e.left,top:e.top}},t.prototype.onDisplayed=function(t){},t.prototype.onResize=function(t,e){},t.prototype.bounds=function(t){return!t&&this.elementBounds||(this.elementBounds=M(this.element)),this.elementBounds},t.prototype.highlight=function(t,e,n,i,r){var o=this;if(void 0===e&&(e={}),void 0===i&&(i="epubjs-hl"),void 0===r&&(r={}),this.contents){var s=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},r),a=this.contents.range(t),h=function(){o.emit(xn,t,e)};e.epubcfi=t,this.pane||(this.pane=new hi(this.iframe,this.element));var u=new ai(a,i,e,s),c=this.pane.addMark(u);return this.highlights[t]={mark:c,element:c.element,listeners:[h,n]},c.element.setAttribute("ref",i),c.element.addEventListener("click",h),c.element.addEventListener("touchstart",h),n&&(c.element.addEventListener("click",n),c.element.addEventListener("touchstart",n)),c}},t.prototype.underline=function(t,e,n,i,r){var o=this;if(void 0===e&&(e={}),void 0===i&&(i="epubjs-ul"),void 0===r&&(r={}),this.contents){var s=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},r),a=this.contents.range(t),h=function(){o.emit(xn,t,e)};e.epubcfi=t,this.pane||(this.pane=new hi(this.iframe,this.element));var u=new si(a,i,e,s),c=this.pane.addMark(u);return this.underlines[t]={mark:c,element:c.element,listeners:[h,n]},c.element.setAttribute("ref",i),c.element.addEventListener("click",h),c.element.addEventListener("touchstart",h),n&&(c.element.addEventListener("click",n),c.element.addEventListener("touchstart",n)),c}},t.prototype.mark=function(t,e,n){var i=this;if(void 0===e&&(e={}),this.contents){if(t in this.marks)return this.marks[t];var r=this.contents.range(t);if(r){var o=r.commonAncestorContainer,s=1===o.nodeType?o:o.parentNode,a=function(n){i.emit(xn,t,e)};r.collapsed&&1===o.nodeType?(r=new Range).selectNodeContents(o):r.collapsed&&(r=new Range).selectNodeContents(s);var h=this.document.createElement("a");return h.setAttribute("ref","epubjs-mk"),h.style.position="absolute",h.dataset.epubcfi=t,e&&Object.keys(e).forEach((function(t){h.dataset[t]=e[t]})),n&&(h.addEventListener("click",n),h.addEventListener("touchstart",n)),h.addEventListener("click",a),h.addEventListener("touchstart",a),this.placeMark(h,r),this.element.appendChild(h),this.marks[t]={element:h,range:r,listeners:[a,n]},s}}},t.prototype.placeMark=function(t,e){var n,i,r;if("pre-paginated"===this.layout.name||"horizontal"!==this.settings.axis){var o=e.getBoundingClientRect();n=o.top,i=o.right}else for(var s=e.getClientRects(),a=void 0,h=0;h!=s.length;h++)a=s[h],(!r||a.left<r)&&(r=a.left,i=Math.ceil(r/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,n=a.top);t.style.top=n+"px",t.style.left=i+"px"},t.prototype.unhighlight=function(t){var e;t in this.highlights&&(e=this.highlights[t],this.pane.removeMark(e.mark),e.listeners.forEach((function(t){t&&(e.element.removeEventListener("click",t),e.element.removeEventListener("touchstart",t))})),delete this.highlights[t])},t.prototype.ununderline=function(t){var e;t in this.underlines&&(e=this.underlines[t],this.pane.removeMark(e.mark),e.listeners.forEach((function(t){t&&(e.element.removeEventListener("click",t),e.element.removeEventListener("touchstart",t))})),delete this.underlines[t])},t.prototype.unmark=function(t){var e;t in this.marks&&(e=this.marks[t],this.element.removeChild(e.element),e.listeners.forEach((function(t){t&&(e.element.removeEventListener("click",t),e.element.removeEventListener("touchstart",t))})),delete this.marks[t])},t.prototype.destroy=function(){for(var t in this.highlights)this.unhighlight(t);for(var t in this.underlines)this.ununderline(t);for(var t in this.marks)this.unmark(t);this.blobUrl&&$(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)},t}();N(ui.prototype);var ci=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},li="object"==typeof h&&h&&h.Object===Object&&h,fi="object"==typeof self&&self&&self.Object===Object&&self,di=li||fi||Function("return this")(),pi=function(){return di.Date.now()},mi=di.Symbol,gi=Object.prototype,vi=gi.hasOwnProperty,yi=gi.toString,wi=mi?mi.toStringTag:void 0,bi=Object.prototype.toString,_i=mi?mi.toStringTag:void 0,xi=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":_i&&_i in Object(t)?function(t){var e=vi.call(t,wi),n=t[wi];try{t[wi]=void 0;var i=!0}catch(t){}var r=yi.call(t);return i&&(e?t[wi]=n:delete t[wi]),r}(t):function(t){return bi.call(t)}(t)},ki=/^\s+|\s+$/g,Ei=/^[-+]0x[0-9a-f]+$/i,Si=/^0b[01]+$/i,Ci=/^0o[0-7]+$/i,Ti=parseInt,Ai=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==xi(t)}(t))return NaN;if(ci(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ci(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(ki,"");var n=Si.test(t);return n||Ci.test(t)?Ti(t.slice(2),n?2:8):Ei.test(t)?NaN:+t},Ni=Math.max,Ri=Math.min,Ii=function(t,e,n){var i,r,o,s,a,h,u=0,c=!1,l=!1,f=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=i,o=r;return i=r=void 0,u=e,s=t.apply(o,n)}function p(t){var n=t-h;return void 0===h||n>=e||n<0||l&&t-u>=o}function m(){var t=pi();if(p(t))return g(t);a=setTimeout(m,function(t){var n=e-(t-h);return l?Ri(n,o-(t-u)):n}(t))}function g(t){return a=void 0,f&&i?d(t):(i=r=void 0,s)}function v(){var t=pi(),n=p(t);if(i=arguments,r=this,h=t,n){if(void 0===a)return function(t){return u=t,a=setTimeout(m,e),c?d(t):s}(h);if(l)return clearTimeout(a),a=setTimeout(m,e),d(h)}return void 0===a&&(a=setTimeout(m,e)),s}return e=Ai(e)||0,ci(n)&&(c=!!n.leading,o=(l="maxWait"in n)?Ni(Ai(n.maxWait)||0,e):o,f="trailing"in n?!!n.trailing:f),v.cancel=function(){void 0!==a&&clearTimeout(a),u=0,i=h=r=a=void 0},v.flush=function(){return void 0===a?s:g(pi())},v},Oi=function(){function t(t){this.settings=t||{},this.id="epubjs-container-"+O(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}return t.prototype.create=function(t){var e=t.height,n=t.width,i=t.overflow||!1,r=t.axis||"vertical",o=t.direction;j(this.settings,t),t.height&&D(t.height)&&(e=t.height+"px"),t.width&&D(t.width)&&(n=t.width+"px");var s=document.createElement("div");return s.id=this.id,s.classList.add("epub-container"),s.style.wordSpacing="0",s.style.lineHeight="0",s.style.verticalAlign="top",s.style.position="relative","horizontal"===r&&(s.style.display="flex",s.style.flexDirection="row",s.style.flexWrap="nowrap"),n&&(s.style.width=n),e&&(s.style.height=e),i&&("scroll"===i&&"vertical"===r?(s.style["overflow-y"]=i,s.style["overflow-x"]="hidden"):"scroll"===i&&"horizontal"===r?(s.style["overflow-y"]="hidden",s.style["overflow-x"]=i):s.style.overflow=i),o&&(s.dir=o,s.style.direction=o),o&&this.settings.fullsize&&(document.body.style.direction=o),s},t.prototype.wrap=function(t){var e=document.createElement("div");return e.style.visibility="hidden",e.style.overflow="hidden",e.style.width="0",e.style.height="0",e.appendChild(t),e},t.prototype.getElement=function(t){var e;if(z(t)?e=t:"string"==typeof t&&(e=document.getElementById(t)),!e)throw new Error("Not an Element");return e},t.prototype.attachTo=function(t){var e,n=this.getElement(t);if(n)return e=this.settings.hidden?this.wrapper:this.container,n.appendChild(e),this.element=n,n},t.prototype.getContainer=function(){return this.container},t.prototype.onResize=function(t){D(this.settings.width)&&D(this.settings.height)||(this.resizeFunc=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return ci(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Ii(t,e,{leading:i,maxWait:e,trailing:r})}(t,50),window.addEventListener("resize",this.resizeFunc,!1))},t.prototype.onOrientationChange=function(t){this.orientationChangeFunc=t,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)},t.prototype.size=function(t,e){var n,i=t||this.settings.width,r=e||this.settings.height;null===t?(n=this.element.getBoundingClientRect()).width&&(t=Math.floor(n.width),this.container.style.width=t+"px"):D(t)?this.container.style.width=t+"px":this.container.style.width=t,null===e?(n=n||this.element.getBoundingClientRect()).height&&(e=n.height,this.container.style.height=e+"px"):D(e)?this.container.style.height=e+"px":this.container.style.height=e,D(t)||(t=this.container.clientWidth),D(e)||(e=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};var o=H(),s=window.getComputedStyle(document.body),a=parseFloat(s["padding-left"])||0,h=parseFloat(s["padding-right"])||0,u=parseFloat(s["padding-top"])||0,c=parseFloat(s["padding-bottom"])||0;return i||(t=o.width-a-h),(this.settings.fullsize&&!r||!r)&&(e=o.height-u-c),{width:t-this.containerPadding.left-this.containerPadding.right,height:e-this.containerPadding.top-this.containerPadding.bottom}},t.prototype.bounds=function(){var t;return"visible"!==this.container.style.overflow&&(t=this.container&&this.container.getBoundingClientRect()),t&&t.width&&t.height?t:H()},t.prototype.getSheet=function(){var t=document.createElement("style");return t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet},t.prototype.addStyleRules=function(t,e){var n="#"+this.id+" ",i="";this.sheet||(this.sheet=this.getSheet()),e.forEach((function(t){for(var e in t)t.hasOwnProperty(e)&&(i+=e+":"+t[e]+";")})),this.sheet.insertRule(n+t+" {"+i+"}",0)},t.prototype.axis=function(t){"horizontal"===t?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=t},t.prototype.direction=function(t){this.container&&(this.container.dir=t,this.container.style.direction=t),this.settings.fullsize&&(document.body.style.direction=t),this.settings.dir=t},t.prototype.overflow=function(t){this.container&&("scroll"===t&&"vertical"===this.settings.axis?(this.container.style["overflow-y"]=t,this.container.style["overflow-x"]="hidden"):"scroll"===t&&"horizontal"===this.settings.axis?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=t):this.container.style.overflow=t),this.settings.overflow=t},t.prototype.destroy=function(){this.element&&(this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))},t}(),zi=function(){function t(t){this.container=t,this._views=[],this.length=0,this.hidden=!1}return t.prototype.all=function(){return this._views},t.prototype.first=function(){return this._views[0]},t.prototype.last=function(){return this._views[this._views.length-1]},t.prototype.indexOf=function(t){return this._views.indexOf(t)},t.prototype.slice=function(){return this._views.slice.apply(this._views,arguments)},t.prototype.get=function(t){return this._views[t]},t.prototype.append=function(t){return this._views.push(t),this.container&&this.container.appendChild(t.element),this.length++,t},t.prototype.prepend=function(t){return this._views.unshift(t),this.container&&this.container.insertBefore(t.element,this.container.firstChild),this.length++,t},t.prototype.insert=function(t,e){return this._views.splice(e,0,t),this.container&&(e<this.container.children.length?this.container.insertBefore(t.element,this.container.children[e]):this.container.appendChild(t.element)),this.length++,t},t.prototype.remove=function(t){var e=this._views.indexOf(t);e>-1&&this._views.splice(e,1),this.destroy(t),this.length--},t.prototype.destroy=function(t){t.displayed&&t.destroy(),this.container&&this.container.removeChild(t.element),t=null},t.prototype.forEach=function(){return this._views.forEach.apply(this._views,arguments)},t.prototype.clear=function(){var t,e=this.length;if(this.length){for(var n=0;n<e;n++)t=this._views[n],this.destroy(t);this._views=[],this.length=0}},t.prototype.find=function(t){for(var e,n=this.length,i=0;i<n;i++)if((e=this._views[i]).displayed&&e.section.index==t.index)return e},t.prototype.displayed=function(){for(var t,e=[],n=this.length,i=0;i<n;i++)(t=this._views[i]).displayed&&e.push(t);return e},t.prototype.show=function(){for(var t,e=this.length,n=0;n<e;n++)(t=this._views[n]).displayed&&t.show();this.hidden=!1},t.prototype.hide=function(){for(var t,e=this.length,n=0;n<e;n++)(t=this._views[n]).displayed&&t.hide();this.hidden=!0},t}(),Di=function(){function t(t){this.name="default",this.optsSettings=t.settings,this.View=t.view,this.request=t.request,this.renditionQueue=t.queue,this.q=new Ge(this),this.settings=j(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,flow:"scrolled",ignoreClass:"",fullsize:void 0}),j(this.settings,t.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0},this.rendered=!1}return t.prototype.render=function(t,e){var n=t.tagName;void 0!==this.settings.fullsize||!n||"body"!=n.toLowerCase()&&"html"!=n.toLowerCase()||(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow="visible",this.overflow=this.settings.overflow),this.settings.size=e,this.stage=new Oi({width:e.width,height:e.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(t),this.container=this.stage.getContainer(),this.views=new zi(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},t.prototype.addEventListeners=function(){var t;window.addEventListener("unload",function(t){this.destroy()}.bind(this)),t=this.settings.fullsize?window:this.container,this._onScroll=this.onScroll.bind(this),t.addEventListener("scroll",this._onScroll)},t.prototype.removeEventListeners=function(){(this.settings.fullsize?window:this.container).removeEventListener("scroll",this._onScroll),this._onScroll=void 0},t.prototype.destroy=function(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1},t.prototype.onOrientationChange=function(t){var e=window.orientation;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout(function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit(cn,e)}.bind(this),500)},t.prototype.onResized=function(t){this.resize()},t.prototype.resize=function(t,e,n){var i=this.stage.size(t,e);this.winBounds=H(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height?this._stageSize=void 0:this._stageSize&&this._stageSize.width===i.width&&this._stageSize.height===i.height||(this._stageSize=i,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit(un,{width:this._stageSize.width,height:this._stageSize.height},n))},t.prototype.createView=function(t){return new this.View(t,this.viewSettings)},t.prototype.display=function(t,e){var n=new at,i=n.promise;(e===t.href||D(e))&&(e=void 0);var r=this.views.find(t);if(r&&t){var o=r.offset();if("ltr"===this.settings.direction)this.scrollTo(o.left,o.top,!0);else{var s=r.width();this.scrollTo(o.left+s,o.top,!0)}if(e){var a=r.locationOf(e);this.moveTo(a)}return n.resolve(),i}return this.clear(),this.add(t).then(function(t){if(e){var n=t.locationOf(e);this.moveTo(n)}}.bind(this),(function(t){n.reject(t)})).then(function(){var e;if("pre-paginated"===this.layout.name&&this.layout.divisor>1&&t.index>0&&(e=t.next()))return this.add(e)}.bind(this)).then(function(){this.views.show(),n.resolve()}.bind(this)),i},t.prototype.afterDisplayed=function(t){this.emit(ln,t)},t.prototype.afterResized=function(t){this.emit(hn,t.section)},t.prototype.moveTo=function(t){var e=0,n=0;this.isPaginated?(e=Math.floor(t.left/this.layout.delta)*this.layout.delta)+this.layout.delta>this.container.scrollWidth&&(e=this.container.scrollWidth-this.layout.delta):n=t.top,this.scrollTo(e,n,!0)},t.prototype.add=function(t){var e=this,n=this.createView(t);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(mn,(function(t){e.updateAxis(t)})),n.display(this.request)},t.prototype.append=function(t){var e=this,n=this.createView(t);return this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(mn,(function(t){e.updateAxis(t)})),n.display(this.request)},t.prototype.prepend=function(t){var e=this,n=this.createView(t);return n.on(yn,(function(t){e.counter(t)})),this.views.prepend(n),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.on(mn,(function(t){e.updateAxis(t)})),n.display(this.request)},t.prototype.counter=function(t){"vertical"===this.settings.axis?this.scrollBy(0,t.heightDelta,!0):this.scrollBy(t.widthDelta,0,!0)},t.prototype.next=function(){var t,e=this.settings.direction;if(this.views.length)return!this.isPaginated||"horizontal"!==this.settings.axis||e&&"ltr"!==e?this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===e?(this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft>0?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next()):this.isPaginated&&"vertical"===this.settings.axis?(this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeight<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):t=this.views.last().section.next()):t=this.views.last().section.next():(this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft+this.container.offsetWidth+this.layout.delta<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):t=this.views.last().section.next()),t?(this.clear(),this.append(t).then(function(){var e;if("pre-paginated"===this.layout.name&&this.layout.divisor>1&&(e=t.next()))return this.append(e)}.bind(this),(function(t){return t})).then(function(){this.views.show()}.bind(this))):void 0},t.prototype.prev=function(){var t,e=this.settings.direction;if(this.views.length)return!this.isPaginated||"horizontal"!==this.settings.axis||e&&"ltr"!==e?this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===e?(this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft+this.container.offsetWidth+this.layout.delta<=this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):t=this.views.first().section.prev()):this.isPaginated&&"vertical"===this.settings.axis?(this.scrollTop=this.container.scrollTop,this.container.scrollTop>0?this.scrollBy(0,-this.layout.height,!0):t=this.views.first().section.prev()):t=this.views.first().section.prev():(this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft>0?this.scrollBy(-this.layout.delta,0,!0):t=this.views.first().section.prev()),t?(this.clear(),this.prepend(t).then(function(){var e;if("pre-paginated"===this.layout.name&&this.layout.divisor>1&&(e=t.prev()))return this.prepend(e)}.bind(this),(function(t){return t})).then(function(){this.isPaginated&&"horizontal"===this.settings.axis&&("rtl"===this.settings.direction?this.scrollTo(0,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))):void 0},t.prototype.current=function(){var t=this.visible();return t.length?t[t.length-1]:null},t.prototype.clear=function(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())},t.prototype.currentLocation=function(){return"vertical"===this.settings.axis?this.location=this.scrolledLocation():this.location=this.paginatedLocation(),this.location},t.prototype.scrolledLocation=function(){var t=this,e=this.visible(),n=this.container.getBoundingClientRect(),i=n.height<window.innerHeight?n.height:window.innerHeight,r=0,o=0;this.settings.fullsize&&(r=window.scrollY);var s=e.map((function(e){var s=e.section,a=s.index,h=s.href,u=e.position(),c=e.height(),l=r+n.top-u.top+o,f=l+i-o;f>c&&(o=(f=c)-l);var d=t.layout.count(c,i).pages,p=Math.ceil(l/i),m=[],g=Math.ceil(f/i);m=[];for(var v=p;v<=g;v++){var y=v+1;m.push(y)}return{index:a,href:h,pages:m,totalPages:d,mapping:t.mapping.page(e.contents,e.section.cfiBase,l,f)}}));return s},t.prototype.paginatedLocation=function(){var t=this,e=this.visible(),n=this.container.getBoundingClientRect(),i=0;this.settings.fullsize&&(i=window.scrollX);var r=e.map((function(e){var r=e.section,o=r.index,s=r.href,a=(e.offset().left,e.position().left),h=e.width(),u=i+n.left-a+0,c=u+t.layout.width-0,l=t.mapping.page(e.contents,e.section.cfiBase,u,c),f=t.layout.count(h).pages,d=Math.floor(u/t.layout.pageWidth),p=[],m=Math.floor(c/t.layout.pageWidth);if(d<0&&(d=0,m+=1),"rtl"===t.settings.direction){var g=d;d=f-m,m=f-g}for(var v=d+1;v<=m;v++){var y=v;p.push(y)}return{index:o,href:s,pages:p,totalPages:f,mapping:l}}));return r},t.prototype.isVisible=function(t,e,n,i){var r=t.position(),o=i||this.bounds();return"horizontal"===this.settings.axis&&r.right>o.left-e&&r.left<o.right+n||"vertical"===this.settings.axis&&r.bottom>o.top-e&&r.top<o.bottom+n},t.prototype.visible=function(){for(var t,e=this.bounds(),n=this.views.displayed(),i=n.length,r=[],o=0;o<i;o++)t=n[o],!0===this.isVisible(t,0,0,e)&&r.push(t);return r},t.prototype.scrollBy=function(t,e,n){var i="rtl"===this.settings.direction?-1:1;n&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(t*i,e*i):(t&&(this.container.scrollLeft+=t*i),e&&(this.container.scrollTop+=e)),this.scrolled=!0},t.prototype.scrollTo=function(t,e,n){n&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(t,e):(this.container.scrollLeft=t,this.container.scrollTop=e),this.scrolled=!0},t.prototype.onScroll=function(){var t,e;this.settings.fullsize?(t=window.scrollY,e=window.scrollX):(t=this.container.scrollTop,e=this.container.scrollLeft),this.scrollTop=t,this.scrollLeft=e,this.ignore?this.ignore=!1:(this.emit(fn,{top:t,left:e}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit(dn,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),20))},t.prototype.bounds=function(){return this.stage.bounds()},t.prototype.applyLayout=function(t){this.layout=t,this.updateLayout()},t.prototype.updateLayout=function(){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.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))},t.prototype.setLayout=function(t){this.viewSettings.layout=t,this.mapping=new $n(t.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach((function(e){e&&e.setLayout(t)}))},t.prototype.updateAxis=function(t,e){this.isPaginated||(t="vertical"),(e||t!==this.settings.axis)&&(this.settings.axis=t,this.stage&&this.stage.axis(t),this.viewSettings.axis=t,this.mapping&&(this.mapping=new $n(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&("vertical"===t?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))},t.prototype.updateFlow=function(t,e){void 0===e&&(e="auto");var n="paginated"===t||"auto"===t;this.isPaginated=n,"scrolled-doc"===t||"scrolled-continuous"===t||"scrolled"===t?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=t,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=n?"hidden":e,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()},t.prototype.getContents=function(){var t=[];return this.views?(this.views.forEach((function(e){var n=e&&e.contents;n&&t.push(n)})),t):t},t.prototype.direction=function(t){void 0===t&&(t="ltr"),this.settings.direction=t,this.stage&&this.stage.direction(t),this.viewSettings.direction=t,this.updateLayout()},t.prototype.isRendered=function(){return this.rendered},t}();N(Di.prototype);var Li=Math.PI/2,Bi={easeOutSine:function(t){return Math.sin(t*Li)},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},easeInCubic:function(t){return Math.pow(t,3)}},Pi=function(){function t(t,e){this.settings=j({duration:80,minVelocity:.2,minDistance:10,easing:Bi.easeInCubic},e||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(t)}return t.prototype.setup=function(t){this.manager=t,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=2*this.settings.duration,this.isVertical="vertical"===this.manager.settings.axis,this.manager.isPaginated&&!this.isVertical&&(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.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())},t.prototype.supportsTouch=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},t.prototype.disableScroll=function(){this.element.style.overflow="hidden"},t.prototype.enableScroll=function(){this.element.style.overflow=""},t.prototype.addListeners=function(){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(ln,this._afterDisplayed)},t.prototype.removeListeners=function(){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(ln,this._afterDisplayed),this._afterDisplayed=void 0},t.prototype.afterDisplayed=function(t){var e=this,n=t.contents;["touchstart","touchmove","touchend"].forEach((function(t){n.on(t,(function(t){return e.triggerViewEvent(t,n)}))}))},t.prototype.triggerViewEvent=function(t,e){this.emit(t.type,t,e)},t.prototype.onScroll=function(t){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop},t.prototype.onResize=function(t){this.resizeCanceler=!0},t.prototype.onTouchStart=function(t){var e=t.touches[0],n=e.screenX,i=e.screenY;this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=n,this.startTouchY=i,this.startTime=this.now()),this.endTouchX=n,this.endTouchY=i,this.endTime=this.now()},t.prototype.onTouchMove=function(t){var e=t.touches[0],n=e.screenX,i=e.screenY,r=Math.abs(i-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&r<10&&(this.element.scrollLeft-=n-this.endTouchX),this.endTouchX=n,this.endTouchY=i,this.endTime=this.now()},t.prototype.onTouchEnd=function(t){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;var e=this.wasSwiped();0!==e?this.snap(e):this.snap(),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0},t.prototype.wasSwiped=function(){var t=this.layout.pageWidth*this.layout.divisor,e=this.endTouchX-this.startTouchX,n=Math.abs(e),i=e/(this.endTime-this.startTime),r=this.settings.minVelocity;return n<=this.settings.minDistance||n>=t?0:i>r?-1:i<-r?1:void 0},t.prototype.needsSnap=function(){return this.scrollLeft%(this.layout.pageWidth*this.layout.divisor)!=0},t.prototype.snap=function(t){void 0===t&&(t=0);var e=this.scrollLeft,n=this.layout.pageWidth*this.layout.divisor,i=Math.round(e/n)*n;return t&&(i+=t*n),this.smoothScrollTo(i)},t.prototype.smoothScrollTo=function(t){var e=new at,n=this.scrollLeft,i=this.now(),r=this.settings.duration,o=this.settings.easing;return this.snapping=!0,function s(){var a=this.now(),h=Math.min(1,(a-i)/r);if(o(h),this.touchCanceler||this.resizeCanceler)return this.resizeCanceler=!1,this.snapping=!1,void e.resolve();h<1?(window.requestAnimationFrame(s.bind(this)),this.scrollTo(n+(t-n)*h,0)):(this.scrollTo(t,0),this.snapping=!1,e.resolve())}.call(this),e.promise},t.prototype.scrollTo=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.fullsize?window.scroll(t,e):(this.scroller.scrollLeft=t,this.scroller.scrollTop=e)},t.prototype.now=function(){return"now"in window.performance?performance.now():(new Date).getTime()},t.prototype.destroy=function(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)},t}();N(Pi.prototype);var ji=function(t){function e(e){var n=t.call(this,e)||this;return n.name="continuous",n.settings=j(n.settings||{},{infinite:!0,overflow:void 0,axis:void 0,flow:"scrolled",offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10}),j(n.settings,e.settings||{}),"undefined"!=e.settings.gap&&0===e.settings.gap&&(n.settings.gap=e.settings.gap),n.viewSettings={ignoreClass:n.settings.ignoreClass,axis:n.settings.axis,flow:n.settings.flow,layout:n.layout,width:0,height:0,forceEvenPages:!1},n.scrollTop=0,n.scrollLeft=0,n}return o(e,t),e.prototype.display=function(t,e){return Di.prototype.display.call(this,t,e).then(function(){return this.fill()}.bind(this))},e.prototype.fill=function(t){var e=this,n=t||new at;return this.q.enqueue((function(){return e.check()})).then((function(t){t?e.fill(n):n.resolve()})),n.promise},e.prototype.moveTo=function(t){var e=0,n=0;this.isPaginated?e=Math.floor(t.left/this.layout.delta)*this.layout.delta:n=t.top,(e>0||n>0)&&this.scrollBy(e,n,!0)},e.prototype.afterResized=function(t){this.emit(hn,t.section)},e.prototype.removeShownListeners=function(t){t.onDisplayed=function(){}},e.prototype.add=function(t){var e=this,n=this.createView(t);return this.views.append(n),n.on(yn,(function(t){n.expanded=!0})),n.on(mn,(function(t){e.updateAxis(t)})),n.onDisplayed=this.afterDisplayed.bind(this),n.onResize=this.afterResized.bind(this),n.display(this.request)},e.prototype.append=function(t){var e=this,n=this.createView(t);return n.on(yn,(function(t){n.expanded=!0})),n.on(mn,(function(t){e.updateAxis(t)})),this.views.append(n),n.onDisplayed=this.afterDisplayed.bind(this),n},e.prototype.prepend=function(t){var e=this,n=this.createView(t);return n.on(yn,(function(t){e.counter(t),n.expanded=!0})),n.on(mn,(function(t){e.updateAxis(t)})),this.views.prepend(n),n.onDisplayed=this.afterDisplayed.bind(this),n},e.prototype.counter=function(t){"vertical"===this.settings.axis?this.scrollBy(0,t.heightDelta,!0):this.scrollBy(t.widthDelta,0,!0)},e.prototype.update=function(t){for(var e,n=this.bounds(),i=this.views.all(),r=i.length,o=void 0!==t?t:this.settings.offset||0,s=new at,a=[],h=0;h<r;h++)if(e=i[h],!0===this.isVisible(e,o,o,n))if(e.displayed)e.show();else{var u=e.display(this.request).then((function(t){t.show()}),(function(t){e.hide()}));a.push(u)}else this.q.enqueue(e.destroy.bind(e)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return a.length?Promise.all(a).catch((function(t){s.reject(t)})):(s.resolve(),s.promise)},e.prototype.check=function(t,e){var n=this,i=new at,r=[],o="horizontal"===this.settings.axis,s=this.settings.offset||0;t&&o&&(s=t),e&&!o&&(s=e);var a=this._bounds,h="rtl"===this.settings.direction,u=o&&h?-1:1,c=o?this.scrollLeft:this.scrollTop*u,l=o?Math.floor(a.width):a.height,f=o?this.container.scrollWidth:this.container.scrollHeight,d=function(){var t=n.views.first(),e=t&&t.section.prev();e&&r.push(n.prepend(e))},p=function(){var t=n.views.last(),e=t&&t.section.next();e&&r.push(n.append(e))};c+l+s>=f&&(o&&h?d():p()),c-s<0&&(o&&h?p():d());var m=r.map((function(t){return t.displayed}));return r.length?Promise.all(m).then((function(){if("pre-paginated"===n.layout.name&&n.layout.props.spread)return n.check()})).then((function(){return n.update(s)}),(function(t){return t})):(this.q.enqueue(function(){this.update()}.bind(this)),i.resolve(!1),i.promise)},e.prototype.trim=function(){for(var t=new at,e=this.views.displayed(),n=e[0],i=e[e.length-1],r=this.views.indexOf(n),o=this.views.indexOf(i),s=this.views.slice(0,r),a=this.views.slice(o+1),h=0;h<s.length-1;h++)this.erase(s[h],s);for(var u=1;u<a.length;u++)this.erase(a[u]);return t.resolve(),t.promise},e.prototype.erase=function(t,e){var n,i;this.settings.fullsize?(n=window.scrollY,i=window.scrollX):(n=this.container.scrollTop,i=this.container.scrollLeft);var r=t.bounds();this.views.remove(t),e&&("vertical"===this.settings.axis?this.scrollTo(0,n-r.height,!0):this.scrollTo(i-Math.floor(r.width),0,!0))},e.prototype.addEventListeners=function(t){window.addEventListener("unload",function(t){this.ignore=!0,this.destroy()}.bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new Pi(this,this.settings.snap&&"object"==typeof this.settings.snap&&this.settings.snap))},e.prototype.addScrollListeners=function(){var t;this.tick=R,this.settings.fullsize?(this.prevScrollTop=window.scrollY,this.prevScrollLeft=window.scrollX):(this.prevScrollTop=this.container.scrollTop,this.prevScrollLeft=this.container.scrollLeft),this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(t=window,this.scrollTop=window.scrollY,this.scrollLeft=window.scrollX):(t=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),t.addEventListener("scroll",this._onScroll),this._scrolled=Ii(this.scrolled.bind(this),30),this.didScroll=!1},e.prototype.removeEventListeners=function(){(this.settings.fullsize?window:this.container).removeEventListener("scroll",this._onScroll),this._onScroll=void 0},e.prototype.onScroll=function(){var t,e,n="rtl"===this.settings.direction?-1:1;this.settings.fullsize?(t=window.scrollY*n,e=window.scrollX*n):(t=this.container.scrollTop,e=this.container.scrollLeft),this.scrollTop=t,this.scrollLeft=e,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(t-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(e-this.prevScrollLeft),this.prevScrollTop=t,this.prevScrollLeft=e,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1},e.prototype.scrolled=function(){this.q.enqueue(function(){this.check()}.bind(this)),this.emit(fn,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit(dn,{top:this.scrollTop,left:this.scrollLeft})}.bind(this),this.settings.afterScrolledTimeout)},e.prototype.next=function(){var t="pre-paginated"===this.layout.props.name&&this.layout.props.spread?2*this.layout.props.delta:this.layout.props.delta;this.views.length&&(this.isPaginated&&"horizontal"===this.settings.axis?this.scrollBy(t,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue(function(){this.check()}.bind(this)))},e.prototype.prev=function(){var t="pre-paginated"===this.layout.props.name&&this.layout.props.spread?2*this.layout.props.delta:this.layout.props.delta;this.views.length&&(this.isPaginated&&"horizontal"===this.settings.axis?this.scrollBy(-t,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue(function(){this.check()}.bind(this)))},e.prototype.updateFlow=function(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),t.prototype.updateFlow.call(this,e,"scroll"),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new Pi(this,this.settings.snap&&"object"==typeof this.settings.snap&&this.settings.snap))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.snapper&&this.snapper.destroy()},e}(Di),Ui=function(){function t(t,e){this.settings=j(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}),j(this.settings,e),"object"==typeof this.settings.manager&&(this.manager=this.settings.manager),this.book=t,this.hooks={},this.hooks.display=new kt(this),this.hooks.serialize=new kt(this),this.hooks.content=new kt(this),this.hooks.unloaded=new kt(this),this.hooks.layout=new kt(this),this.hooks.render=new kt(this),this.hooks.show=new kt(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 Kn(this),this.annotations=new ei(this),this.epubcfi=new xt,this.q=new Ge(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new at,this.started=this.starting.promise,this.q.enqueue(this.start)}return t.prototype.setManager=function(t){this.manager=t},t.prototype.requireManager=function(t){return"string"==typeof t&&"default"===t?Di:"string"==typeof t&&"continuous"===t?ji:t},t.prototype.requireView=function(t){return"string"==typeof t&&"iframe"===t?ui:t},t.prototype.start=function(){this.settings.layout||"pre-paginated"!==this.book.package.metadata.layout&&"true"!==this.book.displayOptions.fixedLayout||(this.settings.layout="pre-paginated"),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.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on(ln,this.afterDisplayed.bind(this)),this.manager.on(pn,this.afterRemoved.bind(this)),this.manager.on(un,this.onResized.bind(this)),this.manager.on(cn,this.onOrientationChange.bind(this)),this.manager.on(dn,this.reportLocation.bind(this)),this.emit(kn),this.starting.resolve()},t.prototype.attachTo=function(t){return this.q.enqueue(function(){this.manager.render(t,{width:this.settings.width,height:this.settings.height}),this.emit(En)}.bind(this))},t.prototype.display=function(t){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,t)},t.prototype._display=function(t){var e=this;if(this.book){this.epubcfi.isCfiString(t);var n,i=new at,r=i.promise;return this.displaying=i,this.book.locations.length()&&L(t)&&(t=this.book.locations.cfiFromPercentage(parseFloat(t))),(n=this.book.spine.get(t))?(this.manager.display(n,t).then((function(){i.resolve(n),e.displaying=void 0,e.emit(Sn,n),e.reportLocation()}),(function(t){e.emit(Cn,t)})),r):(i.reject(new Error("No Section Found")),r)}},t.prototype.afterDisplayed=function(t){var e=this;t.on(xn,(function(n,i){return e.triggerMarkEvent(n,i,t.contents)})),this.hooks.render.trigger(t,this).then((function(){t.contents?e.hooks.content.trigger(t.contents,e).then((function(){e.emit(Tn,t.section,t)})):e.emit(Tn,t.section,t)}))},t.prototype.afterRemoved=function(t){var e=this;this.hooks.unloaded.trigger(t,this).then((function(){e.emit(An,t.section,t)}))},t.prototype.onResized=function(t,e){this.emit(Nn,{width:t.width,height:t.height},e),this.location&&this.location.start&&this.display(e||this.location.start.cfi)},t.prototype.onOrientationChange=function(t){this.emit(Rn,t)},t.prototype.moveTo=function(t){this.manager.moveTo(t)},t.prototype.resize=function(t,e,n){t&&(this.settings.width=t),e&&(this.settings.height=e),this.manager.resize(t,e,n)},t.prototype.clear=function(){this.manager.clear()},t.prototype.next=function(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))},t.prototype.prev=function(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))},t.prototype.determineLayoutProperties=function(t){return{layout:this.settings.layout||t.layout||"reflowable",spread:this.settings.spread||t.spread||"auto",orientation:this.settings.orientation||t.orientation||"auto",flow:this.settings.flow||t.flow||"auto",viewport:t.viewport||"",minSpreadWidth:this.settings.minSpreadWidth||t.minSpreadWidth||800,direction:this.settings.direction||t.direction||"ltr"}},t.prototype.flow=function(t){var e=t;"scrolled"!==t&&"scrolled-doc"!==t&&"scrolled-continuous"!==t||(e="scrolled"),"auto"!==t&&"paginated"!==t||(e="paginated"),this.settings.flow=t,this._layout&&this._layout.flow(e),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(e),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))},t.prototype.layout=function(t){var e=this;return t&&(this._layout=new Xn(t),this._layout.spread(t.spread,this.settings.minSpreadWidth),this._layout.on(Bn,(function(t,n){e.emit(Ln,t,n)}))),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout},t.prototype.spread=function(t,e){this.settings.spread=t,e&&(this.settings.minSpreadWidth=e),this._layout&&this._layout.spread(t,e),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()},t.prototype.direction=function(t){this.settings.direction=t||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))},t.prototype.reportLocation=function(){return this.q.enqueue(function(){requestAnimationFrame(function(){var t=this.manager.currentLocation();if(t&&t.then&&"function"==typeof t.then)t.then(function(t){var e=this.located(t);e&&e.start&&e.end&&(this.location=e,this.emit(In,{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(On,this.location))}.bind(this));else if(t){var e=this.located(t);if(!e||!e.start||!e.end)return;this.location=e,this.emit(In,{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(On,this.location)}}.bind(this))}.bind(this))},t.prototype.currentLocation=function(){var t=this.manager.currentLocation();if(t&&t.then&&"function"==typeof t.then)t.then(function(t){return this.located(t)}.bind(this));else if(t)return this.located(t)},t.prototype.located=function(t){if(!t.length)return{};var e=t[0],n=t[t.length-1],i={start:{index:e.index,href:e.href,cfi:e.mapping.start,displayed:{page:e.pages[0]||1,total:e.totalPages}},end:{index:n.index,href:n.href,cfi:n.mapping.end,displayed:{page:n.pages[n.pages.length-1]||1,total:n.totalPages}}},r=this.book.locations.locationFromCfi(e.mapping.start),o=this.book.locations.locationFromCfi(n.mapping.end);null!=r&&(i.start.location=r,i.start.percentage=this.book.locations.percentageFromLocation(r)),null!=o&&(i.end.location=o,i.end.percentage=this.book.locations.percentageFromLocation(o));var s=this.book.pageList.pageFromCfi(e.mapping.start),a=this.book.pageList.pageFromCfi(n.mapping.end);return-1!=s&&(i.start.page=s),-1!=a&&(i.end.page=a),n.index===this.book.spine.last().index&&i.end.displayed.page>=i.end.displayed.total&&(i.atEnd=!0),e.index===this.book.spine.first().index&&1===i.start.displayed.page&&(i.atStart=!0),i},t.prototype.destroy=function(){this.manager&&this.manager.destroy(),this.book=void 0},t.prototype.passEvents=function(t){var e=this;Qe.forEach((function(n){t.on(n,(function(n){return e.triggerViewEvent(n,t)}))})),t.on(rn,(function(n){return e.triggerSelectedEvent(n,t)}))},t.prototype.triggerViewEvent=function(t,e){this.emit(t.type,t,e)},t.prototype.triggerSelectedEvent=function(t,e){this.emit(Dn,t,e)},t.prototype.triggerMarkEvent=function(t,e,n){this.emit(zn,t,e,n)},t.prototype.getRange=function(t,e){var n=new xt(t),i=this.manager.visible().filter((function(t){if(n.spinePos===t.index)return!0}));if(i.length)return i[0].contents.range(n,e)},t.prototype.adjustImages=function(t){if("pre-paginated"===this._layout.name)return new Promise((function(t){t()}));var e=t.window.getComputedStyle(t.content,null),n=.95*(t.content.offsetHeight-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom))),i=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight);return t.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-i+"px":"100%")+"!important","max-height":n+"px!important","object-fit":"contain","page-break-inside":"avoid","break-inside":"avoid","box-sizing":"border-box"},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-i+"px":"100%")+"!important","max-height":n+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise((function(t,e){setTimeout((function(){t()}),1)}))},t.prototype.getContents=function(){return this.manager?this.manager.getContents():[]},t.prototype.views=function(){return(this.manager?this.manager.views:void 0)||[]},t.prototype.handleLinks=function(t){var e=this;t&&t.on(sn,(function(t){var n=e.book.path.relative(t);e.display(n)}))},t.prototype.injectStylesheet=function(t,e){var n=t.createElement("link");n.setAttribute("type","text/css"),n.setAttribute("rel","stylesheet"),n.setAttribute("href",this.settings.stylesheet),t.getElementsByTagName("head")[0].appendChild(n)},t.prototype.injectScript=function(t,e){var n=t.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",this.settings.script),n.textContent=" ",t.getElementsByTagName("head")[0].appendChild(n)},t.prototype.injectIdentifier=function(t,e){var n=this.book.packaging.metadata.identifier,i=t.createElement("meta");i.setAttribute("name","dc.relation.ispartof"),n&&i.setAttribute("content",n),t.getElementsByTagName("head")[0].appendChild(i)},t}();function Fi(t,e,n,i){var r,o="undefined"!=typeof window&&window.URL,s=o?"blob":"arraybuffer",a=new at,h=new XMLHttpRequest,u=XMLHttpRequest.prototype;for(r in"overrideMimeType"in u||Object.defineProperty(u,"overrideMimeType",{value:function(){}}),n&&(h.withCredentials=!0),h.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE){var t=!1;if(""!==this.responseType&&"document"!==this.responseType||(t=this.responseXML),200===this.status||0===this.status||t){var n;if(!this.response&&!t)return a.reject({status:this.status,message:"Empty Response",stack:(new Error).stack}),a.promise;if(403===this.status)return a.reject({status:this.status,response:this.response,message:"Forbidden",stack:(new Error).stack}),a.promise;n=t?this.responseXML:V(e)?Q(this.response,"text/xml"):"xhtml"==e?Q(this.response,"application/xhtml+xml"):"html"==e||"htm"==e?Q(this.response,"text/html"):"json"==e?JSON.parse(this.response):"blob"==e?o?this.response:new Blob([this.response]):this.response,a.resolve(n)}else a.reject({status:this.status,message:this.response,stack:(new Error).stack})}},h.onerror=function(t){a.reject(t)},h.open("GET",t,!0),i)h.setRequestHeader(r,i[r]);return"json"==e&&h.setRequestHeader("Accept","application/json"),e||(e=new bt(t).extension),"blob"==e&&(h.responseType=s),V(e)&&h.overrideMimeType("text/xml"),"binary"==e&&(h.responseType="arraybuffer"),h.send(),a.promise}N(Ui.prototype);var Mi=void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Wi=[],qi=[],Hi="undefined"!=typeof Uint8Array?Uint8Array:Array,Zi=!1;function Yi(){Zi=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0;e<64;++e)Wi[e]=t[e],qi[t.charCodeAt(e)]=e;qi["-".charCodeAt(0)]=62,qi["_".charCodeAt(0)]=63}function Vi(t,e,n){for(var i,r,o=[],s=e;s<n;s+=3)i=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(Wi[(r=i)>>18&63]+Wi[r>>12&63]+Wi[r>>6&63]+Wi[63&r]);return o.join("")}function Xi(t){var e;Zi||Yi();for(var n=t.length,i=n%3,r="",o=[],s=16383,a=0,h=n-i;a<h;a+=s)o.push(Vi(t,a,a+s>h?h:a+s));return 1===i?(e=t[n-1],r+=Wi[e>>2],r+=Wi[e<<4&63],r+="=="):2===i&&(e=(t[n-2]<<8)+t[n-1],r+=Wi[e>>10],r+=Wi[e>>4&63],r+=Wi[e<<2&63],r+="="),o.push(r),o.join("")}function Ki(t,e,n,i,r){var o,s,a=8*r-i-1,h=(1<<a)-1,u=h>>1,c=-7,l=n?r-1:0,f=n?-1:1,d=t[e+l];for(l+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+l],l+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+l],l+=f,c-=8);if(0===o)o=1-u;else{if(o===h)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=u}return(d?-1:1)*s*Math.pow(2,o-i)}function $i(t,e,n,i,r,o){var s,a,h,u=8*o-r-1,c=(1<<u)-1,l=c>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?f/h:f*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(e*h-1)*Math.pow(2,r),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,r),s=0));r>=8;t[n+d]=255&a,d+=p,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[n+d]=255&s,d+=p,s/=256,u-=8);t[n+d-p]|=128*m}var Gi={}.toString,Ji=Array.isArray||function(t){return"[object Array]"==Gi.call(t)};function Qi(){return er.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function tr(t,e){if(Qi()<e)throw new RangeError("Invalid typed array length");return er.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=er.prototype:(null===t&&(t=new er(e)),t.length=e),t}function er(t,e,n){if(!(er.TYPED_ARRAY_SUPPORT||this instanceof er))return new er(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return rr(this,t)}return nr(this,t,e,n)}function nr(t,e,n,i){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,i){if(n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,n):new Uint8Array(e,n,i),er.TYPED_ARRAY_SUPPORT?(t=e).__proto__=er.prototype:t=or(t,e),t}(t,e,n,i):"string"==typeof e?function(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!er.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|hr(e,n),r=(t=tr(t,i)).write(e,n);return r!==i&&(t=t.slice(0,r)),t}(t,e,n):function(t,e){if(ar(e)){var n=0|sr(e.length);return 0===(t=tr(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?tr(t,0):or(t,e);if("Buffer"===e.type&&Ji(e.data))return or(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function ir(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function rr(t,e){if(ir(e),t=tr(t,e<0?0:0|sr(e)),!er.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function or(t,e){var n=e.length<0?0:0|sr(e.length);t=tr(t,n);for(var i=0;i<n;i+=1)t[i]=255&e[i];return t}function sr(t){if(t>=Qi())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Qi().toString(16)+" bytes");return 0|t}function ar(t){return!(null==t||!t._isBuffer)}function hr(t,e){if(ar(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Dr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Lr(t).length;default:if(i)return Dr(t).length;e=(""+e).toLowerCase(),i=!0}}function ur(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Er(this,e,n);case"utf8":case"utf-8":return br(this,e,n);case"ascii":return xr(this,e,n);case"latin1":case"binary":return kr(this,e,n);case"base64":return wr(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sr(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function cr(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function lr(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=er.from(e,i)),ar(e))return 0===e.length?-1:fr(t,e,n,i,r);if("number"==typeof e)return e&=255,er.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):fr(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function fr(t,e,n,i,r){var o,s=1,a=t.length,h=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,h/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var c=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===h)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+h>a&&(n=a-h),o=n;o>=0;o--){for(var l=!0,f=0;f<h;f++)if(u(t,o+f)!==u(e,f)){l=!1;break}if(l)return o}return-1}function dr(t,e,n,i){n=Number(n)||0;var r=t.length-n;i?(i=Number(i))>r&&(i=r):i=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function pr(t,e,n,i){return Br(Dr(e,t.length-n),t,n,i)}function mr(t,e,n,i){return Br(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,i)}function gr(t,e,n,i){return mr(t,e,n,i)}function vr(t,e,n,i){return Br(Lr(e),t,n,i)}function yr(t,e,n,i){return Br(function(t,e){for(var n,i,r,o=[],s=0;s<t.length&&!((e-=2)<0);++s)i=(n=t.charCodeAt(s))>>8,r=n%256,o.push(r),o.push(i);return o}(e,t.length-n),t,n,i)}function wr(t,e,n){return 0===e&&n===t.length?Xi(t):Xi(t.slice(e,n))}function br(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r<n;){var o,s,a,h,u=t[r],c=null,l=u>239?4:u>223?3:u>191?2:1;if(r+l<=n)switch(l){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[r+1]))&&(h=(31&u)<<6|63&o)>127&&(c=h);break;case 3:o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&(h=(15&u)<<12|(63&o)<<6|63&s)>2047&&(h<55296||h>57343)&&(c=h);break;case 4:o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(h=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&h<1114112&&(c=h)}null===c?(c=65533,l=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),r+=l}return function(t){var e=t.length;if(e<=_r)return String.fromCharCode.apply(String,t);for(var n="",i=0;i<e;)n+=String.fromCharCode.apply(String,t.slice(i,i+=_r));return n}(i)}er.TYPED_ARRAY_SUPPORT=void 0===Mi.TYPED_ARRAY_SUPPORT||Mi.TYPED_ARRAY_SUPPORT,er.poolSize=8192,er._augment=function(t){return t.__proto__=er.prototype,t},er.from=function(t,e,n){return nr(null,t,e,n)},er.TYPED_ARRAY_SUPPORT&&(er.prototype.__proto__=Uint8Array.prototype,er.__proto__=Uint8Array),er.alloc=function(t,e,n){return function(t,e,n,i){return ir(e),e<=0?tr(t,e):void 0!==n?"string"==typeof i?tr(t,e).fill(n,i):tr(t,e).fill(n):tr(t,e)}(null,t,e,n)},er.allocUnsafe=function(t){return rr(null,t)},er.allocUnsafeSlow=function(t){return rr(null,t)},er.isBuffer=function(t){return null!=t&&(!!t._isBuffer||Pr(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&Pr(t.slice(0,0))}(t))},er.compare=function(t,e){if(!ar(t)||!ar(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,i=e.length,r=0,o=Math.min(n,i);r<o;++r)if(t[r]!==e[r]){n=t[r],i=e[r];break}return n<i?-1:i<n?1:0},er.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},er.concat=function(t,e){if(!Ji(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return er.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var i=er.allocUnsafe(e),r=0;for(n=0;n<t.length;++n){var o=t[n];if(!ar(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,r),r+=o.length}return i},er.byteLength=hr,er.prototype._isBuffer=!0,er.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)cr(this,e,e+1);return this},er.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)cr(this,e,e+3),cr(this,e+1,e+2);return this},er.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)cr(this,e,e+7),cr(this,e+1,e+6),cr(this,e+2,e+5),cr(this,e+3,e+4);return this},er.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?br(this,0,t):ur.apply(this,arguments)},er.prototype.equals=function(t){if(!ar(t))throw new TypeError("Argument must be a Buffer");return this===t||0===er.compare(this,t)},er.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},er.prototype.compare=function(t,e,n,i,r){if(!ar(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(i>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),h=this.slice(i,r),u=t.slice(e,n),c=0;c<a;++c)if(h[c]!==u[c]){o=h[c],s=u[c];break}return o<s?-1:s<o?1:0},er.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},er.prototype.indexOf=function(t,e,n){return lr(this,t,e,n,!0)},er.prototype.lastIndexOf=function(t,e,n){return lr(this,t,e,n,!1)},er.prototype.write=function(t,e,n,i){if(void 0===e)i="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)i=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-e;if((void 0===n||n>r)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return dr(this,t,e,n);case"utf8":case"utf-8":return pr(this,t,e,n);case"ascii":return mr(this,t,e,n);case"latin1":case"binary":return gr(this,t,e,n);case"base64":return vr(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yr(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},er.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _r=4096;function xr(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;r<n;++r)i+=String.fromCharCode(127&t[r]);return i}function kr(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;r<n;++r)i+=String.fromCharCode(t[r]);return i}function Er(t,e,n){var i,r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",s=e;s<n;++s)o+=(i=t[s])<16?"0"+i.toString(16):i.toString(16);return o}function Sr(t,e,n){for(var i=t.slice(e,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function Cr(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function Tr(t,e,n,i,r,o){if(!ar(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(n+i>t.length)throw new RangeError("Index out of range")}function Ar(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r<o;++r)t[n+r]=(e&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function Nr(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r<o;++r)t[n+r]=e>>>8*(i?r:3-r)&255}function Rr(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ir(t,e,n,i,r){return r||Rr(t,0,n,4),$i(t,e,n,i,23,4),n+4}function Or(t,e,n,i,r){return r||Rr(t,0,n,8),$i(t,e,n,i,52,8),n+8}er.prototype.slice=function(t,e){var n,i=this.length;if((t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t),er.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=er.prototype;else{var r=e-t;n=new er(r,void 0);for(var o=0;o<r;++o)n[o]=this[o+t]}return n},er.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Cr(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i},er.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Cr(t,e,this.length);for(var i=this[t+--e],r=1;e>0&&(r*=256);)i+=this[t+--e]*r;return i},er.prototype.readUInt8=function(t,e){return e||Cr(t,1,this.length),this[t]},er.prototype.readUInt16LE=function(t,e){return e||Cr(t,2,this.length),this[t]|this[t+1]<<8},er.prototype.readUInt16BE=function(t,e){return e||Cr(t,2,this.length),this[t]<<8|this[t+1]},er.prototype.readUInt32LE=function(t,e){return e||Cr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},er.prototype.readUInt32BE=function(t,e){return e||Cr(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},er.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Cr(t,e,this.length);for(var i=this[t],r=1,o=0;++o<e&&(r*=256);)i+=this[t+o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*e)),i},er.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Cr(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},er.prototype.readInt8=function(t,e){return e||Cr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},er.prototype.readInt16LE=function(t,e){e||Cr(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},er.prototype.readInt16BE=function(t,e){e||Cr(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},er.prototype.readInt32LE=function(t,e){return e||Cr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},er.prototype.readInt32BE=function(t,e){return e||Cr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},er.prototype.readFloatLE=function(t,e){return e||Cr(t,4,this.length),Ki(this,t,!0,23,4)},er.prototype.readFloatBE=function(t,e){return e||Cr(t,4,this.length),Ki(this,t,!1,23,4)},er.prototype.readDoubleLE=function(t,e){return e||Cr(t,8,this.length),Ki(this,t,!0,52,8)},er.prototype.readDoubleBE=function(t,e){return e||Cr(t,8,this.length),Ki(this,t,!1,52,8)},er.prototype.writeUIntLE=function(t,e,n,i){t=+t,e|=0,n|=0,i||Tr(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[e]=255&t;++o<n&&(r*=256);)this[e+o]=t/r&255;return e+n},er.prototype.writeUIntBE=function(t,e,n,i){t=+t,e|=0,n|=0,i||Tr(this,t,e,n,Math.pow(2,8*n)-1,0);var r=n-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+n},er.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,1,255,0),er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},er.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ar(this,t,e,!0),e+2},er.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,2,65535,0),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ar(this,t,e,!1),e+2},er.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Nr(this,t,e,!0),e+4},er.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,4,4294967295,0),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Nr(this,t,e,!1),e+4},er.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);Tr(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+n},er.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);Tr(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+n},er.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,1,127,-128),er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},er.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Ar(this,t,e,!0),e+2},er.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,2,32767,-32768),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Ar(this,t,e,!1),e+2},er.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,4,2147483647,-2147483648),er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Nr(this,t,e,!0),e+4},er.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||Tr(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Nr(this,t,e,!1),e+4},er.prototype.writeFloatLE=function(t,e,n){return Ir(this,t,e,!0,n)},er.prototype.writeFloatBE=function(t,e,n){return Ir(this,t,e,!1,n)},er.prototype.writeDoubleLE=function(t,e,n){return Or(this,t,e,!0,n)},er.prototype.writeDoubleBE=function(t,e,n){return Or(this,t,e,!1,n)},er.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var r,o=i-n;if(this===t&&n<e&&e<i)for(r=o-1;r>=0;--r)t[r+e]=this[r+n];else if(o<1e3||!er.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},er.prototype.fill=function(t,e,n,i){if("string"==typeof t){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!er.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=ar(t)?t:Dr(new er(t,i).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var zr=/[^+\/0-9A-Za-z-_]/g;function Dr(t,e){var n;e=e||1/0;for(var i=t.length,r=null,o=[],s=0;s<i;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Lr(t){return function(t){var e,n,i,r,o,s;Zi||Yi();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===t[a-2]?2:"="===t[a-1]?1:0,s=new Hi(3*a/4-o),i=o>0?a-4:a;var h=0;for(e=0,n=0;e<i;e+=4,n+=3)r=qi[t.charCodeAt(e)]<<18|qi[t.charCodeAt(e+1)]<<12|qi[t.charCodeAt(e+2)]<<6|qi[t.charCodeAt(e+3)],s[h++]=r>>16&255,s[h++]=r>>8&255,s[h++]=255&r;return 2===o?(r=qi[t.charCodeAt(e)]<<2|qi[t.charCodeAt(e+1)]>>4,s[h++]=255&r):1===o&&(r=qi[t.charCodeAt(e)]<<10|qi[t.charCodeAt(e+1)]<<4|qi[t.charCodeAt(e+2)]>>2,s[h++]=r>>8&255,s[h++]=255&r),s}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(zr,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Br(t,e,n,i){for(var r=0;r<i&&!(r+n>=e.length||r>=t.length);++r)e[r+n]=t[r];return r}function Pr(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function jr(){}function Ur(){Ur.init.call(this)}function Fr(t){return void 0===t._maxListeners?Ur.defaultMaxListeners:t._maxListeners}function Mr(t,e,n,i){var r,o,s,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=t._events)?(o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]):(o=t._events=new jr,t._eventsCount=0),s){if("function"==typeof s?s=o[e]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),!s.warned&&(r=Fr(t))&&r>0&&s.length>r){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,a=h,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=o[e]=n,++t._eventsCount;return t}function Wr(t,e,n){var i=!1;function r(){t.removeListener(e,r),i||(i=!0,n.apply(t,arguments))}return r.listener=n,r}function qr(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function Hr(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}function Zr(){throw new Error("setTimeout has not been defined")}function Yr(){throw new Error("clearTimeout has not been defined")}jr.prototype=Object.create(null),Ur.EventEmitter=Ur,Ur.usingDomains=!1,Ur.prototype.domain=void 0,Ur.prototype._events=void 0,Ur.prototype._maxListeners=void 0,Ur.defaultMaxListeners=10,Ur.init=function(){this.domain=null,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new jr,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ur.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},Ur.prototype.getMaxListeners=function(){return Fr(this)},Ur.prototype.emit=function(t){var e,n,i,r,o,s,a,h="error"===t;if(s=this._events)h=h&&null==s.error;else if(!h)return!1;if(a=this.domain,h){if(e=arguments[1],!a){if(e instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=a,e.domainThrown=!1,a.emit("error",e),!1}if(!(n=s[t]))return!1;var c="function"==typeof n;switch(i=arguments.length){case 1:!function(t,e,n){if(e)t.call(n);else for(var i=t.length,r=Hr(t,i),o=0;o<i;++o)r[o].call(n)}(n,c,this);break;case 2:!function(t,e,n,i){if(e)t.call(n,i);else for(var r=t.length,o=Hr(t,r),s=0;s<r;++s)o[s].call(n,i)}(n,c,this,arguments[1]);break;case 3:!function(t,e,n,i,r){if(e)t.call(n,i,r);else for(var o=t.length,s=Hr(t,o),a=0;a<o;++a)s[a].call(n,i,r)}(n,c,this,arguments[1],arguments[2]);break;case 4:!function(t,e,n,i,r,o){if(e)t.call(n,i,r,o);else for(var s=t.length,a=Hr(t,s),h=0;h<s;++h)a[h].call(n,i,r,o)}(n,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];!function(t,e,n,i){if(e)t.apply(n,i);else for(var r=t.length,o=Hr(t,r),s=0;s<r;++s)o[s].apply(n,i)}(n,c,this,r)}return!0},Ur.prototype.addListener=function(t,e){return Mr(this,t,e,!1)},Ur.prototype.on=Ur.prototype.addListener,Ur.prototype.prependListener=function(t,e){return Mr(this,t,e,!0)},Ur.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,Wr(this,t,e)),this},Ur.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,Wr(this,t,e)),this},Ur.prototype.removeListener=function(t,e){var n,i,r,o,s;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(n=i[t]))return this;if(n===e||n.listener&&n.listener===e)0==--this._eventsCount?this._events=new jr:(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,o=n.length;o-- >0;)if(n[o]===e||n[o].listener&&n[o].listener===e){s=n[o].listener,r=o;break}if(r<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new jr,this;delete i[t]}else!function(t,e){for(var n=e,i=n+1,r=t.length;i<r;n+=1,i+=1)t[n]=t[i];t.pop()}(n,r);i.removeListener&&this.emit("removeListener",t,s||e)}return this},Ur.prototype.removeAllListeners=function(t){var e,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new jr,this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=new jr:delete n[t]),this;if(0===arguments.length){for(var i,r=Object.keys(n),o=0;o<r.length;++o)"removeListener"!==(i=r[o])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=new jr,this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},Ur.prototype.listeners=function(t){var e,n,i=this._events;return n=i&&(e=i[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):[],n},Ur.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):qr.call(t,e)},Ur.prototype.listenerCount=qr,Ur.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Vr=Zr,Xr=Yr;function Kr(t){if(Vr===setTimeout)return setTimeout(t,0);if((Vr===Zr||!Vr)&&setTimeout)return Vr=setTimeout,setTimeout(t,0);try{return Vr(t,0)}catch(e){try{return Vr.call(null,t,0)}catch(e){return Vr.call(this,t,0)}}}"function"==typeof Mi.setTimeout&&(Vr=setTimeout),"function"==typeof Mi.clearTimeout&&(Xr=clearTimeout);var $r,Gr=[],Jr=!1,Qr=-1;function to(){Jr&&$r&&(Jr=!1,$r.length?Gr=$r.concat(Gr):Qr=-1,Gr.length&&eo())}function eo(){if(!Jr){var t=Kr(to);Jr=!0;for(var e=Gr.length;e;){for($r=Gr,Gr=[];++Qr<e;)$r&&$r[Qr].run();Qr=-1,e=Gr.length}$r=null,Jr=!1,function(t){if(Xr===clearTimeout)return clearTimeout(t);if((Xr===Yr||!Xr)&&clearTimeout)return Xr=clearTimeout,clearTimeout(t);try{return Xr(t)}catch(e){try{return Xr.call(null,t)}catch(e){return Xr.call(this,t)}}}(t)}}function no(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Gr.push(new io(t,e)),1!==Gr.length||Jr||Kr(eo)}function io(t,e){this.fun=t,this.array=e}io.prototype.run=function(){this.fun.apply(null,this.array)};var ro="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},oo=/%[sdj%]/g;function so(t){if(!wo(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(co(arguments[n]));return e.join(" ")}n=1;for(var i=arguments,r=i.length,o=String(t).replace(oo,(function(t){if("%%"===t)return"%";if(n>=r)return t;switch(t){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return t}})),s=i[n];n<r;s=i[++n])yo(s)||!xo(s)?o+=" "+s:o+=" "+co(s);return o}function ao(t,e){if(bo(Mi.process))return function(){return ao(t,e).apply(this,arguments)};var n=!1;return function(){return n||(console.error(e),n=!0),t.apply(this,arguments)}}var ho,uo={};function co(t,e){var n={seen:[],stylize:fo};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),vo(e)?n.showHidden=e:e&&function(t,e){if(!e||!xo(e))return t;for(var n=Object.keys(e),i=n.length;i--;)t[n[i]]=e[n[i]]}(n,e),bo(n.showHidden)&&(n.showHidden=!1),bo(n.depth)&&(n.depth=2),bo(n.colors)&&(n.colors=!1),bo(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=lo),po(n,t,n.depth)}function lo(t,e){var n=co.styles[e];return n?"["+co.colors[n][0]+"m"+t+"["+co.colors[n][1]+"m":t}function fo(t,e){return t}function po(t,e,n){if(t.customInspect&&e&&So(e.inspect)&&e.inspect!==co&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return wo(i)||(i=po(t,i,n)),i}var r=function(t,e){if(bo(e))return t.stylize("undefined","undefined");if(wo(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return"number"==typeof e?t.stylize(""+e,"number"):vo(e)?t.stylize(""+e,"boolean"):yo(e)?t.stylize("null","null"):void 0}(t,e);if(r)return r;var o=Object.keys(e),s=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Eo(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return mo(e);if(0===o.length){if(So(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(_o(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(ko(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Eo(e))return mo(e)}var h,u,c="",l=!1,f=["{","}"];return h=e,Array.isArray(h)&&(l=!0,f=["[","]"]),So(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),_o(e)&&(c=" "+RegExp.prototype.toString.call(e)),ko(e)&&(c=" "+Date.prototype.toUTCString.call(e)),Eo(e)&&(c=" "+mo(e)),0!==o.length||l&&0!=e.length?n<0?_o(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=l?function(t,e,n,i,r){for(var o=[],s=0,a=e.length;s<a;++s)To(e,String(s))?o.push(go(t,e,n,i,String(s),!0)):o.push("");return r.forEach((function(r){r.match(/^\d+$/)||o.push(go(t,e,n,i,r,!0))})),o}(t,e,n,s,o):o.map((function(i){return go(t,e,n,s,i,l)})),t.seen.pop(),function(t,e,n){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}(u,c,f)):f[0]+c+f[1]}function mo(t){return"["+Error.prototype.toString.call(t)+"]"}function go(t,e,n,i,r,o){var s,a,h;if((h=Object.getOwnPropertyDescriptor(e,r)||{value:e[r]}).get?a=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(a=t.stylize("[Setter]","special")),To(i,r)||(s="["+r+"]"),a||(t.seen.indexOf(h.value)<0?(a=yo(n)?po(t,h.value,null):po(t,h.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return"  "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return"   "+t})).join("\n")):a=t.stylize("[Circular]","special")),bo(s)){if(o&&r.match(/^\d+$/))return a;(s=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function vo(t){return"boolean"==typeof t}function yo(t){return null===t}function wo(t){return"string"==typeof t}function bo(t){return void 0===t}function _o(t){return xo(t)&&"[object RegExp]"===Co(t)}function xo(t){return"object"==typeof t&&null!==t}function ko(t){return xo(t)&&"[object Date]"===Co(t)}function Eo(t){return xo(t)&&("[object Error]"===Co(t)||t instanceof Error)}function So(t){return"function"==typeof t}function Co(t){return Object.prototype.toString.call(t)}function To(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ao(){this.head=null,this.tail=null,this.length=0}co.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},co.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Ao.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},Ao.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},Ao.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},Ao.prototype.clear=function(){this.head=this.tail=null,this.length=0},Ao.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},Ao.prototype.concat=function(t){if(0===this.length)return er.alloc(0);if(1===this.length)return this.head.data;for(var e=er.allocUnsafe(t>>>0),n=this.head,i=0;n;)n.data.copy(e,i),i+=n.data.length,n=n.next;return e};var No=er.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ro(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!No(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Oo;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=zo;break;default:return void(this.write=Io)}this.charBuffer=new er(6),this.charReceived=0,this.charLength=0}function Io(t){return t.toString(this.encoding)}function Oo(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function zo(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}Ro.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(t=t.slice(n,t.length),!((i=(e=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(e.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i,r=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,r),r-=this.charReceived),r=(e+=t.toString(this.encoding,0,r)).length-1,(i=e.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,r)}return e},Ro.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},Ro.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,i=this.charBuffer,r=this.encoding;e+=i.slice(0,n).toString(r)}return e},Po.ReadableState=Bo;var Do,Lo=(Do="stream",bo(ho)&&(ho=""),Do=Do.toUpperCase(),uo[Do]||(new RegExp("\\b"+Do+"\\b","i").test(ho)?uo[Do]=function(){var t=so.apply(null,arguments);console.error("%s %d: %s",Do,0,t)}:uo[Do]=function(){}),uo[Do]);function Bo(t,e){t=t||{},this.objectMode=!!t.objectMode,e instanceof ls&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new Ao,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(this.decoder=new Ro(t.encoding),this.encoding=t.encoding)}function Po(t){if(!(this instanceof Po))return new Po(t);this._readableState=new Bo(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),Ur.call(this)}function jo(t,e,n,i,r){var o=function(t,e){var n=null;return er.isBuffer(e)||"string"==typeof e||null==e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(e,n);if(o)t.emit("error",o);else if(null===n)e.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,Mo(t)}}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!r){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&r){var a=new Error("stream.unshift() after end event");t.emit("error",a)}else{var h;!e.decoder||r||i||(n=e.decoder.write(n),h=!e.objectMode&&0===n.length),r||(e.reading=!1),h||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&Mo(t))),function(t,e){e.readingMore||(e.readingMore=!0,no(qo,t,e))}(t,e)}else r||(e.reading=!1);return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(e)}ro(Po,Ur),Po.prototype.push=function(t,e){var n=this._readableState;return n.objectMode||"string"!=typeof t||(e=e||n.defaultEncoding)!==n.encoding&&(t=er.from(t,e),e=""),jo(this,n,t,e,!1)},Po.prototype.unshift=function(t){return jo(this,this._readableState,t,"",!0)},Po.prototype.isPaused=function(){return!1===this._readableState.flowing},Po.prototype.setEncoding=function(t){return this._readableState.decoder=new Ro(t),this._readableState.encoding=t,this};var Uo=8388608;function Fo(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=Uo?t=Uo:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function Mo(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(Lo("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?no(Wo,t):Wo(t))}function Wo(t){Lo("emit readable"),t.emit("readable"),Yo(t)}function qo(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Lo("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function Ho(t){Lo("readable nexttick read 0"),t.read(0)}function Zo(t,e){e.reading||(Lo("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),Yo(t),e.flowing&&!e.reading&&t.read(0)}function Yo(t){var e=t._readableState;for(Lo("flow",e.flowing);e.flowing&&null!==t.read(););}function Vo(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var i;return t<e.head.data.length?(i=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):i=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,i=1,r=n.data;for(t-=r.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(s===o.length?r+=o:r+=o.slice(0,t),0==(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e):function(t,e){var n=er.allocUnsafe(t),i=e.head,r=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0==(t-=s)){s===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++r}return e.length-=r,n}(t,e),i}(t,e.buffer,e.decoder),n);var n}function Xo(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,no(Ko,e,t))}function Ko(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function $o(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}function Go(){}function Jo(t,e,n){this.chunk=t,this.encoding=e,this.callback=n,this.next=null}function Qo(t,e){Object.defineProperty(this,"buffer",{get:ao((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),t=t||{},this.objectMode=!!t.objectMode,e instanceof ls&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=!1===t.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,r=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,r){--e.pendingcb,n?no(r,i):r(i),t._writableState.errorEmitted=!0,t.emit("error",i)}(t,n,i,e,r);else{var o=rs(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||is(t,n),i?no(ns,t,n,o,r):ns(t,n,o,r)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new as(this)}function ts(t){if(!(this instanceof ts||this instanceof ls))return new ts(t);this._writableState=new Qo(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),Ur.call(this)}function es(t,e,n,i,r,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}function ns(t,e,n,i){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),ss(t,e)}function is(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,r=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var s=0;n;)r[s]=n,n=n.next,s+=1;es(t,e,!0,e.length,r,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new as(e)}else{for(;n;){var a=n.chunk,h=n.encoding,u=n.callback;if(es(t,e,!1,e.objectMode?1:a.length,a,h,u),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function rs(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function os(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function ss(t,e){var n=rs(e);return n&&(0===e.pendingcb?(os(t,e),e.finished=!0,t.emit("finish")):os(t,e)),n}function as(t){var e=this;this.next=null,this.entry=null,this.finish=function(n){var i=e.entry;for(e.entry=null;i;){var r=i.callback;t.pendingcb--,r(n),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}Po.prototype.read=function(t){Lo("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Lo("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Xo(this):Mo(this),null;if(0===(t=Fo(t,e))&&e.ended)return 0===e.length&&Xo(this),null;var i,r=e.needReadable;return Lo("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&Lo("length less than watermark",r=!0),e.ended||e.reading?Lo("reading or ended",r=!1):r&&(Lo("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Fo(n,e))),null===(i=t>0?Vo(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&Xo(this)),null!==i&&this.emit("data",i),i},Po.prototype._read=function(t){this.emit("error",new Error("not implemented"))},Po.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,Lo("pipe count=%d opts=%j",i.pipesCount,e);var r=e&&!1===e.end?u:s;function o(t){Lo("onunpipe"),t===n&&u()}function s(){Lo("onend"),t.end()}i.endEmitted?no(r):n.once("end",r),t.on("unpipe",o);var a=function(t){return function(){var e=t._readableState;Lo("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&t.listeners("data").length&&(e.flowing=!0,Yo(t))}}(n);t.on("drain",a);var h=!1;function u(){Lo("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",a),t.removeListener("error",f),t.removeListener("unpipe",o),n.removeListener("end",s),n.removeListener("end",u),n.removeListener("data",l),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||a()}var c=!1;function l(e){Lo("ondata"),c=!1,!1!==t.write(e)||c||((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==$o(i.pipes,t))&&!h&&(Lo("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,c=!0),n.pause())}function f(e){Lo("onerror",e),m(),t.removeListener("error",f),0===t.listeners("error").length&&t.emit("error",e)}function d(){t.removeListener("finish",p),m()}function p(){Lo("onfinish"),t.removeListener("close",d),m()}function m(){Lo("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(Lo("pipe resume"),n.resume()),t},Po.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var r=0;r<i;r++)n[r].emit("unpipe",this);return this}var o=$o(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this)),this},Po.prototype.on=function(t,e){var n=Ur.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&Mo(this):no(Ho,this))}return n},Po.prototype.addListener=Po.prototype.on,Po.prototype.resume=function(){var t=this._readableState;return t.flowing||(Lo("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,no(Zo,t,e))}(this,t)),this},Po.prototype.pause=function(){return Lo("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(Lo("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Po.prototype.wrap=function(t){var e=this._readableState,n=!1,i=this;for(var r in t.on("end",(function(){if(Lo("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&i.push(t)}i.push(null)})),t.on("data",(function(r){Lo("wrapped data"),e.decoder&&(r=e.decoder.write(r)),e.objectMode&&null==r||(e.objectMode||r&&r.length)&&(i.push(r)||(n=!0,t.pause()))})),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));return function(e){for(var n=0,r=e.length;n<r;n++)o=e[n],t.on(o,i.emit.bind(i,o));var o}(["error","close","destroy","pause","resume"]),i._read=function(e){Lo("wrapped _read",e),n&&(n=!1,t.resume())},i},Po._fromList=Vo,ts.WritableState=Qo,ro(ts,Ur),Qo.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},ts.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},ts.prototype.write=function(t,e,n){var i=this._writableState,r=!1;return"function"==typeof e&&(n=e,e=null),er.isBuffer(t)?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof n&&(n=Go),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),no(e,n)}(this,n):function(t,e,n,i){var r=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):er.isBuffer(n)||"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),no(i,o),r=!1),r}(this,i,t,n)&&(i.pendingcb++,r=function(t,e,n,i,r){n=function(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=er.from(e,n)),e}(e,n,i),er.isBuffer(n)&&(i="buffer");var o=e.objectMode?1:n.length;e.length+=o;var s=e.length<e.highWaterMark;if(s||(e.needDrain=!0),e.writing||e.corked){var a=e.lastBufferedRequest;e.lastBufferedRequest=new Jo(n,i,r),a?a.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else es(t,e,!1,o,n,i,r);return s}(this,i,t,e,n)),r},ts.prototype.cork=function(){this._writableState.corked++},ts.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||is(this,t))},ts.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},ts.prototype._write=function(t,e,n){n(new Error("not implemented"))},ts.prototype._writev=null,ts.prototype.end=function(t,e,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,n){e.ending=!0,ss(t,e),n&&(e.finished?no(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,i,n)},ro(ls,Po);for(var hs=Object.keys(ts.prototype),us=0;us<hs.length;us++){var cs=hs[us];ls.prototype[cs]||(ls.prototype[cs]=ts.prototype[cs])}function ls(t){if(!(this instanceof ls))return new ls(t);Po.call(this,t),ts.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",fs)}function fs(){this.allowHalfOpen||this._writableState.ended||no(ds,this)}function ds(t){t.end()}function ps(t){this.afterTransform=function(e,n){return function(t,e,n){var i=t._transformState;i.transforming=!1;var r=i.writecb;if(!r)return t.emit("error",new Error("no writecb in Transform class"));i.writechunk=null,i.writecb=null,null!=n&&t.push(n),r(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function ms(t){if(!(this instanceof ms))return new ms(t);ls.call(this,t),this._transformState=new ps(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",(function(){"function"==typeof this._flush?this._flush((function(t){gs(e,t)})):gs(e)}))}function gs(t,e){if(e)return t.emit("error",e);var n=t._writableState,i=t._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}function vs(t){if(!(this instanceof vs))return new vs(t);ms.call(this,t)}function ys(){Ur.call(this)}ro(ms,ls),ms.prototype.push=function(t,e){return this._transformState.needTransform=!1,ls.prototype.push.call(this,t,e)},ms.prototype._transform=function(t,e,n){throw new Error("Not implemented")},ms.prototype._write=function(t,e,n){var i=this._transformState;if(i.writecb=n,i.writechunk=t,i.writeencoding=e,!i.transforming){var r=this._readableState;(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},ms.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},ro(vs,ms),vs.prototype._transform=function(t,e,n){n(null,t)},ro(ys,Ur),ys.Readable=Po,ys.Writable=ts,ys.Duplex=ls,ys.Transform=ms,ys.PassThrough=vs,ys.Stream=ys,ys.prototype.pipe=function(t,e){var n=this;function i(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function r(){n.readable&&n.resume&&n.resume()}n.on("data",i),t.on("drain",r),t._isStdio||e&&!1===e.end||(n.on("end",s),n.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(u(),0===Ur.listenerCount(this,"error"))throw t}function u(){n.removeListener("data",i),t.removeListener("drain",r),n.removeListener("end",s),n.removeListener("close",a),n.removeListener("error",h),t.removeListener("error",h),n.removeListener("end",u),n.removeListener("close",u),t.removeListener("close",u)}return n.on("error",h),t.on("error",h),n.on("end",u),n.on("close",u),t.on("close",u),t.emit("pipe",n),t};var ws,bs,_s=ys,xs=c((function(t,e){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer=void 0!==er,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var n=new ArrayBuffer(0);try{e.blob=0===new Blob([n],{type:"application/zip"}).size}catch(t){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),e.blob=0===i.getBlob("application/zip").size}catch(t){e.blob=!1}}}try{e.nodestream=!!_s.Readable}catch(t){e.nodestream=!1}})),ks="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Es=void 0!==er,Ss=function(t,e){if(er.from&&er.from!==Uint8Array.from)return er.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new er(t,e)},Cs=function(t){if(er.alloc)return er.alloc(t);var e=new er(t);return e.fill(0),e},Ts=function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume},As="function"==typeof setImmediate?setImmediate:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)},Ns=h.MutationObserver||h.WebKitMutationObserver;if(Ns){var Rs=0,Is=new Ns(Ls),Os=h.document.createTextNode("");Is.observe(Os,{characterData:!0}),ws=function(){Os.data=Rs=++Rs%2}}else if(h.setImmediate||void 0===h.MessageChannel)ws="document"in h&&"onreadystatechange"in h.document.createElement("script")?function(){var t=h.document.createElement("script");t.onreadystatechange=function(){Ls(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},h.document.documentElement.appendChild(t)}:function(){setTimeout(Ls,0)};else{var zs=new h.MessageChannel;zs.port1.onmessage=Ls,ws=function(){zs.port2.postMessage(0)}}var Ds=[];function Ls(){var t,e;bs=!0;for(var n=Ds.length;n;){for(e=Ds,Ds=[],t=-1;++t<n;)e[t]();n=Ds.length}bs=!1}function Bs(){}var Ps={},js=["REJECTED"],Us=["FULFILLED"],Fs=["PENDING"],Ms=Ws;function Ws(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=Fs,this.queue=[],this.outcome=void 0,t!==Bs&&Ys(this,t)}function qs(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function Hs(t,e,n){var i;i=function(){var i;try{i=e(n)}catch(e){return Ps.reject(t,e)}i===t?Ps.reject(t,new TypeError("Cannot resolve promise with itself")):Ps.resolve(t,i)},1!==Ds.push(i)||bs||ws()}function Zs(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function Ys(t,e){var n=!1;function i(e){n||(n=!0,Ps.reject(t,e))}function r(e){n||(n=!0,Ps.resolve(t,e))}var o=Vs((function(){e(r,i)}));"error"===o.status&&i(o.value)}function Vs(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}Ws.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){throw n}))}))},Ws.prototype.catch=function(t){return this.then(null,t)},Ws.prototype.then=function(t,e){if("function"!=typeof t&&this.state===Us||"function"!=typeof e&&this.state===js)return this;var n=new this.constructor(Bs);return this.state!==Fs?Hs(n,this.state===Us?t:e,this.outcome):this.queue.push(new qs(n,t,e)),n},qs.prototype.callFulfilled=function(t){Ps.resolve(this.promise,t)},qs.prototype.otherCallFulfilled=function(t){Hs(this.promise,this.onFulfilled,t)},qs.prototype.callRejected=function(t){Ps.reject(this.promise,t)},qs.prototype.otherCallRejected=function(t){Hs(this.promise,this.onRejected,t)},Ps.resolve=function(t,e){var n=Vs(Zs,e);if("error"===n.status)return Ps.reject(t,n.value);var i=n.value;if(i)Ys(t,i);else{t.state=Us,t.outcome=e;for(var r=-1,o=t.queue.length;++r<o;)t.queue[r].callFulfilled(e)}return t},Ps.reject=function(t,e){t.state=js,t.outcome=e;for(var n=-1,i=t.queue.length;++n<i;)t.queue[n].callRejected(e);return t},Ws.resolve=function(t){return t instanceof this?t:Ps.resolve(new this(Bs),t)},Ws.reject=function(t){var e=new this(Bs);return Ps.reject(e,t)},Ws.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var r=new Array(n),o=0,s=-1,a=new this(Bs);++s<n;)h(t[s],s);return a;function h(t,s){e.resolve(t).then((function(t){r[s]=t,++o!==n||i||(i=!0,Ps.resolve(a,r))}),(function(t){i||(i=!0,Ps.reject(a,t))}))}},Ws.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,n=!1;if(!e)return this.resolve([]);for(var i,r=-1,o=new this(Bs);++r<e;)i=t[r],this.resolve(i).then((function(t){n||(n=!0,Ps.resolve(o,t))}),(function(t){n||(n=!0,Ps.reject(o,t))}));return o};var Xs={Promise:"undefined"!=typeof Promise?Promise:Ms},Ks=c((function(t,e){function n(t){return t}function i(t,e){for(var n=0;n<t.length;++n)e[n]=255&t.charCodeAt(n);return e}e.newBlob=function(t,n){e.checkSupport("blob");try{return new Blob([t],{type:n})}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(t),i.getBlob(n)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var r={stringifyByChunk:function(t,e,n){var i=[],r=0,o=t.length;if(o<=n)return String.fromCharCode.apply(null,t);for(;r<o;)"array"===e||"nodebuffer"===e?i.push(String.fromCharCode.apply(null,t.slice(r,Math.min(r+n,o)))):i.push(String.fromCharCode.apply(null,t.subarray(r,Math.min(r+n,o)))),r+=n;return i.join("")},stringifyByChar:function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},applyCanBeUsed:{uint8array:function(){try{return xs.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return xs.nodebuffer&&1===String.fromCharCode.apply(null,Cs(1)).length}catch(t){return!1}}()}};function o(t){var n=65536,i=e.getTypeOf(t),o=!0;if("uint8array"===i?o=r.applyCanBeUsed.uint8array:"nodebuffer"===i&&(o=r.applyCanBeUsed.nodebuffer),o)for(;n>1;)try{return r.stringifyByChunk(t,i,n)}catch(t){n=Math.floor(n/2)}return r.stringifyByChar(t)}function s(t,e){for(var n=0;n<t.length;n++)e[n]=t[n];return e}e.applyFromCharCode=o;var a={};a.string={string:n,array:function(t){return i(t,new Array(t.length))},arraybuffer:function(t){return a.string.uint8array(t).buffer},uint8array:function(t){return i(t,new Uint8Array(t.length))},nodebuffer:function(t){return i(t,Cs(t.length))}},a.array={string:o,array:n,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return Ss(t)}},a.arraybuffer={string:function(t){return o(new Uint8Array(t))},array:function(t){return s(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:n,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return Ss(new Uint8Array(t))}},a.uint8array={string:o,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:n,nodebuffer:function(t){return Ss(t)}},a.nodebuffer={string:o,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return a.nodebuffer.uint8array(t).buffer},uint8array:function(t){return s(t,new Uint8Array(t.length))},nodebuffer:n},e.transformTo=function(t,n){if(n||(n=""),!t)return n;e.checkSupport(t);var i=e.getTypeOf(n);return a[i][t](n)},e.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":xs.nodebuffer&&(e=t,er.isBuffer(e))?"nodebuffer":xs.uint8array&&t instanceof Uint8Array?"uint8array":xs.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0;var e},e.checkSupport=function(t){if(!xs[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(t){var e,n,i="";for(n=0;n<(t||"").length;n++)i+="\\x"+((e=t.charCodeAt(n))<16?"0":"")+e.toString(16).toUpperCase();return i},e.delay=function(t,e,n){As((function(){t.apply(n||null,e||[])}))},e.inherits=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n},e.extend=function(){var t,e,n={};for(t=0;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&void 0===n[e]&&(n[e]=arguments[t][e]);return n},e.prepareContent=function(t,n,r,o,s){return Xs.Promise.resolve(n).then((function(t){return xs.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new Xs.Promise((function(e,n){var i=new FileReader;i.onload=function(t){e(t.target.result)},i.onerror=function(t){n(t.target.error)},i.readAsArrayBuffer(t)})):t})).then((function(n){var a=e.getTypeOf(n);return a?("arraybuffer"===a?n=e.transformTo("uint8array",n):"string"===a&&(s?n=function(t){var e,n,i,r,o,s,a=0,h=0;if("data:"===t.substr(0,5))throw new Error("Invalid base64 input, it looks like a data url.");var u,c=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===ks.charAt(64)&&c--,t.charAt(t.length-2)===ks.charAt(64)&&c--,c%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=xs.uint8array?new Uint8Array(0|c):new Array(0|c);a<t.length;)e=ks.indexOf(t.charAt(a++))<<2|(r=ks.indexOf(t.charAt(a++)))>>4,n=(15&r)<<4|(o=ks.indexOf(t.charAt(a++)))>>2,i=(3&o)<<6|(s=ks.indexOf(t.charAt(a++))),u[h++]=e,64!==o&&(u[h++]=n),64!==s&&(u[h++]=i);return u}(n):r&&!0!==o&&(n=function(t){return i(t,xs.uint8array?new Uint8Array(t.length):new Array(t.length))}(n))),n):Xs.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}}));function $s(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}$s.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n<this._listeners[t].length;n++)this._listeners[t][n].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var t=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},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 t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}};var Gs=$s,Js=c((function(t,e){for(var n=new Array(256),i=0;i<256;i++)n[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;function r(){Gs.call(this,"utf-8 decode"),this.leftOver=null}function o(){Gs.call(this,"utf-8 encode")}n[254]=n[254]=1,e.utf8encode=function(t){return xs.nodebuffer?Ss(t,"utf-8"):function(t){var e,n,i,r,o,s=t.length,a=0;for(r=0;r<s;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=xs.uint8array?new Uint8Array(a):new Array(a),o=0,r=0;o<a;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),n<128?e[o++]=n:n<2048?(e[o++]=192|n>>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e}(t)},e.utf8decode=function(t){return xs.nodebuffer?Ks.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,r,o,s=t.length,a=new Array(2*s);for(i=0,e=0;e<s;)if((r=t[e++])<128)a[i++]=r;else if((o=n[r])>4)a[i++]=65533,e+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&e<s;)r=r<<6|63&t[e++],o--;o>1?a[i++]=65533:r<65536?a[i++]=r:(r-=65536,a[i++]=55296|r>>10&1023,a[i++]=56320|1023&r)}return a.length!==i&&(a.subarray?a=a.subarray(0,i):a.length=i),Ks.applyFromCharCode(a)}(t=Ks.transformTo(xs.uint8array?"uint8array":"array",t))},Ks.inherits(r,Gs),r.prototype.processChunk=function(t){var i=Ks.transformTo(xs.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(xs.uint8array){var r=i;(i=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),i.set(r,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var o=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+n[t[i]]>e?i:e}(i),s=i;o!==i.length&&(xs.uint8array?(s=i.subarray(0,o),this.leftOver=i.subarray(o,i.length)):(s=i.slice(0,o),this.leftOver=i.slice(o,i.length))),this.push({data:e.utf8decode(s),meta:t.meta})},r.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=r,Ks.inherits(o,Gs),o.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=o}));function Qs(t){Gs.call(this,"ConvertWorker to "+t),this.destType=t}Ks.inherits(Qs,Gs),Qs.prototype.processChunk=function(t){this.push({data:Ks.transformTo(this.destType,t.data),meta:t.meta})};var ta=Qs,ea=_s.Readable;function na(t,e,n){ea.call(this,e),this._helper=t;var i=this;t.on("data",(function(t,e){i.push(t)||i._helper.pause(),n&&n(e)})).on("error",(function(t){i.emit("error",t)})).on("end",(function(){i.push(null)}))}Ks.inherits(na,ea),na.prototype._read=function(){this._helper.resume()};var ia=na,ra=null;if(xs.nodestream)try{ra=ia}catch(xc){}function oa(t,e){return new Xs.Promise((function(n,i){var r=[],o=t._internalType,s=t._outputType,a=t._mimeType;t.on("data",(function(t,n){r.push(t),e&&e(n)})).on("error",(function(t){r=[],i(t)})).on("end",(function(){try{var t=function(t,e,n){switch(t){case"blob":return Ks.newBlob(Ks.transformTo("arraybuffer",e),n);case"base64":return function(t){for(var e,n,i,r,o,s,a,h=[],u=0,c=t.length,l=c,f="string"!==Ks.getTypeOf(t);u<t.length;)l=c-u,f?(e=t[u++],n=u<c?t[u++]:0,i=u<c?t[u++]:0):(e=t.charCodeAt(u++),n=u<c?t.charCodeAt(u++):0,i=u<c?t.charCodeAt(u++):0),r=e>>2,o=(3&e)<<4|n>>4,s=l>1?(15&n)<<2|i>>6:64,a=l>2?63&i:64,h.push(ks.charAt(r)+ks.charAt(o)+ks.charAt(s)+ks.charAt(a));return h.join("")}(e);default:return Ks.transformTo(t,e)}}(s,function(t,e){var n,i=0,r=null,o=0;for(n=0;n<e.length;n++)o+=e[n].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(r=new Uint8Array(o),n=0;n<e.length;n++)r.set(e[n],i),i+=e[n].length;return r;case"nodebuffer":return er.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(o,r),a);n(t)}catch(t){i(t)}r=[]})).resume()}))}function sa(t,e,n){var i=e;switch(e){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=e,this._mimeType=n,Ks.checkSupport(i),this._worker=t.pipe(new ta(i)),t.lock()}catch(t){this._worker=new Gs("error"),this._worker.error(t)}}sa.prototype={accumulate:function(t){return oa(this,t)},on:function(t,e){var n=this;return"data"===t?this._worker.on(t,(function(t){e.call(n,t.data,t.meta)})):this._worker.on(t,(function(){Ks.delay(e,arguments,n)})),this},resume:function(){return Ks.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(Ks.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new ra(this,{objectMode:"nodebuffer"!==this._outputType},t)}};var aa=sa,ha={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null};function ua(t){Gs.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=Ks.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}Ks.inherits(ua,Gs),ua.prototype.cleanUp=function(){Gs.prototype.cleanUp.call(this),this.data=null},ua.prototype.resume=function(){return!!Gs.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Ks.delay(this._tickAndRepeat,[],this)),!0)},ua.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(Ks.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},ua.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})};var ca=ua;function la(t){Gs.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}Ks.inherits(la,Gs),la.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}Gs.prototype.processChunk.call(this,t)};var fa=la,da=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}(),pa=function(t,e){return void 0!==t&&t.length?"string"!==Ks.getTypeOf(t)?function(t,e,n){var i=da,r=0+n;t=~t;for(var o=0;o<r;o++)t=t>>>8^i[255&(t^e[o])];return~t}(0|e,t,t.length):function(t,e,n){var i=da,r=0+n;t=~t;for(var o=0;o<r;o++)t=t>>>8^i[255&(t^e.charCodeAt(o))];return~t}(0|e,t,t.length):0};function ma(){Gs.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Ks.inherits(ma,Gs),ma.prototype.processChunk=function(t){this.streamInfo.crc32=pa(t.data,this.streamInfo.crc32||0),this.push(t)};var ga=ma;function va(t,e,n,i,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=i,this.compressedContent=r}va.prototype={getContentWorker:function(){var t=new ca(Xs.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new fa("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new ca(Xs.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},va.createWorkerFrom=function(t,e,n){return t.pipe(new ga).pipe(new fa("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new fa("compressedSize")).withStreamInfo("compression",e)};var ya=va,wa=function(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};wa.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");var i="string"===(n=t.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!i&&(e=e.pipe(new Js.Utf8EncodeWorker)),!r&&i&&(e=e.pipe(new Js.Utf8DecodeWorker))}catch(t){(e=new Gs("error")).error(t)}return new aa(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof ya&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new Js.Utf8EncodeWorker)),ya.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof ya?this._data.getContentWorker():this._data instanceof Gs?this._data:new ca(this._data)}};for(var ba=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],_a=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},xa=0;xa<ba.length;xa++)wa.prototype[ba[xa]]=_a;var ka=wa,Ea=c((function(t,e){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(t[r]=n[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){var e,n,i,r,o,s;for(i=0,e=0,n=t.length;e<n;e++)i+=t[e].length;for(s=new Uint8Array(i),r=0,e=0,n=t.length;e<n;e++)o=t[e],s.set(o,r),r+=o.length;return s}},o={arraySet:function(t,e,n,i,r){for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(n)}));function Sa(t){for(var e=t.length;--e>=0;)t[e]=0}var Ca=[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],Ta=[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],Aa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Na=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ra=new Array(576);Sa(Ra);var Ia=new Array(60);Sa(Ia);var Oa=new Array(512);Sa(Oa);var za=new Array(256);Sa(za);var Da=new Array(29);Sa(Da);var La,Ba,Pa,ja=new Array(30);function Ua(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function Fa(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Ma(t){return t<256?Oa[t]:Oa[256+(t>>>7)]}function Wa(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function qa(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,Wa(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function Ha(t,e,n){qa(t,n[2*e],n[2*e+1])}function Za(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function Ya(t,e,n){var i,r,o=new Array(16),s=0;for(i=1;i<=15;i++)o[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=Za(o[a]++,a))}}function Va(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Xa(t){t.bi_valid>8?Wa(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Ka(t,e,n,i){var r=2*e,o=2*n;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]}function $a(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&Ka(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!Ka(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function Ga(t,e,n){var i,r,o,s,a=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*a]<<8|t.pending_buf[t.d_buf+2*a+1],r=t.pending_buf[t.l_buf+a],a++,0===i?Ha(t,r,e):(Ha(t,(o=za[r])+256+1,e),0!==(s=Ca[o])&&qa(t,r-=Da[o],s),Ha(t,o=Ma(--i),n),0!==(s=Ta[o])&&qa(t,i-=ja[o],s))}while(a<t.last_lit);Ha(t,256,e)}function Ja(t,e){var n,i,r,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,h=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<h;n++)0!==o[2*n]?(t.heap[++t.heap_len]=u=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=s[2*r+1]);for(e.max_code=u,n=t.heap_len>>1;n>=1;n--)$a(t,o,n);r=h;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],$a(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,$a(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,s,a,h=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(h[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(o=h[2*h[2*(i=t.heap[n])+1]+1]+1)>p&&(o=p,m++),h[2*i+1]=o,i>u||(t.bl_count[o]++,s=0,i>=d&&(s=f[i-d]),a=h[2*i],t.opt_len+=a*(o+s),l&&(t.static_len+=a*(c[2*i+1]+s)));if(0!==m){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(i=t.bl_count[o];0!==i;)(r=t.heap[--n])>u||(h[2*r+1]!==o&&(t.opt_len+=(o-h[2*r+1])*h[2*r],h[2*r+1]=o),i--)}}(t,e),Ya(o,u,t.bl_count)}function Qa(t,e,n){var i,r,o=-1,s=e[1],a=0,h=7,u=4;for(0===s&&(h=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++a<h&&r===s||(a<u?t.bl_tree[2*r]+=a:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=r,0===s?(h=138,u=3):r===s?(h=6,u=3):(h=7,u=4))}function th(t,e,n){var i,r,o=-1,s=e[1],a=0,h=7,u=4;for(0===s&&(h=138,u=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++a<h&&r===s)){if(a<u)do{Ha(t,r,t.bl_tree)}while(0!=--a);else 0!==r?(r!==o&&(Ha(t,r,t.bl_tree),a--),Ha(t,16,t.bl_tree),qa(t,a-3,2)):a<=10?(Ha(t,17,t.bl_tree),qa(t,a-3,3)):(Ha(t,18,t.bl_tree),qa(t,a-11,7));a=0,o=r,0===s?(h=138,u=3):r===s?(h=6,u=3):(h=7,u=4)}}Sa(ja);var eh=!1;function nh(t,e,n,i){qa(t,0+(i?1:0),3),function(t,e,n){Xa(t),Wa(t,n),Wa(t,~n),Ea.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n)}var ih,rh={_tr_init:function(t){eh||(function(){var t,e,n,i,r,o=new Array(16);for(n=0,i=0;i<28;i++)for(Da[i]=n,t=0;t<1<<Ca[i];t++)za[n++]=i;for(za[n-1]=i,r=0,i=0;i<16;i++)for(ja[i]=r,t=0;t<1<<Ta[i];t++)Oa[r++]=i;for(r>>=7;i<30;i++)for(ja[i]=r<<7,t=0;t<1<<Ta[i]-7;t++)Oa[256+r++]=i;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)Ra[2*t+1]=8,t++,o[8]++;for(;t<=255;)Ra[2*t+1]=9,t++,o[9]++;for(;t<=279;)Ra[2*t+1]=7,t++,o[7]++;for(;t<=287;)Ra[2*t+1]=8,t++,o[8]++;for(Ya(Ra,287,o),t=0;t<30;t++)Ia[2*t+1]=5,Ia[2*t]=Za(t,5);La=new Ua(Ra,Ca,257,286,15),Ba=new Ua(Ia,Ta,0,30,15),Pa=new Ua(new Array(0),Aa,0,19,7)}(),eh=!0),t.l_desc=new Fa(t.dyn_ltree,La),t.d_desc=new Fa(t.dyn_dtree,Ba),t.bl_desc=new Fa(t.bl_tree,Pa),t.bi_buf=0,t.bi_valid=0,Va(t)},_tr_stored_block:nh,_tr_flush_block:function(t,e,n,i){var r,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),Ja(t,t.l_desc),Ja(t,t.d_desc),s=function(t){var e;for(Qa(t,t.dyn_ltree,t.l_desc.max_code),Qa(t,t.dyn_dtree,t.d_desc.max_code),Ja(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*Na[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==e?nh(t,e,n,i):4===t.strategy||o===r?(qa(t,2+(i?1:0),3),Ga(t,Ra,Ia)):(qa(t,4+(i?1:0),3),function(t,e,n,i){var r;for(qa(t,e-257,5),qa(t,n-1,5),qa(t,i-4,4),r=0;r<i;r++)qa(t,t.bl_tree[2*Na[r]+1],3);th(t,t.dyn_ltree,e-1),th(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),Ga(t,t.dyn_ltree,t.dyn_dtree)),Va(t),i&&Xa(t)},_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(za[n]+256+1)]++,t.dyn_dtree[2*Ma(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){qa(t,2,3),Ha(t,256,Ra),function(t){16===t.bi_valid?(Wa(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},oh=function(t,e,n,i){for(var r=65535&t,o=t>>>16&65535,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(r=r+e[i++]|0)|0}while(--s);r%=65521,o%=65521}return r|o<<16},sh=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}(),ah=function(t,e,n,i){var r=sh,o=i+n;t^=-1;for(var s=i;s<o;s++)t=t>>>8^r[255&(t^e[s])];return~t},hh={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"},uh=-2,ch=258,lh=262,fh=103,dh=113,ph=666;function mh(t,e){return t.msg=hh[e],e}function gh(t){return(t<<1)-(t>4?9:0)}function vh(t){for(var e=t.length;--e>=0;)t[e]=0}function yh(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(Ea.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function wh(t,e){rh._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yh(t.strm)}function bh(t,e){t.pending_buf[t.pending++]=e}function _h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function xh(t,e){var n,i,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-lh?t.strstart-(t.w_size-lh):0,u=t.window,c=t.w_mask,l=t.prev,f=t.strstart+ch,d=u[o+s-1],p=u[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(n=e)+s]===p&&u[n+s-1]===d&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<f);if(i=ch-(f-o),o=f-ch,i>s){if(t.match_start=e,s=i,i>=a)break;d=u[o+s-1],p=u[o+s]}}}while((e=l[e&c])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead}function kh(t){var e,n,i,r,o,s,a,h,u,c,l=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=l+(l-lh)){Ea.arraySet(t.window,t.window,l,l,0),t.match_start-=l,t.strstart-=l,t.block_start-=l,e=n=t.hash_size;do{i=t.head[--e],t.head[e]=i>=l?i-l:0}while(--n);e=n=l;do{i=t.prev[--e],t.prev[e]=i>=l?i-l:0}while(--n);r+=l}if(0===t.strm.avail_in)break;if(s=t.strm,a=t.window,h=t.strstart+t.lookahead,u=r,c=void 0,(c=s.avail_in)>u&&(c=u),n=0===c?0:(s.avail_in-=c,Ea.arraySet(a,s.input,s.next_in,c,h),1===s.state.wrap?s.adler=oh(s.adler,a,c,h):2===s.state.wrap&&(s.adler=ah(s.adler,a,c,h)),s.next_in+=c,s.total_in+=c,c),t.lookahead+=n,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<lh&&0!==t.strm.avail_in)}function Eh(t,e){for(var n,i;;){if(t.lookahead<lh){if(kh(t),t.lookahead<lh&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-lh&&(t.match_length=xh(t,n)),t.match_length>=3)if(i=rh._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=rh._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(wh(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(wh(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(wh(t,!1),0===t.strm.avail_out)?1:2}function Sh(t,e){for(var n,i,r;;){if(t.lookahead<lh){if(kh(t),t.lookahead<lh&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-lh&&(t.match_length=xh(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,i=rh._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(wh(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=rh._tr_tally(t,0,t.window[t.strstart-1]))&&wh(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=rh._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(wh(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(wh(t,!1),0===t.strm.avail_out)?1:2}function Ch(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function Th(){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=8,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 Ea.Buf16(1146),this.dyn_dtree=new Ea.Buf16(122),this.bl_tree=new Ea.Buf16(78),vh(this.dyn_ltree),vh(this.dyn_dtree),vh(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ea.Buf16(16),this.heap=new Ea.Buf16(573),vh(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ea.Buf16(573),vh(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 Ah(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:dh,t.adler=2===e.wrap?0:1,e.last_flush=0,rh._tr_init(e),0):mh(t,uh)}function Nh(t){var e,n=Ah(t);return 0===n&&((e=t.state).window_size=2*e.w_size,vh(e.head),e.max_lazy_match=ih[e.level].max_lazy,e.good_match=ih[e.level].good_length,e.nice_match=ih[e.level].nice_length,e.max_chain_length=ih[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),n}function Rh(t,e,n,i,r,o){if(!t)return uh;var s=1;if(-1===e&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),r<1||r>9||8!==n||i<8||i>15||e<0||e>9||o<0||o>4)return mh(t,uh);8===i&&(i=9);var a=new Th;return t.state=a,a.strm=t,a.wrap=s,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=r+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Ea.Buf8(2*a.w_size),a.head=new Ea.Buf16(a.hash_size),a.prev=new Ea.Buf16(a.w_size),a.lit_bufsize=1<<r+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Ea.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=3*a.lit_bufsize,a.level=e,a.strategy=o,a.method=n,Nh(t)}ih=[new Ch(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(kh(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,wh(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-lh&&(wh(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(wh(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(wh(t,!1),t.strm.avail_out),1)})),new Ch(4,4,8,4,Eh),new Ch(4,5,16,8,Eh),new Ch(4,6,32,32,Eh),new Ch(4,4,16,16,Sh),new Ch(8,16,32,32,Sh),new Ch(8,16,128,128,Sh),new Ch(8,32,128,256,Sh),new Ch(32,128,258,1024,Sh),new Ch(32,258,258,4096,Sh)];var Ih={deflateInit:function(t,e){return Rh(t,e,8,15,8,0)},deflateInit2:Rh,deflateReset:Nh,deflateResetKeep:Ah,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?uh:(t.state.gzhead=e,0):uh},deflate:function(t,e){var n,i,r,o;if(!t||!t.state||e>5||e<0)return t?mh(t,uh):uh;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===ph&&4!==e)return mh(t,0===t.avail_out?-5:uh);if(i.strm=t,n=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,bh(i,31),bh(i,139),bh(i,8),i.gzhead?(bh(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),bh(i,255&i.gzhead.time),bh(i,i.gzhead.time>>8&255),bh(i,i.gzhead.time>>16&255),bh(i,i.gzhead.time>>24&255),bh(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),bh(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(bh(i,255&i.gzhead.extra.length),bh(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=ah(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(bh(i,0),bh(i,0),bh(i,0),bh(i,0),bh(i,0),bh(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),bh(i,3),i.status=dh);else{var s=8+(i.w_bits-8<<4)<<8;s|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(s|=32),s+=31-s%31,i.status=dh,_h(i,s),0!==i.strstart&&(_h(i,t.adler>>>16),_h(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(t.adler=ah(t.adler,i.pending_buf,i.pending-r,r)),yh(t),r=i.pending,i.pending!==i.pending_buf_size));)bh(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(t.adler=ah(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=ah(t.adler,i.pending_buf,i.pending-r,r)),yh(t),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,bh(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>r&&(t.adler=ah(t.adler,i.pending_buf,i.pending-r,r)),0===o&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=ah(t.adler,i.pending_buf,i.pending-r,r)),yh(t),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,bh(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>r&&(t.adler=ah(t.adler,i.pending_buf,i.pending-r,r)),0===o&&(i.status=fh)}else i.status=fh;if(i.status===fh&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&yh(t),i.pending+2<=i.pending_buf_size&&(bh(i,255&t.adler),bh(i,t.adler>>8&255),t.adler=0,i.status=dh)):i.status=dh),0!==i.pending){if(yh(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&gh(e)<=gh(n)&&4!==e)return mh(t,-5);if(i.status===ph&&0!==t.avail_in)return mh(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&i.status!==ph){var a=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(kh(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=rh._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(wh(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(wh(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(wh(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var n,i,r,o,s=t.window;;){if(t.lookahead<=ch){if(kh(t),t.lookahead<=ch&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[r=t.strstart-1])===s[++r]&&i===s[++r]&&i===s[++r]){o=t.strstart+ch;do{}while(i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&i===s[++r]&&r<o);t.match_length=ch-(o-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=rh._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=rh._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(wh(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(wh(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(wh(t,!1),0===t.strm.avail_out)?1:2}(i,e):ih[i.level].func(i,e);if(3!==a&&4!==a||(i.status=ph),1===a||3===a)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===a&&(1===e?rh._tr_align(i):5!==e&&(rh._tr_stored_block(i,0,0,!1),3===e&&(vh(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),yh(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(bh(i,255&t.adler),bh(i,t.adler>>8&255),bh(i,t.adler>>16&255),bh(i,t.adler>>24&255),bh(i,255&t.total_in),bh(i,t.total_in>>8&255),bh(i,t.total_in>>16&255),bh(i,t.total_in>>24&255)):(_h(i,t.adler>>>16),_h(i,65535&t.adler)),yh(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},deflateEnd:function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==fh&&e!==dh&&e!==ph?mh(t,uh):(t.state=null,e===dh?mh(t,-3):0):uh},deflateSetDictionary:function(t,e){var n,i,r,o,s,a,h,u,c=e.length;if(!t||!t.state)return uh;if(2===(o=(n=t.state).wrap)||1===o&&42!==n.status||n.lookahead)return uh;for(1===o&&(t.adler=oh(t.adler,e,c,0)),n.wrap=0,c>=n.w_size&&(0===o&&(vh(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new Ea.Buf8(n.w_size),Ea.arraySet(u,e,c-n.w_size,n.w_size,0),e=u,c=n.w_size),s=t.avail_in,a=t.next_in,h=t.input,t.avail_in=c,t.next_in=0,t.input=e,kh(n);n.lookahead>=3;){i=n.strstart,r=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+3-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++}while(--r);n.strstart=i,n.lookahead=2,kh(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=a,t.input=h,t.avail_in=s,n.wrap=o,0},deflateInfo:"pako deflate (from Nodeca project)"},Oh=!0,zh=!0;try{String.fromCharCode.apply(null,[0])}catch(kc){Oh=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Ec){zh=!1}for(var Dh=new Ea.Buf8(256),Lh=0;Lh<256;Lh++)Dh[Lh]=Lh>=252?6:Lh>=248?5:Lh>=240?4:Lh>=224?3:Lh>=192?2:1;function Bh(t,e){if(e<65534&&(t.subarray&&zh||!t.subarray&&Oh))return String.fromCharCode.apply(null,Ea.shrinkBuf(t,e));for(var n="",i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n}Dh[254]=Dh[254]=1;var Ph=function(t){var e,n,i,r,o,s=t.length,a=0;for(r=0;r<s;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Ea.Buf8(a),o=0,r=0;o<a;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),n<128?e[o++]=n:n<2048?(e[o++]=192|n>>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e},jh=function(t,e){var n,i,r,o,s=e||t.length,a=new Array(2*s);for(i=0,n=0;n<s;)if((r=t[n++])<128)a[i++]=r;else if((o=Dh[r])>4)a[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n<s;)r=r<<6|63&t[n++],o--;o>1?a[i++]=65533:r<65536?a[i++]=r:(r-=65536,a[i++]=55296|r>>10&1023,a[i++]=56320|1023&r)}return Bh(a,i)},Uh=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+Dh[t[n]]>e?n:e},Fh=function(){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},Mh=Object.prototype.toString;function Wh(t){if(!(this instanceof Wh))return new Wh(t);this.options=Ea.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fh,this.strm.avail_out=0;var n=Ih.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(hh[n]);if(e.header&&Ih.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Ph(e.dictionary):"[object ArrayBuffer]"===Mh.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=Ih.deflateSetDictionary(this.strm,i)))throw new Error(hh[n]);this._dict_set=!0}}function qh(t,e){var n=new Wh(e);if(n.push(t,!0),n.err)throw n.msg||hh[n.err];return n.result}Wh.prototype.push=function(t,e){var n,i,r,o=this.strm,s=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=Ph(t):"[object ArrayBuffer]"===Mh.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new Ea.Buf8(s),o.next_out=0,o.avail_out=s),1!==(n=Ih.deflate(o,i))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(Bh(r=Ea.shrinkBuf(o.output,o.next_out),r.length)):this.onData(Ea.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==n);return 4===i?(n=Ih.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==i||(this.onEnd(0),o.avail_out=0,!0)},Wh.prototype.onData=function(t){this.chunks.push(t)},Wh.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ea.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Hh={Deflate:Wh,deflate:qh,deflateRaw:function(t,e){return(e=e||{}).raw=!0,qh(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,qh(t,e)}},Zh=function(t,e){var n,i,r,o,s,a,h,u,c,l,f,d,p,m,g,v,y,w,b,_,x,k,E,S,C;n=t.state,i=t.next_in,S=t.input,r=i+(t.avail_in-5),o=t.next_out,C=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),h=n.dmax,u=n.wsize,c=n.whave,l=n.wnext,f=n.window,d=n.hold,p=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;t:do{p<15&&(d+=S[i++]<<p,p+=8,d+=S[i++]<<p,p+=8),w=m[d&v];e:for(;;){if(d>>>=b=w>>>24,p-=b,0==(b=w>>>16&255))C[o++]=65535&w;else{if(!(16&b)){if(64&b){if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=m[(65535&w)+(d&(1<<b)-1)];continue e}for(_=65535&w,(b&=15)&&(p<b&&(d+=S[i++]<<p,p+=8),_+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=S[i++]<<p,p+=8,d+=S[i++]<<p,p+=8),w=g[d&y];;){if(d>>>=b=w>>>24,p-=b,16&(b=w>>>16&255)){if(x=65535&w,p<(b&=15)&&(d+=S[i++]<<p,(p+=8)<b&&(d+=S[i++]<<p,p+=8)),(x+=d&(1<<b)-1)>h){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=b,p-=b,x>(b=o-s)){if((b=x-b)>c&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(k=0,E=f,0===l){if(k+=u-b,b<_){_-=b;do{C[o++]=f[k++]}while(--b);k=o-x,E=C}}else if(l<b){if(k+=u+l-b,(b-=l)<_){_-=b;do{C[o++]=f[k++]}while(--b);if(k=0,l<_){_-=b=l;do{C[o++]=f[k++]}while(--b);k=o-x,E=C}}}else if(k+=l-b,b<_){_-=b;do{C[o++]=f[k++]}while(--b);k=o-x,E=C}for(;_>2;)C[o++]=E[k++],C[o++]=E[k++],C[o++]=E[k++],_-=3;_&&(C[o++]=E[k++],_>1&&(C[o++]=E[k++]))}else{k=o-x;do{C[o++]=C[k++],C[o++]=C[k++],C[o++]=C[k++],_-=3}while(_>2);_&&(C[o++]=C[k++],_>1&&(C[o++]=C[k++]))}break}if(64&b){t.msg="invalid distance code",n.mode=30;break t}w=g[(65535&w)+(d&(1<<b)-1)]}}break}}while(i<r&&o<a);i-=_=p>>3,d&=(1<<(p-=_<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=d,n.bits=p},Yh=[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],Vh=[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],Xh=[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],Kh=[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],$h=function(t,e,n,i,r,o,s,a){var h,u,c,l,f,d,p,m,g,v=a.bits,y=0,w=0,b=0,_=0,x=0,k=0,E=0,S=0,C=0,T=0,A=null,N=0,R=new Ea.Buf16(16),I=new Ea.Buf16(16),O=null,z=0;for(y=0;y<=15;y++)R[y]=0;for(w=0;w<i;w++)R[e[n+w]]++;for(x=v,_=15;_>=1&&0===R[_];_--);if(x>_&&(x=_),0===_)return r[o++]=20971520,r[o++]=20971520,a.bits=1,0;for(b=1;b<_&&0===R[b];b++);for(x<b&&(x=b),S=1,y=1;y<=15;y++)if(S<<=1,(S-=R[y])<0)return-1;if(S>0&&(0===t||1!==_))return-1;for(I[1]=0,y=1;y<15;y++)I[y+1]=I[y]+R[y];for(w=0;w<i;w++)0!==e[n+w]&&(s[I[e[n+w]]++]=w);if(0===t?(A=O=s,d=19):1===t?(A=Yh,N-=257,O=Vh,z-=257,d=256):(A=Xh,O=Kh,d=-1),T=0,w=0,y=b,f=o,k=x,E=0,c=-1,l=(C=1<<x)-1,1===t&&C>852||2===t&&C>592)return 1;for(;;){p=y-E,s[w]<d?(m=0,g=s[w]):s[w]>d?(m=O[z+s[w]],g=A[N+s[w]]):(m=96,g=0),h=1<<y-E,b=u=1<<k;do{r[f+(T>>E)+(u-=h)]=p<<24|m<<16|g}while(0!==u);for(h=1<<y-1;T&h;)h>>=1;if(0!==h?(T&=h-1,T+=h):T=0,w++,0==--R[y]){if(y===_)break;y=e[n+s[w]]}if(y>x&&(T&l)!==c){for(0===E&&(E=x),f+=b,S=1<<(k=y-E);k+E<_&&!((S-=R[k+E])<=0);)k++,S<<=1;if(C+=1<<k,1===t&&C>852||2===t&&C>592)return 1;r[c=T&l]=x<<24|k<<16|f-o}}return 0!==T&&(r[f+T]=y-E<<24|64<<16),a.bits=x,0},Gh=-2,Jh=12,Qh=30;function tu(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function eu(){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 Ea.Buf16(320),this.work=new Ea.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function nu(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Ea.Buf32(852),e.distcode=e.distdyn=new Ea.Buf32(592),e.sane=1,e.back=-1,0):Gh}function iu(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,nu(t)):Gh}function ru(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Gh:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,iu(t))):Gh}function ou(t,e){var n,i;return t?(i=new eu,t.state=i,i.window=null,0!==(n=ru(t,e))&&(t.state=null),n):Gh}var su,au,hu=!0;function uu(t){if(hu){var e;for(su=new Ea.Buf32(512),au=new Ea.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for($h(1,t.lens,0,288,su,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;$h(2,t.lens,0,32,au,0,t.work,{bits:5}),hu=!1}t.lencode=su,t.lenbits=9,t.distcode=au,t.distbits=5}function cu(t,e,n,i){var r,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Ea.Buf8(o.wsize)),i>=o.wsize?(Ea.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),Ea.arraySet(o.window,e,n-i,r,o.wnext),(i-=r)?(Ea.arraySet(o.window,e,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0}var lu={inflateReset:iu,inflateReset2:ru,inflateResetKeep:nu,inflateInit:function(t){return ou(t,15)},inflateInit2:ou,inflate:function(t,e){var n,i,r,o,s,a,h,u,c,l,f,d,p,m,g,v,y,w,b,_,x,k,E,S,C=0,T=new Ea.Buf8(4),A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Gh;(n=t.state).mode===Jh&&(n.mode=13),s=t.next_out,r=t.output,h=t.avail_out,o=t.next_in,i=t.input,a=t.avail_in,u=n.hold,c=n.bits,l=a,f=h,k=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;c<16;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(2&n.wrap&&35615===u){n.check=0,T[0]=255&u,T[1]=u>>>8&255,n.check=ah(n.check,T,2,0),u=0,c=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",n.mode=Qh;break}if(8!=(15&u)){t.msg="unknown compression method",n.mode=Qh;break}if(c-=4,x=8+(15&(u>>>=4)),0===n.wbits)n.wbits=x;else if(x>n.wbits){t.msg="invalid window size",n.mode=Qh;break}n.dmax=1<<x,t.adler=n.check=1,n.mode=512&u?10:Jh,u=0,c=0;break;case 2:for(;c<16;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(n.flags=u,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=Qh;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=Qh;break}n.head&&(n.head.text=u>>8&1),512&n.flags&&(T[0]=255&u,T[1]=u>>>8&255,n.check=ah(n.check,T,2,0)),u=0,c=0,n.mode=3;case 3:for(;c<32;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}n.head&&(n.head.time=u),512&n.flags&&(T[0]=255&u,T[1]=u>>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,n.check=ah(n.check,T,4,0)),u=0,c=0,n.mode=4;case 4:for(;c<16;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}n.head&&(n.head.xflags=255&u,n.head.os=u>>8),512&n.flags&&(T[0]=255&u,T[1]=u>>>8&255,n.check=ah(n.check,T,2,0)),u=0,c=0,n.mode=5;case 5:if(1024&n.flags){for(;c<16;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}n.length=u,n.head&&(n.head.extra_len=u),512&n.flags&&(T[0]=255&u,T[1]=u>>>8&255,n.check=ah(n.check,T,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((d=n.length)>a&&(d=a),d&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Ea.arraySet(n.head.extra,i,o,d,x)),512&n.flags&&(n.check=ah(n.check,i,d,o)),a-=d,o+=d,n.length-=d),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===a)break t;d=0;do{x=i[o+d++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x))}while(x&&d<a);if(512&n.flags&&(n.check=ah(n.check,i,d,o)),a-=d,o+=d,x)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===a)break t;d=0;do{x=i[o+d++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x))}while(x&&d<a);if(512&n.flags&&(n.check=ah(n.check,i,d,o)),a-=d,o+=d,x)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;c<16;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(u!==(65535&n.check)){t.msg="header crc mismatch",n.mode=Qh;break}u=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Jh;break;case 10:for(;c<32;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}t.adler=n.check=tu(u),u=0,c=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=a,n.hold=u,n.bits=c,2;t.adler=n.check=1,n.mode=Jh;case Jh:if(5===e||6===e)break t;case 13:if(n.last){u>>>=7&c,c-=7&c,n.mode=27;break}for(;c<3;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}switch(n.last=1&u,c-=1,3&(u>>>=1)){case 0:n.mode=14;break;case 1:if(uu(n),n.mode=20,6===e){u>>>=2,c-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=Qh}u>>>=2,c-=2;break;case 14:for(u>>>=7&c,c-=7&c;c<32;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",n.mode=Qh;break}if(n.length=65535&u,u=0,c=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(d=n.length){if(d>a&&(d=a),d>h&&(d=h),0===d)break t;Ea.arraySet(r,i,o,d,s),a-=d,o+=d,h-=d,s+=d,n.length-=d;break}n.mode=Jh;break;case 17:for(;c<14;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(n.nlen=257+(31&u),u>>>=5,c-=5,n.ndist=1+(31&u),u>>>=5,c-=5,n.ncode=4+(15&u),u>>>=4,c-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Qh;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;c<3;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}n.lens[A[n.have++]]=7&u,u>>>=3,c-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},k=$h(0,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,k){t.msg="invalid code lengths set",n.mode=Qh;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;v=(C=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,y=65535&C,!((g=C>>>24)<=c);){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(y<16)u>>>=g,c-=g,n.lens[n.have++]=y;else{if(16===y){for(S=g+2;c<S;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(u>>>=g,c-=g,0===n.have){t.msg="invalid bit length repeat",n.mode=Qh;break}x=n.lens[n.have-1],d=3+(3&u),u>>>=2,c-=2}else if(17===y){for(S=g+3;c<S;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}c-=g,x=0,d=3+(7&(u>>>=g)),u>>>=3,c-=3}else{for(S=g+7;c<S;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}c-=g,x=0,d=11+(127&(u>>>=g)),u>>>=7,c-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Qh;break}for(;d--;)n.lens[n.have++]=x}}if(n.mode===Qh)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=Qh;break}if(n.lenbits=9,E={bits:n.lenbits},k=$h(1,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,k){t.msg="invalid literal/lengths set",n.mode=Qh;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},k=$h(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,k){t.msg="invalid distances set",n.mode=Qh;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(a>=6&&h>=258){t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=a,n.hold=u,n.bits=c,Zh(t,f),s=t.next_out,r=t.output,h=t.avail_out,o=t.next_in,i=t.input,a=t.avail_in,u=n.hold,c=n.bits,n.mode===Jh&&(n.back=-1);break}for(n.back=0;v=(C=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,y=65535&C,!((g=C>>>24)<=c);){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(v&&!(240&v)){for(w=g,b=v,_=y;v=(C=n.lencode[_+((u&(1<<w+b)-1)>>w)])>>>16&255,y=65535&C,!(w+(g=C>>>24)<=c);){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}u>>>=w,c-=w,n.back+=w}if(u>>>=g,c-=g,n.back+=g,n.length=y,0===v){n.mode=26;break}if(32&v){n.back=-1,n.mode=Jh;break}if(64&v){t.msg="invalid literal/length code",n.mode=Qh;break}n.extra=15&v,n.mode=22;case 22:if(n.extra){for(S=n.extra;c<S;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;v=(C=n.distcode[u&(1<<n.distbits)-1])>>>16&255,y=65535&C,!((g=C>>>24)<=c);){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(!(240&v)){for(w=g,b=v,_=y;v=(C=n.distcode[_+((u&(1<<w+b)-1)>>w)])>>>16&255,y=65535&C,!(w+(g=C>>>24)<=c);){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}u>>>=w,c-=w,n.back+=w}if(u>>>=g,c-=g,n.back+=g,64&v){t.msg="invalid distance code",n.mode=Qh;break}n.offset=y,n.extra=15&v,n.mode=24;case 24:if(n.extra){for(S=n.extra;c<S;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Qh;break}n.mode=25;case 25:if(0===h)break t;if(d=f-h,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Qh;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),m=n.window}else m=r,p=s-n.offset,d=n.length;d>h&&(d=h),h-=d,n.length-=d;do{r[s++]=m[p++]}while(--d);0===n.length&&(n.mode=21);break;case 26:if(0===h)break t;r[s++]=n.length,h--,n.mode=21;break;case 27:if(n.wrap){for(;c<32;){if(0===a)break t;a--,u|=i[o++]<<c,c+=8}if(f-=h,t.total_out+=f,n.total+=f,f&&(t.adler=n.check=n.flags?ah(n.check,r,f,s-f):oh(n.check,r,f,s-f)),f=h,(n.flags?u:tu(u))!==n.check){t.msg="incorrect data check",n.mode=Qh;break}u=0,c=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;c<32;){if(0===a)break t;a--,u+=i[o++]<<c,c+=8}if(u!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=Qh;break}u=0,c=0}n.mode=29;case 29:k=1;break t;case Qh:k=-3;break t;case 31:return-4;default:return Gh}return t.next_out=s,t.avail_out=h,t.next_in=o,t.avail_in=a,n.hold=u,n.bits=c,(n.wsize||f!==t.avail_out&&n.mode<Qh&&(n.mode<27||4!==e))&&cu(t,t.output,t.next_out,f-t.avail_out),l-=t.avail_in,f-=t.avail_out,t.total_in+=l,t.total_out+=f,n.total+=f,n.wrap&&f&&(t.adler=n.check=n.flags?ah(n.check,r,f,t.next_out-f):oh(n.check,r,f,t.next_out-f)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Jh?128:0)+(20===n.mode||15===n.mode?256:0),(0===l&&0===f||4===e)&&0===k&&(k=-5),k},inflateEnd:function(t){if(!t||!t.state)return Gh;var e=t.state;return e.window&&(e.window=null),t.state=null,0},inflateGetHeader:function(t,e){var n;return t&&t.state&&2&(n=t.state).wrap?(n.head=e,e.done=!1,0):Gh},inflateSetDictionary:function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?Gh:11===n.mode&&oh(1,e,i,0)!==n.check?-3:cu(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,0):Gh},inflateInfo:"pako inflate (from Nodeca project)"},fu={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},du=function(){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},pu=Object.prototype.toString;function mu(t){if(!(this instanceof mu))return new mu(t);this.options=Ea.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Fh,this.strm.avail_out=0;var n=lu.inflateInit2(this.strm,e.windowBits);if(n!==fu.Z_OK)throw new Error(hh[n]);if(this.header=new du,lu.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Ph(e.dictionary):"[object ArrayBuffer]"===pu.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=lu.inflateSetDictionary(this.strm,e.dictionary))!==fu.Z_OK))throw new Error(hh[n])}function gu(t,e){var n=new mu(e);if(n.push(t,!0),n.err)throw n.msg||hh[n.err];return n.result}mu.prototype.push=function(t,e){var n,i,r,o,s,a=this.strm,h=this.options.chunkSize,u=this.options.dictionary,c=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?fu.Z_FINISH:fu.Z_NO_FLUSH,"string"==typeof t?a.input=function(t){for(var e=new Ea.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e}(t):"[object ArrayBuffer]"===pu.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new Ea.Buf8(h),a.next_out=0,a.avail_out=h),(n=lu.inflate(a,fu.Z_NO_FLUSH))===fu.Z_NEED_DICT&&u&&(n=lu.inflateSetDictionary(this.strm,u)),n===fu.Z_BUF_ERROR&&!0===c&&(n=fu.Z_OK,c=!1),n!==fu.Z_STREAM_END&&n!==fu.Z_OK)return this.onEnd(n),this.ended=!0,!1;a.next_out&&(0!==a.avail_out&&n!==fu.Z_STREAM_END&&(0!==a.avail_in||i!==fu.Z_FINISH&&i!==fu.Z_SYNC_FLUSH)||("string"===this.options.to?(r=Uh(a.output,a.next_out),o=a.next_out-r,s=jh(a.output,r),a.next_out=o,a.avail_out=h-o,o&&Ea.arraySet(a.output,a.output,r,o,0),this.onData(s)):this.onData(Ea.shrinkBuf(a.output,a.next_out)))),0===a.avail_in&&0===a.avail_out&&(c=!0)}while((a.avail_in>0||0===a.avail_out)&&n!==fu.Z_STREAM_END);return n===fu.Z_STREAM_END&&(i=fu.Z_FINISH),i===fu.Z_FINISH?(n=lu.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===fu.Z_OK):i!==fu.Z_SYNC_FLUSH||(this.onEnd(fu.Z_OK),a.avail_out=0,!0)},mu.prototype.onData=function(t){this.chunks.push(t)},mu.prototype.onEnd=function(t){t===fu.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ea.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var vu={Inflate:mu,inflate:gu,inflateRaw:function(t,e){return(e=e||{}).raw=!0,gu(t,e)},ungzip:gu},yu={};(0,Ea.assign)(yu,Hh,vu,fu);var wu=yu,bu="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function _u(t,e){Gs.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}Ks.inherits(_u,Gs),_u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(Ks.transformTo(bu,t.data),!1)},_u.prototype.flush=function(){Gs.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},_u.prototype.cleanUp=function(){Gs.prototype.cleanUp.call(this),this._pako=null},_u.prototype._createPako=function(){this._pako=new wu[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}};var xu={STORE:{magic:"\0\0",compressWorker:function(t){return new Gs("STORE compression")},uncompressWorker:function(){return new Gs("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(t){return new _u("Deflate",t)},uncompressWorker:function(){return new _u("Inflate",{})}}},ku="PK",Eu="PK",Su="PK",Cu="PK",Tu="PK",Au=function(t,e){var n,i="";for(n=0;n<e;n++)i+=String.fromCharCode(255&t),t>>>=8;return i},Nu=function(t,e,n,i,r,o){var s,a,h=t.file,u=t.compression,c=o!==Js.utf8encode,l=Ks.transformTo("string",o(h.name)),f=Ks.transformTo("string",Js.utf8encode(h.name)),d=h.comment,p=Ks.transformTo("string",o(d)),m=Ks.transformTo("string",Js.utf8encode(d)),g=f.length!==h.name.length,v=m.length!==d.length,y="",w="",b="",_=h.dir,x=h.date,k={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(k.crc32=t.crc32,k.compressedSize=t.compressedSize,k.uncompressedSize=t.uncompressedSize);var E=0;e&&(E|=8),c||!g&&!v||(E|=2048);var S,C,T,A=0,N=0;_&&(A|=16),"UNIX"===r?(N=798,A|=(S=h.unixPermissions,C=_,T=S,S||(T=C?16893:33204),(65535&T)<<16)):(N=20,A|=63&(h.dosPermissions||0)),s=x.getUTCHours(),s<<=6,s|=x.getUTCMinutes(),s<<=5,s|=x.getUTCSeconds()/2,a=x.getUTCFullYear()-1980,a<<=4,a|=x.getUTCMonth()+1,a<<=5,a|=x.getUTCDate(),g&&(w=Au(1,1)+Au(pa(l),4)+f,y+="up"+Au(w.length,2)+w),v&&(b=Au(1,1)+Au(pa(p),4)+m,y+="uc"+Au(b.length,2)+b);var R="";return R+="\n\0",R+=Au(E,2),R+=u.magic,R+=Au(s,2),R+=Au(a,2),R+=Au(k.crc32,4),R+=Au(k.compressedSize,4),R+=Au(k.uncompressedSize,4),R+=Au(l.length,2),R+=Au(y.length,2),{fileRecord:ku+R+l+y,dirRecord:Eu+Au(N,2)+R+Au(p.length,2)+"\0\0\0\0"+Au(A,4)+Au(i,4)+l+y+p}},Ru=function(t){return"PK\b"+Au(t.crc32,4)+Au(t.compressedSize,4)+Au(t.uncompressedSize,4)};function Iu(t,e,n,i){Gs.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Ks.inherits(Iu,Gs),Iu.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,Gs.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},Iu.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=Nu(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Iu.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=Nu(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:Ru(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Iu.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var n=this.bytesWritten-t,i=function(t,e,n,i,r){var o=Ks.transformTo("string",r(i));return Su+"\0\0\0\0"+Au(t,2)+Au(t,2)+Au(e,4)+Au(n,4)+Au(o.length,2)+o}(this.dirRecords.length,n,t,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},Iu.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},Iu.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},Iu.prototype.resume=function(){return!!Gs.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},Iu.prototype.error=function(t){var e=this._sources;if(!Gs.prototype.error.call(this,t))return!1;for(var n=0;n<e.length;n++)try{e[n].error(t)}catch(t){}return!0},Iu.prototype.lock=function(){Gs.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()};var Ou=Iu;function zu(t,e){Gs.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}Ks.inherits(zu,Gs),zu.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},zu.prototype.pause=function(){return!!Gs.prototype.pause.call(this)&&(this._stream.pause(),!0)},zu.prototype.resume=function(){return!!Gs.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)};var Du=zu,Lu=function(t,e,n){var i,r=Ks.getTypeOf(e),o=Ks.extend(n||{},ha);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=Pu(t)),o.createFolders&&(i=Bu(t))&&ju.call(this,i,!0);var s="string"===r&&!1===o.binary&&!1===o.base64;n&&void 0!==n.binary||(o.binary=!s),(e instanceof ya&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",r="string");var a;a=e instanceof ya||e instanceof Gs?e:Es&&Ts(e)?new Du(t,e):Ks.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var h=new ka(t,a,o);this.files[t]=h},Bu=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},Pu=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},ju=function(t,e){return e=void 0!==e?e:ha.createFolders,t=Pu(t),this.files[t]||Lu.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function Uu(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var Fu={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,i;for(e in this.files)this.files.hasOwnProperty(e)&&(i=this.files[e],(n=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(n,i))},filter:function(t){var e=[];return this.forEach((function(n,i){t(n,i)&&e.push(i)})),e},file:function(t,e,n){if(1===arguments.length){if(Uu(t)){var i=t;return this.filter((function(t,e){return!e.dir&&i.test(t)}))}var r=this.files[this.root+t];return r&&!r.dir?r:null}return t=this.root+t,Lu.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(Uu(t))return this.filter((function(e,n){return n.dir&&t.test(e)}));var e=this.root+t,n=ju.call(this,e),i=this.clone();return i.root=n.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter((function(e,n){return n.name.slice(0,t.length)===t})),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,n={};try{if((n=Ks.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Js.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");Ks.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS"),e=function(t,e,n){var i=new Ou(e.streamFiles,n,e.platform,e.encodeFileName),r=0;try{t.forEach((function(t,n){r++;var o=function(t,e){var n=t||e,i=xu[n];if(!i)throw new Error(n+" is not a valid compression method !");return i}(n.options.compression,e.compression),s=n.options.compressionOptions||e.compressionOptions||{},a=n.dir,h=n.date;n._compressWorker(o,s).withStreamInfo("file",{name:t,dir:a,date:h,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(i)})),i.entriesCount=r}catch(t){i.error(t)}return i}(this,n,n.comment||this.comment||"")}catch(t){(e=new Gs("error")).error(t)}return new aa(e,n.type||"string",n.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}},Mu=Fu;function Wu(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}Wu.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return Ks.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}};var qu=Wu;function Hu(t){qu.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}Ks.inherits(Hu,qu),Hu.prototype.byteAt=function(t){return this.data[this.zero+t]},Hu.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===i&&this.data[o+3]===r)return o-this.zero;return-1},Hu.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&n===o[1]&&i===o[2]&&r===o[3]},Hu.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};var Zu=Hu;function Yu(t){qu.call(this,t)}Ks.inherits(Yu,qu),Yu.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},Yu.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},Yu.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},Yu.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};var Vu=Yu;function Xu(t){Zu.call(this,t)}Ks.inherits(Xu,Zu),Xu.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};var Ku=Xu;function $u(t){Ku.call(this,t)}Ks.inherits($u,Ku),$u.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e};var Gu=$u,Ju=function(t){var e=Ks.getTypeOf(t);return Ks.checkSupport(e),"string"!==e||xs.uint8array?"nodebuffer"===e?new Gu(t):xs.uint8array?new Ku(Ks.transformTo("uint8array",t)):new Zu(Ks.transformTo("array",t)):new Vu(t)};function Qu(t,e){this.options=t,this.loadOptions=e}Qu.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(e=function(t){for(var e in xu)if(xu.hasOwnProperty(e)&&xu[e].magic===t)return xu[e];return null}(this.compressionMethod),null===e)throw new Error("Corrupted zip : compression "+Ks.pretty(this.compressionMethod)+" unknown (inner file : "+Ks.transformTo("string",this.fileName)+")");this.decompressed=new ya(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=Ju(this.extraFields[1].value);this.uncompressedSize===Ks.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===Ks.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===Ks.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===Ks.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,n,i,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<r;)e=t.readInt(2),n=t.readInt(2),i=t.readData(n),this.extraFields[e]={id:e,length:n,value:i}},handleUTF8:function(){var t=xs.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Js.utf8decode(this.fileName),this.fileCommentStr=Js.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var n=Ks.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var r=Ks.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=Ju(t.value);return 1!==e.readInt(1)||pa(this.fileName)!==e.readInt(4)?null:Js.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=Ju(t.value);return 1!==e.readInt(1)||pa(this.fileComment)!==e.readInt(4)?null:Js.utf8decode(e.readData(t.length-5))}return null}};var tc=Qu;function ec(t){this.files=[],this.loadOptions=t}ec.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+Ks.pretty(e)+", expected "+Ks.pretty(t)+")")}},isSignature:function(t,e){var n=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(n),i},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 t=this.reader.readData(this.zipCommentLength),e=xs.uint8array?"uint8array":"array",n=Ks.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(n)},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 t,e,n,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},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 t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(ku),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Eu);)(t=new tc({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(Su);if(t<0)throw this.isSignature(0,ku)?new Error("Corrupted zip: can't find end of central directory"):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");this.reader.setIndex(t);var e=t;if(this.checkSignature(Su),this.readBlockEndOfCentral(),this.diskNumber===Ks.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Ks.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Ks.MAX_VALUE_16BITS||this.centralDirRecords===Ks.MAX_VALUE_16BITS||this.centralDirSize===Ks.MAX_VALUE_32BITS||this.centralDirOffset===Ks.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(Cu))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(Cu),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Tu)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Tu),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Tu),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=e-n;if(i>0)this.isSignature(e,Eu)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=Ju(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var nc=ec;function ic(t){return new Xs.Promise((function(e,n){var i=t.decompressed.getContentWorker().pipe(new ga);i.on("error",(function(t){n(t)})).on("end",(function(){i.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}function rc(){if(!(this instanceof rc))return new rc;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var t=new rc;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}rc.prototype=Mu,rc.prototype.loadAsync=function(t,e){var n=this;return e=Ks.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:Js.utf8decode}),Es&&Ts(t)?Xs.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Ks.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var n=new nc(e);return n.load(t),n})).then((function(t){var n=[Xs.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var r=0;r<i.length;r++)n.push(ic(i[r]));return Xs.Promise.all(n)})).then((function(t){for(var i=t.shift(),r=i.files,o=0;o<r.length;o++){var s=r[o];n.file(s.fileNameStr,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:e.createFolders})}return i.zipComment.length&&(n.comment=i.zipComment),n}))},rc.support=xs,rc.defaults=ha,rc.version="3.2.0",rc.loadAsync=function(t,e){return(new rc).loadAsync(t,e)},rc.external=Xs;var oc=rc,sc=function(){function t(){this.zip=new oc,this.urlCache={}}return t.prototype.checkRequirements=function(){console.log("check for jszip");try{if(void 0===oc){var t=n(1710);this.zip=new t}else this.zip=new oc}catch(t){throw new Error("JSZip lib not loaded")}},t.prototype.open=function(t,e){return this.zip.loadAsync(t,{base64:e})},t.prototype.openUrl=function(t,e){return Fi(t,"binary").then(function(t){return this.zip.loadAsync(t,{base64:e})}.bind(this))},t.prototype.request=function(t,e){var n,i=new at,r=new bt(t);return e||(e=r.extension),(n="blob"==e?this.getBlob(t):this.getText(t))?n.then(function(t){var n=this.handleResponse(t,e);i.resolve(n)}.bind(this)):i.reject({message:"File not found in the epub: "+t,stack:(new Error).stack}),i.promise},t.prototype.handleResponse=function(t,e){return"json"==e?JSON.parse(t):V(e)?Q(t,"text/xml"):"xhtml"==e?Q(t,"application/xhtml+xml"):"html"==e||"htm"==e?Q(t,"text/html"):t},t.prototype.getBlob=function(t,e){var n=window.decodeURIComponent(t.substr(1)),i=this.zip.file(n);if(i)return e=e||Zn(i.name),i.async("uint8array").then((function(t){return new Blob([t],{type:e})}))},t.prototype.getText=function(t,e){var n=window.decodeURIComponent(t.substr(1)),i=this.zip.file(n);if(i)return i.async("string").then((function(t){return t}))},t.prototype.getBase64=function(t,e){var n=window.decodeURIComponent(t.substr(1)),i=this.zip.file(n);if(i)return e=e||Zn(i.name),i.async("base64").then((function(t){return"data:"+e+";base64,"+t}))},t.prototype.createUrl=function(t,e){var n,i,r=new at,o=window.URL||window.webkitURL||window.mozURL,s=e&&e.base64;return t in this.urlCache?(r.resolve(this.urlCache[t]),r.promise):(s?(i=this.getBase64(t))&&i.then(function(e){this.urlCache[t]=e,r.resolve(e)}.bind(this)):(i=this.getBlob(t))&&i.then(function(e){n=o.createObjectURL(e),this.urlCache[t]=n,r.resolve(n)}.bind(this)),i||r.reject({message:"File not found in the epub: "+t,stack:(new Error).stack}),r.promise)},t.prototype.revokeUrl=function(t){var e=window.URL||window.webkitURL||window.mozURL,n=this.urlCache[t];n&&e.revokeObjectURL(n)},t.prototype.destroy=function(){var t=window.URL||window.webkitURL||window.mozURL;for(var e in this.urlCache)t.revokeObjectURL(e);this.zip=void 0,this.urlCache={}},t}(),ac=function(){function t(t,e,n){this.urlCache={},this.storage=void 0,this.name=t,this.requester=e||Fi,this.resolver=n,this.online=!0,this.checkRequirements(),this.addListeners()}return t.prototype.checkRequirements=function(){try{var t=void 0;t="undefined"==typeof localforage?n(3790):localforage,this.storage=t.createInstance({name:this.name})}catch(t){throw new Error("localForage lib not loaded")}},t.prototype.addListeners=function(){this._status=this.status.bind(this),window.addEventListener("online",this._status),window.addEventListener("offline",this._status)},t.prototype.removeListeners=function(){window.removeEventListener("online",this._status),window.removeEventListener("offline",this._status),this._status=void 0},t.prototype.status=function(t){var e=navigator.onLine;this.online=e,e?this.emit("online",this):this.emit("offline",this)},t.prototype.add=function(t,e){var n=this,i=t.resources.map((function(t){var i=t.href,r=n.resolver(i),o=window.encodeURIComponent(r);return n.storage.getItem(o).then((function(t){return!t||e?n.requester(r,"binary").then((function(t){return n.storage.setItem(o,t)})):t}))}));return Promise.all(i)},t.prototype.put=function(t,e,n){var i=this,r=window.encodeURIComponent(t);return this.storage.getItem(r).then((function(o){return o||i.requester(t,"binary",e,n).then((function(t){return i.storage.setItem(r,t)}))}))},t.prototype.request=function(t,e,n,i){var r=this;return this.online?this.requester(t,e,n,i).then((function(e){return r.put(t),e})):this.retrieve(t,e)},t.prototype.retrieve=function(t,e){var n=this,i=(new at,new bt(t));return e||(e=i.extension),("blob"==e?this.getBlob(t):this.getText(t)).then((function(i){var r,o=new at;return i?(r=n.handleResponse(i,e),o.resolve(r)):o.reject({message:"File not found in storage: "+t,stack:(new Error).stack}),o.promise}))},t.prototype.handleResponse=function(t,e){return"json"==e?JSON.parse(t):V(e)?Q(t,"text/xml"):"xhtml"==e?Q(t,"application/xhtml+xml"):"html"==e||"htm"==e?Q(t,"text/html"):t},t.prototype.getBlob=function(t,e){var n=window.encodeURIComponent(t);return this.storage.getItem(n).then((function(n){if(n)return e=e||Zn(t),new Blob([n],{type:e})}))},t.prototype.getText=function(t,e){var n=window.encodeURIComponent(t);return e=e||Zn(t),this.storage.getItem(n).then((function(t){var n,i=new at,r=new FileReader;if(t)return n=new Blob([t],{type:e}),r.addEventListener("loadend",(function(){i.resolve(r.result)})),r.readAsText(n,e),i.promise}))},t.prototype.getBase64=function(t,e){var n=window.encodeURIComponent(t);return e=e||Zn(t),this.storage.getItem(n).then((function(t){var n,i=new at,r=new FileReader;if(t)return n=new Blob([t],{type:e}),r.addEventListener("loadend",(function(){i.resolve(r.result)})),r.readAsDataURL(n,e),i.promise}))},t.prototype.createUrl=function(t,e){var n,i,r=new at,o=window.URL||window.webkitURL||window.mozURL,s=e&&e.base64;return t in this.urlCache?(r.resolve(this.urlCache[t]),r.promise):(s?(i=this.getBase64(t))&&i.then(function(e){this.urlCache[t]=e,r.resolve(e)}.bind(this)):(i=this.getBlob(t))&&i.then(function(e){n=o.createObjectURL(e),this.urlCache[t]=n,r.resolve(n)}.bind(this)),i||r.reject({message:"File not found in storage: "+t,stack:(new Error).stack}),r.promise)},t.prototype.revokeUrl=function(t){var e=window.URL||window.webkitURL||window.mozURL,n=this.urlCache[t];n&&e.revokeObjectURL(n)},t.prototype.destroy=function(){var t=window.URL||window.webkitURL||window.mozURL;for(var e in this.urlCache)t.revokeObjectURL(e);this.urlCache={},this.removeListeners()},t}();N(ac.prototype);var hc,uc=function(){function t(t){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",t&&this.parse(t)}return t.prototype.parse=function(t){var e=this;if(!t)return this;var n=tt(t,"display_options");return n?(et(n,"option").forEach((function(t){var n="";switch(t.childNodes.length&&(n=t.childNodes[0].nodeValue),t.attributes.name.value){case"interactive":e.interactive=n;break;case"fixed-layout":e.fixedLayout=n;break;case"open-to-spread":e.openToSpread=n;break;case"orientation-lock":e.orientationLock=n}})),this):this},t.prototype.destroy=function(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0},t}(),cc="META-INF/container.xml",lc="binary",fc="base64",dc="epub",pc="json",mc=function(){function t(t,e){var n=this;void 0===e&&"string"!=typeof t&&t instanceof Blob==0&&(e=t,t=void 0),this.settings=j(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}),j(this.settings,e),this.opening=new at,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new at,spine:new at,metadata:new at,cover:new at,navigation:new at,pageList:new at,resources:new at,displayOptions:new at},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||Fi,this.spine=new $e,this.locations=new Un(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),t&&this.open(t,this.settings.openAs).catch((function(e){var i=new Error("Cannot load book at "+t);n.emit(tn,i)}))}return t.prototype.open=function(t,e){var n,i=e||this.determineType(t);return i===lc?(this.archived=!0,this.url=new _t("/",""),n=this.openEpub(t)):i===fc?(this.archived=!0,this.url=new _t("/",""),n=this.openEpub(t,i)):i===dc?(this.archived=!0,this.url=new _t("/",""),n=this.request(t,"binary",this.settings.requestCredentials).then(this.openEpub.bind(this))):"opf"==i?(this.url=new _t(t),n=this.openPackaging(this.url.Path.toString())):i==pc?(this.url=new _t(t),n=this.openManifest(this.url.Path.toString())):(this.url=new _t(t),n=this.openContainer(cc).then(this.openPackaging.bind(this))),n},t.prototype.openEpub=function(t,e){var n=this;return this.unarchive(t,e||this.settings.encoding).then((function(){return n.openContainer(cc)})).then((function(t){return n.openPackaging(t)}))},t.prototype.openContainer=function(t){var e=this;return this.load(t).then((function(t){return e.container=new Fn(t),e.resolve(e.container.packagePath)}))},t.prototype.openPackaging=function(t){var e=this;return this.path=new bt(t),this.load(t).then((function(t){return e.packaging=new Mn(t),e.unpack(e.packaging)}))},t.prototype.openManifest=function(t){var e=this;return this.path=new bt(t),this.load(t).then((function(t){return e.packaging=new Mn,e.packaging.load(t),e.unpack(e.packaging)}))},t.prototype.load=function(t){var e=this.resolve(t);return this.archived?this.archive.request(e):this.request(e,null,this.settings.requestCredentials,this.settings.requestHeaders)},t.prototype.resolve=function(t,e){if(t){var n=t;return t.indexOf("://")>-1?t:(this.path&&(n=this.path.resolve(t)),0!=e&&this.url&&(n=this.url.resolve(n)),n)}},t.prototype.canonical=function(t){return t?this.settings.canonical?this.settings.canonical(t):this.resolve(t,!0):""},t.prototype.determineType=function(t){var e;return"base64"===this.settings.encoding?fc:"string"!=typeof t?lc:(e=new _t(t).path().extension)?"epub"===e?dc:"opf"===e?"opf":"json"===e?pc:void 0:"directory"},t.prototype.unpack=function(t){var e=this;this.package=t,""===this.packaging.metadata.layout?this.load(this.url.resolve("META-INF/com.apple.ibooks.display-options.xml")).then((function(t){e.displayOptions=new uc(t),e.loading.displayOptions.resolve(e.displayOptions)})).catch((function(t){e.displayOptions=new uc,e.loading.displayOptions.resolve(e.displayOptions)})):(this.displayOptions=new uc,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new Yn(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((function(){e.loading.navigation.resolve(e.navigation)})),this.packaging.coverPath&&(this.cover=this.resolve(this.packaging.coverPath)),this.loading.manifest.resolve(this.packaging.manifest),this.loading.metadata.resolve(this.packaging.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived||this.settings.replacements&&"none"!=this.settings.replacements?this.replacements().then((function(){e.loaded.displayOptions.then((function(){e.opening.resolve(e)}))})).catch((function(t){console.error(t)})):this.loaded.displayOptions.then((function(){e.opening.resolve(e)}))},t.prototype.loadNavigation=function(t){var e=this,n=t.navPath||t.ncxPath,i=t.toc;return i?new Promise((function(n,r){e.navigation=new Wn(i),t.pageList&&(e.pageList=new Vn(t.pageList)),n(e.navigation)})):n?this.load(n,"xml").then((function(t){return e.navigation=new Wn(t),e.pageList=new Vn(t),e.navigation})):new Promise((function(t,n){e.navigation=new Wn,e.pageList=new Vn,t(e.navigation)}))},t.prototype.section=function(t){return this.spine.get(t)},t.prototype.renderTo=function(t,e){return this.rendition=new Ui(this,e),this.rendition.attachTo(t),this.rendition},t.prototype.setRequestCredentials=function(t){this.settings.requestCredentials=t},t.prototype.setRequestHeaders=function(t){this.settings.requestHeaders=t},t.prototype.unarchive=function(t,e){return this.archive=new sc,this.archive.open(t,e)},t.prototype.store=function(t){var e=this,n=this.settings.replacements&&"none"!==this.settings.replacements,i=this.url,r=this.settings.requestMethod||Fi.bind(this);return this.storage=new ac(t,r,this.resolve.bind(this)),this.request=this.storage.request.bind(this.storage),this.opened.then((function(){e.archived&&(e.storage.requester=e.archive.request.bind(e.archive));var t=function(t,n){n.output=e.resources.substitute(t,n.url)};e.resources.settings.replacements=n||"blobUrl",e.resources.replacements().then((function(){return e.resources.replaceCss()})),e.storage.on("offline",(function(){e.url=new _t("/",""),e.spine.hooks.serialize.register(t)})),e.storage.on("online",(function(){e.url=i,e.spine.hooks.serialize.deregister(t)}))})),this.storage},t.prototype.coverUrl=function(){var t=this;return this.loaded.cover.then((function(e){return t.archived?t.resources.get(t.cover):t.cover}))},t.prototype.replacements=function(){var t=this;return this.spine.hooks.serialize.register((function(e,n){n.output=t.resources.substitute(e,n.url)})),this.resources.replacements().then((function(){return t.resources.replaceCss()}))},t.prototype.getRange=function(t){var e=new xt(t),n=this.spine.get(e.spinePos),i=this.load.bind(this);return n?n.load(i).then((function(t){return e.toRange(n.document)})):new Promise((function(t,e){e("CFI could not be found")}))},t.prototype.key=function(t){return"epubjs:0.3:"+(t||this.packaging.metadata.identifier||this.url.filename)},t.prototype.destroy=function(){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},t}();function gc(t,e){return new mc(t,e)}function vc(t,e,n,i,r,o){i||(i=200),r||(r=100),o||(o=0),(o+=1)>r?n&&n():t()?e():setTimeout((function(){vc(t,e,n,i,r,o)}),i)}N(mc.prototype),function(t){var e=function(){try{return!!Symbol.iterator}catch(t){return!1}}(),n=function(t){var n={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e&&(n[Symbol.iterator]=function(){return n}),n},i=function(t){return encodeURIComponent(t).replace(/%20/g,"+")},r=function(t){return decodeURIComponent(String(t).replace(/\+/g," "))};(function(){try{var e=t.URLSearchParams;return"a=1"===new e("?a=1").toString()&&"function"==typeof e.prototype.set}catch(t){return!1}})()||function(){var r=function(t){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var e=typeof t;if("undefined"===e);else if("string"===e)""!==t&&this._fromString(t);else if(t instanceof r){var n=this;t.forEach((function(t,e){n.append(e,t)}))}else{if(null===t||"object"!==e)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(t))for(var i=0;i<t.length;i++){var o=t[i];if("[object Array]"!==Object.prototype.toString.call(o)&&2===o.length)throw new TypeError("Expected [string, any] as entry at index "+i+" of URLSearchParams's input");this.append(o[0],o[1])}else for(var s in t)t.hasOwnProperty(s)&&this.append(s,t[s])}},o=r.prototype;o.append=function(t,e){t in this._entries?this._entries[t].push(String(e)):this._entries[t]=[String(e)]},o.delete=function(t){delete this._entries[t]},o.get=function(t){return t in this._entries?this._entries[t][0]:null},o.getAll=function(t){return t in this._entries?this._entries[t].slice(0):[]},o.has=function(t){return t in this._entries},o.set=function(t,e){this._entries[t]=[String(e)]},o.forEach=function(t,e){var n;for(var i in this._entries)if(this._entries.hasOwnProperty(i)){n=this._entries[i];for(var r=0;r<n.length;r++)t.call(e,n[r],i,this)}},o.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),n(t)},o.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),n(t)},o.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),n(t)},e&&(o[Symbol.iterator]=o.entries),o.toString=function(){var t=[];return this.forEach((function(e,n){t.push(i(n)+"="+i(e))})),t.join("&")},t.URLSearchParams=r}();var o=t.URLSearchParams.prototype;"function"!=typeof o.sort&&(o.sort=function(){var t=this,e=[];this.forEach((function(n,i){e.push([i,n]),t._entries||t.delete(i)})),e.sort((function(t,e){return t[0]<e[0]?-1:t[0]>e[0]?1:0})),t._entries&&(t._entries={});for(var n=0;n<e.length;n++)this.append(e[n][0],e[n][1])}),"function"!=typeof o._fromString&&Object.defineProperty(o,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(t){if(this._entries)this._entries={};else{var e=[];this.forEach((function(t,n){e.push(n)}));for(var n=0;n<e.length;n++)this.delete(e[n])}var i,o=(t=t.replace(/^\?/,"")).split("&");for(n=0;n<o.length;n++)i=o[n].split("="),this.append(r(i[0]),i.length>1?r(i[1]):"")}})}(void 0!==h?h:"undefined"!=typeof window?window:"undefined"!=typeof self?self:h),function(t){if(function(){try{var e=new t.URL("b","http://a");return e.pathname="c d","http://a/c%20d"===e.href&&e.searchParams}catch(t){return!1}}()||function(){var e=t.URL,n=function(e,n){"string"!=typeof e&&(e=String(e));var i,r=document;if(n&&(void 0===t.location||n!==t.location.href)){(i=(r=document.implementation.createHTMLDocument("")).createElement("base")).href=n,r.head.appendChild(i);try{if(0!==i.href.indexOf(n))throw new Error(i.href)}catch(t){throw new Error("URL unable to set base "+n+" due to "+t)}}var o=r.createElement("a");o.href=e,i&&(r.body.appendChild(o),o.href=o.href);var s=r.createElement("input");if(s.type="url",s.value=e,":"===o.protocol||!/:/.test(o.href)||!s.checkValidity()&&!n)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:o});var a=new t.URLSearchParams(this.search),h=!0,u=!0,c=this;["append","delete","set"].forEach((function(t){var e=a[t];a[t]=function(){e.apply(a,arguments),h&&(u=!1,c.search=a.toString(),u=!0)}})),Object.defineProperty(this,"searchParams",{value:a,enumerable:!0});var l=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==l&&(l=this.search,u&&(h=!1,this.searchParams._fromString(this.search),h=!0))}})},i=n.prototype;["hash","host","hostname","port","protocol"].forEach((function(t){!function(t){Object.defineProperty(i,t,{get:function(){return this._anchorElement[t]},set:function(e){this._anchorElement[t]=e},enumerable:!0})}(t)})),Object.defineProperty(i,"search",{get:function(){return this._anchorElement.search},set:function(t){this._anchorElement.search=t,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(i,{toString:{get:function(){var t=this;return function(){return t.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(t){this._anchorElement.href=t,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(t){this._anchorElement.pathname=t},enumerable:!0},origin:{get:function(){var t={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],e=this._anchorElement.port!=t&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(e?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(t){},enumerable:!0},username:{get:function(){return""},set:function(t){},enumerable:!0}}),n.createObjectURL=function(t){return e.createObjectURL.apply(e,arguments)},n.revokeObjectURL=function(t){return e.revokeObjectURL.apply(e,arguments)},t.URL=n}(),void 0!==t.location&&!("origin"in t.location)){var e=function(){return t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")};try{Object.defineProperty(t.location,"origin",{get:e,enumerable:!0})}catch(n){setInterval((function(){t.location.origin=e()}),100)}}}(void 0!==h?h:"undefined"!=typeof window?window:"undefined"!=typeof self?self:h),gc.VERSION=Je,void 0!==Mi&&(Mi.EPUBJS_VERSION=Je),gc.Book=mc,gc.Rendition=Ui,gc.Contents=ti,gc.CFI=xt,gc.utils=pt,function(t){t.LTR="ltr",t.RTL="rtl"}(hc||(hc={}));var yc=function(){function t(t){(0,r.r)(this,t),this._book=null,this._rendition=null,this._href=null,this._bookReady=!1,this._prevEnabled=!0,this._mobile=!1,this._nextEnabled=!0,this._showDivider=!1,this.width="100%",this.height="100%",this.mobileWidth=300,this.minSpreadWidth=800,this.bookReady=(0,r.c)(this,"bookReady",7),this.loadedBookMetadata=(0,r.c)(this,"loadedBookMetadata",7),this.loadedNavigation=(0,r.c)(this,"loadedNavigation",7),this.relocated=(0,r.c)(this,"relocated",7),this.renditionAttached=(0,r.c)(this,"renditionAttached",7)}return t.prototype.load=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){return this._book&&(this._book.destroy(),this._book=null,this._rendition=null,this._bookReady=!1,this._href=null),this._bookPath=t,[2]}))}))},t.prototype.resize=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){return this._bookReady&&this._rendition.resize(this._viewer.clientWidth,this._viewer.clientHeight),[2]}))}))},t.prototype.display=function(t){return s(this,void 0,void 0,(function(){var e=this;return a(this,(function(n){return this._href!==t&&vc((function(){return e._bookReady}),(function(){e._href=t;try{e._rendition.display(t)}catch(e){console.warn("unable to display",t)}})),[2]}))}))},t.prototype.getBook=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){if(!this._bookReady)throw"Book is not ready yet.";return[2,this._book]}))}))},t.prototype.handleKeyDown=function(t){switch(t.key){case"ArrowLeft":this._prev();break;case"ArrowRight":this._next()}},t.prototype._prev=function(){this._bookReady&&(this._book.package.metadata.direction===hc.RTL?this._rendition.next():this._rendition.prev())},t.prototype._next=function(){this._bookReady&&(this._book.package.metadata.direction===hc.RTL?this._rendition.prev():this._rendition.next())},t.prototype._prevButtonClickedHandler=function(t){this._prev(),t.preventDefault()},t.prototype._nextButtonClickedHandler=function(t){this._next(),t.preventDefault()},t.prototype.render=function(){var t=this;return(0,r.h)("div",{id:"main"},(0,r.h)("div",{id:"titlebar"}),(0,r.h)("div",{id:"divider",class:{show:this._bookReady&&this._showDivider}}),(0,r.h)("div",{id:"prev",class:{arrow:!0,disabled:!this._prevEnabled&&!this._bookReady,small:this._mobile},onClick:function(e){return t._prevButtonClickedHandler(e)}},"<"),(0,r.h)("div",{id:"viewer",class:{twoup:this._showDivider},ref:function(e){return t._viewer=e}}),this._nextEnabled?(0,r.h)("div",{id:"next",class:{arrow:!0,disabled:!this._nextEnabled&&!this._bookReady,small:this._mobile},onClick:function(e){return t._nextButtonClickedHandler(e)}},">"):null,!this._bookReady&&(0,r.h)("div",{id:"spinner"},(0,r.h)("div",{class:"square"})))},t.prototype.componentDidUpdate=function(){var t=this;this._bookPath&&!this._rendition&&(this._book=gc(this._bookPath),this._rendition=this._book.renderTo("viewer",{width:this.width,height:this.height,minSpreadWidth:this.minSpreadWidth}),this._rendition.display(),this._rendition.on("attached",(function(){t.renditionAttached.emit()})),this._rendition.on("layout",(function(){t._viewer.clientWidth>=t.minSpreadWidth?t._showDivider=!0:t._showDivider=!1,t._mobile=t._viewer.clientWidth<=t.mobileWidth})),this._rendition.on("relocated",(function(e){t._prevEnabled=!e.atStart,t._nextEnabled=!e.atEnd,t.relocated.emit(e)})),this._book.ready.then((function(){t._bookReady=!0,t.bookReady.emit(t._bookPath)})),this._book.loaded.metadata.then((function(e){t.loadedBookMetadata.emit(e)})),this._book.loaded.navigation.then((function(e){t.loadedNavigation.emit(e)})))},Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"el",{get:function(){return(0,r.g)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"#main{position:absolute;width:100%;height:100%;right:0;overflow:hidden}#titlebar{height:10%}#viewer{width:75%;height:80%;margin:0 auto;max-width:1250px;z-index:2;position:relative;overflow:hidden}#viewer iframe{border:none}#prev{left:20px}#next{right:20px}.arrow{position:absolute;top:50%;margin-top:-50px;font-size:64px;color:var(--reader-arrow-color);font-family:monospace,sans-serif;font-weight:700;cursor:pointer;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.arrow.small{font-size:50px}#prev.small{left:4px}#next.small{right:4px}.arrow:hover{color:var(--reader-arrow-hover-color)}.arrow.active,.arrow:active{color:#000}#divider{position:absolute;width:1px;border-right:1px solid #000;height:80%;z-index:1;left:50%;margin-left:-1px;top:10%;opacity:.15;-webkit-box-shadow:-2px 0 15px #000;box-shadow:-2px 0 15px #000;display:none}#divider.show{display:block}#spinner{position:absolute;z-index:10;left:50%;top:calc(50% - 15px)}#spinner .square{background-color:var(--reader-spinner-color,#fff);margin:0 0 0 -15px;width:30px;height:30px;-webkit-animation:sk-rotateplane 1.2s ease-in-out infinite;-moz-animation:sk-rotateplane 1.2s infinite ease-in-out;animation:sk-rotateplane 1.2s ease-in-out infinite}@-webkit-keyframes sk-rotateplane{0%{-webkit-transform:perspective(120px)}50%{-webkit-transform:perspective(120px) rotateY(180deg)}to{-webkit-transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0deg) rotateY(0deg);-webkit-transform:perspective(120px) rotateX(0deg) rotateY(0deg)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.highlight{background-color:#ff0}.md-show,.md-show~.overlay{visibility:visible}.md-show~.overlay{opacity:1}.md-content{color:#fff;background:#6b6b6b;position:relative;border-radius:3px;margin:0 auto;height:320px}.md-content h3{margin:0;padding:6px;text-align:center;font-size:22px;font-weight:300;opacity:.8;background:rgba(0,0,0,.1);border-radius:3px 3px 0 0}.md-content>div{padding:15px 40px 30px;margin:0;font-weight:300;font-size:14px}.md-content>div p{margin:0;padding:10px 0}.md-content>div ul{margin:0;padding:0 0 30px 20px}.md-content>div ul li{padding:5px 0}.md-content button{display:block;margin:0 auto;font-size:.8em}.md-effect-1 .md-content{-webkit-transform:scale(.7);-moz-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7);opacity:0;-webkit-transition:all .3s;-moz-transition:all .3s;-ms-transition:all .3s;transition:all .3s}.md-show.md-effect-1 .md-content{-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:1}.md-content>.closer{font-size:18px;position:absolute;right:0;top:0;font-size:24px;padding:4px}"},enumerable:!0,configurable:!0}),t}(),wc=function(){function t(t){(0,r.r)(this,t),this.toc=[],this.selected=null,this.disabled=!1,this.itemClicked=(0,r.c)(this,"itemClicked",7)}return t.prototype._itemClickedHandler=function(t){var e=t.currentTarget,n=e.getAttribute("href");this.selected=e.parentElement.id,this.itemClicked.emit(n),t.preventDefault()},t.prototype.render=function(){var t=this;return(0,r.h)("div",{id:"toc",class:{disabled:this.disabled}},(0,r.h)("ul",null,this.toc.map((function(e){return(0,r.h)("li",{id:e.id,class:{selected:t.selected===e.href||t.selected&&-1!==t.selected.indexOf((n=e.href,n.startsWith("../")&&(n=n.split("../")[1]),-1!==n.indexOf("#")&&(n=n.split("#")[0]),n))}},(0,r.h)("a",{href:e.href,onClick:function(e){return t._itemClickedHandler(e)}},e.label));var n}))))},Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"el",{get:function(){return(0,r.g)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"#toc ul{margin:var(--toc-margin);padding:var(--toc-padding);list-style-type:var(--toc-list-style-type)}#toc ul li{padding:var(--toc-link-padding)}#toc ul li a{color:var(--toc-link-color)}#toc ul li.selected a{color:var(--toc-link-selected-color)}"},enumerable:!0,configurable:!0}),t}()},1710:(t,e,n)=>{t.exports=function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[s]={exports:{}};e[s][0].call(u.exports,(function(t){return r(e[s][1][t]||t)}),u,u.exports,t,e,n,i)}return n[s].exports}for(var o=void 0,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){"use strict";var i=t("./utils"),r=t("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(t){for(var e,n,r,s,a,h,u,c=[],l=0,f=t.length,d=f,p="string"!==i.getTypeOf(t);l<t.length;)d=f-l,r=p?(e=t[l++],n=l<f?t[l++]:0,l<f?t[l++]:0):(e=t.charCodeAt(l++),n=l<f?t.charCodeAt(l++):0,l<f?t.charCodeAt(l++):0),s=e>>2,a=(3&e)<<4|n>>4,h=1<d?(15&n)<<2|r>>6:64,u=2<d?63&r:64,c.push(o.charAt(s)+o.charAt(a)+o.charAt(h)+o.charAt(u));return c.join("")},n.decode=function(t){var e,n,i,s,a,h,u=0,c=0,l="data:";if(t.substr(0,5)===l)throw new Error("Invalid base64 input, it looks like a data url.");var f,d=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&d--,t.charAt(t.length-2)===o.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=r.uint8array?new Uint8Array(0|d):new Array(0|d);u<t.length;)e=o.indexOf(t.charAt(u++))<<2|(s=o.indexOf(t.charAt(u++)))>>4,n=(15&s)<<4|(a=o.indexOf(t.charAt(u++)))>>2,i=(3&a)<<6|(h=o.indexOf(t.charAt(u++))),f[c++]=e,64!==a&&(f[c++]=n),64!==h&&(f[c++]=i);return f}},{"./support":30,"./utils":32}],2:[function(t,e,n){"use strict";var i=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),s=t("./stream/DataLengthProbe");function a(t,e,n,i,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=i,this.compressedContent=r}a.prototype={getContentWorker:function(){var t=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,n){return t.pipe(new o).pipe(new s("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,n){"use strict";var i=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,n){"use strict";var i=t("./utils"),r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,n){var i=r,o=0+n;t^=-1;for(var s=0;s<o;s++)t=t>>>8^i[255&(t^e[s])];return~t}(0|e,t,t.length):function(t,e,n){var i=r,o=0+n;t^=-1;for(var s=0;s<o;s++)t=t>>>8^i[255&(t^e.charCodeAt(s))];return~t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(t,e,n){"use strict";var i;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=t("pako"),o=t("./utils"),s=t("./stream/GenericWorker"),a=i?"uint8array":"array";function h(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}n.magic="\b\0",o.inherits(h,s),h.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},h.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},n.compressWorker=function(t){return new h("Deflate",t)},n.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,n){"use strict";function i(t,e){var n,i="";for(n=0;n<e;n++)i+=String.fromCharCode(255&t),t>>>=8;return i}function r(t,e,n,r,s,c){var l,f,d=t.file,p=t.compression,m=c!==a.utf8encode,g=o.transformTo("string",c(d.name)),v=o.transformTo("string",a.utf8encode(d.name)),y=d.comment,w=o.transformTo("string",c(y)),b=o.transformTo("string",a.utf8encode(y)),_=v.length!==d.name.length,x=b.length!==y.length,k="",E="",S="",C=d.dir,T=d.date,A={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(A.crc32=t.crc32,A.compressedSize=t.compressedSize,A.uncompressedSize=t.uncompressedSize);var N=0;e&&(N|=8),m||!_&&!x||(N|=2048);var R=0,I=0;C&&(R|=16),"UNIX"===s?(I=798,R|=function(t,e){var n=t;return t||(n=e?16893:33204),(65535&n)<<16}(d.unixPermissions,C)):(I=20,R|=function(t){return 63&(t||0)}(d.dosPermissions)),l=T.getUTCHours(),l<<=6,l|=T.getUTCMinutes(),l<<=5,l|=T.getUTCSeconds()/2,f=T.getUTCFullYear()-1980,f<<=4,f|=T.getUTCMonth()+1,f<<=5,f|=T.getUTCDate(),_&&(E=i(1,1)+i(h(g),4)+v,k+="up"+i(E.length,2)+E),x&&(S=i(1,1)+i(h(w),4)+b,k+="uc"+i(S.length,2)+S);var O="";return O+="\n\0",O+=i(N,2),O+=p.magic,O+=i(l,2),O+=i(f,2),O+=i(A.crc32,4),O+=i(A.compressedSize,4),O+=i(A.uncompressedSize,4),O+=i(g.length,2),O+=i(k.length,2),{fileRecord:u.LOCAL_FILE_HEADER+O+g+k,dirRecord:u.CENTRAL_FILE_HEADER+i(I,2)+O+i(w.length,2)+"\0\0\0\0"+i(R,4)+i(r,4)+g+k+w}}var o=t("../utils"),s=t("../stream/GenericWorker"),a=t("../utf8"),h=t("../crc32"),u=t("../signature");function c(t,e,n,i){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(c,s),c.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,s.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=r(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=r(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:function(t){return u.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var n=this.bytesWritten-t,r=function(t,e,n,r,s){var a=o.transformTo("string",s(r));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(t,2)+i(t,2)+i(e,4)+i(n,4)+i(a.length,2)+a}(this.dirRecords.length,n,t,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},c.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(t){var e=this._sources;if(!s.prototype.error.call(this,t))return!1;for(var n=0;n<e.length;n++)try{e[n].error(t)}catch(t){}return!0},c.prototype.lock=function(){s.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=c},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,n){"use strict";var i=t("../compressions"),r=t("./ZipFileWorker");n.generateWorker=function(t,e,n){var o=new r(e.streamFiles,n,e.platform,e.encodeFileName),s=0;try{t.forEach((function(t,n){s++;var r=function(t,e){var n=t||e,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,e.compression),a=n.options.compressionOptions||e.compressionOptions||{},h=n.dir,u=n.date;n._compressWorker(r,a).withStreamInfo("file",{name:t,dir:h,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)})),o.entriesCount=s}catch(t){o.error(t)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,n){"use strict";function i(){if(!(this instanceof i))return new i;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 t=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(i.prototype=t("./object")).loadAsync=t("./load"),i.support=t("./support"),i.defaults=t("./defaults"),i.version="3.10.1",i.loadAsync=function(t,e){return(new i).loadAsync(t,e)},i.external=t("./external"),e.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,n){"use strict";var i=t("./utils"),r=t("./external"),o=t("./utf8"),s=t("./zipEntries"),a=t("./stream/Crc32Probe"),h=t("./nodejsUtils");function u(t){return new r.Promise((function(e,n){var i=t.decompressed.getContentWorker().pipe(new a);i.on("error",(function(t){n(t)})).on("end",(function(){i.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var n=this;return e=i.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),h.isNode&&h.isStream(t)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var n=new s(e);return n.load(t),n})).then((function(t){var n=[r.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var o=0;o<i.length;o++)n.push(u(i[o]));return r.Promise.all(n)})).then((function(t){for(var r=t.shift(),o=r.files,s=0;s<o.length;s++){var a=o[s],h=a.fileNameStr,u=i.resolve(a.fileNameStr);n.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:e.createFolders}),a.dir||(n.file(u).unsafeOriginalName=h)}return r.zipComment.length&&(n.comment=r.zipComment),n}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,n){"use strict";var i=t("../utils"),r=t("../stream/GenericWorker");function o(t,e){r.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}i.inherits(o,r),o.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,n){"use strict";var i=t("readable-stream").Readable;function r(t,e,n){i.call(this,e),this._helper=t;var r=this;t.on("data",(function(t,e){r.push(t)||r._helper.pause(),n&&n(e)})).on("error",(function(t){r.emit("error",t)})).on("end",(function(){r.push(null)}))}t("../utils").inherits(r,i),r.prototype._read=function(){this._helper.resume()},e.exports=r},{"../utils":32,"readable-stream":16}],14:[function(t,e,n){"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,n){"use strict";function i(t,e,n){var i,r=o.getTypeOf(e),a=o.extend(n||{},h);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=m(t)),a.createFolders&&(i=p(t))&&g.call(this,i,!0);var l="string"===r&&!1===a.binary&&!1===a.base64;n&&void 0!==n.binary||(a.binary=!l),(e instanceof u&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",r="string");var v;v=e instanceof u||e instanceof s?e:f.isNode&&f.isStream(e)?new d(t,e):o.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var y=new c(t,v,a);this.files[t]=y}var r=t("./utf8"),o=t("./utils"),s=t("./stream/GenericWorker"),a=t("./stream/StreamHelper"),h=t("./defaults"),u=t("./compressedObject"),c=t("./zipObject"),l=t("./generate"),f=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},g=function(t,e){return e=void 0!==e?e:h.createFolders,t=m(t),this.files[t]||i.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function v(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,i;for(e in this.files)i=this.files[e],(n=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(n,i)},filter:function(t){var e=[];return this.forEach((function(n,i){t(n,i)&&e.push(i)})),e},file:function(t,e,n){if(1!==arguments.length)return t=this.root+t,i.call(this,t,e,n),this;if(v(t)){var r=t;return this.filter((function(t,e){return!e.dir&&r.test(t)}))}var o=this.files[this.root+t];return o&&!o.dir?o:null},folder:function(t){if(!t)return this;if(v(t))return this.filter((function(e,n){return n.dir&&t.test(e)}));var e=this.root+t,n=g.call(this,e),i=this.clone();return i.root=n.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter((function(e,n){return n.name.slice(0,t.length)===t})),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,n={};try{if((n=o.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var i=n.comment||this.comment||"";e=l.generateWorker(this,n,i)}catch(t){(e=new s("error")).error(t)}return new a(e,n.type||"string",n.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=y},{"./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,e,n){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,n){"use strict";var i=t("./DataReader");function r(t){i.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(r,i),r.prototype.byteAt=function(t){return this.data[this.zero+t]},r.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===i&&this.data[o+3]===r)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&n===o[1]&&i===o[2]&&r===o[3]},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./DataReader":18}],18:[function(t,e,n){"use strict";var i=t("../utils");function r(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=r},{"../utils":32}],19:[function(t,e,n){"use strict";var i=t("./Uint8ArrayReader");function r(t){i.call(this,t)}t("../utils").inherits(r,i),r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,n){"use strict";var i=t("./DataReader");function r(t){i.call(this,t)}t("../utils").inherits(r,i),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,e,n){"use strict";var i=t("./ArrayReader");function r(t){i.call(this,t)}t("../utils").inherits(r,i),r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,n){"use strict";var i=t("../utils"),r=t("../support"),o=t("./ArrayReader"),s=t("./StringReader"),a=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new h(i.transformTo("uint8array",t)):new o(i.transformTo("array",t)):new s(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,n){"use strict";var i=t("./GenericWorker"),r=t("../utils");function o(t){i.call(this,"ConvertWorker to "+t),this.destType=t}r.inherits(o,i),o.prototype.processChunk=function(t){this.push({data:r.transformTo(this.destType,t.data),meta:t.meta})},e.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,n){"use strict";var i=t("./GenericWorker"),r=t("../crc32");function o(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,i),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,n){"use strict";var i=t("../utils"),r=t("./GenericWorker");function o(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(o,r),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},e.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,n){"use strict";var i=t("../utils"),r=t("./GenericWorker");function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,n){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n<this._listeners[t].length;n++)this._listeners[t][n].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},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 t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=i},{}],29:[function(t,e,n){"use strict";var i=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),s=t("../base64"),a=t("../support"),h=t("../external"),u=null;if(a.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function c(t,e,n){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=n,i.checkSupport(s),this._worker=t.pipe(new r(s)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}c.prototype={accumulate:function(t){return function(t,e){return new h.Promise((function(n,r){var o=[],a=t._internalType,h=t._outputType,u=t._mimeType;t.on("data",(function(t,n){o.push(t),e&&e(n)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var t=function(t,e,n){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),n);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(h,function(t,e){var n,i=0,r=null,o=0;for(n=0;n<e.length;n++)o+=e[n].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(r=new Uint8Array(o),n=0;n<e.length;n++)r.set(e[n],i),i+=e[n].length;return r;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,o),u);n(t)}catch(t){r(t)}o=[]})).resume()}))}(this,t)},on:function(t,e){var n=this;return"data"===t?this._worker.on(t,(function(t){e.call(n,t.data,t.meta)})):this._worker.on(t,(function(){i.delay(e,arguments,n)})),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(i),n.blob=0===r.getBlob("application/zip").size}catch(t){n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch(t){n.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,n){"use strict";for(var i=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),s=t("./stream/GenericWorker"),a=new Array(256),h=0;h<256;h++)a[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function u(){s.call(this,"utf-8 decode"),this.leftOver=null}function c(){s.call(this,"utf-8 encode")}a[254]=a[254]=1,n.utf8encode=function(t){return r.nodebuffer?o.newBufferFrom(t,"utf-8"):function(t){var e,n,i,o,s,a=t.length,h=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),h+=n<128?1:n<2048?2:n<65536?3:4;for(e=r.uint8array?new Uint8Array(h):new Array(h),o=s=0;s<h;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[s++]=n:(n<2048?e[s++]=192|n>>>6:(n<65536?e[s++]=224|n>>>12:(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63),e[s++]=128|n>>>6&63),e[s++]=128|63&n);return e}(t)},n.utf8decode=function(t){return r.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,n,r,o,s=t.length,h=new Array(2*s);for(e=n=0;e<s;)if((r=t[e++])<128)h[n++]=r;else if(4<(o=a[r]))h[n++]=65533,e+=o-1;else{for(r&=2===o?31:3===o?15:7;1<o&&e<s;)r=r<<6|63&t[e++],o--;1<o?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return h.length!==n&&(h.subarray?h=h.subarray(0,n):h.length=n),i.applyFromCharCode(h)}(t=i.transformTo(r.uint8array?"uint8array":"array",t))},i.inherits(u,s),u.prototype.processChunk=function(t){var e=i.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=e;(e=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),e.set(o,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var s=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return n<0||0===n?e:n+a[t[n]]>e?n:e}(e),h=e;s!==e.length&&(r.uint8array?(h=e.subarray(0,s),this.leftOver=e.subarray(s,e.length)):(h=e.slice(0,s),this.leftOver=e.slice(s,e.length))),this.push({data:n.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,i.inherits(c,s),c.prototype.processChunk=function(t){this.push({data:n.utf8encode(t.data),meta:t.meta})},n.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,n){"use strict";var i=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),s=t("./external");function a(t){return t}function h(t,e){for(var n=0;n<t.length;++n)e[n]=255&t.charCodeAt(n);return e}t("setimmediate"),n.newBlob=function(t,e){n.checkSupport("blob");try{return new Blob([t],{type:e})}catch(n){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(t),i.getBlob(e)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,e,n){var i=[],r=0,o=t.length;if(o<=n)return String.fromCharCode.apply(null,t);for(;r<o;)"array"===e||"nodebuffer"===e?i.push(String.fromCharCode.apply(null,t.slice(r,Math.min(r+n,o)))):i.push(String.fromCharCode.apply(null,t.subarray(r,Math.min(r+n,o)))),r+=n;return i.join("")},stringifyByChar:function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(t){return!1}}()}};function c(t){var e=65536,i=n.getTypeOf(t),r=!0;if("uint8array"===i?r=u.applyCanBeUsed.uint8array:"nodebuffer"===i&&(r=u.applyCanBeUsed.nodebuffer),r)for(;1<e;)try{return u.stringifyByChunk(t,i,e)}catch(t){e=Math.floor(e/2)}return u.stringifyByChar(t)}function l(t,e){for(var n=0;n<t.length;n++)e[n]=t[n];return e}n.applyFromCharCode=c;var f={};f.string={string:a,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:function(t){return h(t,o.allocBuffer(t.length))}},f.array={string:c,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return o.newBufferFrom(t)}},f.arraybuffer={string:function(t){return c(new Uint8Array(t))},array:function(t){return l(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return o.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:c,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a,nodebuffer:function(t){return o.newBufferFrom(t)}},f.nodebuffer={string:c,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:a},n.transformTo=function(t,e){if(e=e||"",!t)return e;n.checkSupport(t);var i=n.getTypeOf(e);return f[i][t](e)},n.resolve=function(t){for(var e=t.split("/"),n=[],i=0;i<e.length;i++){var r=e[i];"."===r||""===r&&0!==i&&i!==e.length-1||(".."===r?n.pop():n.push(r))}return n.join("/")},n.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":i.nodebuffer&&o.isBuffer(t)?"nodebuffer":i.uint8array&&t instanceof Uint8Array?"uint8array":i.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(t){if(!i[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(t){var e,n,i="";for(n=0;n<(t||"").length;n++)i+="\\x"+((e=t.charCodeAt(n))<16?"0":"")+e.toString(16).toUpperCase();return i},n.delay=function(t,e,n){setImmediate((function(){t.apply(n||null,e||[])}))},n.inherits=function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n},n.extend=function(){var t,e,n={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===n[e]&&(n[e]=arguments[t][e]);return n},n.prepareContent=function(t,e,o,a,u){return s.Promise.resolve(e).then((function(t){return i.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new s.Promise((function(e,n){var i=new FileReader;i.onload=function(t){e(t.target.result)},i.onerror=function(t){n(t.target.error)},i.readAsArrayBuffer(t)})):t})).then((function(e){var c=n.getTypeOf(e);return c?("arraybuffer"===c?e=n.transformTo("uint8array",e):"string"===c&&(u?e=r.decode(e):o&&!0!==a&&(e=function(t){return h(t,i.uint8array?new Uint8Array(t.length):new Array(t.length))}(e))),e):s.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,n){"use strict";var i=t("./reader/readerFor"),r=t("./utils"),o=t("./signature"),s=t("./zipEntry"),a=t("./support");function h(t){this.files=[],this.loadOptions=t}h.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(e)+", expected "+r.pretty(t)+")")}},isSignature:function(t,e){var n=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(n),i},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 t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",n=r.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(n)},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 t,e,n,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):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");this.reader.setIndex(t);var e=t;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),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 n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=e-n;if(0<i)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,n){"use strict";var i=t("./reader/readerFor"),r=t("./utils"),o=t("./compressedObject"),s=t("./crc32"),a=t("./utf8"),h=t("./compressions"),u=t("./support");function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in h)if(Object.prototype.hasOwnProperty.call(h,e)&&h[e].magic===t)return h[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,n,i,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<r;)e=t.readInt(2),n=t.readInt(2),i=t.readData(n),this.extraFields[e]={id:e,length:n,value:i};t.setIndex(r)},handleUTF8:function(){var t=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var n=r.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var o=r.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=i(t.value);return 1!==e.readInt(1)||s(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=i(t.value);return 1!==e.readInt(1)||s(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},e.exports=c},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,n){"use strict";function i(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var r=t("./stream/StreamHelper"),o=t("./stream/DataWorker"),s=t("./utf8"),a=t("./compressedObject"),h=t("./stream/GenericWorker");i.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");var i="string"===(n=t.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),e=this._decompressWorker();var o=!this._dataBinary;o&&!i&&(e=e.pipe(new s.Utf8EncodeWorker)),!o&&i&&(e=e.pipe(new s.Utf8DecodeWorker))}catch(t){(e=new h("error")).error(t)}return new r(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new s.Utf8EncodeWorker)),a.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof h?this._data:new o(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},l=0;l<u.length;l++)i.prototype[u[l]]=c;e.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,i){(function(t){"use strict";var n,i,r=t.MutationObserver||t.WebKitMutationObserver;if(r){var o=0,s=new r(c),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var h=new t.MessageChannel;h.port1.onmessage=c,n=function(){h.port2.postMessage(0)}}var u=[];function c(){var t,e;i=!0;for(var n=u.length;n;){for(e=u,u=[],t=-1;++t<n;)e[t]();n=u.length}i=!1}e.exports=function(t){1!==u.push(t)||i||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,n){"use strict";var i=t("immediate");function r(){}var o={},s=["REJECTED"],a=["FULFILLED"],h=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==r&&d(this,t)}function c(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(t,e,n){i((function(){var i;try{i=e(n)}catch(i){return o.reject(t,i)}i===t?o.reject(t,new TypeError("Cannot resolve promise with itself")):o.resolve(t,i)}))}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var n=!1;function i(e){n||(n=!0,o.reject(t,e))}function r(e){n||(n=!0,o.resolve(t,e))}var s=p((function(){e(r,i)}));"error"===s.status&&i(s.value)}function p(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}(e.exports=u).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){throw n}))}))},u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(r);return this.state!==h?l(n,this.state===a?t:e,this.outcome):this.queue.push(new c(n,t,e)),n},c.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){l(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){o.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){l(this.promise,this.onRejected,t)},o.resolve=function(t,e){var n=p(f,e);if("error"===n.status)return o.reject(t,n.value);var i=n.value;if(i)d(t,i);else{t.state=a,t.outcome=e;for(var r=-1,s=t.queue.length;++r<s;)t.queue[r].callFulfilled(e)}return t},o.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,i=t.queue.length;++n<i;)t.queue[n].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:o.resolve(new this(r),t)},u.reject=function(t){var e=new this(r);return o.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,h=-1,u=new this(r);++h<n;)c(t[h],h);return u;function c(t,r){e.resolve(t).then((function(t){s[r]=t,++a!==n||i||(i=!0,o.resolve(u,s))}),(function(t){i||(i=!0,o.reject(u,t))}))}},u.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,n=!1;if(!e)return this.resolve([]);for(var i,s=-1,a=new this(r);++s<e;)i=t[s],this.resolve(i).then((function(t){n||(n=!0,o.resolve(a,t))}),(function(t){n||(n=!0,o.reject(a,t))}));return a}},{immediate:36}],38:[function(t,e,n){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,n){"use strict";var i=t("./zlib/deflate"),r=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/messages"),a=t("./zlib/zstream"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(s[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=i.deflateSetDictionary(this.strm,c)))throw new Error(s[n]);this._dict_set=!0}}function c(t,e){var n=new u(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}u.prototype.push=function(t,e){var n,s,a=this.strm,u=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===h.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(u),a.next_out=0,a.avail_out=u),1!==(n=i.deflate(a,s))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==s||(this.onEnd(0),!(a.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=u,n.deflate=c,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,n){"use strict";var i=t("./zlib/inflate"),r=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/constants"),a=t("./zlib/messages"),h=t("./zlib/zstream"),u=t("./zlib/gzheader"),c=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&!(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function f(t,e){var n=new l(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}l.prototype.push=function(t,e){var n,a,h,u,l,f,d=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?d.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new r.Buf8(p),d.next_out=0,d.avail_out=p),(n=i.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(f="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,n=i.inflateSetDictionary(this.strm,f)),n===s.Z_BUF_ERROR&&!0===g&&(n=s.Z_OK,g=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&n!==s.Z_STREAM_END&&(0!==d.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(h=o.utf8border(d.output,d.next_out),u=d.next_out-h,l=o.buf2string(d.output,h),d.next_out=u,d.avail_out=p-u,u&&r.arraySet(d.output,d.output,h,u,0),this.onData(l)):this.onData(r.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(g=!0)}while((0<d.avail_in||0===d.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(d.avail_out=0))},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=l,n.inflate=f,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){var e,n,i,r,o,s;for(e=i=0,n=t.length;e<n;e++)i+=t[e].length;for(s=new Uint8Array(i),e=r=0,n=t.length;e<n;e++)o=t[e],s.set(o,r),r+=o.length;return s}},o={arraySet:function(t,e,n,i,r){for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(i)},{}],42:[function(t,e,n){"use strict";var i=t("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new i.Buf8(256),a=0;a<256;a++)s[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function h(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,n.string2buf=function(t){var e,n,r,o,s,a=t.length,h=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),h+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(h),o=s=0;s<h;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?e[s++]=n:(n<2048?e[s++]=192|n>>>6:(n<65536?e[s++]=224|n>>>12:(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63),e[s++]=128|n>>>6&63),e[s++]=128|63&n);return e},n.buf2binstring=function(t){return h(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,r,o,a=e||t.length,u=new Array(2*a);for(n=i=0;n<a;)if((r=t[n++])<128)u[i++]=r;else if(4<(o=s[r]))u[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;1<o&&n<a;)r=r<<6|63&t[n++],o--;1<o?u[i++]=65533:r<65536?u[i++]=r:(r-=65536,u[i++]=55296|r>>10&1023,u[i++]=56320|1023&r)}return h(u,i)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;0<=n&&128==(192&t[n]);)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},{"./common":41}],43:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){for(var r=65535&t,o=t>>>16&65535,s=0;0!==n;){for(n-=s=2e3<n?2e3:n;o=o+(r=r+e[i++]|0)|0,--s;);r%=65521,o%=65521}return r|o<<16}},{}],44:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,n){"use strict";var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return~t}},{}],46:[function(t,e,n){"use strict";var i,r=t("../utils/common"),o=t("./trees"),s=t("./adler32"),a=t("./crc32"),h=t("./messages"),u=-2,c=258,l=262,f=113;function d(t,e){return t.msg=h[e],e}function p(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function g(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function v(t,e){o._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,g(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function w(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function b(t,e){var n,i,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-l?t.strstart-(t.w_size-l):0,u=t.window,f=t.w_mask,d=t.prev,p=t.strstart+c,m=u[o+s-1],g=u[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(n=e)+s]===g&&u[n+s-1]===m&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<p);if(i=c-(p-o),o=p-c,s<i){if(t.match_start=e,a<=(s=i))break;m=u[o+s-1],g=u[o+s]}}}while((e=d[e&f])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead}function _(t){var e,n,i,o,h,u,c,f,d,p,m=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-l)){for(r.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=n=t.hash_size;i=t.head[--e],t.head[e]=m<=i?i-m:0,--n;);for(e=n=m;i=t.prev[--e],t.prev[e]=m<=i?i-m:0,--n;);o+=m}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,f=t.strstart+t.lookahead,p=void 0,(d=o)<(p=u.avail_in)&&(p=d),n=0===p?0:(u.avail_in-=p,r.arraySet(c,u.input,u.next_in,p,f),1===u.state.wrap?u.adler=s(u.adler,c,p,f):2===u.state.wrap&&(u.adler=a(u.adler,c,p,f)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=n,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<l&&0!==t.strm.avail_in)}function x(t,e){for(var n,i;;){if(t.lookahead<l){if(_(t),t.lookahead<l&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-l&&(t.match_length=b(t,n)),t.match_length>=3)if(i=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}function k(t,e){for(var n,i,r;;){if(t.lookahead<l){if(_(t),t.lookahead<l&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-l&&(t.match_length=b(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(r=t.strstart+t.lookahead-3,i=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(v(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=o._tr_tally(t,0,t.window[t.strstart-1]))&&v(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}function E(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function S(){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=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),m(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 C(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:f,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):d(t,u)}function T(t){var e=C(t);return 0===e&&function(t){t.window_size=2*t.w_size,m(t.head),t.max_lazy_match=i[t.level].max_lazy,t.good_match=i[t.level].good_length,t.nice_match=i[t.level].nice_length,t.max_chain_length=i[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function A(t,e,n,i,o,s){if(!t)return u;var a=1;if(-1===e&&(e=6),i<0?(a=0,i=-i):15<i&&(a=2,i-=16),o<1||9<o||8!==n||i<8||15<i||e<0||9<e||s<0||4<s)return d(t,u);8===i&&(i=9);var h=new S;return(t.state=h).strm=t,h.wrap=a,h.gzhead=null,h.w_bits=i,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=o+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new r.Buf8(2*h.w_size),h.head=new r.Buf16(h.hash_size),h.prev=new r.Buf16(h.w_size),h.lit_bufsize=1<<o+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new r.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=s,h.method=n,T(t)}i=[new E(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,v(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-l&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(v(t,!1),t.strm.avail_out),1)})),new E(4,4,8,4,x),new E(4,5,16,8,x),new E(4,6,32,32,x),new E(4,4,16,16,k),new E(8,16,32,32,k),new E(8,16,128,128,k),new E(8,32,128,256,k),new E(32,128,258,1024,k),new E(32,258,258,4096,k)],n.deflateInit=function(t,e){return A(t,e,8,15,8,0)},n.deflateInit2=A,n.deflateReset=T,n.deflateResetKeep=C,n.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},n.deflate=function(t,e){var n,r,s,h;if(!t||!t.state||5<e||e<0)return t?d(t,u):u;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==e)return d(t,0===t.avail_out?-5:u);if(r.strm=t,n=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,y(r,31),y(r,139),y(r,8),r.gzhead?(y(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),y(r,255&r.gzhead.time),y(r,r.gzhead.time>>8&255),y(r,r.gzhead.time>>16&255),y(r,r.gzhead.time>>24&255),y(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),y(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(y(r,255&r.gzhead.extra.length),y(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(y(r,0),y(r,0),y(r,0),y(r,0),y(r,0),y(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),y(r,3),r.status=f);else{var l=8+(r.w_bits-8<<4)<<8;l|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(l|=32),l+=31-l%31,r.status=f,w(r,l),0!==r.strstart&&(w(r,t.adler>>>16),w(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),g(t),s=r.pending,r.pending!==r.pending_buf_size));)y(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),g(t),s=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,y(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===h&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),g(t),s=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,y(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===h&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&g(t),r.pending+2<=r.pending_buf_size&&(y(r,255&t.adler),y(r,t.adler>>8&255),t.adler=0,r.status=f)):r.status=f),0!==r.pending){if(g(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(n)&&4!==e)return d(t,-5);if(666===r.status&&0!==t.avail_in)return d(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var b=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var n,i,r,s,a=t.window;;){if(t.lookahead<=c){if(_(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(i=a[r=t.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){s=t.strstart+c;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);t.match_length=c-(s-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(v(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(v(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(v(t,!1),0===t.strm.avail_out)?1:2}(r,e):i[r.level].func(r,e);if(3!==b&&4!==b||(r.status=666),1===b||3===b)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===b&&(1===e?o._tr_align(r):5!==e&&(o._tr_stored_block(r,0,0,!1),3===e&&(m(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),g(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(y(r,255&t.adler),y(r,t.adler>>8&255),y(r,t.adler>>16&255),y(r,t.adler>>24&255),y(r,255&t.total_in),y(r,t.total_in>>8&255),y(r,t.total_in>>16&255),y(r,t.total_in>>24&255)):(w(r,t.adler>>>16),w(r,65535&t.adler)),g(t),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?0:1)},n.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==f&&666!==e?d(t,u):(t.state=null,e===f?d(t,-3):0):u},n.deflateSetDictionary=function(t,e){var n,i,o,a,h,c,l,f,d=e.length;if(!t||!t.state)return u;if(2===(a=(n=t.state).wrap)||1===a&&42!==n.status||n.lookahead)return u;for(1===a&&(t.adler=s(t.adler,e,d,0)),n.wrap=0,d>=n.w_size&&(0===a&&(m(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new r.Buf8(n.w_size),r.arraySet(f,e,d-n.w_size,n.w_size,0),e=f,d=n.w_size),h=t.avail_in,c=t.next_in,l=t.input,t.avail_in=d,t.next_in=0,t.input=e,_(n);n.lookahead>=3;){for(i=n.strstart,o=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+3-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--o;);n.strstart=i,n.lookahead=2,_(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=c,t.input=l,t.avail_in=h,n.wrap=a,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,n){"use strict";e.exports=function(){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}},{}],48:[function(t,e,n){"use strict";e.exports=function(t,e){var n,i,r,o,s,a,h,u,c,l,f,d,p,m,g,v,y,w,b,_,x,k,E,S,C;n=t.state,i=t.next_in,S=t.input,r=i+(t.avail_in-5),o=t.next_out,C=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),h=n.dmax,u=n.wsize,c=n.whave,l=n.wnext,f=n.window,d=n.hold,p=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;t:do{p<15&&(d+=S[i++]<<p,p+=8,d+=S[i++]<<p,p+=8),w=m[d&v];e:for(;;){if(d>>>=b=w>>>24,p-=b,0==(b=w>>>16&255))C[o++]=65535&w;else{if(!(16&b)){if(!(64&b)){w=m[(65535&w)+(d&(1<<b)-1)];continue e}if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}_=65535&w,(b&=15)&&(p<b&&(d+=S[i++]<<p,p+=8),_+=d&(1<<b)-1,d>>>=b,p-=b),p<15&&(d+=S[i++]<<p,p+=8,d+=S[i++]<<p,p+=8),w=g[d&y];n:for(;;){if(d>>>=b=w>>>24,p-=b,!(16&(b=w>>>16&255))){if(!(64&b)){w=g[(65535&w)+(d&(1<<b)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(x=65535&w,p<(b&=15)&&(d+=S[i++]<<p,(p+=8)<b&&(d+=S[i++]<<p,p+=8)),h<(x+=d&(1<<b)-1)){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=b,p-=b,(b=o-s)<x){if(c<(b=x-b)&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(E=f,(k=0)===l){if(k+=u-b,b<_){for(_-=b;C[o++]=f[k++],--b;);k=o-x,E=C}}else if(l<b){if(k+=u+l-b,(b-=l)<_){for(_-=b;C[o++]=f[k++],--b;);if(k=0,l<_){for(_-=b=l;C[o++]=f[k++],--b;);k=o-x,E=C}}}else if(k+=l-b,b<_){for(_-=b;C[o++]=f[k++],--b;);k=o-x,E=C}for(;2<_;)C[o++]=E[k++],C[o++]=E[k++],C[o++]=E[k++],_-=3;_&&(C[o++]=E[k++],1<_&&(C[o++]=E[k++]))}else{for(k=o-x;C[o++]=C[k++],C[o++]=C[k++],C[o++]=C[k++],2<(_-=3););_&&(C[o++]=C[k++],1<_&&(C[o++]=C[k++]))}break}}break}}while(i<r&&o<a);i-=_=p>>3,d&=(1<<(p-=_<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=d,n.bits=p}},{}],49:[function(t,e,n){"use strict";var i=t("../utils/common"),r=t("./adler32"),o=t("./crc32"),s=t("./inffast"),a=t("./inftrees"),h=-2;function u(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):h}function f(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):h}function d(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?h:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,f(t))):h}function p(t,e){var n,i;return t?(i=new c,(t.state=i).window=null,0!==(n=d(t,e))&&(t.state=null),n):h}var m,g,v=!0;function y(t){if(v){var e;for(m=new i.Buf32(512),g=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,g,0,t.work,{bits:5}),v=!1}t.lencode=m,t.lenbits=9,t.distcode=g,t.distbits=5}function w(t,e,n,r){var o,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new i.Buf8(s.wsize)),r>=s.wsize?(i.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(r<(o=s.wsize-s.wnext)&&(o=r),i.arraySet(s.window,e,n-r,o,s.wnext),(r-=o)?(i.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}n.inflateReset=f,n.inflateReset2=d,n.inflateResetKeep=l,n.inflateInit=function(t){return p(t,15)},n.inflateInit2=p,n.inflate=function(t,e){var n,c,l,f,d,p,m,g,v,b,_,x,k,E,S,C,T,A,N,R,I,O,z,D,L=0,B=new i.Buf8(4),P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;12===(n=t.state).mode&&(n.mode=13),d=t.next_out,l=t.output,m=t.avail_out,f=t.next_in,c=t.input,p=t.avail_in,g=n.hold,v=n.bits,b=p,_=m,O=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;v<16;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(2&n.wrap&&35615===g){B[n.check=0]=255&g,B[1]=g>>>8&255,n.check=o(n.check,B,2,0),v=g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){t.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){t.msg="unknown compression method",n.mode=30;break}if(v-=4,I=8+(15&(g>>>=4)),0===n.wbits)n.wbits=I;else if(I>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<I,t.adler=n.check=1,n.mode=512&g?10:12,v=g=0;break;case 2:for(;v<16;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(n.flags=g,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=g>>8&1),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,n.check=o(n.check,B,2,0)),v=g=0,n.mode=3;case 3:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}n.head&&(n.head.time=g),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,B[2]=g>>>16&255,B[3]=g>>>24&255,n.check=o(n.check,B,4,0)),v=g=0,n.mode=4;case 4:for(;v<16;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}n.head&&(n.head.xflags=255&g,n.head.os=g>>8),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,n.check=o(n.check,B,2,0)),v=g=0,n.mode=5;case 5:if(1024&n.flags){for(;v<16;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}n.length=g,n.head&&(n.head.extra_len=g),512&n.flags&&(B[0]=255&g,B[1]=g>>>8&255,n.check=o(n.check,B,2,0)),v=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(x=n.length)&&(x=p),x&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,c,f,x,I)),512&n.flags&&(n.check=o(n.check,c,x,f)),p-=x,f+=x,n.length-=x),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break t;for(x=0;I=c[f+x++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I)),I&&x<p;);if(512&n.flags&&(n.check=o(n.check,c,x,f)),p-=x,f+=x,I)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===p)break t;for(x=0;I=c[f+x++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I)),I&&x<p;);if(512&n.flags&&(n.check=o(n.check,c,x,f)),p-=x,f+=x,I)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;v<16;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(g!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}v=g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;v<32;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}t.adler=n.check=u(g),v=g=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,n.hold=g,n.bits=v,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break t;case 13:if(n.last){g>>>=7&v,v-=7&v,n.mode=27;break}for(;v<3;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}switch(n.last=1&g,v-=1,3&(g>>>=1)){case 0:n.mode=14;break;case 1:if(y(n),n.mode=20,6!==e)break;g>>>=2,v-=2;break t;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if((65535&g)!=(g>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,v=g=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(x=n.length){if(p<x&&(x=p),m<x&&(x=m),0===x)break t;i.arraySet(l,c,f,x,d),p-=x,f+=x,m-=x,d+=x,n.length-=x;break}n.mode=12;break;case 17:for(;v<14;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(n.nlen=257+(31&g),g>>>=5,v-=5,n.ndist=1+(31&g),g>>>=5,v-=5,n.ncode=4+(15&g),g>>>=4,v-=4,286<n.nlen||30<n.ndist){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;v<3;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}n.lens[P[n.have++]]=7&g,g>>>=3,v-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},O=a(0,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,O){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;C=(L=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,T=65535&L,!((S=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(T<16)g>>>=S,v-=S,n.lens[n.have++]=T;else{if(16===T){for(D=S+2;v<D;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(g>>>=S,v-=S,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}I=n.lens[n.have-1],x=3+(3&g),g>>>=2,v-=2}else if(17===T){for(D=S+3;v<D;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}v-=S,I=0,x=3+(7&(g>>>=S)),g>>>=3,v-=3}else{for(D=S+7;v<D;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}v-=S,I=0,x=11+(127&(g>>>=S)),g>>>=7,v-=7}if(n.have+x>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;x--;)n.lens[n.have++]=I}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,z={bits:n.lenbits},O=a(1,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,O){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},O=a(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,O){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(6<=p&&258<=m){t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,n.hold=g,n.bits=v,s(t,_),d=t.next_out,l=t.output,m=t.avail_out,f=t.next_in,c=t.input,p=t.avail_in,g=n.hold,v=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;C=(L=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,T=65535&L,!((S=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(C&&!(240&C)){for(A=S,N=C,R=T;C=(L=n.lencode[R+((g&(1<<A+N)-1)>>A)])>>>16&255,T=65535&L,!(A+(S=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}g>>>=A,v-=A,n.back+=A}if(g>>>=S,v-=S,n.back+=S,n.length=T,0===C){n.mode=26;break}if(32&C){n.back=-1,n.mode=12;break}if(64&C){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&C,n.mode=22;case 22:if(n.extra){for(D=n.extra;v<D;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}n.length+=g&(1<<n.extra)-1,g>>>=n.extra,v-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;C=(L=n.distcode[g&(1<<n.distbits)-1])>>>16&255,T=65535&L,!((S=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(!(240&C)){for(A=S,N=C,R=T;C=(L=n.distcode[R+((g&(1<<A+N)-1)>>A)])>>>16&255,T=65535&L,!(A+(S=L>>>24)<=v);){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}g>>>=A,v-=A,n.back+=A}if(g>>>=S,v-=S,n.back+=S,64&C){t.msg="invalid distance code",n.mode=30;break}n.offset=T,n.extra=15&C,n.mode=24;case 24:if(n.extra){for(D=n.extra;v<D;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}n.offset+=g&(1<<n.extra)-1,g>>>=n.extra,v-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===m)break t;if(x=_-m,n.offset>x){if((x=n.offset-x)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}k=x>n.wnext?(x-=n.wnext,n.wsize-x):n.wnext-x,x>n.length&&(x=n.length),E=n.window}else E=l,k=d-n.offset,x=n.length;for(m<x&&(x=m),m-=x,n.length-=x;l[d++]=E[k++],--x;);0===n.length&&(n.mode=21);break;case 26:if(0===m)break t;l[d++]=n.length,m--,n.mode=21;break;case 27:if(n.wrap){for(;v<32;){if(0===p)break t;p--,g|=c[f++]<<v,v+=8}if(_-=m,t.total_out+=_,n.total+=_,_&&(t.adler=n.check=n.flags?o(n.check,l,_,d-_):r(n.check,l,_,d-_)),_=m,(n.flags?g:u(g))!==n.check){t.msg="incorrect data check",n.mode=30;break}v=g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;v<32;){if(0===p)break t;p--,g+=c[f++]<<v,v+=8}if(g!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}v=g=0}n.mode=29;case 29:O=1;break t;case 30:O=-3;break t;case 31:return-4;default:return h}return t.next_out=d,t.avail_out=m,t.next_in=f,t.avail_in=p,n.hold=g,n.bits=v,(n.wsize||_!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&w(t,t.output,t.next_out,_-t.avail_out)?(n.mode=31,-4):(b-=t.avail_in,_-=t.avail_out,t.total_in+=b,t.total_out+=_,n.total+=_,n.wrap&&_&&(t.adler=n.check=n.flags?o(n.check,l,_,t.next_out-_):r(n.check,l,_,t.next_out-_)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==b&&0===_||4===e)&&0===O&&(O=-5),O)},n.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,0},n.inflateGetHeader=function(t,e){var n;return t&&t.state&&2&(n=t.state).wrap?((n.head=e).done=!1,0):h},n.inflateSetDictionary=function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?h:11===n.mode&&r(1,e,i,0)!==n.check?-3:w(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,0):h},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,n){"use strict";var i=t("../utils/common"),r=[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],o=[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],s=[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],a=[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];e.exports=function(t,e,n,h,u,c,l,f){var d,p,m,g,v,y,w,b,_,x=f.bits,k=0,E=0,S=0,C=0,T=0,A=0,N=0,R=0,I=0,O=0,z=null,D=0,L=new i.Buf16(16),B=new i.Buf16(16),P=null,j=0;for(k=0;k<=15;k++)L[k]=0;for(E=0;E<h;E++)L[e[n+E]]++;for(T=x,C=15;1<=C&&0===L[C];C--);if(C<T&&(T=C),0===C)return u[c++]=20971520,u[c++]=20971520,f.bits=1,0;for(S=1;S<C&&0===L[S];S++);for(T<S&&(T=S),k=R=1;k<=15;k++)if(R<<=1,(R-=L[k])<0)return-1;if(0<R&&(0===t||1!==C))return-1;for(B[1]=0,k=1;k<15;k++)B[k+1]=B[k]+L[k];for(E=0;E<h;E++)0!==e[n+E]&&(l[B[e[n+E]]++]=E);if(y=0===t?(z=P=l,19):1===t?(z=r,D-=257,P=o,j-=257,256):(z=s,P=a,-1),k=S,v=c,N=E=O=0,m=-1,g=(I=1<<(A=T))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(w=k-N,_=l[E]<y?(b=0,l[E]):l[E]>y?(b=P[j+l[E]],z[D+l[E]]):(b=96,0),d=1<<k-N,S=p=1<<A;u[v+(O>>N)+(p-=d)]=w<<24|b<<16|_,0!==p;);for(d=1<<k-1;O&d;)d>>=1;if(0!==d?(O&=d-1,O+=d):O=0,E++,0==--L[k]){if(k===C)break;k=e[n+l[E]]}if(T<k&&(O&g)!==m){for(0===N&&(N=T),v+=S,R=1<<(A=k-N);A+N<C&&!((R-=L[A+N])<=0);)A++,R<<=1;if(I+=1<<A,1===t&&852<I||2===t&&592<I)return 1;u[m=O&g]=T<<24|A<<16|v-c}}return 0!==O&&(u[v+O]=k-N<<24|64<<16),f.bits=T,0}},{"../utils/common":41}],51:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,n){"use strict";var i=t("../utils/common");function r(t){for(var e=t.length;0<=--e;)t[e]=0}var o=256,s=286,a=30,h=15,u=[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],c=[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],l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);r(d);var p=new Array(60);r(p);var m=new Array(512);r(m);var g=new Array(256);r(g);var v=new Array(29);r(v);var y,w,b,_=new Array(a);function x(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function E(t){return t<256?m[t]:m[256+(t>>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,S(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function T(t,e,n){C(t,n[2*e],n[2*e+1])}function A(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}function N(t,e,n){var i,r,o=new Array(16),s=0;for(i=1;i<=h;i++)o[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=A(o[a]++,a))}}function R(t){var e;for(e=0;e<s;e++)t.dyn_ltree[2*e]=0;for(e=0;e<a;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function I(t){8<t.bi_valid?S(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function O(t,e,n,i){var r=2*e,o=2*n;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]}function z(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&O(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!O(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function D(t,e,n){var i,r,s,a,h=0;if(0!==t.last_lit)for(;i=t.pending_buf[t.d_buf+2*h]<<8|t.pending_buf[t.d_buf+2*h+1],r=t.pending_buf[t.l_buf+h],h++,0===i?T(t,r,e):(T(t,(s=g[r])+o+1,e),0!==(a=u[s])&&C(t,r-=v[s],a),T(t,s=E(--i),n),0!==(a=c[s])&&C(t,i-=_[s],a)),h<t.last_lit;);T(t,256,e)}function L(t,e){var n,i,r,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=s[2*r+1]);for(e.max_code=c,n=t.heap_len>>1;1<=n;n--)z(t,o,n);for(r=u;n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],z(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,z(t,o,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,s,a,u=e.dyn_tree,c=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(o=0;o<=h;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)m<(o=u[2*u[2*(i=t.heap[n])+1]+1]+1)&&(o=m,g++),u[2*i+1]=o,c<i||(t.bl_count[o]++,s=0,p<=i&&(s=d[i-p]),a=u[2*i],t.opt_len+=a*(o+s),f&&(t.static_len+=a*(l[2*i+1]+s)));if(0!==g){do{for(o=m-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[m]--,g-=2}while(0<g);for(o=m;0!==o;o--)for(i=t.bl_count[o];0!==i;)c<(r=t.heap[--n])||(u[2*r+1]!==o&&(t.opt_len+=(o-u[2*r+1])*u[2*r],u[2*r+1]=o),i--)}}(t,e),N(o,c,t.bl_count)}function B(t,e,n){var i,r,o=-1,s=e[1],a=0,h=7,u=4;for(0===s&&(h=138,u=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++a<h&&r===s||(a<u?t.bl_tree[2*r]+=a:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=r,u=(a=0)===s?(h=138,3):r===s?(h=6,3):(h=7,4))}function P(t,e,n){var i,r,o=-1,s=e[1],a=0,h=7,u=4;for(0===s&&(h=138,u=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++a<h&&r===s)){if(a<u)for(;T(t,r,t.bl_tree),0!=--a;);else 0!==r?(r!==o&&(T(t,r,t.bl_tree),a--),T(t,16,t.bl_tree),C(t,a-3,2)):a<=10?(T(t,17,t.bl_tree),C(t,a-3,3)):(T(t,18,t.bl_tree),C(t,a-11,7));o=r,u=(a=0)===s?(h=138,3):r===s?(h=6,3):(h=7,4)}}r(_);var j=!1;function U(t,e,n,r){C(t,0+(r?1:0),3),function(t,e,n){I(t),S(t,n),S(t,~n),i.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n)}n._tr_init=function(t){j||(function(){var t,e,n,i,r,o=new Array(16);for(i=n=0;i<28;i++)for(v[i]=n,t=0;t<1<<u[i];t++)g[n++]=i;for(g[n-1]=i,i=r=0;i<16;i++)for(_[i]=r,t=0;t<1<<c[i];t++)m[r++]=i;for(r>>=7;i<a;i++)for(_[i]=r<<7,t=0;t<1<<c[i]-7;t++)m[256+r++]=i;for(e=0;e<=h;e++)o[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,o[8]++;for(;t<=255;)d[2*t+1]=9,t++,o[9]++;for(;t<=279;)d[2*t+1]=7,t++,o[7]++;for(;t<=287;)d[2*t+1]=8,t++,o[8]++;for(N(d,287,o),t=0;t<a;t++)p[2*t+1]=5,p[2*t]=A(t,5);y=new x(d,u,257,s,h),w=new x(p,c,0,a,h),b=new x(new Array(0),l,0,19,7)}(),j=!0),t.l_desc=new k(t.dyn_ltree,y),t.d_desc=new k(t.dyn_dtree,w),t.bl_desc=new k(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,R(t)},n._tr_stored_block=U,n._tr_flush_block=function(t,e,n,i){var r,s,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<o;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),L(t,t.l_desc),L(t,t.d_desc),a=function(t){var e;for(B(t,t.dyn_ltree,t.l_desc.max_code),B(t,t.dyn_dtree,t.d_desc.max_code),L(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==e?U(t,e,n,i):4===t.strategy||s===r?(C(t,2+(i?1:0),3),D(t,d,p)):(C(t,4+(i?1:0),3),function(t,e,n,i){var r;for(C(t,e-257,5),C(t,n-1,5),C(t,i-4,4),r=0;r<i;r++)C(t,t.bl_tree[2*f[r]+1],3);P(t,t.dyn_ltree,e-1),P(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),D(t,t.dyn_ltree,t.dyn_dtree)),R(t),i&&I(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(g[n]+o+1)]++,t.dyn_dtree[2*E(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){C(t,2,3),T(t,256,d),function(t){16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,n){"use strict";e.exports=function(){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}},{}],54:[function(t,e,i){(function(t){!function(t){"use strict";if(!t.setImmediate){var e,n,i,r,o=1,s={},a=!1,h=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,e="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){l(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?(r="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",f,!1):t.attachEvent("onmessage",f),function(e){t.postMessage(r+e,"*")}):t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){l(t.data)},function(t){i.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(n=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){l(t),e.onreadystatechange=null,n.removeChild(e),e=null},n.appendChild(e)}):function(t){setTimeout(l,0,t)},u.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var n=new Array(arguments.length-1),i=0;i<n.length;i++)n[i]=arguments[i+1];var r={callback:t,args:n};return s[o]=r,e(o),o++},u.clearImmediate=c}function c(t){delete s[t]}function l(t){if(a)setTimeout(l,0,t);else{var e=s[t];if(e){a=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(undefined,n)}}(e)}finally{c(t),a=!1}}}}function f(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(r)&&l(+e.data.slice(r.length))}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},3790:(t,e,n)=>{t.exports=function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[s]={exports:{}};e[s][0].call(u.exports,(function(t){return r(e[s][1][t]||t)}),u,u.exports,t,e,n,i)}return n[s].exports}for(var o=void 0,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,i){(function(t){"use strict";var n,i,r=t.MutationObserver||t.WebKitMutationObserver;if(r){var o=0,s=new r(c),a=t.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var h=new t.MessageChannel;h.port1.onmessage=c,n=function(){h.port2.postMessage(0)}}var u=[];function c(){var t,e;i=!0;for(var n=u.length;n;){for(e=u,u=[],t=-1;++t<n;)e[t]();n=u.length}i=!1}e.exports=function(t){1!==u.push(t)||i||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){"use strict";var i=t(1);function r(){}var o={},s=["REJECTED"],a=["FULFILLED"],h=["PENDING"];function u(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==r&&d(this,t)}function c(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(t,e,n){i((function(){var i;try{i=e(n)}catch(e){return o.reject(t,e)}i===t?o.reject(t,new TypeError("Cannot resolve promise with itself")):o.resolve(t,i)}))}function f(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function d(t,e){var n=!1;function i(e){n||(n=!0,o.reject(t,e))}function r(e){n||(n=!0,o.resolve(t,e))}var s=p((function(){e(r,i)}));"error"===s.status&&i(s.value)}function p(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}e.exports=u,u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(r);return this.state!==h?l(n,this.state===a?t:e,this.outcome):this.queue.push(new c(n,t,e)),n},c.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){l(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){o.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){l(this.promise,this.onRejected,t)},o.resolve=function(t,e){var n=p(f,e);if("error"===n.status)return o.reject(t,n.value);var i=n.value;if(i)d(t,i);else{t.state=a,t.outcome=e;for(var r=-1,s=t.queue.length;++r<s;)t.queue[r].callFulfilled(e)}return t},o.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,i=t.queue.length;++n<i;)t.queue[n].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:o.resolve(new this(r),t)},u.reject=function(t){var e=new this(r);return o.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);for(var s=new Array(n),a=0,h=-1,u=new this(r);++h<n;)c(t[h],h);return u;function c(t,r){e.resolve(t).then((function(t){s[r]=t,++a!==n||i||(i=!0,o.resolve(u,s))}),(function(t){i||(i=!0,o.reject(u,t))}))}},u.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n,i=t.length,s=!1;if(!i)return this.resolve([]);for(var a=-1,h=new this(r);++a<i;)n=t[a],e.resolve(n).then((function(t){s||(s=!0,o.resolve(h,t))}),(function(t){s||(s=!0,o.reject(h,t))}));return h}},{1:1}],3:[function(t,e,i){(function(e){"use strict";"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var r=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(t){return}}();function o(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(r){if("TypeError"!==r.name)throw r;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),i=0;i<t.length;i+=1)n.append(t[i]);return n.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var s=Promise;function a(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function h(t,e,n){"function"==typeof e&&t.then(e),"function"==typeof n&&t.catch(n)}function u(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function c(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",f=void 0,d={},p=Object.prototype.toString,m="readonly",g="readwrite";function v(t){for(var e=t.length,n=new ArrayBuffer(e),i=new Uint8Array(n),r=0;r<e;r++)i[r]=t.charCodeAt(r);return n}function y(t){return"boolean"==typeof f?s.resolve(f):function(t){return new s((function(e){var n=t.transaction(l,g),i=o([""]);n.objectStore(l).put(i,"key"),n.onabort=function(t){t.preventDefault(),t.stopPropagation(),e(!1)},n.oncomplete=function(){var t=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);e(n||!t||parseInt(t[1],10)>=43)}})).catch((function(){return!1}))}(t).then((function(t){return f=t}))}function w(t){var e=d[t.name],n={};n.promise=new s((function(t,e){n.resolve=t,n.reject=e})),e.deferredOperations.push(n),e.dbReady?e.dbReady=e.dbReady.then((function(){return n.promise})):e.dbReady=n.promise}function b(t){var e=d[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function _(t,e){var n=d[t.name].deferredOperations.pop();if(n)return n.reject(e),n.promise}function x(t,e){return new s((function(n,i){if(d[t.name]=d[t.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},t.db){if(!e)return n(t.db);w(t),t.db.close()}var o=[t.name];e&&o.push(t.version);var s=r.open.apply(r,o);e&&(s.onupgradeneeded=function(e){var n=s.result;try{n.createObjectStore(t.storeName),e.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),s.onerror=function(t){t.preventDefault(),i(s.error)},s.onsuccess=function(){var e=s.result;e.onversionchange=function(t){t.target.close()},n(e),b(t)}}))}function k(t){return x(t,!1)}function E(t){return x(t,!0)}function S(t,e){if(!t.db)return!0;var n=!t.db.objectStoreNames.contains(t.storeName),i=t.version<t.db.version,r=t.version>t.db.version;if(i&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),r||n){if(n){var o=t.db.version+1;o>t.version&&(t.version=o)}return!0}return!1}function C(t){return o([v(atob(t.data))],{type:t.type})}function T(t){return t&&t.__local_forage_encoded_blob}function A(t){var e=this,n=e._initReady().then((function(){var t=d[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return h(n,t,t),n}function N(t,e,n,i){void 0===i&&(i=1);try{var r=t.db.transaction(t.storeName,e);n(null,r)}catch(r){if(i>0&&(!t.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return s.resolve().then((function(){if(!t.db||"NotFoundError"===r.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),E(t)})).then((function(){return function(t){w(t);for(var e=d[t.name],n=e.forages,i=0;i<n.length;i++){var r=n[i];r._dbInfo.db&&(r._dbInfo.db.close(),r._dbInfo.db=null)}return t.db=null,k(t).then((function(e){return t.db=e,S(t)?E(t):e})).then((function(i){t.db=e.db=i;for(var r=0;r<n.length;r++)n[r]._dbInfo.db=i})).catch((function(e){throw _(t,e),e}))}(t).then((function(){N(t,e,n,i-1)}))})).catch(n);n(r)}}var R={_driver:"asyncStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var i in t)n[i]=t[i];var r=d[n.name];r||(r={forages:[],db:null,dbReady:null,deferredOperations:[]},d[n.name]=r),r.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=A);var o=[];function a(){return s.resolve()}for(var h=0;h<r.forages.length;h++){var u=r.forages[h];u!==e&&o.push(u._initReady().catch(a))}var c=r.forages.slice(0);return s.all(o).then((function(){return n.db=r.db,k(n)})).then((function(t){return n.db=t,S(n,e._defaultConfig.version)?E(n):t})).then((function(t){n.db=r.db=t,e._dbInfo=n;for(var i=0;i<c.length;i++){var o=c[i];o!==e&&(o._dbInfo.db=n.db,o._dbInfo.version=n.version)}}))},_support:function(){try{if(!r||!r.open)return!1;var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),e="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!t||e)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(t){return!1}}(),iterate:function(t,e){var n=this,i=new s((function(e,i){n.ready().then((function(){N(n._dbInfo,m,(function(r,o){if(r)return i(r);try{var s=o.objectStore(n._dbInfo.storeName).openCursor(),a=1;s.onsuccess=function(){var n=s.result;if(n){var i=n.value;T(i)&&(i=C(i));var r=t(i,n.key,a++);void 0!==r?e(r):n.continue()}else e()},s.onerror=function(){i(s.error)}}catch(t){i(t)}}))})).catch(i)}));return a(i,e),i},getItem:function(t,e){var n=this;t=u(t);var i=new s((function(e,i){n.ready().then((function(){N(n._dbInfo,m,(function(r,o){if(r)return i(r);try{var s=o.objectStore(n._dbInfo.storeName).get(t);s.onsuccess=function(){var t=s.result;void 0===t&&(t=null),T(t)&&(t=C(t)),e(t)},s.onerror=function(){i(s.error)}}catch(t){i(t)}}))})).catch(i)}));return a(i,e),i},setItem:function(t,e,n){var i=this;t=u(t);var r=new s((function(n,r){var o;i.ready().then((function(){return o=i._dbInfo,"[object Blob]"===p.call(e)?y(o.db).then((function(t){return t?e:(n=e,new s((function(t,e){var i=new FileReader;i.onerror=e,i.onloadend=function(e){var i=btoa(e.target.result||"");t({__local_forage_encoded_blob:!0,data:i,type:n.type})},i.readAsBinaryString(n)})));var n})):e})).then((function(e){N(i._dbInfo,g,(function(o,s){if(o)return r(o);try{var a=s.objectStore(i._dbInfo.storeName);null===e&&(e=void 0);var h=a.put(e,t);s.oncomplete=function(){void 0===e&&(e=null),n(e)},s.onabort=s.onerror=function(){var t=h.error?h.error:h.transaction.error;r(t)}}catch(t){r(t)}}))})).catch(r)}));return a(r,n),r},removeItem:function(t,e){var n=this;t=u(t);var i=new s((function(e,i){n.ready().then((function(){N(n._dbInfo,g,(function(r,o){if(r)return i(r);try{var s=o.objectStore(n._dbInfo.storeName).delete(t);o.oncomplete=function(){e()},o.onerror=function(){i(s.error)},o.onabort=function(){var t=s.error?s.error:s.transaction.error;i(t)}}catch(t){i(t)}}))})).catch(i)}));return a(i,e),i},clear:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){N(e._dbInfo,g,(function(i,r){if(i)return n(i);try{var o=r.objectStore(e._dbInfo.storeName).clear();r.oncomplete=function(){t()},r.onabort=r.onerror=function(){var t=o.error?o.error:o.transaction.error;n(t)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},length:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){N(e._dbInfo,m,(function(i,r){if(i)return n(i);try{var o=r.objectStore(e._dbInfo.storeName).count();o.onsuccess=function(){t(o.result)},o.onerror=function(){n(o.error)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},key:function(t,e){var n=this,i=new s((function(e,i){t<0?e(null):n.ready().then((function(){N(n._dbInfo,m,(function(r,o){if(r)return i(r);try{var s=o.objectStore(n._dbInfo.storeName),a=!1,h=s.openKeyCursor();h.onsuccess=function(){var n=h.result;n?0===t||a?e(n.key):(a=!0,n.advance(t)):e(null)},h.onerror=function(){i(h.error)}}catch(t){i(t)}}))})).catch(i)}));return a(i,e),i},keys:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){N(e._dbInfo,m,(function(i,r){if(i)return n(i);try{var o=r.objectStore(e._dbInfo.storeName).openKeyCursor(),s=[];o.onsuccess=function(){var e=o.result;e?(s.push(e.key),e.continue()):t(s)},o.onerror=function(){n(o.error)}}catch(t){n(t)}}))})).catch(n)}));return a(n,t),n},dropInstance:function(t,e){e=c.apply(this,arguments);var n,i=this.config();if((t="function"!=typeof t&&t||{}).name||(t.name=t.name||i.name,t.storeName=t.storeName||i.storeName),t.name){var o=t.name===i.name&&this._dbInfo.db?s.resolve(this._dbInfo.db):k(t).then((function(e){var n=d[t.name],i=n.forages;n.db=e;for(var r=0;r<i.length;r++)i[r]._dbInfo.db=e;return e}));n=t.storeName?o.then((function(e){if(e.objectStoreNames.contains(t.storeName)){var n=e.version+1;w(t);var i=d[t.name],o=i.forages;e.close();for(var a=0;a<o.length;a++){var h=o[a];h._dbInfo.db=null,h._dbInfo.version=n}var u=new s((function(e,i){var o=r.open(t.name,n);o.onerror=function(t){o.result.close(),i(t)},o.onupgradeneeded=function(){o.result.deleteObjectStore(t.storeName)},o.onsuccess=function(){var t=o.result;t.close(),e(t)}}));return u.then((function(t){i.db=t;for(var e=0;e<o.length;e++){var n=o[e];n._dbInfo.db=t,b(n._dbInfo)}})).catch((function(e){throw(_(t,e)||s.resolve()).catch((function(){})),e}))}})):o.then((function(e){w(t);var n=d[t.name],i=n.forages;e.close();for(var o=0;o<i.length;o++)i[o]._dbInfo.db=null;var a=new s((function(e,n){var i=r.deleteDatabase(t.name);i.onerror=function(){var t=i.result;t&&t.close(),n(i.error)},i.onblocked=function(){console.warn('dropInstance blocked for database "'+t.name+'" until all open connections are closed')},i.onsuccess=function(){var t=i.result;t&&t.close(),e(t)}}));return a.then((function(t){n.db=t;for(var e=0;e<i.length;e++)b(i[e]._dbInfo)})).catch((function(e){throw(_(t,e)||s.resolve()).catch((function(){})),e}))}))}else n=s.reject("Invalid arguments");return a(n,e),n}};var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=/^~~local_forage_type~([^~]+)~/,z="__lfsc__:",D="arbf",L="blob",B="si08",P="ui08",j="uic8",U="si16",F="si32",M="ur16",W="ui32",q="fl32",H="fl64",Z=Object.prototype.toString;function Y(t){var e,n,i,r,o,s=.75*t.length,a=t.length,h=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);var u=new ArrayBuffer(s),c=new Uint8Array(u);for(e=0;e<a;e+=4)n=I.indexOf(t[e]),i=I.indexOf(t[e+1]),r=I.indexOf(t[e+2]),o=I.indexOf(t[e+3]),c[h++]=n<<2|i>>4,c[h++]=(15&i)<<4|r>>2,c[h++]=(3&r)<<6|63&o;return u}function V(t){var e,n=new Uint8Array(t),i="";for(e=0;e<n.length;e+=3)i+=I[n[e]>>2],i+=I[(3&n[e])<<4|n[e+1]>>4],i+=I[(15&n[e+1])<<2|n[e+2]>>6],i+=I[63&n[e+2]];return n.length%3==2?i=i.substring(0,i.length-1)+"=":n.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}var X={serialize:function(t,e){var n="";if(t&&(n=Z.call(t)),t&&("[object ArrayBuffer]"===n||t.buffer&&"[object ArrayBuffer]"===Z.call(t.buffer))){var i,r=z;t instanceof ArrayBuffer?(i=t,r+=D):(i=t.buffer,"[object Int8Array]"===n?r+=B:"[object Uint8Array]"===n?r+=P:"[object Uint8ClampedArray]"===n?r+=j:"[object Int16Array]"===n?r+=U:"[object Uint16Array]"===n?r+=M:"[object Int32Array]"===n?r+=F:"[object Uint32Array]"===n?r+=W:"[object Float32Array]"===n?r+=q:"[object Float64Array]"===n?r+=H:e(new Error("Failed to get type for BinaryArray"))),e(r+V(i))}else if("[object Blob]"===n){var o=new FileReader;o.onload=function(){var n="~~local_forage_type~"+t.type+"~"+V(this.result);e(z+L+n)},o.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(n){console.error("Couldn't convert value into a JSON string: ",t),e(null,n)}},deserialize:function(t){if(t.substring(0,9)!==z)return JSON.parse(t);var e,n=t.substring(13),i=t.substring(9,13);if(i===L&&O.test(n)){var r=n.match(O);e=r[1],n=n.substring(r[0].length)}var s=Y(n);switch(i){case D:return s;case L:return o([s],{type:e});case B:return new Int8Array(s);case P:return new Uint8Array(s);case j:return new Uint8ClampedArray(s);case U:return new Int16Array(s);case M:return new Uint16Array(s);case F:return new Int32Array(s);case W:return new Uint32Array(s);case q:return new Float32Array(s);case H:return new Float64Array(s);default:throw new Error("Unkown type: "+i)}},stringToBuffer:Y,bufferToString:V};function K(t,e,n,i){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function $(t,e,n,i,r,o){t.executeSql(n,i,r,(function(t,s){s.code===s.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,a){a.rows.length?o(t,s):K(t,e,(function(){t.executeSql(n,i,r,o)}),o)}),o):o(t,s)}),o)}function G(t,e,n,i){var r=this;t=u(t);var o=new s((function(o,s){r.ready().then((function(){void 0===e&&(e=null);var a=e,h=r._dbInfo;h.serializer.serialize(e,(function(e,u){u?s(u):h.db.transaction((function(n){$(n,h,"INSERT OR REPLACE INTO "+h.storeName+" (key, value) VALUES (?, ?)",[t,e],(function(){o(a)}),(function(t,e){s(e)}))}),(function(e){if(e.code===e.QUOTA_ERR){if(i>0)return void o(G.apply(r,[t,a,n,i-1]));s(e)}}))}))})).catch(s)}));return a(o,n),o}var J={_driver:"webSQLStorage",_initStorage:function(t){var e=this,n={db:null};if(t)for(var i in t)n[i]="string"!=typeof t[i]?t[i].toString():t[i];var r=new s((function(t,i){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(t){return i(t)}n.db.transaction((function(r){K(r,n,(function(){e._dbInfo=n,t()}),(function(t,e){i(e)}))}),i)}));return n.serializer=X,r},_support:"function"==typeof openDatabase,iterate:function(t,e){var n=this,i=new s((function(e,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){$(n,r,"SELECT * FROM "+r.storeName,[],(function(n,i){for(var o=i.rows,s=o.length,a=0;a<s;a++){var h=o.item(a),u=h.value;if(u&&(u=r.serializer.deserialize(u)),void 0!==(u=t(u,h.key,a+1)))return void e(u)}e()}),(function(t,e){i(e)}))}))})).catch(i)}));return a(i,e),i},getItem:function(t,e){var n=this;t=u(t);var i=new s((function(e,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){$(n,r,"SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,n){var i=n.rows.length?n.rows.item(0).value:null;i&&(i=r.serializer.deserialize(i)),e(i)}),(function(t,e){i(e)}))}))})).catch(i)}));return a(i,e),i},setItem:function(t,e,n){return G.apply(this,[t,e,n,1])},removeItem:function(t,e){var n=this;t=u(t);var i=new s((function(e,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){$(n,r,"DELETE FROM "+r.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){i(e)}))}))})).catch(i)}));return a(i,e),i},clear:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var i=e._dbInfo;i.db.transaction((function(e){$(e,i,"DELETE FROM "+i.storeName,[],(function(){t()}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},length:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var i=e._dbInfo;i.db.transaction((function(e){$(e,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],(function(e,n){var i=n.rows.item(0).c;t(i)}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},key:function(t,e){var n=this,i=new s((function(e,i){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){$(n,r,"SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,n){var i=n.rows.length?n.rows.item(0).key:null;e(i)}),(function(t,e){i(e)}))}))})).catch(i)}));return a(i,e),i},keys:function(t){var e=this,n=new s((function(t,n){e.ready().then((function(){var i=e._dbInfo;i.db.transaction((function(e){$(e,i,"SELECT key FROM "+i.storeName,[],(function(e,n){for(var i=[],r=0;r<n.rows.length;r++)i.push(n.rows.item(r).key);t(i)}),(function(t,e){n(e)}))}))})).catch(n)}));return a(n,t),n},dropInstance:function(t,e){e=c.apply(this,arguments);var n=this.config();(t="function"!=typeof t&&t||{}).name||(t.name=t.name||n.name,t.storeName=t.storeName||n.storeName);var i,r=this;return a(i=t.name?new s((function(e){var i;i=t.name===n.name?r._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?e({db:i,storeNames:[t.storeName]}):e(function(t){return new s((function(e,n){t.transaction((function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,i){for(var r=[],o=0;o<i.rows.length;o++)r.push(i.rows.item(o).name);e({db:t,storeNames:r})}),(function(t,e){n(e)}))}),(function(t){n(t)}))}))}(i))})).then((function(t){return new s((function(e,n){t.db.transaction((function(i){function r(t){return new s((function(e,n){i.executeSql("DROP TABLE IF EXISTS "+t,[],(function(){e()}),(function(t,e){n(e)}))}))}for(var o=[],a=0,h=t.storeNames.length;a<h;a++)o.push(r(t.storeNames[a]));s.all(o).then((function(){e()})).catch((function(t){n(t)}))}),(function(t){n(t)}))}))})):s.reject("Invalid arguments"),e),i}};function Q(t,e){var n=t.name+"/";return t.storeName!==e.storeName&&(n+=t.storeName+"/"),n}function tt(){return!function(){var t="_localforage_support_test";try{return localStorage.setItem(t,!0),localStorage.removeItem(t),!1}catch(t){return!0}}()||localStorage.length>0}var et={_driver:"localStorageWrapper",_initStorage:function(t){var e={};if(t)for(var n in t)e[n]=t[n];return e.keyPrefix=Q(t,this._defaultConfig),tt()?(this._dbInfo=e,e.serializer=X,s.resolve()):s.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(t){return!1}}(),iterate:function(t,e){var n=this,i=n.ready().then((function(){for(var e=n._dbInfo,i=e.keyPrefix,r=i.length,o=localStorage.length,s=1,a=0;a<o;a++){var h=localStorage.key(a);if(0===h.indexOf(i)){var u=localStorage.getItem(h);if(u&&(u=e.serializer.deserialize(u)),void 0!==(u=t(u,h.substring(r),s++)))return u}}}));return a(i,e),i},getItem:function(t,e){var n=this;t=u(t);var i=n.ready().then((function(){var e=n._dbInfo,i=localStorage.getItem(e.keyPrefix+t);return i&&(i=e.serializer.deserialize(i)),i}));return a(i,e),i},setItem:function(t,e,n){var i=this;t=u(t);var r=i.ready().then((function(){void 0===e&&(e=null);var n=e;return new s((function(r,o){var s=i._dbInfo;s.serializer.serialize(e,(function(e,i){if(i)o(i);else try{localStorage.setItem(s.keyPrefix+t,e),r(n)}catch(t){"QuotaExceededError"!==t.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==t.name||o(t),o(t)}}))}))}));return a(r,n),r},removeItem:function(t,e){var n=this;t=u(t);var i=n.ready().then((function(){var e=n._dbInfo;localStorage.removeItem(e.keyPrefix+t)}));return a(i,e),i},clear:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);0===i.indexOf(t)&&localStorage.removeItem(i)}}));return a(n,t),n},length:function(t){var e=this.keys().then((function(t){return t.length}));return a(e,t),e},key:function(t,e){var n=this,i=n.ready().then((function(){var e,i=n._dbInfo;try{e=localStorage.key(t)}catch(t){e=null}return e&&(e=e.substring(i.keyPrefix.length)),e}));return a(i,e),i},keys:function(t){var e=this,n=e.ready().then((function(){for(var t=e._dbInfo,n=localStorage.length,i=[],r=0;r<n;r++){var o=localStorage.key(r);0===o.indexOf(t.keyPrefix)&&i.push(o.substring(t.keyPrefix.length))}return i}));return a(n,t),n},dropInstance:function(t,e){if(e=c.apply(this,arguments),!(t="function"!=typeof t&&t||{}).name){var n=this.config();t.name=t.name||n.name,t.storeName=t.storeName||n.storeName}var i,r=this;return i=t.name?new s((function(e){t.storeName?e(Q(t,r._defaultConfig)):e(t.name+"/")})).then((function(t){for(var e=localStorage.length-1;e>=0;e--){var n=localStorage.key(e);0===n.indexOf(t)&&localStorage.removeItem(n)}})):s.reject("Invalid arguments"),a(i,e),i}},nt=function(t,e){for(var n=t.length,i=0;i<n;){if((r=t[i])===(o=e)||"number"==typeof r&&"number"==typeof o&&isNaN(r)&&isNaN(o))return!0;i++}var r,o;return!1},it=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},rt={},ot={},st={INDEXEDDB:R,WEBSQL:J,LOCALSTORAGE:et},at=[st.INDEXEDDB._driver,st.WEBSQL._driver,st.LOCALSTORAGE._driver],ht=["dropInstance"],ut=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ht),ct={description:"",driver:at.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function lt(t,e){t[e]=function(){var n=arguments;return t.ready().then((function(){return t[e].apply(t,n)}))}}function ft(){for(var t=1;t<arguments.length;t++){var e=arguments[t];if(e)for(var n in e)e.hasOwnProperty(n)&&(it(e[n])?arguments[0][n]=e[n].slice():arguments[0][n]=e[n])}return arguments[0]}var dt=function(){function t(e){for(var n in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),st)if(st.hasOwnProperty(n)){var i=st[n],r=i._driver;this[n]=r,rt[r]||this.defineDriver(i)}this._defaultConfig=ft({},ct),this._config=ft({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return t.prototype.config=function(t){if("object"===(void 0===t?"undefined":i(t))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var e in t){if("storeName"===e&&(t[e]=t[e].replace(/\W/g,"_")),"version"===e&&"number"!=typeof t[e])return new Error("Database version must be a number.");this._config[e]=t[e]}return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)}return"string"==typeof t?this._config[t]:this._config},t.prototype.defineDriver=function(t,e,n){var i=new s((function(e,n){try{var i=t._driver,r=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver)return void n(r);for(var o=ut.concat("_initStorage"),h=0,u=o.length;h<u;h++){var c=o[h];if((!nt(ht,c)||t[c])&&"function"!=typeof t[c])return void n(r)}!function(){for(var e=function(t){return function(){var e=new Error("Method "+t+" is not implemented by the current driver"),n=s.reject(e);return a(n,arguments[arguments.length-1]),n}},n=0,i=ht.length;n<i;n++){var r=ht[n];t[r]||(t[r]=e(r))}}();var l=function(n){rt[i]&&console.info("Redefining LocalForage driver: "+i),rt[i]=t,ot[i]=n,e()};"_support"in t?t._support&&"function"==typeof t._support?t._support().then(l,n):l(!!t._support):l(!0)}catch(t){n(t)}}));return h(i,e,n),i},t.prototype.driver=function(){return this._driver||null},t.prototype.getDriver=function(t,e,n){var i=rt[t]?s.resolve(rt[t]):s.reject(new Error("Driver not found."));return h(i,e,n),i},t.prototype.getSerializer=function(t){var e=s.resolve(X);return h(e,t),e},t.prototype.ready=function(t){var e=this,n=e._driverSet.then((function(){return null===e._ready&&(e._ready=e._initDriver()),e._ready}));return h(n,t,t),n},t.prototype.setDriver=function(t,e,n){var i=this;it(t)||(t=[t]);var r=this._getSupportedDrivers(t);function o(){i._config.driver=i.driver()}function a(t){return i._extend(t),o(),i._ready=i._initStorage(i._config),i._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return s.resolve()})):s.resolve();return this._driverSet=u.then((function(){var t=r[0];return i._dbInfo=null,i._ready=null,i.getDriver(t).then((function(t){i._driver=t._driver,o(),i._wrapLibraryMethodsWithReady(),i._initDriver=function(t){return function(){var e=0;return function n(){for(;e<t.length;){var r=t[e];return e++,i._dbInfo=null,i._ready=null,i.getDriver(r).then(a).catch(n)}o();var h=new Error("No available storage method found.");return i._driverSet=s.reject(h),i._driverSet}()}}(r)}))})).catch((function(){o();var t=new Error("No available storage method found.");return i._driverSet=s.reject(t),i._driverSet})),h(this._driverSet,e,n),this._driverSet},t.prototype.supports=function(t){return!!ot[t]},t.prototype._extend=function(t){ft(this,t)},t.prototype._getSupportedDrivers=function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];this.supports(r)&&e.push(r)}return e},t.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,e=ut.length;t<e;t++)lt(this,ut[t])},t.prototype.createInstance=function(e){return new t(e)},t}(),pt=new dt;e.exports=pt},{3:3}]},{},[4])(4)},9788:(t,e,n)=>{function i(t){this.options=t||{locator:{}}}function r(){this.cdata=!1}function o(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function s(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function a(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function h(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}i.prototype.parseFromString=function(t,e){var n=this.options,i=new u,o=n.domBuilder||new r,a=n.errorHandler,h=n.locator,c=n.xmlns||{},l={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return h&&o.setDocumentLocator(h),i.errorHandler=function(t,e,n){if(!t){if(e instanceof r)return e;t=e}var i={},o=t instanceof Function;function a(e){var r=t[e];!r&&o&&(r=2==t.length?function(n){t(e,n)}:t),i[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+s(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),i}(a,o,h),i.domBuilder=n.domBuilder||o,/\/x?html?$/.test(e)&&(l.nbsp=" ",l.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t?i.parse(t,c,l):i.errorHandler.error("invalid doc source"),o.doc},r.prototype={startDocument:function(){this.doc=(new c).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,i){var r=this.doc,s=r.createElementNS(t,n||e),a=i.length;h(this,s),this.currentElement=s,this.locator&&o(this.locator,s);for(var u=0;u<a;u++){t=i.getURI(u);var c=i.getValue(u),l=(n=i.getQName(u),r.createAttributeNS(t,n));this.locator&&o(i.getLocator(u),l),l.value=l.nodeValue=c,s.setAttributeNode(l)}},endElement:function(t,e,n){var i=this.currentElement;i.tagName,this.currentElement=i.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&o(this.locator,n),h(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=a.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(t);else i=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(t)&&this.doc.appendChild(i),this.locator&&o(this.locator,i)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=a.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&o(this.locator,i),h(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(t,e,n);this.locator&&o(this.locator,r),h(this,r)}},warning:function(t){console.warn("[xmldom warning]\t"+t,s(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,s(this.locator))},fatalError:function(t){throw console.error("[xmldom fatalError]\t"+t,s(this.locator)),t}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){r.prototype[t]=function(){return null}}));var u=n(7494).$,c=n(3278).DOMImplementation;n(3278),e.S=i},3278:(t,e)=>{function n(t,e){for(var n in t)e[n]=t[n]}function i(t,e){var i=t.prototype;if(Object.create){var r=Object.create(e.prototype);i.__proto__=r}if(!(i instanceof e)){function o(){}o.prototype=e.prototype,n(i,o=new o),t.prototype=i=o}i.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),i.constructor=t)}var r={},o=r.ELEMENT_NODE=1,s=r.ATTRIBUTE_NODE=2,a=r.TEXT_NODE=3,h=r.CDATA_SECTION_NODE=4,u=r.ENTITY_REFERENCE_NODE=5,c=r.ENTITY_NODE=6,l=r.PROCESSING_INSTRUCTION_NODE=7,f=r.COMMENT_NODE=8,d=r.DOCUMENT_NODE=9,p=r.DOCUMENT_TYPE_NODE=10,m=r.DOCUMENT_FRAGMENT_NODE=11,g=r.NOTATION_NODE=12,v={},y={},w=(v.INDEX_SIZE_ERR=(y[1]="Index size error",1),v.DOMSTRING_SIZE_ERR=(y[2]="DOMString size error",2),v.HIERARCHY_REQUEST_ERR=(y[3]="Hierarchy request error",3)),b=(v.WRONG_DOCUMENT_ERR=(y[4]="Wrong document",4),v.INVALID_CHARACTER_ERR=(y[5]="Invalid character",5),v.NO_DATA_ALLOWED_ERR=(y[6]="No data allowed",6),v.NO_MODIFICATION_ALLOWED_ERR=(y[7]="No modification allowed",7),v.NOT_FOUND_ERR=(y[8]="Not found",8)),_=(v.NOT_SUPPORTED_ERR=(y[9]="Not supported",9),v.INUSE_ATTRIBUTE_ERR=(y[10]="Attribute in use",10));function x(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,y[t]),this.message=y[t],Error.captureStackTrace&&Error.captureStackTrace(this,x);return n.code=t,e&&(this.message=this.message+": "+e),n}function k(){}function E(t,e){this._node=t,this._refresh=e,S(this)}function S(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var i=t._refresh(t._node);nt(t,"length",i.length),n(i,t),t._inc=e}}function C(){}function T(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function A(t,e,n,i){if(i?e[T(e,i)]=n:e[e.length++]=n,t){n.ownerElement=t;var r=t.ownerDocument;r&&(i&&L(r,t,i),function(t,e,n){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(e._nsMap[n.prefix?n.localName:""]=n.value)}(r,t,n))}}function N(t,e,n){var i=T(e,n);if(!(i>=0))throw x(b,new Error(t.tagName+"@"+n));for(var r=e.length-1;i<r;)e[i]=e[++i];if(e.length=r,t){var o=t.ownerDocument;o&&(L(o,t,n),n.ownerElement=null)}}function R(t){if(this._features={},t)for(var e in t)this._features=t[e]}function I(){}function O(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function z(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(z(t,e))return!0}while(t=t.nextSibling)}function D(){}function L(t,e,n,i){t&&t._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete e._nsMap[n.prefix?n.localName:""]}function B(t,e,n){if(t&&t._inc){t._inc++;var i=e.childNodes;if(n)i[i.length++]=n;else{for(var r=e.firstChild,o=0;r;)i[o++]=r,r=r.nextSibling;i.length=o}}}function P(t,e){var n=e.previousSibling,i=e.nextSibling;return n?n.nextSibling=i:t.firstChild=i,i?i.previousSibling=n:t.lastChild=n,B(t.ownerDocument,t),e}function j(t,e,n){var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===m){var r=e.firstChild;if(null==r)return e;var o=e.lastChild}else r=o=e;var s=n?n.previousSibling:t.lastChild;r.previousSibling=s,o.nextSibling=n,s?s.nextSibling=r:t.firstChild=r,null==n?t.lastChild=o:n.previousSibling=o;do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));return B(t.ownerDocument||t,t),e.nodeType==m&&(e.firstChild=e.lastChild=null),e}function U(){this._nsMap={}}function F(){}function M(){}function W(){}function q(){}function H(){}function Z(){}function Y(){}function V(){}function X(){}function K(){}function $(){}function G(t,e){var n=[],i=9==this.nodeType?this.documentElement:this,r=i.prefix,o=i.namespaceURI;if(o&&null==r&&null==(r=i.lookupPrefix(o)))var s=[{namespace:o,prefix:null}];return Q(this,n,t,e,s),n.join("")}function J(t,e,n){var i=t.prefix||"",r=t.namespaceURI;if(!i&&!r)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var o=n.length;o--;){var s=n[o];if(s.prefix==i)return s.namespace!=r}return!0}function Q(t,e,n,i,r){if(i){if(!(t=i(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case o:r||(r=[]),r.length;var c=t.attributes,g=c.length,v=t.firstChild,y=t.tagName;n="http://www.w3.org/1999/xhtml"===t.namespaceURI||n,e.push("<",y);for(var w=0;w<g;w++)"xmlns"==(b=c.item(w)).prefix?r.push({prefix:b.localName,namespace:b.value}):"xmlns"==b.nodeName&&r.push({prefix:"",namespace:b.value});for(w=0;w<g;w++){var b;if(J(b=c.item(w),0,r)){var _=b.prefix||"",x=b.namespaceURI,k=_?" xmlns:"+_:" xmlns";e.push(k,'="',x,'"'),r.push({prefix:_,namespace:x})}Q(b,e,n,i,r)}if(J(t,0,r)&&(_=t.prefix||"",x=t.namespaceURI,k=_?" xmlns:"+_:" xmlns",e.push(k,'="',x,'"'),r.push({prefix:_,namespace:x})),v||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(y)){if(e.push(">"),n&&/^script$/i.test(y))for(;v;)v.data?e.push(v.data):Q(v,e,n,i,r),v=v.nextSibling;else for(;v;)Q(v,e,n,i,r),v=v.nextSibling;e.push("</",y,">")}else e.push("/>");return;case d:case m:for(v=t.firstChild;v;)Q(v,e,n,i,r),v=v.nextSibling;return;case s:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,O),'"');case a:return e.push(t.data.replace(/[<&]/g,O));case h:return e.push("<![CDATA[",t.data,"]]>");case f:return e.push("\x3c!--",t.data,"--\x3e");case p:var E=t.publicId,S=t.systemId;if(e.push("<!DOCTYPE ",t.name),E)e.push(' PUBLIC "',E),S&&"."!=S&&e.push('" "',S),e.push('">');else if(S&&"."!=S)e.push(' SYSTEM "',S,'">');else{var C=t.internalSubset;C&&e.push(" [",C,"]"),e.push(">")}return;case l:return e.push("<?",t.target," ",t.data,"?>");case u:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function tt(t,e,n){var i;switch(e.nodeType){case o:(i=e.cloneNode(!1)).ownerDocument=t;case m:break;case s:n=!0}if(i||(i=e.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,n)for(var r=e.firstChild;r;)i.appendChild(tt(t,r,n)),r=r.nextSibling;return i}function et(t,e,n){var i=new e.constructor;for(var r in e){var a=e[r];"object"!=typeof a&&a!=i[r]&&(i[r]=a)}switch(e.childNodes&&(i.childNodes=new k),i.ownerDocument=t,i.nodeType){case o:var h=e.attributes,u=i.attributes=new C,c=h.length;u._ownerElement=i;for(var l=0;l<c;l++)i.setAttributeNode(et(t,h.item(l),!0));break;case s:n=!0}if(n)for(var f=e.firstChild;f;)i.appendChild(et(t,f,n)),f=f.nextSibling;return i}function nt(t,e,n){t[e]=n}v.INVALID_STATE_ERR=(y[11]="Invalid state",11),v.SYNTAX_ERR=(y[12]="Syntax error",12),v.INVALID_MODIFICATION_ERR=(y[13]="Invalid modification",13),v.NAMESPACE_ERR=(y[14]="Invalid namespace",14),v.INVALID_ACCESS_ERR=(y[15]="Invalid access",15),x.prototype=Error.prototype,n(v,x),k.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],i=0;i<this.length;i++)Q(this[i],n,t,e);return n.join("")}},E.prototype.item=function(t){return S(this),this[t]},i(E,k),C.prototype={length:0,item:k.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new x(_);var n=this.getNamedItem(t.nodeName);return A(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new x(_);return e=this.getNamedItemNS(t.namespaceURI,t.localName),A(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return N(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return N(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var i=this[n];if(i.localName==e&&i.namespaceURI==t)return i}return null}},R.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];return!(!n||e&&!(e in n))},createDocument:function(t,e,n){var i=new D;if(i.implementation=this,i.childNodes=new k,i.doctype=n,n&&i.appendChild(n),e){var r=i.createElementNS(t,e);i.appendChild(r)}return i},createDocumentType:function(t,e,n){var i=new Z;return i.name=t,i.nodeName=t,i.publicId=e,i.systemId=n,i}},I.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(t,e){return j(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return P(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return et(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==a&&t.nodeType==a?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var i in n)if(n[i]==t)return i;e=e.nodeType==s?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==s?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},n(r,I),n(r,I.prototype),D.prototype={nodeName:"#document",nodeType:d,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==m){for(var n=t.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,e),n=i}return t}return null==this.documentElement&&t.nodeType==o&&(this.documentElement=t),j(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),P(this,t)},importNode:function(t,e){return tt(this,t,e)},getElementById:function(t){var e=null;return z(this.documentElement,(function(n){if(n.nodeType==o&&n.getAttribute("id")==t)return e=n,!0})),e},createElement:function(t){var e=new U;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new k,(e.attributes=new C)._ownerElement=e,e},createDocumentFragment:function(){var t=new K;return t.ownerDocument=this,t.childNodes=new k,t},createTextNode:function(t){var e=new W;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new q;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new H;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new $;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new F;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new X;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new U,i=e.split(":"),r=n.attributes=new C;return n.childNodes=new k,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=e,r._ownerElement=n,n},createAttributeNS:function(t,e){var n=new F,i=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=e,n}},i(D,I),U.prototype={nodeType:o,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===m?this.insertBefore(t,null):function(t,e){var n=e.parentNode;if(n){var i=t.lastChild;n.removeChild(e),i=t.lastChild}return i=t.lastChild,e.parentNode=t,e.previousSibling=i,e.nextSibling=null,i?i.nextSibling=e:t.firstChild=e,t.lastChild=e,B(t.ownerDocument,t,e),e}(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var i=this.ownerDocument.createAttributeNS(t,e);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new E(this,(function(e){var n=[];return z(e,(function(i){i===e||i.nodeType!=o||"*"!==t&&i.tagName!=t||n.push(i)})),n}))},getElementsByTagNameNS:function(t,e){return new E(this,(function(n){var i=[];return z(n,(function(r){r===n||r.nodeType!==o||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||i.push(r)})),i}))}},D.prototype.getElementsByTagName=U.prototype.getElementsByTagName,D.prototype.getElementsByTagNameNS=U.prototype.getElementsByTagNameNS,i(U,I),F.prototype.nodeType=s,i(F,I),M.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(y[w])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){n=this.data.substring(0,t)+n+this.data.substring(t+e),this.nodeValue=this.data=n,this.length=n.length}},i(M,I),W.prototype={nodeName:"#text",nodeType:a,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},i(W,M),q.prototype={nodeName:"#comment",nodeType:f},i(q,M),H.prototype={nodeName:"#cdata-section",nodeType:h},i(H,M),Z.prototype.nodeType=p,i(Z,I),Y.prototype.nodeType=g,i(Y,I),V.prototype.nodeType=c,i(V,I),X.prototype.nodeType=u,i(X,I),K.prototype.nodeName="#document-fragment",K.prototype.nodeType=m,i(K,I),$.prototype.nodeType=l,i($,I),I.prototype.toString=G;try{if(Object.defineProperty){function it(t){switch(t.nodeType){case o:case m:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(it(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(E.prototype,"length",{get:function(){return S(this),this.$$length}}),Object.defineProperty(I.prototype,"textContent",{get:function(){return it(this)},set:function(t){switch(this.nodeType){case o:case m:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),nt=function(t,e,n){t["$$"+e]=n}}}catch(rt){}e.DOMImplementation=R},7494:(t,e)=>{var n=/[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]/,i=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+n.source+i.source+"*(?::"+n.source+i.source+"*)?$");function o(){}function s(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function a(t,e,n,i,r,o){for(var s,a=++e,h=0;;){var u=t.charAt(a);switch(u){case"=":if(1===h)s=t.slice(e,a),h=3;else{if(2!==h)throw new Error("attribute equal must after attrName");h=3}break;case"'":case'"':if(3===h||1===h){if(1===h&&(o.warning('attribute value must after "="'),s=t.slice(e,a)),e=a+1,!((a=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");c=t.slice(e,a).replace(/&#?\w+;/g,r),n.add(s,c,e-1),h=5}else{if(4!=h)throw new Error('attribute value must after "="');c=t.slice(e,a).replace(/&#?\w+;/g,r),n.add(s,c,e),o.warning('attribute "'+s+'" missed start quot('+u+")!!"),e=a+1,h=5}break;case"/":switch(h){case 0:n.setTagName(t.slice(e,a));case 5:case 6:case 7:h=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==h&&n.setTagName(t.slice(e,a)),a;case">":switch(h){case 0:n.setTagName(t.slice(e,a));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(e,a)).slice(-1)&&(n.closed=!0,c=c.slice(0,-1));case 2:2===h&&(c=s),4==h?(o.warning('attribute "'+c+'" missed quot(")!!'),n.add(s,c.replace(/&#?\w+;/g,r),e)):("http://www.w3.org/1999/xhtml"===i[""]&&c.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),n.add(c,c,e));break;case 3:throw new Error("attribute value missed!!")}return a;case"€":u=" ";default:if(u<=" ")switch(h){case 0:n.setTagName(t.slice(e,a)),h=6;break;case 1:s=t.slice(e,a),h=2;break;case 4:var c=t.slice(e,a).replace(/&#?\w+;/g,r);o.warning('attribute "'+c+'" missed quot(")!!'),n.add(s,c,e);case 5:h=6}else switch(h){case 2:n.tagName,"http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),n.add(s,s,e),e=a,h=1;break;case 5:o.warning('attribute space is required"'+s+'"!!');case 6:h=1,e=a;break;case 3:h=4,e=a;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}a++}}function h(t,e,n){for(var i=t.tagName,r=null,o=t.length;o--;){var s=t[o],a=s.qName,h=s.value;if((d=a.indexOf(":"))>0)var u=s.prefix=a.slice(0,d),c=a.slice(d+1),f="xmlns"===u&&c;else c=a,u=null,f="xmlns"===a&&"";s.localName=c,!1!==f&&(null==r&&(r={},l(n,n={})),n[f]=r[f]=h,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(f,h))}for(o=t.length;o--;)(u=(s=t[o]).prefix)&&("xml"===u&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(s.uri=n[u||""]));var d;(d=i.indexOf(":"))>0?(u=t.prefix=i.slice(0,d),c=t.localName=i.slice(d+1)):(u=null,c=t.localName=i);var p=t.uri=n[u||""];if(e.startElement(p,c,i,t),!t.closed)return t.currentNSMap=n,t.localNSMap=r,!0;if(e.endElement(p,c,i),r)for(u in r)e.endPrefixMapping(u)}function u(t,e,n,i,r){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(n)?(r.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),o)}return e+1}function c(t,e,n,i){var r=i[n];return null==r&&((r=t.lastIndexOf("</"+n+">"))<e&&(r=t.lastIndexOf("</"+n)),i[n]=r),r<e}function l(t,e){for(var n in t)e[n]=t[n]}function f(t,e,n,i){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(r=t.indexOf("--\x3e",e+4))>e?(n.comment(t,e+4,r-e-4),r+3):(i.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var r=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,r-e-9),n.endCDATA(),r+3}var o=function(t,e){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(t);n=r.exec(t);)if(i.push(n),n[1])return i}(t,e),s=o.length;if(s>1&&/!doctype/i.test(o[0][0])){var a=o[1][0],h=s>3&&/^public$/i.test(o[2][0])&&o[3][0],u=s>4&&o[4][0],c=o[s-1];return n.startDTD(a,h&&h.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),c.index+c[0].length}return-1}function d(t,e,n){var i=t.indexOf("?>",e);if(i){var r=t.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,n.processingInstruction(r[1],r[2]),i+2):-1}return-1}function p(t){}function m(t,e){return t.__proto__=e,t}o.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),l(e,e={}),function(t,e,n,i,r){function o(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?function(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}(parseInt(e.substr(1).replace("x","0x"))):(r.error("entity not found:"+t),t)}function l(e){if(e>x){var n=t.substring(x,e).replace(/&#?\w+;/g,o);w&&m(x),i.characters(n,0,e-x),x=e}}function m(e,n){for(;e>=v&&(n=y.exec(t));)g=n.index,v=g+n[0].length,w.lineNumber++;w.columnNumber=e-g+1}for(var g=0,v=0,y=/.*(?:\r\n?|\n)|.*$/g,w=i.locator,b=[{currentNSMap:e}],_={},x=0;;){try{var k=t.indexOf("<",x);if(k<0){if(!t.substr(x).match(/^\s*$/)){var E=i.doc,S=E.createTextNode(t.substr(x));E.appendChild(S),i.currentElement=S}return}switch(k>x&&l(k),t.charAt(k+1)){case"/":var C=t.indexOf(">",k+3),T=t.substring(k+2,C),A=b.pop();C<0?(T=t.substring(k+2).replace(/[\s<].*/,""),r.error("end tag name: "+T+" is not complete:"+A.tagName),C=k+1+T.length):T.match(/\s</)&&(T=T.replace(/[\s<].*/,""),r.error("end tag name: "+T+" maybe not complete"),C=k+1+T.length);var N=A.localNSMap,R=A.tagName==T;if(R||A.tagName&&A.tagName.toLowerCase()==T.toLowerCase()){if(i.endElement(A.uri,A.localName,T),N)for(var I in N)i.endPrefixMapping(I);R||r.fatalError("end tag name: "+T+" is not match the current start tagName:"+A.tagName)}else b.push(A);C++;break;case"?":w&&m(k),C=d(t,k,i);break;case"!":w&&m(k),C=f(t,k,i,r);break;default:w&&m(k);var O=new p,z=b[b.length-1].currentNSMap,D=(C=a(t,k,O,z,o,r),O.length);if(!O.closed&&c(t,C,O.tagName,_)&&(O.closed=!0,n.nbsp||r.warning("unclosed xml attribute")),w&&D){for(var L=s(w,{}),B=0;B<D;B++){var P=O[B];m(P.offset),P.locator=s(w,{})}i.locator=L,h(O,i,z)&&b.push(O),i.locator=w}else h(O,i,z)&&b.push(O);"http://www.w3.org/1999/xhtml"!==O.uri||O.closed?C++:C=u(t,C,O.tagName,o,i)}}catch(t){r.error("element parse error: "+t),C=-1}C>x?x=C:l(Math.max(k,x)+1)}}(t,e,n,i,this.errorHandler),i.endDocument()}},p.prototype={setTagName:function(t){if(!r.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},add:function(t,e,n){if(!r.test(t))throw new Error("invalid attribute:"+t);this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},m({},m.prototype)instanceof m||(m=function(t,e){function n(){}for(e in n.prototype=e,n=new n,t)n[e]=t[e];return n}),e.$=o}}]);