From 98e2ece85a03c8d4991bd0fbca61976d9732c53e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Jan 2024 20:42:29 +0300 Subject: remove some promise chains with async/await --- dist/app-libs.min.js | 24 +- dist/app.min.js | 2 +- js/reader.js | 1045 ++- lib/bootstrap/v3/js/jquery.js | 16473 +++++++++++++++++++++------------------- 4 files changed, 9275 insertions(+), 8269 deletions(-) diff --git a/dist/app-libs.min.js b/dist/app-libs.min.js index 94a1ceb..666b1eb 100644 --- a/dist/app-libs.min.js +++ b/dist/app-libs.min.js @@ -1,33 +1,23 @@ /*! - * jQuery JavaScript Library v1.9.1 - * http://jquery.com/ + * jQuery JavaScript Library v3.7.1 + * https://jquery.com/ * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license - * http://jquery.org/license + * https://jquery.org/license * - * Date: 2013-2-4 + * Date: 2023-08-28T13:37Z */ /*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under the MIT license */ -if(function(e,t){var i,n,r=e.document,s=e.location,o=e.jQuery,a=e.$,l={},c=[],h=c.concat,u=c.push,d=c.slice,f=c.indexOf,p=l.toString,g=l.hasOwnProperty,m="1.9.1".trim,v=function(e,t){return new v.fn.init(e,t,n)},y=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,b=/\S+/g,w=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,x=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,_=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,k=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,S=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,C=/^-ms-/,N=/-([\da-z])/gi,O=function(e,t){return t.toUpperCase()},A=function(e){(r.addEventListener||"load"===e.type||"complete"===r.readyState)&&(I(),v.ready())},I=function(){r.addEventListener?(r.removeEventListener("DOMContentLoaded",A,!1),e.removeEventListener("load",A,!1)):(r.detachEvent("onreadystatechange",A),e.detachEvent("onload",A))};function R(e){var t=e.length,i=v.type(e);return!v.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===i||"function"!==i&&(0===t||"number"==typeof t&&t>0&&t-1 in e)))}v.fn=v.prototype={jquery:"1.9.1",constructor:v,init:function(e,t,i){var n,s;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:x.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof v?t[0]:t,v.merge(this,v.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),_.test(n[1])&&v.isPlainObject(t))for(n in t)v.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((s=r.getElementById(n[2]))&&s.parentNode){if(s.id!==n[2])return i.find(e);this.length=1,this[0]=s}return this.context=r,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):v.isFunction(e)?i.ready(e):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=v.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i0||(i.resolveWith(r,[v]),v.fn.trigger&&v(r).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===v.type(e)},isArray:Array.isArray||function(e){return"array"===v.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?l[p.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==v.type(e)||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!g.call(e,"constructor")&&!g.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var t;for(t in e);return void 0===t||g.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,i){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(i=t,t=!1),t=t||r;var n=_.exec(e),s=!i&&[];return n?[t.createElement(n[1])]:(n=v.buildFragment([e],t,s),s&&v(s).remove(),v.merge([],n.childNodes))},parseJSON:function(t){return e.JSON&&e.JSON.parse?e.JSON.parse(t):null===t?t:"string"==typeof t&&(t=v.trim(t))&&E.test(t.replace(T,"@").replace(S,"]").replace(k,""))?new Function("return "+t)():void v.error("Invalid JSON: "+t)},parseXML:function(t){var i;if(!t||"string"!=typeof t)return null;try{e.DOMParser?i=(new DOMParser).parseFromString(t,"text/xml"):((i=new ActiveXObject("Microsoft.XMLDOM")).async="false",i.loadXML(t))}catch(e){i=void 0}return i&&i.documentElement&&!i.getElementsByTagName("parsererror").length||v.error("Invalid XML: "+t),i},noop:function(){},globalEval:function(t){t&&v.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(N,O)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,i){var n=0,r=e.length,s=R(e);if(i){if(s)for(;n-1;)a.splice(n,1),t&&(n<=r&&r--,n<=s&&s--)})),this},has:function(e){return e?v.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],this},disable:function(){return a=l=i=void 0,this},disabled:function(){return!a},lock:function(){return l=void 0,i||h.disable(),this},locked:function(){return!l},fireWith:function(e,i){return i=[e,(i=i||[]).slice?i.slice():i],!a||n&&!l||(t?l.push(i):c(i)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred((function(i){v.each(t,(function(t,s){var o=s[0],a=v.isFunction(e[t])&&e[t];r[s[1]]((function(){var e=a&&a.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[o+"With"](this===n?i.promise():this,a?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?v.extend(e,n):n}},r={};return n.pipe=n.then,v.each(t,(function(e,s){var o=s[2],a=s[3];n[s[1]]=o.add,a&&o.add((function(){i=a}),t[1^e][2].disable,t[2][2].lock),r[s[0]]=function(){return r[s[0]+"With"](this===r?n:this,arguments),this},r[s[0]+"With"]=o.fireWith})),n.promise(r),e&&e.call(r,r),r},when:function(e){var t,i,n,r=0,s=d.call(arguments),o=s.length,a=1!==o||e&&v.isFunction(e.promise)?o:0,l=1===a?e:v.Deferred(),c=function(e,i,n){return function(r){i[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===t?l.notifyWith(i,n):--a||l.resolveWith(i,n)}};if(o>1)for(t=new Array(o),i=new Array(o),n=new Array(o);r
a",i=d.getElementsByTagName("*"),n=d.getElementsByTagName("a")[0],!i||!n||!i.length)return{};l=(o=r.createElement("select")).appendChild(r.createElement("option")),s=d.getElementsByTagName("input")[0],n.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:!!s.value,optSelected:l.selected,enctype:!!r.createElement("form").enctype,html5Clone:"<:nav>"!==r.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===r.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,t.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(e){t.deleteExpando=!1}for(u in(s=r.createElement("input")).setAttribute("value",""),t.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),t.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),(a=r.createDocumentFragment()).appendChild(s),t.appendChecked=s.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",(function(){t.noCloneEvent=!1})),d.cloneNode(!0).click()),{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+u,"t"),t[u+"Bubbles"]=c in e||!1===d.attributes[c].expando;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,v((function(){var i,n,s,o="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=r.getElementsByTagName("body")[0];a&&((i=r.createElement("div")).style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(i).appendChild(d),d.innerHTML="
t
",(s=d.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",h=0===s[0].offsetHeight,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=h&&0===s[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==a.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,(n=d.appendChild(r.createElement("div"))).style.cssText=d.style.cssText=o,n.style.marginRight=n.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(n,null)||{}).marginRight)),void 0!==d.style.zoom&&(d.innerHTML="",d.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(i),i=d=s=n=null)})),i=o=a=l=n=s=null,t}();var j=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,z=/([A-Z])/g;function L(e,t,i,n){if(v.acceptData(e)){var r,s,o=v.expando,a="string"==typeof t,l=e.nodeType,h=l?v.cache:e,u=l?e[o]:e[o]&&o;if(u&&h[u]&&(n||h[u].data)||!a||void 0!==i)return u||(l?e[o]=u=c.pop()||v.guid++:u=o),h[u]||(h[u]={},l||(h[u].toJSON=v.noop)),"object"!=typeof t&&"function"!=typeof t||(n?h[u]=v.extend(h[u],t):h[u].data=v.extend(h[u].data,t)),r=h[u],n||(r.data||(r.data={}),r=r.data),void 0!==i&&(r[v.camelCase(t)]=i),a?null==(s=r[t])&&(s=r[v.camelCase(t)]):s=r,s}}function B(e,t,i){if(v.acceptData(e)){var n,r,s,o=e.nodeType,a=o?v.cache:e,l=o?e[v.expando]:v.expando;if(a[l]){if(t&&(s=i?a[l]:a[l].data)){for((n=0,r=(t=v.isArray(t)?t.concat(v.map(t,v.camelCase)):t in s||(t=v.camelCase(t))in s?[t]:t.split(" ")).length);n1,null,!0)},removeData:function(e){return this.each((function(){v.removeData(this,e)}))}}),v.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=v._data(e,t),i&&(!n||v.isArray(i)?n=v._data(e,t,v.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=v.queue(e,t),n=i.length,r=i.shift(),s=v._queueHooks(e,t);"inprogress"===r&&(r=i.shift(),n--),s.cur=r,r&&("fx"===t&&i.unshift("inprogress"),delete s.stop,r.call(e,(function(){v.dequeue(e,t)}),s)),!n&&s&&s.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return v._data(e,i)||v._data(e,i,{empty:v.Callbacks("once memory").add((function(){v._removeData(e,t+"queue"),v._removeData(e,i)}))})}}),v.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length1)},removeAttr:function(e){return this.each((function(){v.removeAttr(this,e)}))},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each((function(){try{this[e]=void 0,delete this[e]}catch(e){}}))},addClass:function(e){var t,i,n,r,s,o=0,a=this.length,l="string"==typeof e&&e;if(v.isFunction(e))return this.each((function(t){v(this).addClass(e.call(this,t,this.className))}));if(l)for(t=(e||"").match(b)||[];o=0;)n=n.replace(" "+r+" "," ");i.className=e?v.trim(n):""}return this},toggleClass:function(e,t){var i=typeof e,n="boolean"==typeof t;return v.isFunction(e)?this.each((function(i){v(this).toggleClass(e.call(this,i,this.className,t),t)})):this.each((function(){if("string"===i)for(var r,s=0,o=v(this),a=t,l=e.match(b)||[];r=l[s++];)a=n?a:!o.hasClass(r),o[a?"addClass":"removeClass"](r);else"undefined"!==i&&"boolean"!==i||(this.className&&v._data(this,"__className__",this.className),this.className=this.className||!1===e?"":v._data(this,"__className__")||"")}))},hasClass:function(e){for(var t=" "+e+" ",i=0,n=this.length;i=0)return!0;return!1},val:function(e){var t,i,n,r=this[0];return arguments.length?(n=v.isFunction(e),this.each((function(t){var r,s=v(this);1===this.nodeType&&(null==(r=n?e.call(this,t,s.val()):e)?r="":"number"==typeof r?r+="":v.isArray(r)&&(r=v.map(r,(function(e){return null==e?"":e+""}))),(i=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()])&&"set"in i&&void 0!==i.set(this,r,"value")||(this.value=r))}))):r?(i=v.valHooks[r.type]||v.valHooks[r.nodeName.toLowerCase()])&&"get"in i&&void 0!==(t=i.get(r,"value"))?t:"string"==typeof(t=r.value)?t.replace(W,""):null==t?"":t:void 0}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,i,n=e.options,r=e.selectedIndex,s="select-one"===e.type||r<0,o=s?null:[],a=s?r+1:n.length,l=r<0?a:s?r:0;l=0})),i.length||(e.selectedIndex=-1),i}}},attr:function(e,t,i){var n,r,s,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?v.prop(e,t,i):((r=1!==o||!v.isXMLDoc(e))&&(t=t.toLowerCase(),n=v.attrHooks[t]||(X.test(t)?q:F)),void 0===i?n&&r&&"get"in n&&null!==(s=n.get(e,t))?s:(void 0!==e.getAttribute&&(s=e.getAttribute(t)),null==s?void 0:s):null!==i?n&&r&&"set"in n&&void 0!==(s=n.set(e,i,t))?s:(e.setAttribute(t,i+""),i):void v.removeAttr(e,t))},removeAttr:function(e,t){var i,n,r=0,s=t&&t.match(b);if(s&&1===e.nodeType)for(;i=s[r++];)n=v.propFix[i]||i,X.test(i)?!V&&Y.test(i)?e[v.camelCase("default-"+i)]=e[n]=!1:e[n]=!1:v.attr(e,i,""),e.removeAttribute(V?i:n)},attrHooks:{type:{set:function(e,t){if(!v.support.radioValue&&"radio"===t&&v.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,t,i){var n,r,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return(1!==s||!v.isXMLDoc(e))&&(t=v.propFix[t]||t,r=v.propHooks[t]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(e,i,t))?n:e[t]=i:r&&"get"in r&&null!==(n=r.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=e.getAttributeNode("tabindex");return t&&t.specified?parseInt(t.value,10):H.test(e.nodeName)||$.test(e.nodeName)&&e.href?0:void 0}}}}),q={get:function(e,t){var i=v.prop(e,t),n="boolean"==typeof i&&e.getAttribute(t),r="boolean"==typeof i?Z&&V?null!=n:Y.test(t)?e[v.camelCase("default-"+t)]:!!n:e.getAttributeNode(t);return r&&!1!==r.value?t.toLowerCase():void 0},set:function(e,t,i){return!1===t?v.removeAttr(e,i):Z&&V||!Y.test(i)?e.setAttribute(!V&&v.propFix[i]||i,i):e[v.camelCase("default-"+i)]=e[i]=!0,i}},Z&&V||(v.attrHooks.value={get:function(e,t){var i=e.getAttributeNode(t);return v.nodeName(e,"input")?e.defaultValue:i&&i.specified?i.value:void 0},set:function(e,t,i){if(!v.nodeName(e,"input"))return F&&F.set(e,t,i);e.defaultValue=t}}),V||(F=v.valHooks.button={get:function(e,t){var i=e.getAttributeNode(t);return i&&("id"===t||"name"===t||"coords"===t?""!==i.value:i.specified)?i.value:void 0},set:function(e,t,i){var n=e.getAttributeNode(i);return n||e.setAttributeNode(n=e.ownerDocument.createAttribute(i)),n.value=t+="","value"===i||t===e.getAttribute(i)?t:void 0}},v.attrHooks.contenteditable={get:F.get,set:function(e,t,i){F.set(e,""!==t&&t,i)}},v.each(["width","height"],(function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,i){if(""===i)return e.setAttribute(t,"auto"),i}})}))),v.support.hrefNormalized||(v.each(["href","src","width","height"],(function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{get:function(e){var i=e.getAttribute(t,2);return null==i?void 0:i}})})),v.each(["href","src"],(function(e,t){v.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}))),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],(function(){v.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}})),v.each(["radio","checkbox"],(function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})}));var G=/^(?:input|select|textarea)$/i,K=/^key/,Q=/^(?:mouse|contextmenu)|click/,J=/^(?:focusinfocus|focusoutblur)$/,ee=/^([^.]*)(?:\.(.+)|)$/;function te(){return!0}function ie(){return!1}v.event={global:{},add:function(e,t,i,n,r){var s,o,a,l,c,h,u,d,f,p,g,m=v._data(e);if(m){for(i.handler&&(i=(l=i).handler,r=l.selector),i.guid||(i.guid=v.guid++),(o=m.events)||(o=m.events={}),(h=m.handle)||((h=m.handle=function(e){return void 0===v||e&&v.event.triggered===e.type?void 0:v.event.dispatch.apply(h.elem,arguments)}).elem=e),a=(t=(t||"").match(b)||[""]).length;a--;)f=g=(s=ee.exec(t[a])||[])[1],p=(s[2]||"").split(".").sort(),c=v.event.special[f]||{},f=(r?c.delegateType:c.bindType)||f,c=v.event.special[f]||{},u=v.extend({type:f,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&v.expr.match.needsContext.test(r),namespace:p.join(".")},l),(d=o[f])||((d=o[f]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,n,p,h)||(e.addEventListener?e.addEventListener(f,h,!1):e.attachEvent&&e.attachEvent("on"+f,h))),c.add&&(c.add.call(e,u),u.handler.guid||(u.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),v.event.global[f]=!0;e=null}},remove:function(e,t,i,n,r){var s,o,a,l,c,h,u,d,f,p,g,m=v.hasData(e)&&v._data(e);if(m&&(h=m.events)){for(c=(t=(t||"").match(b)||[""]).length;c--;)if(f=g=(a=ee.exec(t[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(u=v.event.special[f]||{},d=h[f=(n?u.delegateType:u.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=s=d.length;s--;)o=d[s],!r&&g!==o.origType||i&&i.guid!==o.guid||a&&!a.test(o.namespace)||n&&n!==o.selector&&("**"!==n||!o.selector)||(d.splice(s,1),o.selector&&d.delegateCount--,u.remove&&u.remove.call(e,o));l&&!d.length&&(u.teardown&&!1!==u.teardown.call(e,p,m.handle)||v.removeEvent(e,f,m.handle),delete h[f])}else for(f in h)v.event.remove(e,f+t[c],i,n,!0);v.isEmptyObject(h)&&(delete m.handle,v._removeData(e,"events"))}},trigger:function(t,i,n,s){var o,a,l,c,h,u,d,f=[n||r],p=g.call(t,"type")?t.type:t,m=g.call(t,"namespace")?t.namespace.split("."):[];if(l=u=n=n||r,3!==n.nodeType&&8!==n.nodeType&&!J.test(p+v.event.triggered)&&(p.indexOf(".")>=0&&(m=p.split("."),p=m.shift(),m.sort()),a=p.indexOf(":")<0&&"on"+p,(t=t[v.expando]?t:new v.Event(p,"object"==typeof t&&t)).isTrigger=!0,t.namespace=m.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),i=null==i?[t]:v.makeArray(i,[t]),h=v.event.special[p]||{},s||!h.trigger||!1!==h.trigger.apply(n,i))){if(!s&&!h.noBubble&&!v.isWindow(n)){for(c=h.delegateType||p,J.test(c+p)||(l=l.parentNode);l;l=l.parentNode)f.push(l),u=l;u===(n.ownerDocument||r)&&f.push(u.defaultView||u.parentWindow||e)}for(d=0;(l=f[d++])&&!t.isPropagationStopped();)t.type=d>1?c:h.bindType||p,(o=(v._data(l,"events")||{})[t.type]&&v._data(l,"handle"))&&o.apply(l,i),(o=a&&l[a])&&v.acceptData(l)&&o.apply&&!1===o.apply(l,i)&&t.preventDefault();if(t.type=p,!s&&!t.isDefaultPrevented()&&(!h._default||!1===h._default.apply(n.ownerDocument,i))&&("click"!==p||!v.nodeName(n,"a"))&&v.acceptData(n)&&a&&n[p]&&!v.isWindow(n)){(u=n[a])&&(n[a]=null),v.event.triggered=p;try{n[p]()}catch(e){}v.event.triggered=void 0,u&&(n[a]=u)}return t.result}},dispatch:function(e){e=v.event.fix(e);var t,i,n,r,s,o=[],a=d.call(arguments),l=(v._data(this,"events")||{})[e.type]||[],c=v.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(o=v.event.handlers.call(this,e,l),t=0;(r=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=r.elem,s=0;(n=r.handlers[s++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(n.namespace)||(e.handleObj=n,e.data=n.data,void 0!==(i=((v.event.special[n.origType]||{}).handle||n.handler).apply(r.elem,a))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var i,n,r,s,o=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(r=[],s=0;s=0:v.find(i,this,null,[l]).length),r[i]&&r.push(n);r.length&&o.push({elem:l,handlers:r})}return a+~])"+D+"*"),q=new RegExp(B),U=new RegExp("^"+z+"$"),W={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),NAME:new RegExp("^\\[name=['\"]?("+j+")['\"]?\\]"),TAG:new RegExp("^("+j.replace("w","w*")+")"),ATTR:new RegExp("^"+L),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},H=/[\x20\t\r\n\f]*[+~]/,$=/^[^{]+\{\s*\[native code/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/^(?:input|select|textarea|button)$/i,V=/^h\d$/i,Z=/'|\\/g,G=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,K=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Q=function(e,t){var i="0x"+t-65536;return i!=i?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)};try{I.call(x.documentElement.childNodes,0)[0].nodeType}catch(e){I=function(e){for(var t,i=[];t=this[e++];)i.push(t);return i}}function J(e){return $.test(e+"")}function ee(){var e,t=[];return e=function(i,n){return t.push(i+=" ")>r.cacheLength&&delete e[t.shift()],e[i]=n}}function te(e){return e[w]=!0,e}function ie(e){var t=u.createElement("div");try{return e(t)}catch(e){return!1}finally{t=null}}function ne(e,t,i,n){var s,o,l,c,d,g,m,v,b,E;if((t?t.ownerDocument||t:x)!==u&&h(t),i=i||[],!e||"string"!=typeof e)return i;if(1!==(c=(t=t||u).nodeType)&&9!==c)return[];if(!f&&!n){if(s=X.exec(e))if(l=s[1]){if(9===c){if(!(o=t.getElementById(l))||!o.parentNode)return i;if(o.id===l)return i.push(o),i}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(l))&&y(t,o)&&o.id===l)return i.push(o),i}else{if(s[2])return A.apply(i,I.call(t.getElementsByTagName(e),0)),i;if((l=s[3])&&_.getByClassName&&t.getElementsByClassName)return A.apply(i,I.call(t.getElementsByClassName(l),0)),i}if(_.qsa&&!p.test(e)){if(m=!0,v=w,b=t,E=9===c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(g=le(e),(m=t.getAttribute("id"))?v=m.replace(Z,"\\$&"):t.setAttribute("id",v),v="[id='"+v+"'] ",d=g.length;d--;)g[d]=v+ce(g[d]);b=H.test(e)&&t.parentNode||t,E=g.join(",")}if(E)try{return A.apply(i,I.call(b.querySelectorAll(E),0)),i}catch(e){}finally{m||t.removeAttribute("id")}}}return function(e,t,i,n){var s,o,l,c,h,u=le(e);if(!n&&1===u.length){if((o=u[0]=u[0].slice(0)).length>2&&"ID"===(l=o[0]).type&&9===t.nodeType&&!f&&r.relative[o[1].type]){if(!(t=r.find.ID(l.matches[0].replace(K,Q),t)[0]))return i;e=e.slice(o.shift().value.length)}for(s=W.needsContext.test(e)?0:o.length;s--&&(l=o[s],!r.relative[c=l.type]);)if((h=r.find[c])&&(n=h(l.matches[0].replace(K,Q),H.test(o[0].type)&&t.parentNode||t))){if(o.splice(s,1),!(e=n.length&&ce(o)))return A.apply(i,I.call(n,0)),i;break}}return a(e,u)(n,t,f,i,H.test(e)),i}(e.replace(P,"$1"),t,i,n)}function re(e,t){var i=t&&e,n=i&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function se(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function oe(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function ae(e){return te((function(t){return t=+t,te((function(i,n){for(var r,s=e([],i.length,t),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))}))}))}for(i in o=ne.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=ne.setDocument=function(e){var t=e?e.ownerDocument||e:x;return t!==u&&9===t.nodeType&&t.documentElement?(u=t,d=t.documentElement,f=o(t),_.tagNameNoComments=ie((function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length})),_.attributes=ie((function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t})),_.getByClassName=ie((function(e){return e.innerHTML="",!(!e.getElementsByClassName||!e.getElementsByClassName("e").length)&&(e.lastChild.className="e",2===e.getElementsByClassName("e").length)})),_.getByName=ie((function(e){e.id=w+0,e.innerHTML="
",d.insertBefore(e,d.firstChild);var i=t.getElementsByName&&t.getElementsByName(w).length===2+t.getElementsByName(w+0).length;return _.getIdNotName=!t.getElementById(w),d.removeChild(e),i})),r.attrHandle=ie((function(e){return e.innerHTML="",e.firstChild&&void 0!==e.firstChild.getAttribute&&"#"===e.firstChild.getAttribute("href")}))?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},_.getIdNotName?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&!f){var i=t.getElementById(e);return i&&i.parentNode?[i]:[]}},r.filter.ID=function(e){var t=e.replace(K,Q);return function(e){return e.getAttribute("id")===t}}):(r.find.ID=function(e,t){if(void 0!==t.getElementById&&!f){var i=t.getElementById(e);return i?i.id===e||void 0!==i.getAttributeNode&&i.getAttributeNode("id").value===e?[i]:void 0:[]}},r.filter.ID=function(e){var t=e.replace(K,Q);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}}),r.find.TAG=_.tagNameNoComments?function(e,t){if(void 0!==t.getElementsByTagName)return t.getElementsByTagName(e)}:function(e,t){var i,n=[],r=0,s=t.getElementsByTagName(e);if("*"===e){for(;i=s[r++];)1===i.nodeType&&n.push(i);return n}return s},r.find.NAME=_.getByName&&function(e,t){if(void 0!==t.getElementsByName)return t.getElementsByName(name)},r.find.CLASS=_.getByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&!f)return t.getElementsByClassName(e)},g=[],p=[":focus"],(_.qsa=J(t.querySelectorAll))&&(ie((function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||p.push("\\["+D+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||p.push(":checked")})),ie((function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&p.push("[*^$]="+D+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||p.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),p.push(",.*:")}))),(_.matchesSelector=J(m=d.matchesSelector||d.mozMatchesSelector||d.webkitMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ie((function(e){_.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",B)})),p=new RegExp(p.join("|")),g=new RegExp(g.join("|")),y=J(d.contains)||d.compareDocumentPosition?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},b=d.compareDocumentPosition?function(e,i){var n;return e===i?(l=!0,0):(n=i.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(i))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===t||y(x,e)?-1:i===t||y(x,i)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,i){var n,r=0,s=e.parentNode,o=i.parentNode,a=[e],c=[i];if(e===i)return l=!0,0;if(!s||!o)return e===t?-1:i===t?1:s?-1:o?1:0;if(s===o)return re(e,i);for(n=e;n=n.parentNode;)a.unshift(n);for(n=i;n=n.parentNode;)c.unshift(n);for(;a[r]===c[r];)r++;return r?re(a[r],c[r]):a[r]===x?-1:c[r]===x?1:0},l=!1,[0,0].sort(b),_.detectDuplicates=l,u):u},ne.matches=function(e,t){return ne(e,null,null,t)},ne.matchesSelector=function(e,t){if((e.ownerDocument||e)!==u&&h(e),t=t.replace(G,"='$1']"),_.matchesSelector&&!f&&(!g||!g.test(t))&&!p.test(t))try{var i=m.call(e,t);if(i||_.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return ne(t,u,null,[e]).length>0},ne.contains=function(e,t){return(e.ownerDocument||e)!==u&&h(e),y(e,t)},ne.attr=function(e,t){var i;return(e.ownerDocument||e)!==u&&h(e),f||(t=t.toLowerCase()),(i=r.attrHandle[t])?i(e):f||_.attributes?e.getAttribute(t):((i=e.getAttributeNode(t))||e.getAttribute(t))&&!0===e[t]?t:i&&i.specified?i.value:null},ne.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ne.uniqueSort=function(e){var t,i=[],n=1,r=0;if(l=!_.detectDuplicates,e.sort(b),l){for(;t=e[n];n++)t===e[n-1]&&(r=i.push(n));for(;r--;)e.splice(i[r],1)}return e},s=ne.getText=function(e){var t,i="",n=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=s(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[n];n++)i+=s(t);return i},r=ne.selectors={cacheLength:50,createPseudo:te,match:W,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(K,Q),e[3]=(e[4]||e[5]||"").replace(K,Q),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ne.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ne.error(e[0]),e},PSEUDO:function(e){var t,i=!e[5]&&e[2];return W.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:i&&q.test(i)&&(t=le(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(K,Q).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+D+")"+e+"("+D+"|$)"))&&T(e,(function(e){return t.test(e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,i){return function(n){var r=ne.attr(n,e);return null==r?"!="===t:!t||(r+="","="===t?r===i:"!="===t?r!==i:"^="===t?i&&0===r.indexOf(i):"*="===t?i&&r.indexOf(i)>-1:"$="===t?i&&r.slice(-i.length)===i:"~="===t?(" "+r+" ").indexOf(i)>-1:"|="===t&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,i,n,r){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===n&&0===r?function(e){return!!e.parentNode}:function(t,i,l){var c,h,u,d,f,p,g=s!==o?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a;if(m){if(s){for(;g;){for(u=t;u=u[g];)if(a?u.nodeName.toLowerCase()===v:1===u.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}if(p=[o?m.firstChild:m.lastChild],o&&y){for(f=(c=(h=m[w]||(m[w]={}))[e]||[])[0]===E&&c[1],d=c[0]===E&&c[2],u=f&&m.childNodes[f];u=++f&&u&&u[g]||(d=f=0)||p.pop();)if(1===u.nodeType&&++d&&u===t){h[e]=[E,f,d];break}}else if(y&&(c=(t[w]||(t[w]={}))[e])&&c[0]===E)d=c[1];else for(;(u=++f&&u&&u[g]||(d=f=0)||p.pop())&&((a?u.nodeName.toLowerCase()!==v:1!==u.nodeType)||!++d||(y&&((u[w]||(u[w]={}))[e]=[E,d]),u!==t)););return(d-=r)===n||d%n==0&&d/n>=0}}},PSEUDO:function(e,t){var i,n=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ne.error("unsupported pseudo: "+e);return n[w]?n(t):n.length>1?(i=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,i){for(var r,s=n(e,t),o=s.length;o--;)e[r=R.call(e,s[o])]=!(i[r]=s[o])})):function(e){return n(e,0,i)}):n}},pseudos:{not:te((function(e){var t=[],i=[],n=a(e.replace(P,"$1"));return n[w]?te((function(e,t,i,r){for(var s,o=n(e,null,r,[]),a=e.length;a--;)(s=o[a])&&(e[a]=!(t[a]=s))})):function(e,r,s){return t[0]=e,n(t,null,s,i),!i.pop()}})),has:te((function(e){return function(t){return ne(e,t).length>0}})),contains:te((function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}})),lang:te((function(e){return U.test(e||"")||ne.error("unsupported lang: "+e),e=e.replace(K,Q).toLowerCase(),function(t){var i;do{if(i=f?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===u.activeElement&&(!u.hasFocus||u.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return V.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ae((function(){return[0]})),last:ae((function(e,t){return[t-1]})),eq:ae((function(e,t,i){return[i<0?i+t:i]})),even:ae((function(e,t){for(var i=0;i=0;)e.push(n);return e})),gt:ae((function(e,t,i){for(var n=i<0?i+t:i;++n1?function(t,i,n){for(var r=e.length;r--;)if(!e[r](t,i,n))return!1;return!0}:e[0]}function de(e,t,i,n,r){for(var s,o=[],a=0,l=e.length,c=null!=t;a-1&&(s[c]=!(o[c]=u))}}else v=de(v===o?v.splice(p,v.length):v),r?r(null,o,v,l):A.apply(o,v)}))}function pe(e){for(var t,i,n,s=e.length,o=r.relative[e[0].type],a=o||r.relative[" "],l=o?1:0,h=he((function(e){return e===t}),a,!0),u=he((function(e){return R.call(t,e)>-1}),a,!0),d=[function(e,i,n){return!o&&(n||i!==c)||((t=i).nodeType?h(e,i,n):u(e,i,n))}];l1&&ue(d),l>1&&ce(e.slice(0,l-1)).replace(P,"$1"),i,l0,o=e.length>0,a=function(a,l,h,d,f){var p,g,m,v=[],y=0,b="0",w=a&&[],x=null!=f,_=c,k=a||o&&r.find.TAG("*",f&&l.parentNode||l),T=E+=null==_?1:Math.random()||.1;for(x&&(c=l!==u&&l,n=i);null!=(p=k[b]);b++){if(o&&p){for(g=0;m=e[g++];)if(m(p,l,h)){d.push(p);break}x&&(E=T,n=++i)}s&&((p=!m&&p)&&y--,a&&w.push(p))}if(y+=b,s&&b!==y){for(g=0;m=t[g++];)m(w,v,l,h);if(a){if(y>0)for(;b--;)w[b]||v[b]||(v[b]=O.call(d));v=de(v)}A.apply(d,v),x&&!a&&v.length>0&&y+t.length>1&&ne.uniqueSort(d)}return x&&(E=T,c=_),w};return s?te(a):a}(o,s))}return a},r.pseudos.nth=r.pseudos.eq,r.filters=ge.prototype=r.pseudos,r.setFilters=new ge,h(),ne.attr=v.attr,v.find=ne,v.expr=ne.selectors,v.expr[":"]=v.expr.pseudos,v.unique=ne.uniqueSort,v.text=ne.getText,v.isXMLDoc=ne.isXML,v.contains=ne.contains}(e);var ne=/Until$/,re=/^(?:parents|prev(?:Until|All))/,se=/^.[^:#\[\.,]*$/,oe=v.expr.match.needsContext,ae={children:!0,contents:!0,next:!0,prev:!0};function le(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}function ce(e,t,i){if(t=t||0,v.isFunction(t))return v.grep(e,(function(e,n){return!!t.call(e,n,e)===i}));if(t.nodeType)return v.grep(e,(function(e){return e===t===i}));if("string"==typeof t){var n=v.grep(e,(function(e){return 1===e.nodeType}));if(se.test(t))return v.filter(t,n,!i);t=v.filter(t,n)}return v.grep(e,(function(e){return v.inArray(e,t)>=0===i}))}function he(e){var t=ue.split("|"),i=e.createDocumentFragment();if(i.createElement)for(;t.length;)i.createElement(t.pop());return i}v.fn.extend({find:function(e){var t,i,n,r=this.length;if("string"!=typeof e)return n=this,this.pushStack(v(e).filter((function(){for(t=0;t1?v.unique(i):i)).selector=(this.selector?this.selector+" ":"")+e,i},has:function(e){var t,i=v(e,this),n=i.length;return this.filter((function(){for(t=0;t=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var i,n=0,r=this.length,s=[],o=oe.test(e)||"string"!=typeof e?v(e,t||this.context):0;n-1:v.find.matchesSelector(i,e)){s.push(i);break}i=i.parentNode}return this.pushStack(s.length>1?v.unique(s):s)},index:function(e){return e?"string"==typeof e?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var i="string"==typeof e?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),n=v.merge(this.get(),i);return this.pushStack(v.unique(n))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,i){return v.dir(e,"parentNode",i)},next:function(e){return le(e,"nextSibling")},prev:function(e){return le(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,i){return v.dir(e,"nextSibling",i)},prevUntil:function(e,t,i){return v.dir(e,"previousSibling",i)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},(function(e,t){v.fn[e]=function(i,n){var r=v.map(this,t,i);return ne.test(e)||(n=i),n&&"string"==typeof n&&(r=v.filter(n,r)),r=this.length>1&&!ae[e]?v.unique(r):r,this.length>1&&re.test(e)&&(r=r.reverse()),this.pushStack(r)}})),v.extend({filter:function(e,t,i){return i&&(e=":not("+e+")"),1===t.length?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,t,i){for(var n=[],r=e[t];r&&9!==r.nodeType&&(void 0===i||1!==r.nodeType||!v(r).is(i));)1===r.nodeType&&n.push(r),r=r[t];return n},sibling:function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i}});var ue="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",de=/ jQuery\d+="(?:null|\d+)"/g,fe=new RegExp("<(?:"+ue+")[\\s/>]","i"),pe=/^\s+/,ge=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,me=/<([\w:]+)/,ve=/\s*$/g,Te={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:v.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},Se=he(r).appendChild(r.createElement("div"));function Ce(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function Ne(e){var t=Ee.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Oe(e,t){for(var i,n=0;null!=(i=e[n]);n++)v._data(i,"globalEval",!t||v._data(t[n],"globalEval"))}function Ae(e,t){if(1===t.nodeType&&v.hasData(e)){var i,n,r,s=v._data(e),o=v._data(t,s),a=s.events;if(a)for(i in delete o.handle,o.events={},a)for(n=0,r=a[i].length;n0)&&(t||1!==i.nodeType||v.cleanData(Re(i)),i.parentNode&&(t&&v.contains(i.ownerDocument,i)&&Oe(Re(i,"script")),i.parentNode.removeChild(i)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&v.cleanData(Re(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&v.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return v.clone(this,e,t)}))},html:function(e){return v.access(this,(function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(de,""):void 0;if("string"==typeof e&&!be.test(e)&&(v.support.htmlSerialize||!fe.test(e))&&(v.support.leadingWhitespace||!pe.test(e))&&!Te[(me.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(ge,"<$1>");try{for(;i")?s=e.cloneNode(!0):(Se.innerHTML=e.outerHTML,Se.removeChild(s=Se.firstChild)),!(v.support.noCloneEvent&&v.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||v.isXMLDoc(e)))for(n=Re(s),a=Re(e),o=0;null!=(r=a[o]);++o)n[o]&&Ie(r,n[o]);if(t)if(i)for(a=a||Re(e),n=n||Re(s),o=0;null!=(r=a[o]);o++)Ae(r,n[o]);else Ae(e,s);return(n=Re(s,"script")).length>0&&Oe(n,!l&&Re(e,"script")),n=a=r=null,s},buildFragment:function(e,t,i,n){for(var r,s,o,a,l,c,h,u=e.length,d=he(t),f=[],p=0;p")+h[2],r=h[0];r--;)a=a.lastChild;if(!v.support.leadingWhitespace&&pe.test(s)&&f.push(t.createTextNode(pe.exec(s)[0])),!v.support.tbody)for(r=(s="table"!==l||ve.test(s)?""!==h[1]||ve.test(s)?0:a:a.firstChild)&&s.childNodes.length;r--;)v.nodeName(c=s.childNodes[r],"tbody")&&!c.childNodes.length&&s.removeChild(c);for(v.merge(f,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=d.lastChild}else f.push(t.createTextNode(s));for(a&&d.removeChild(a),v.support.appendChecked||v.grep(Re(f,"input"),De),p=0;s=f[p++];)if((!n||-1===v.inArray(s,n))&&(o=v.contains(s.ownerDocument,s),a=Re(d.appendChild(s),"script"),o&&Oe(a),i))for(r=0;s=a[r++];)_e.test(s.type||"")&&i.push(s);return a=null,d},cleanData:function(e,t){for(var i,n,r,s,o=0,a=v.expando,l=v.cache,h=v.support.deleteExpando,u=v.event.special;null!=(i=e[o]);o++)if((t||v.acceptData(i))&&(s=(r=i[a])&&l[r])){if(s.events)for(n in s.events)u[n]?v.event.remove(i,n):v.removeEvent(i,n,s.handle);l[r]&&(delete l[r],h?delete i[a]:void 0!==i.removeAttribute?i.removeAttribute(a):i[a]=null,c.push(r))}}});var je,ze,Le,Be=/alpha\([^)]*\)/i,Pe=/opacity\s*=\s*([^)]*)/,Me=/^(top|right|bottom|left)$/,Fe=/^(none|table(?!-c[ea]).+)/,qe=/^margin/,Ue=new RegExp("^("+y+")(.*)$","i"),We=new RegExp("^("+y+")(?!px)[a-z%]+$","i"),He=new RegExp("^([+-])=("+y+")","i"),$e={BODY:"block"},Xe={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:0,fontWeight:400},Ve=["Top","Right","Bottom","Left"],Ze=["Webkit","O","Moz","ms"];function Ge(e,t){if(t in e)return t;for(var i=t.charAt(0).toUpperCase()+t.slice(1),n=t,r=Ze.length;r--;)if((t=Ze[r]+i)in e)return t;return n}function Ke(e,t){return e=t||e,"none"===v.css(e,"display")||!v.contains(e.ownerDocument,e)}function Qe(e,t){for(var i,n,r,s=[],o=0,a=e.length;o").css("cssText","display:block !important")).appendTo(t.documentElement))[0].contentWindow||je[0].contentDocument).document).write(""),t.close(),i=nt(e,t),je.detach()),$e[e]=i),i}function nt(e,t){var i=v(t.createElement(e)).appendTo(t.body),n=v.css(i[0],"display");return i.remove(),n}v.fn.extend({css:function(e,t){return v.access(this,(function(e,t,i){var n,r,s={},o=0;if(v.isArray(t)){for(r=ze(e),n=t.length;o1)},show:function(){return Qe(this,!0)},hide:function(){return Qe(this)},toggle:function(e){var t="boolean"==typeof e;return this.each((function(){(t?e:Ke(this))?v(this).show():v(this).hide()}))}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=Le(e,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,o,a=v.camelCase(t),l=e.style;if(t=v.cssProps[a]||(v.cssProps[a]=Ge(l,a)),o=v.cssHooks[t]||v.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(r=o.get(e,!1,n))?r:l[t];if(!("string"===(s=typeof i)&&(r=He.exec(i))&&(i=(r[1]+1)*r[2]+parseFloat(v.css(e,t)),s="number"),null==i||"number"===s&&isNaN(i)||("number"!==s||v.cssNumber[a]||(i+="px"),v.support.clearCloneStyle||""!==i||0!==t.indexOf("background")||(l[t]="inherit"),o&&"set"in o&&void 0===(i=o.set(e,i,n)))))try{l[t]=i}catch(e){}}},css:function(e,t,i,n){var r,s,o,a=v.camelCase(t);return t=v.cssProps[a]||(v.cssProps[a]=Ge(e.style,a)),(o=v.cssHooks[t]||v.cssHooks[a])&&"get"in o&&(s=o.get(e,!0,i)),void 0===s&&(s=Le(e,t,n)),"normal"===s&&t in Ye&&(s=Ye[t]),""===i||i?(r=parseFloat(s),!0===i||v.isNumeric(r)?r||0:s):s},swap:function(e,t,i,n){var r,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];for(s in r=i.apply(e,n||[]),t)e.style[s]=o[s];return r}}),e.getComputedStyle?(ze=function(t){return e.getComputedStyle(t,null)},Le=function(e,t,i){var n,r,s,o=i||ze(e),a=o?o.getPropertyValue(t)||o[t]:void 0,l=e.style;return o&&(""!==a||v.contains(e.ownerDocument,e)||(a=v.style(e,t)),We.test(a)&&qe.test(t)&&(n=l.width,r=l.minWidth,s=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=o.width,l.width=n,l.minWidth=r,l.maxWidth=s)),a}):r.documentElement.currentStyle&&(ze=function(e){return e.currentStyle},Le=function(e,t,i){var n,r,s,o=i||ze(e),a=o?o[t]:void 0,l=e.style;return null==a&&l&&l[t]&&(a=l[t]),We.test(a)&&!Me.test(t)&&(n=l.left,(s=(r=e.runtimeStyle)&&r.left)&&(r.left=e.currentStyle.left),l.left="fontSize"===t?"1em":a,a=l.pixelLeft+"px",l.left=n,s&&(r.left=s)),""===a?"auto":a}),v.each(["height","width"],(function(e,t){v.cssHooks[t]={get:function(e,i,n){if(i)return 0===e.offsetWidth&&Fe.test(v.css(e,"display"))?v.swap(e,Xe,(function(){return tt(e,t,n)})):tt(e,t,n)},set:function(e,i,n){var r=n&&ze(e);return Je(0,i,n?et(e,t,n,v.support.boxSizing&&"border-box"===v.css(e,"boxSizing",!1,r),r):0)}}})),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return Pe.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var i=e.style,n=e.currentStyle,r=v.isNumeric(t)?"alpha(opacity="+100*t+")":"",s=n&&n.filter||i.filter||"";i.zoom=1,(t>=1||""===t)&&""===v.trim(s.replace(Be,""))&&i.removeAttribute&&(i.removeAttribute("filter"),""===t||n&&!n.filter)||(i.filter=Be.test(s)?s.replace(Be,r):s+" "+r)}}),v((function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){if(t)return v.swap(e,{display:"inline-block"},Le,[e,"marginRight"])}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],(function(e,t){v.cssHooks[t]={get:function(e,i){if(i)return i=Le(e,t),We.test(i)?v(e).position()[t]+"px":i}}}))})),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!v.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||v.css(e,"display"))},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},(function(e,t){v.cssHooks[e+t]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[e+Ve[n]+t]=s[n]||s[n-2]||s[0];return r}},qe.test(e)||(v.cssHooks[e+t].set=Je)}));var rt=/%20/g,st=/\[\]$/,ot=/\r?\n/g,at=/^(?:submit|button|image|reset|file)$/i,lt=/^(?:input|select|textarea|keygen)/i;function ct(e,t,i,n){var r;if(v.isArray(t))v.each(t,(function(t,r){i||st.test(e)?n(e,r):ct(e+"["+("object"==typeof r?t:"")+"]",r,i,n)}));else if(i||"object"!==v.type(t))n(e,t);else for(r in t)ct(e+"["+r+"]",t[r],i,n)}v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=v.prop(this,"elements");return e?v.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!v(this).is(":disabled")&<.test(this.nodeName)&&!at.test(e)&&(this.checked||!we.test(e))})).map((function(e,t){var i=v(this).val();return null==i?null:v.isArray(i)?v.map(i,(function(e){return{name:t.name,value:e.replace(ot,"\r\n")}})):{name:t.name,value:i.replace(ot,"\r\n")}})).get()}}),v.param=function(e,t){var i,n=[],r=function(e,t){t=v.isFunction(t)?t():null==t?"":t,n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=v.ajaxSettings&&v.ajaxSettings.traditional),v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,(function(){r(this.name,this.value)}));else for(i in e)ct(i,e[i],t,r);return n.join("&").replace(rt,"+")},v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){v.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}})),v.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var ht,ut,dt=v.now(),ft=/\?/,pt=/#.*$/,gt=/([?&])_=[^&]*/,mt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,vt=/^(?:GET|HEAD)$/,yt=/^\/\//,bt=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,wt=v.fn.load,xt={},_t={},Et="*/".concat("*");try{ut=s.href}catch(e){(ut=r.createElement("a")).href="",ut=ut.href}function kt(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,r=0,s=t.toLowerCase().match(b)||[];if(v.isFunction(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function Tt(e,t,i,n){var r={},s=e===_t;function o(a){var l;return r[a]=!0,v.each(e[a]||[],(function(e,a){var c=a(t,i,n);return"string"!=typeof c||s||r[c]?s?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)})),l}return o(t.dataTypes[0])||!r["*"]&&o("*")}function St(e,t){var i,n,r=v.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&v.extend(!0,e,i),e}ht=bt.exec(ut.toLowerCase())||[],v.fn.load=function(e,t,i){if("string"!=typeof e&&wt)return wt.apply(this,arguments);var n,r,s,o=this,a=e.indexOf(" ");return a>=0&&(n=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(t)?(i=t,t=void 0):t&&"object"==typeof t&&(s="POST"),o.length>0&&v.ajax({url:e,type:s,dataType:"html",data:t}).done((function(e){r=arguments,o.html(n?v("
").append(v.parseHTML(e)).find(n):e)})).complete(i&&function(e,t){o.each(i,r||[e.responseText,t,e])}),this},v.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){v.fn[t]=function(e){return this.on(t,e)}})),v.each(["get","post"],(function(e,t){v[t]=function(e,i,n,r){return v.isFunction(i)&&(r=r||n,n=i,i=void 0),v.ajax({url:e,type:t,dataType:r,data:i,success:n})}})),v.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ut,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ht[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Et,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?St(St(e,v.ajaxSettings),t):St(v.ajaxSettings,e)},ajaxPrefilter:kt(xt),ajaxTransport:kt(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,n,r,s,o,a,l,c,h=v.ajaxSetup({},t),u=h.context||h,d=h.context&&(u.nodeType||u.jquery)?v(u):v.event,f=v.Deferred(),p=v.Callbacks("once memory"),g=h.statusCode||{},m={},y={},w=0,x="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(2===w){if(!c)for(c={};t=mt.exec(s);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===w?s:null},setRequestHeader:function(e,t){var i=e.toLowerCase();return w||(e=y[i]=y[i]||e,m[e]=t),this},overrideMimeType:function(e){return w||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(w<2)for(t in e)g[t]=[g[t],e[t]];else _.always(e[_.status]);return this},abort:function(e){var t=e||x;return l&&l.abort(t),E(0,t),this}};if(f.promise(_).complete=p.add,_.success=_.done,_.error=_.fail,h.url=((e||h.url||ut)+"").replace(pt,"").replace(yt,ht[1]+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=v.trim(h.dataType||"*").toLowerCase().match(b)||[""],null==h.crossDomain&&(i=bt.exec(h.url.toLowerCase()),h.crossDomain=!(!i||i[1]===ht[1]&&i[2]===ht[2]&&(i[3]||("http:"===i[1]?80:443))==(ht[3]||("http:"===ht[1]?80:443)))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=v.param(h.data,h.traditional)),Tt(xt,h,t,_),2===w)return _;for(n in(a=h.global)&&0==v.active++&&v.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!vt.test(h.type),r=h.url,h.hasContent||(h.data&&(r=h.url+=(ft.test(r)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=gt.test(r)?r.replace(gt,"$1_="+dt++):r+(ft.test(r)?"&":"?")+"_="+dt++)),h.ifModified&&(v.lastModified[r]&&_.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&_.setRequestHeader("If-None-Match",v.etag[r])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&_.setRequestHeader("Content-Type",h.contentType),_.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Et+"; q=0.01":""):h.accepts["*"]),h.headers)_.setRequestHeader(n,h.headers[n]);if(h.beforeSend&&(!1===h.beforeSend.call(u,_,h)||2===w))return _.abort();for(n in x="abort",{success:1,error:1,complete:1})_[n](h[n]);if(l=Tt(_t,h,t,_)){_.readyState=1,a&&d.trigger("ajaxSend",[_,h]),h.async&&h.timeout>0&&(o=setTimeout((function(){_.abort("timeout")}),h.timeout));try{w=1,l.send(m,E)}catch(e){if(!(w<2))throw e;E(-1,e)}}else E(-1,"No Transport");function E(e,t,i,n){var c,m,y,b,x,E=t;2!==w&&(w=2,o&&clearTimeout(o),l=void 0,s=n||"",_.readyState=e>0?4:0,i&&(b=function(e,t,i){var n,r,s,o,a=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in i&&(t[c[o]]=i[o]);for(;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in a)if(a[o]&&a[o].test(r)){l.unshift(o);break}if(l[0]in i)s=l[0];else{for(o in i){if(!l[0]||e.converters[o+" "+l[0]]){s=o;break}n||(n=o)}s=s||n}if(s)return s!==l[0]&&l.unshift(s),i[s]}(h,_,i)),e>=200&&e<300||304===e?(h.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(v.lastModified[r]=x),(x=_.getResponseHeader("etag"))&&(v.etag[r]=x)),204===e?(c=!0,E="nocontent"):304===e?(c=!0,E="notmodified"):(E=(c=function(e,t){var i,n,r,s,o={},a=0,l=e.dataTypes.slice(),c=l[0];e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(l[1])for(r in e.converters)o[r.toLowerCase()]=e.converters[r];for(;n=l[++a];)if("*"!==n){if("*"!==c&&c!==n){if(!(r=o[c+" "+n]||o["* "+n]))for(i in o)if((s=i.split(" "))[1]===n&&(r=o[c+" "+s[0]]||o["* "+s[0]])){!0===r?r=o[i]:!0!==o[i]&&(n=s[0],l.splice(a--,0,n));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+c+" to "+n}}}c=n}return{state:"success",data:t}}(h,b)).state,m=c.data,c=!(y=c.error))):(y=E,!e&&E||(E="error",e<0&&(e=0))),_.status=e,_.statusText=(t||E)+"",c?f.resolveWith(u,[m,E,_]):f.rejectWith(u,[_,E,y]),_.statusCode(g),g=void 0,a&&d.trigger(c?"ajaxSuccess":"ajaxError",[_,h,c?m:y]),p.fireWith(u,[_,E]),a&&(d.trigger("ajaxComplete",[_,h]),--v.active||v.event.trigger("ajaxStop")))}return _},getScript:function(e,t){return v.get(e,void 0,t,"script")},getJSON:function(e,t,i){return v.get(e,t,i,"json")}}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)})),v.ajaxTransport("script",(function(e){if(e.crossDomain){var t,i=r.head||v("head")[0]||r.documentElement;return{send:function(n,s){(t=r.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||s(200,"success"))},i.insertBefore(t,i.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}}));var Ct=[],Nt=/(=)\?(?=&|$)|\?\?/;v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ct.pop()||v.expando+"_"+dt++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",(function(t,i,n){var r,s,o,a=!1!==t.jsonp&&(Nt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Nt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=v.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Nt,"$1"+r):!1!==t.jsonp&&(t.url+=(ft.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return o||v.error(r+" was not called"),o[0]},t.dataTypes[0]="json",s=e[r],e[r]=function(){o=arguments},n.always((function(){e[r]=s,t[r]&&(t.jsonpCallback=i.jsonpCallback,Ct.push(r)),o&&v.isFunction(s)&&s(o[0]),o=s=void 0})),"script"}));var Ot,At,It=0,Rt=e.ActiveXObject&&function(){var e;for(e in Ot)Ot[e](void 0,!0)};function Dt(){try{return new e.XMLHttpRequest}catch(e){}}v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Dt()||function(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}()}:Dt,At=v.ajaxSettings.xhr(),v.support.cors=!!At&&"withCredentials"in At,(At=v.support.ajax=!!At)&&v.ajaxTransport((function(t){var i;if(!t.crossDomain||v.support.cors)return{send:function(n,r){var s,o,a=t.xhr();if(t.username?a.open(t.type,t.url,t.async,t.username,t.password):a.open(t.type,t.url,t.async),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");try{for(o in n)a.setRequestHeader(o,n[o])}catch(e){}a.send(t.hasContent&&t.data||null),i=function(e,n){var o,l,c,h;try{if(i&&(n||4===a.readyState))if(i=void 0,s&&(a.onreadystatechange=v.noop,Rt&&delete Ot[s]),n)4!==a.readyState&&a.abort();else{h={},o=a.status,l=a.getAllResponseHeaders(),"string"==typeof a.responseText&&(h.text=a.responseText);try{c=a.statusText}catch(e){c=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=h.text?200:404}}catch(e){n||r(-1,e)}h&&r(o,c,h,l)},t.async?4===a.readyState?setTimeout(i):(s=++It,Rt&&(Ot||(Ot={},v(e).unload(Rt)),Ot[s]=i),a.onreadystatechange=i):i()},abort:function(){i&&i(void 0,!0)}}}));var jt,zt,Lt=/^(?:toggle|show|hide)$/,Bt=new RegExp("^(?:([+-])=|)("+y+")([a-z%]*)$","i"),Pt=/queueHooks$/,Mt=[function(e,t,i){var n,r,s,o,a,l,c,h,u,d=this,f=e.style,p={},g=[],m=e.nodeType&&Ke(e);i.queue||(null==(h=v._queueHooks(e,"fx")).unqueued&&(h.unqueued=0,u=h.empty.fire,h.empty.fire=function(){h.unqueued||u()}),h.unqueued++,d.always((function(){d.always((function(){h.unqueued--,v.queue(e,"fx").length||h.empty.fire()}))})));1===e.nodeType&&("height"in t||"width"in t)&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],"inline"===v.css(e,"display")&&"none"===v.css(e,"float")&&(v.support.inlineBlockNeedsLayout&&"inline"!==it(e.nodeName)?f.zoom=1:f.display="inline-block"));i.overflow&&(f.overflow="hidden",v.support.shrinkWrapBlocks||d.always((function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})));for(r in t)if(o=t[r],Lt.exec(o)){if(delete t[r],l=l||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(s=g.length){"hidden"in(a=v._data(e,"fxshow")||v._data(e,"fxshow",{}))&&(m=a.hidden),l&&(a.hidden=!m),m?v(e).show():d.done((function(){v(e).hide()})),d.done((function(){var t;for(t in v._removeData(e,"fxshow"),p)v.style(e,t,p[t])}));for(r=0;r-1?(r=(u=o.position()).top,s=u.left):(r=parseFloat(l)||0,s=parseFloat(c)||0),v.isFunction(t)&&(t=t.call(e,i,a)),null!=t.top&&(h.top=t.top-a.top+r),null!=t.left&&(h.left=t.left-a.left+s),"using"in t?t.using.call(e,h):o.css(h)}},v.fn.extend({position:function(){if(this[0]){var e,t,i={top:0,left:0},n=this[0];return"fixed"===v.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),v.nodeName(e[0],"html")||(i=e.offset()),i.top+=v.css(e[0],"borderTopWidth",!0),i.left+=v.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-v.css(n,"marginTop",!0),left:t.left-i.left-v.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||r.documentElement;e&&!v.nodeName(e,"html")&&"static"===v.css(e,"position");)e=e.offsetParent;return e||r.documentElement}))}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var i=/Y/.test(t);v.fn[e]=function(n){return v.access(this,(function(e,n,r){var s=$t(e);if(void 0===r)return s?t in s?s[t]:s.document.documentElement[n]:e[n];s?s.scrollTo(i?v(s).scrollLeft():r,i?r:v(s).scrollTop()):e[n]=r}),e,n,arguments.length,null)}})),v.each({Height:"height",Width:"width"},(function(e,t){v.each({padding:"inner"+e,content:t,"":"outer"+e},(function(i,n){v.fn[n]=function(n,r){var s=arguments.length&&(i||"boolean"!=typeof n),o=i||(!0===n||!0===r?"margin":"border");return v.access(this,(function(t,i,n){var r;return v.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===n?v.css(t,i,o):v.style(t,i,n,o)}),t,s?n:void 0,s,null)}}))})),e.jQuery=e.$=v,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],(function(){return v}))}(window),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(e){"use strict";var t=jQuery.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(),function(e){"use strict";e.fn.emulateTransitionEnd=function(t){var i=!1,n=this;e(this).one("bsTransitionEnd",(function(){i=!0}));return setTimeout((function(){i||e(n).trigger(e.support.transition.end)}),t),this},e((function(){e.support.transition=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return{end:t[i]};return!1}(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){return e(t.target).is(this)?t.handleObj.handler.apply(this,arguments):void 0}})}))}(jQuery),function(e){"use strict";var t='[data-dismiss="alert"]',i=function(i){e(i).on("click",t,this.close)};i.VERSION="3.3.5",i.TRANSITION_DURATION=150,i.prototype.close=function(t){function n(){o.detach().trigger("closed.bs.alert").remove()}var r=e(this),s=r.attr("data-target");s||(s=(s=r.attr("href"))&&s.replace(/.*(?=#[^\s]*$)/,""));var o=e(s);t&&t.preventDefault(),o.length||(o=r.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(i.TRANSITION_DURATION):n())};var n=e.fn.alert;e.fn.alert=function(t){return this.each((function(){var n=e(this),r=n.data("bs.alert");r||n.data("bs.alert",r=new i(this)),"string"==typeof t&&r[t].call(n)}))},e.fn.alert.Constructor=i,e.fn.alert.noConflict=function(){return e.fn.alert=n,this},e(document).on("click.bs.alert.data-api",t,i.prototype.close)}(jQuery),function(e){"use strict";function t(t){return this.each((function(){var n=e(this),r=n.data("bs.button"),s="object"==typeof t&&t;r||n.data("bs.button",r=new i(this,s)),"toggle"==t?r.toggle():t&&r.setState(t)}))}var i=function(t,n){this.$element=e(t),this.options=e.extend({},i.DEFAULTS,n),this.isLoading=!1};i.VERSION="3.3.5",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(t){var i="disabled",n=this.$element,r=n.is("input")?"val":"html",s=n.data();t+="Text",null==s.resetText&&n.data("resetText",n[r]()),setTimeout(e.proxy((function(){n[r](null==s[t]?this.options[t]:s[t]),"loadingText"==t?(this.isLoading=!0,n.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i))}),this),0)},i.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),e&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=t,e.fn.button.Constructor=i,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(i){var n=e(i.target);n.hasClass("btn")||(n=n.closest(".btn")),t.call(n,"toggle"),e(i.target).is('input[type="radio"]')||e(i.target).is('input[type="checkbox"]')||i.preventDefault()})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))}))}(jQuery),function(e){"use strict";function t(t){return this.each((function(){var n=e(this),r=n.data("bs.carousel"),s=e.extend({},i.DEFAULTS,n.data(),"object"==typeof t&&t),o="string"==typeof t?t:s.slide;r||n.data("bs.carousel",r=new i(this,s)),"number"==typeof t?r.to(t):o?r[o]():s.interval&&r.pause().cycle()}))}var i=function(t,i){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};i.VERSION="3.3.5",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},i.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},i.prototype.getItemForDirection=function(e,t){var i=this.getItemIndex(t);if(("prev"==e&&0===i||"next"==e&&i==this.$items.length-1)&&!this.options.wrap)return t;var n=(i+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(n)},i.prototype.to=function(e){var t=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid.bs.carousel",(function(){t.to(e)})):i==e?this.pause().cycle():this.slide(e>i?"next":"prev",this.$items.eq(e))},i.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(t,n){var r=this.$element.find(".item.active"),s=n||this.getItemForDirection(t,r),o=this.interval,a="next"==t?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],h=e.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,o&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var u=e(this.$indicators.children()[this.getItemIndex(s)]);u&&u.addClass("active")}var d=e.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return e.support.transition&&this.$element.hasClass("slide")?(s.addClass(t),s[0].offsetWidth,r.addClass(a),s.addClass(a),r.one("bsTransitionEnd",(function(){s.removeClass([t,a].join(" ")).addClass("active"),r.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(d)}),0)})).emulateTransitionEnd(i.TRANSITION_DURATION)):(r.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(d)),o&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=i,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this};var r=function(i){var n,r=e(this),s=e(r.attr("data-target")||(n=r.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var o=e.extend({},s.data(),r.data()),a=r.attr("data-slide-to");a&&(o.interval=!1),t.call(s,o),a&&s.data("bs.carousel").to(a),i.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r),e(window).on("load",(function(){e('[data-ride="carousel"]').each((function(){var i=e(this);t.call(i,i.data())}))}))}(jQuery),function(e){"use strict";function t(t){var i,n=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return e(n)}function i(t){return this.each((function(){var i=e(this),r=i.data("bs.collapse"),s=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t);!r&&s.toggle&&/show|hide/.test(t)&&(s.toggle=!1),r||i.data("bs.collapse",r=new n(this,s)),"string"==typeof t&&r[t]()}))}var n=function(t,i){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,i),this.$trigger=e('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.5",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(r&&r.length&&(t=r.data("bs.collapse"),t&&t.transitioning))){var s=e.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){r&&r.length&&(i.call(r,"hide"),t||r.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var l=e.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[o](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return e.support.transition?void this.$element[i](0).one("bsTransitionEnd",e.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION):r.call(this)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy((function(i,n){var r=e(n);this.addAriaAndCollapsedClass(t(r),r)}),this)).end()},n.prototype.addAriaAndCollapsedClass=function(e,t){var i=e.hasClass("in");e.attr("aria-expanded",i),t.toggleClass("collapsed",!i).attr("aria-expanded",i)};var r=e.fn.collapse;e.fn.collapse=i,e.fn.collapse.Constructor=n,e.fn.collapse.noConflict=function(){return e.fn.collapse=r,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(n){var r=e(this);r.attr("data-target")||n.preventDefault();var s=t(r),o=s.data("bs.collapse")?"toggle":r.data();i.call(s,o)}))}(jQuery),function(e){"use strict";function t(t){var i=t.attr("data-target");i||(i=(i=t.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n=i&&e(i);return n&&n.length?n:t.parent()}function i(i){i&&3===i.which||(e(n).remove(),e(r).each((function(){var n=e(this),r=t(n),s={relatedTarget:this};r.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&e.contains(r[0],i.target)||(r.trigger(i=e.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(n.attr("aria-expanded","false"),r.removeClass("open").trigger("hidden.bs.dropdown",s))))})))}var n=".dropdown-backdrop",r='[data-toggle="dropdown"]',s=function(t){e(t).on("click.bs.dropdown",this.toggle)};s.VERSION="3.3.5",s.prototype.toggle=function(n){var r=e(this);if(!r.is(".disabled, :disabled")){var s=t(r),o=s.hasClass("open");if(i(),!o){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",i);var a={relatedTarget:this};if(s.trigger(n=e.Event("show.bs.dropdown",a)),n.isDefaultPrevented())return;r.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger("shown.bs.dropdown",a)}return!1}},s.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var n=e(this);if(i.preventDefault(),i.stopPropagation(),!n.is(".disabled, :disabled")){var s=t(n),o=s.hasClass("open");if(!o&&27!=i.which||o&&27==i.which)return 27==i.which&&s.find(r).trigger("focus"),n.trigger("click");var a=s.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(i.target);38==i.which&&l>0&&l--,40==i.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},t.prototype.init=function(t,i,n){if(this.enabled=!0,this.type=t,this.$element=e(i),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var r=this.options.trigger.split(" "),s=r.length;s--;){var o=r[s];if("click"==o)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=o){var a="hover"==o?"mouseenter":"focusin",l="hover"==o?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return(t=e.extend({},this.getDefaults(),this.$element.data(),t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&e.each(this._options,(function(e,n){i[e]!=n&&(t[e]=n)})),t},t.prototype.enter=function(t){var i=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,i)),t instanceof e.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout((function(){"in"==i.hoverState&&i.show()}),i.options.delay.show)):i.show())},t.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},t.prototype.leave=function(t){var i=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,i)),t instanceof e.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout((function(){"out"==i.hoverState&&i.hide()}),i.options.delay.hide)):i.hide())},t.prototype.show=function(){var i=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(i);var n=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(i.isDefaultPrevented()||!n)return;var r=this,s=this.tip(),o=this.getUID(this.type);this.setContent(),s.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&s.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(a);c&&(a=a.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),u=s[0].offsetWidth,d=s[0].offsetHeight;if(c){var f=a,p=this.getPosition(this.$viewport);a="bottom"==a&&h.bottom+d>p.bottom?"top":"top"==a&&h.top-dp.width?"left":"left"==a&&h.left-uo.top+o.height&&(r.top=o.top+o.height-l)}else{var c=t.left-s,h=t.left+s+i;co.right&&(r.left=o.left+o.width-h)}return r},t.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},t.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},t.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var i=this;t&&((i=e(t.currentTarget).data("bs."+this.type))||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,i))),t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},t.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide((function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null}))};var i=e.fn.tooltip;e.fn.tooltip=function(i){return this.each((function(){var n=e(this),r=n.data("bs.tooltip"),s="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||n.data("bs.tooltip",r=new t(this,s)),"string"==typeof i&&r[i]())}))},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=i,this}}(jQuery),function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.3.5",t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),i=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=e.fn.popover;e.fn.popover=function(i){return this.each((function(){var n=e(this),r=n.data("bs.popover"),s="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||n.data("bs.popover",r=new t(this,s)),"string"==typeof i&&r[i]())}))},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=i,this}}(jQuery),function(e){"use strict";function t(i,n){this.$body=e(document.body),this.$scrollElement=e(e(i).is(document.body)?window:i),this.options=e.extend({},t.DEFAULTS,n),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each((function(){var n=e(this),r=n.data("bs.scrollspy"),s="object"==typeof i&&i;r||n.data("bs.scrollspy",r=new t(this,s)),"string"==typeof i&&r[i]()}))}t.VERSION="3.3.5",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,i="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(i="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var t=e(this),r=t.data("target")||t.attr("href"),s=/^#./.test(r)&&e(r);return s&&s.length&&s.is(":visible")&&[[s[i]().top+n,r]]||null})).sort((function(e,t){return e[0]-t[0]})).each((function(){t.offsets.push(this[0]),t.targets.push(this[1])}))},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),n=this.options.offset+i-this.$scrollElement.height(),r=this.offsets,s=this.targets,o=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),t>=n)return o!=(e=s[s.length-1])&&this.activate(e);if(o&&t=r[e]&&(void 0===r[e+1]||t .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),a?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),r&&r()}var o=n.find("> .active"),a=r&&e.support.transition&&(o.length&&o.hasClass("fade")||!!n.find("> .fade").length);o.length&&a?o.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),o.removeClass("in")};var n=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=i,e.fn.tab.noConflict=function(){return e.fn.tab=n,this};var r=function(i){i.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(jQuery),function(e){"use strict";function t(t){return this.each((function(){var n=e(this),r=n.data("bs.affix"),s="object"==typeof t&&t;r||n.data("bs.affix",r=new i(this,s)),"string"==typeof t&&r[t]()}))}var i=function(t,n){this.options=e.extend({},i.DEFAULTS,n),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.5",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(e,t,i,n){var r=this.$target.scrollTop(),s=this.$element.offset(),o=this.$target.height();if(null!=i&&"top"==this.affixed)return i>r&&"top";if("bottom"==this.affixed)return null!=i?!(r+this.unpin<=s.top)&&"bottom":!(e-n>=r+o)&&"bottom";var a=null==this.affixed,l=a?r:s.top;return null!=i&&i>=r?"top":null!=n&&l+(a?o:t)>=e-n&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},i.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),n=this.options.offset,r=n.top,s=n.bottom,o=Math.max(e(document).height(),e(document.body).height());"object"!=typeof n&&(s=r=n),"function"==typeof r&&(r=n.top(this.$element)),"function"==typeof s&&(s=n.bottom(this.$element));var a=this.getState(o,t,r,s);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=e.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:o-t-s})}};var n=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=i,e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",(function(){e('[data-spy="affix"]').each((function(){var i=e(this),n=i.data();n.offset=n.offset||{},null!=n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!=n.offsetTop&&(n.offset.top=n.offsetTop),t.call(i,n)}))}))}(jQuery),function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=e()}((function(){return function e(t,i,n){function r(o,a){if(!i[o]){if(!t[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[o]={exports:{}};t[o][0].call(h.exports,(function(e){return r(t[o][1][e]||e)}),h,h.exports,e,t,i,n)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o>2,a=(3&t)<<4|i>>4,l=1>6:64,c=2>4,i=(15&o)<<4|(a=s.indexOf(e.charAt(c++)))>>2,n=(3&a)<<6|(l=s.indexOf(e.charAt(c++))),d[h++]=t,64!==a&&(d[h++]=i),64!==l&&(d[h++]=n);return d}},{"./support":30,"./utils":32}],2:[function(e,t,i){"use strict";var n=e("./external"),r=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function a(e,t,i,n,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=i,this.compression=n,this.compressedContent=r}a.prototype={getContentWorker:function(){var e=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,i){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(i)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,i){"use strict";var n=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,i){"use strict";var n=e("./utils"),r=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,i,n){var s=r,o=0+i;e^=-1;for(var a=0;a>>8^s[255&(e^t[a])];return-1^e}(0|t,e,e.length):function(e,t,i,n){var s=r,o=0+i;e^=-1;for(var a=0;a>>8^s[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,i){"use strict";i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,t,i){"use strict";var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),s=e("./utils"),o=e("./stream/GenericWorker"),a=n?"uint8array":"array";function l(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}i.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},i.compressWorker=function(e){return new l("Deflate",e)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,i){"use strict";function n(e,t){var i,n="";for(i=0;i>>=8;return n}function r(e,t,i,r,o,h){var u,d,f=e.file,p=e.compression,g=h!==a.utf8encode,m=s.transformTo("string",h(f.name)),v=s.transformTo("string",a.utf8encode(f.name)),y=f.comment,b=s.transformTo("string",h(y)),w=s.transformTo("string",a.utf8encode(y)),x=v.length!==f.name.length,_=w.length!==y.length,E="",k="",T="",S=f.dir,C=f.date,N={crc32:0,compressedSize:0,uncompressedSize:0};t&&!i||(N.crc32=e.crc32,N.compressedSize=e.compressedSize,N.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),g||!x&&!_||(O|=2048);var A=0,I=0;S&&(A|=16),"UNIX"===o?(I=798,A|=function(e,t){var i=e;return e||(i=t?16893:33204),(65535&i)<<16}(f.unixPermissions,S)):(I=20,A|=function(e){return 63&(e||0)}(f.dosPermissions)),u=C.getUTCHours(),u<<=6,u|=C.getUTCMinutes(),u<<=5,u|=C.getUTCSeconds()/2,d=C.getUTCFullYear()-1980,d<<=4,d|=C.getUTCMonth()+1,d<<=5,d|=C.getUTCDate(),x&&(k=n(1,1)+n(l(m),4)+v,E+="up"+n(k.length,2)+k),_&&(T=n(1,1)+n(l(b),4)+w,E+="uc"+n(T.length,2)+T);var R="";return R+="\n\0",R+=n(O,2),R+=p.magic,R+=n(u,2),R+=n(d,2),R+=n(N.crc32,4),R+=n(N.compressedSize,4),R+=n(N.uncompressedSize,4),R+=n(m.length,2),R+=n(E.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+m+E,dirRecord:c.CENTRAL_FILE_HEADER+n(I,2)+R+n(b.length,2)+"\0\0\0\0"+n(A,4)+n(r,4)+m+E+b}}var s=e("../utils"),o=e("../stream/GenericWorker"),a=e("../utf8"),l=e("../crc32"),c=e("../signature");function h(e,t,i,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,o),h.prototype.push=function(e){var t=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(t+100*(i-n-1))/i:100}}))},h.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var i=r(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,i=r(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)i=(i<<8)+this.byteAt(t);return this.index+=e,i},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,i){"use strict";var n=e("./Uint8ArrayReader");function r(e){n.call(this,e)}e("../utils").inherits(r,n),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,i){"use strict";var n=e("./DataReader");function r(e){n.call(this,e)}e("../utils").inherits(r,n),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,i){"use strict";var n=e("./ArrayReader");function r(e){n.call(this,e)}e("../utils").inherits(r,n),r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,i){"use strict";var n=e("../utils"),r=e("../support"),s=e("./ArrayReader"),o=e("./StringReader"),a=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new a(e):r.uint8array?new l(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,i){"use strict";i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,i){"use strict";var n=e("./GenericWorker"),r=e("../utils");function s(e){n.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,i){"use strict";var n=e("./GenericWorker"),r=e("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,i){"use strict";var n=e("../utils"),r=e("./GenericWorker");function s(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(s,r),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,i){"use strict";var n=e("../utils"),r=e("./GenericWorker");function s(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(s,r),s.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,i){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var i=0;i "+e:e}},t.exports=n},{}],29:[function(e,t,i){"use strict";var n=e("../utils"),r=e("./ConvertWorker"),s=e("./GenericWorker"),o=e("../base64"),a=e("../support"),l=e("../external"),c=null;if(a.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function h(e,t,i){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=t,this._mimeType=i,n.checkSupport(o),this._worker=e.pipe(new r(o)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}h.prototype={accumulate:function(e){return function(e,t){return new l.Promise((function(i,r){var s=[],a=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",(function(e,i){s.push(e),t&&t(i)})).on("error",(function(e){s=[],r(e)})).on("end",(function(){try{var e=function(e,t,i){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),i);case"base64":return o.encode(t);default:return n.transformTo(e,t)}}(l,function(e,t){var i,n=0,r=null,s=0;for(i=0;i>>6:(i<65536?t[o++]=224|i>>>12:(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63),t[o++]=128|i>>>6&63),t[o++]=128|63&i);return t}(e)},i.utf8decode=function(e){return r.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,i,r,s,o=e.length,l=new Array(2*o);for(t=i=0;t>10&1023,l[i++]=56320|1023&r)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)}(e=n.transformTo(r.uint8array?"uint8array":"array",e))},n.inherits(c,o),c.prototype.processChunk=function(e){var t=n.transformTo(r.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=t;(t=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),t.set(s,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0||0===i?t:i+a[e[i]]>t?i:t}(t),l=t;o!==t.length&&(r.uint8array?(l=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(l=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:i.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=c,n.inherits(h,o),h.prototype.processChunk=function(e){this.push({data:i.utf8encode(e.data),meta:e.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,i){"use strict";var n=e("./support"),r=e("./base64"),s=e("./nodejsUtils"),o=e("set-immediate-shim"),a=e("./external");function l(e){return e}function c(e,t){for(var i=0;i>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(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(e){var t,i,n,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(i<65536?t[o++]=224|i>>>12:(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63),t[o++]=128|i>>>6&63),t[o++]=128|63&i);return t},i.buf2binstring=function(e){return l(e,e.length)},i.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,r=t.length;i>10&1023,c[n++]=56320|1023&r)}return l(c,n)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0||0===i?t:i+o[e[i]]>t?i:t}},{"./common":41}],43:[function(e,t,i){"use strict";t.exports=function(e,t,i,n){for(var r=65535&e|0,s=e>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,r){var s=n,o=r+i;e^=-1;for(var a=r;a>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,i){"use strict";var n,r=e("../utils/common"),s=e("./trees"),o=e("./adler32"),a=e("./crc32"),l=e("./messages"),c=-2,h=258,u=262,d=113;function f(e,t){return e.msg=l[t],t}function p(e){return(e<<1)-(4e.avail_out&&(i=e.avail_out),0!==i&&(r.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function v(e,t){s._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function b(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function w(e,t){var i,n,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,c=e.window,d=e.w_mask,f=e.prev,p=e.strstart+h,g=c[s+o-1],m=c[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(i=t)+o]===m&&c[i+o-1]===g&&c[i]===c[s]&&c[++i]===c[s+1]){s+=2,i++;do{}while(c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&sl&&0!=--r);return o<=e.lookahead?o:e.lookahead}function x(e){var t,i,n,s,l,c,h,d,f,p,g=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=g+(g-u)){for(r.arraySet(e.window,e.window,g,g,0),e.match_start-=g,e.strstart-=g,e.block_start-=g,t=i=e.hash_size;n=e.head[--t],e.head[t]=g<=n?n-g:0,--i;);for(t=i=g;n=e.prev[--t],e.prev[t]=g<=n?n-g:0,--i;);s+=g}if(0===e.strm.avail_in)break;if(c=e.strm,h=e.window,d=e.strstart+e.lookahead,p=void 0,(f=s)<(p=c.avail_in)&&(p=f),i=0===p?0:(c.avail_in-=p,r.arraySet(h,c.input,c.next_in,p,d),1===c.state.wrap?c.adler=o(c.adler,h,p,d):2===c.state.wrap&&(c.adler=a(c.adler,h,p,d)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=i,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=s._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-3,n=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(x(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,v(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(v(e,!1),e.strm.avail_out),1)})),new k(4,4,8,4,_),new k(4,5,16,8,_),new k(4,6,32,32,_),new k(4,4,16,16,E),new k(8,16,32,32,E),new k(8,16,128,128,E),new k(8,32,128,256,E),new k(32,128,258,1024,E),new k(32,258,258,4096,E)],i.deflateInit=function(e,t){return N(e,t,8,15,8,0)},i.deflateInit2=N,i.deflateReset=C,i.deflateResetKeep=S,i.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},i.deflate=function(e,t){var i,r,o,l;if(!e||!e.state||5>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&&(e.adler=a(e.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=d);else{var u=8+(r.w_bits-8<<4)<<8;u|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(u|=32),u+=31-u%31,r.status=d,b(r,u),0!==r.strstart&&(b(r,e.adler>>>16),b(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),m(e),o=r.pending,r.pending!==r.pending_buf_size));)y(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),m(e),o=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexo&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),m(e),o=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindexo&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&m(e),r.pending+2<=r.pending_buf_size&&(y(r,255&e.adler),y(r,e.adler>>8&255),e.adler=0,r.status=d)):r.status=d),0!==r.pending){if(m(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(i)&&4!==t)return f(e,-5);if(666===r.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&666!==r.status){var w=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(x(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var i,n,r,o,a=e.window;;){if(e.lookahead<=h){if(x(e),e.lookahead<=h&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=s._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(v(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(v(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(v(e,!1),0===e.strm.avail_out)?1:2}(r,t):n[r.level].func(r,t);if(3!==w&&4!==w||(r.status=666),1===w||3===w)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===w&&(1===t?s._tr_align(r):5!==t&&(s._tr_stored_block(r,0,0,!1),3===t&&(g(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),m(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(y(r,255&e.adler),y(r,e.adler>>8&255),y(r,e.adler>>16&255),y(r,e.adler>>24&255),y(r,255&e.total_in),y(r,e.total_in>>8&255),y(r,e.total_in>>16&255),y(r,e.total_in>>24&255)):(b(r,e.adler>>>16),b(r,65535&e.adler)),m(e),0=i.w_size&&(0===a&&(g(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new r.Buf8(i.w_size),r.arraySet(d,t,f-i.w_size,i.w_size,0),t=d,f=i.w_size),l=e.avail_in,h=e.next_in,u=e.input,e.avail_in=f,e.next_in=0,e.input=t,x(i);i.lookahead>=3;){for(n=i.strstart,s=i.lookahead-2;i.ins_h=(i.ins_h<>>=w=b>>>24,p-=w,0==(w=b>>>16&255))S[s++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=g[(65535&b)+(f&(1<>>=w,p-=w),p<15&&(f+=T[n++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=m[(65535&b)+(f&(1<>>=w,p-=w,(w=s-o)<_){if(h<(w=_-w)&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(k=d,(E=0)===u){if(E+=c-w,w>3,f&=(1<<(p-=x<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,u(e)):l}function f(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(n.arraySet(o.window,t,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r<(s=o.wsize-o.wnext)&&(s=r),n.arraySet(o.window,t,i-r,s,o.wnext),(r-=s)?(n.arraySet(o.window,t,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,i.check=s(i.check,L,2,0),v=m=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&m)){e.msg="unknown compression method",i.mode=30;break}if(v-=4,I=8+(15&(m>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<>8&1),512&i.flags&&(L[0]=255&m,L[1]=m>>>8&255,i.check=s(i.check,L,2,0)),v=m=0,i.mode=3;case 3:for(;v<32;){if(0===p)break e;p--,m+=h[d++]<>>8&255,L[2]=m>>>16&255,L[3]=m>>>24&255,i.check=s(i.check,L,4,0)),v=m=0,i.mode=4;case 4:for(;v<16;){if(0===p)break e;p--,m+=h[d++]<>8),512&i.flags&&(L[0]=255&m,L[1]=m>>>8&255,i.check=s(i.check,L,2,0)),v=m=0,i.mode=5;case 5:if(1024&i.flags){for(;v<16;){if(0===p)break e;p--,m+=h[d++]<>>8&255,i.check=s(i.check,L,2,0)),v=m=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(p<(_=i.length)&&(_=p),_&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,h,d,_,I)),512&i.flags&&(i.check=s(i.check,h,_,d)),p-=_,d+=_,i.length-=_),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===p)break e;for(_=0;I=h[d+_++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I)),I&&_>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;v<32;){if(0===p)break e;p--,m+=h[d++]<>>=7&v,v-=7&v,i.mode=27;break}for(;v<3;){if(0===p)break e;p--,m+=h[d++]<>>=1)){case 0:i.mode=14;break;case 1:if(y(i),i.mode=20,6!==t)break;m>>>=2,v-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}m>>>=2,v-=2;break;case 14:for(m>>>=7&v,v-=7&v;v<32;){if(0===p)break e;p--,m+=h[d++]<>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&m,v=m=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(_=i.length){if(p<_&&(_=p),g<_&&(_=g),0===_)break e;n.arraySet(u,h,d,_,f),p-=_,d+=_,g-=_,f+=_,i.length-=_;break}i.mode=12;break;case 17:for(;v<14;){if(0===p)break e;p--,m+=h[d++]<>>=5,v-=5,i.ndist=1+(31&m),m>>>=5,v-=5,i.ncode=4+(15&m),m>>>=4,v-=4,286>>=3,v-=3}for(;i.have<19;)i.lens[B[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,D={bits:i.lenbits},R=a(0,i.lens,0,19,i.lencode,0,i.work,D),i.lenbits=D.bits,R){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have>>16&255,C=65535&z,!((T=z>>>24)<=v);){if(0===p)break e;p--,m+=h[d++]<>>=T,v-=T,i.lens[i.have++]=C;else{if(16===C){for(j=T+2;v>>=T,v-=T,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],_=3+(3&m),m>>>=2,v-=2}else if(17===C){for(j=T+3;v>>=T)),m>>>=3,v-=3}else{for(j=T+7;v>>=T)),m>>>=7,v-=7}if(i.have+_>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;_--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,D={bits:i.lenbits},R=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,D),i.lenbits=D.bits,R){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,D={bits:i.distbits},R=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,D),i.distbits=D.bits,R){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=p&&258<=g){e.next_out=f,e.avail_out=g,e.next_in=d,e.avail_in=p,i.hold=m,i.bits=v,o(e,x),f=e.next_out,u=e.output,g=e.avail_out,d=e.next_in,h=e.input,p=e.avail_in,m=i.hold,v=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;S=(z=i.lencode[m&(1<>>16&255,C=65535&z,!((T=z>>>24)<=v);){if(0===p)break e;p--,m+=h[d++]<>N)])>>>16&255,C=65535&z,!(N+(T=z>>>24)<=v);){if(0===p)break e;p--,m+=h[d++]<>>=N,v-=N,i.back+=N}if(m>>>=T,v-=T,i.back+=T,i.length=C,0===S){i.mode=26;break}if(32&S){i.back=-1,i.mode=12;break}if(64&S){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&S,i.mode=22;case 22:if(i.extra){for(j=i.extra;v>>=i.extra,v-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;S=(z=i.distcode[m&(1<>>16&255,C=65535&z,!((T=z>>>24)<=v);){if(0===p)break e;p--,m+=h[d++]<>N)])>>>16&255,C=65535&z,!(N+(T=z>>>24)<=v);){if(0===p)break e;p--,m+=h[d++]<>>=N,v-=N,i.back+=N}if(m>>>=T,v-=T,i.back+=T,64&S){e.msg="invalid distance code",i.mode=30;break}i.offset=C,i.extra=15&S,i.mode=24;case 24:if(i.extra){for(j=i.extra;v>>=i.extra,v-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===g)break e;if(_=x-g,i.offset>_){if((_=i.offset-_)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}E=_>i.wnext?(_-=i.wnext,i.wsize-_):i.wnext-_,_>i.length&&(_=i.length),k=i.window}else k=u,E=f-i.offset,_=i.length;for(g<_&&(_=g),g-=_,i.length-=_;u[f++]=k[E++],--_;);0===i.length&&(i.mode=21);break;case 26:if(0===g)break e;u[f++]=i.length,g--,i.mode=21;break;case 27:if(i.wrap){for(;v<32;){if(0===p)break e;p--,m|=h[d++]<y?(w=B[P+u[k]],D[j+u[k]]):(w=96,0),f=1<>O)+(p-=f)]=b<<24|w<<16|x|0,0!==p;);for(f=1<>=1;if(0!==f?(R&=f-1,R+=f):R=0,k++,0==--z[E]){if(E===S)break;E=t[i+u[k]]}if(C>>7)]}function T(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<>>=1,i<<=1,0<--t;);return i>>>1}function O(e,t,i){var n,r,s=new Array(16),o=0;for(n=1;n<=l;n++)s[n]=o=o+i[n-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=N(s[a]++,a))}}function A(e){var t;for(t=0;t>1;1<=i;i--)D(e,s,i);for(r=c;i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=n,s[2*r]=s[2*i]+s[2*n],e.depth[r]=(e.depth[i]>=e.depth[n]?e.depth[i]:e.depth[n])+1,s[2*i+1]=s[2*n+1]=r,e.heap[1]=r++,D(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,n,r,s,o,a,c=t.dyn_tree,h=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,g=t.stat_desc.max_length,m=0;for(s=0;s<=l;s++)e.bl_count[s]=0;for(c[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)g<(s=c[2*c[2*(n=e.heap[i])+1]+1]+1)&&(s=g,m++),c[2*n+1]=s,h>=7;n>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t>>3,(o=e.static_len+3+7>>>3)<=r&&(r=o)):r=o=i+5,i+4<=r&&-1!==t?M(e,t,i,n):4===e.strategy||o===r?(S(e,2+(n?1:0),3),j(e,f,p)):(S(e,4+(n?1:0),3),function(e,t,i,n){var r;for(S(e,t-257,5),S(e,i-1,5),S(e,n-4,4),r=0;r>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(m[i]+s+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},i._tr_align=function(e){S(e,2,3),C(e,256,f),function(e){16===e.bi_valid?(T(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,i){"use strict";t.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(e,t,i){"use strict";t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("JSZip")):"function"==typeof define&&define.amd?define(["JSZip"],t):"object"==typeof exports?exports.ePub=t(require("JSZip")):e.ePub=t(e.JSZip)}(window,(function(e){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=30)}([function(e,t,i){"use strict";i.r(t),i.d(t,"requestAnimationFrame",(function(){return r})),i.d(t,"uuid",(function(){return o})),i.d(t,"documentHeight",(function(){return a})),i.d(t,"isElement",(function(){return l})),i.d(t,"isNumber",(function(){return c})),i.d(t,"isFloat",(function(){return h})),i.d(t,"prefixed",(function(){return u})),i.d(t,"defaults",(function(){return d})),i.d(t,"extend",(function(){return f})),i.d(t,"insert",(function(){return p})),i.d(t,"locationOf",(function(){return g})),i.d(t,"indexOfSorted",(function(){return m})),i.d(t,"bounds",(function(){return v})),i.d(t,"borders",(function(){return y})),i.d(t,"nodeBounds",(function(){return b})),i.d(t,"windowBounds",(function(){return w})),i.d(t,"indexOfNode",(function(){return x})),i.d(t,"indexOfTextNode",(function(){return _})),i.d(t,"indexOfElementNode",(function(){return E})),i.d(t,"isXml",(function(){return k})),i.d(t,"createBlob",(function(){return T})),i.d(t,"createBlobUrl",(function(){return S})),i.d(t,"revokeBlobUrl",(function(){return C})),i.d(t,"createBase64Url",(function(){return N})),i.d(t,"type",(function(){return O})),i.d(t,"parse",(function(){return A})),i.d(t,"qs",(function(){return I})),i.d(t,"qsa",(function(){return R})),i.d(t,"qsp",(function(){return D})),i.d(t,"sprint",(function(){return j})),i.d(t,"treeWalker",(function(){return z})),i.d(t,"walk",(function(){return L})),i.d(t,"blob2base64",(function(){return B})),i.d(t,"defer",(function(){return P})),i.d(t,"querySelectorByType",(function(){return M})),i.d(t,"findChildren",(function(){return F})),i.d(t,"parents",(function(){return q})),i.d(t,"filterChildren",(function(){return U})),i.d(t,"getParentByTagName",(function(){return W})),i.d(t,"RangeObject",(function(){return H}));var n=i(15);const r="undefined"!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),s="undefined"!=typeof URL?URL:"undefined"!=typeof window?window.URL||window.webkitURL||window.mozURL:void 0;function o(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:7&i|8).toString(16)}))}function a(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function l(e){return!(!e||1!=e.nodeType)}function c(e){return!isNaN(parseFloat(e))&&isFinite(e)}function h(e){let t=parseFloat(e);return!1!==c(e)&&("string"==typeof e&&e.indexOf(".")>-1||Math.floor(t)!==t)}function u(e){var t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],i=e.toLowerCase(),n=["Webkit","webkit","Moz","O","ms"].length;if("undefined"==typeof document||void 0!==document.body.style[i])return e;for(var r=0;rt?1:e=0?l:l+1:0===s?l:-1===s?g(e,t,i,l,a):g(e,t,i,o,l))}function m(e,t,i,n,r){var s,o=n||0,a=r||t.length,l=parseInt(o+(a-o)/2);return i||(i=function(e,t){return e>t?1:e-1}function T(e,t){return new Blob([e],{type:t})}function S(e,t){var i=T(e,t);return s.createObjectURL(i)}function C(e){return s.revokeObjectURL(e)}function N(e,t){if("string"==typeof e)return"data:"+t+";base64,"+btoa(e)}function O(e){return Object.prototype.toString.call(e).slice(8,-1)}function A(e,t,i){var r;return r="undefined"==typeof DOMParser||i?n.DOMParser:DOMParser,65279===e.charCodeAt(0)&&(e=e.slice(1)),(new r).parseFromString(e,t)}function I(e,t){var i;if(!e)throw new Error("No Element Provided");return void 0!==e.querySelector?e.querySelector(t):(i=e.getElementsByTagName(t)).length?i[0]:void 0}function R(e,t){return void 0!==e.querySelector?e.querySelectorAll(t):e.getElementsByTagName(t)}function D(e,t,i){var n,r;if(void 0!==e.querySelector){for(var s in t+="[",i)t+=s+"~='"+i[s]+"'";return t+="]",e.querySelector(t)}if(n=e.getElementsByTagName(t),r=Array.prototype.slice.call(n,0).filter((function(e){for(var t in i)if(e.getAttribute(t)===i[t])return!0;return!1})))return r[0]}function j(e,t){void 0!==(e.ownerDocument||e).createTreeWalker?z(e,t,NodeFilter.SHOW_TEXT):L(e,(function(e){e&&3===e.nodeType&&t(e)}))}function z(e,t,i){var n=document.createTreeWalker(e,i,null,!1);let r;for(;r=n.nextNode();)t(r)}function L(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(L(e,t))return!0;e=e.nextSibling}while(e)}function B(e){return new Promise((function(t,i){var n=new FileReader;n.readAsDataURL(e),n.onloadend=function(){t(n.result)}}))}function P(){this.resolve=null,this.reject=null,this.id=o(),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}),Object.freeze(this)}function M(e,t,i){var n;if(void 0!==e.querySelector&&(n=e.querySelector(`${t}[*|type="${i}"]`)),n&&0!==n.length)return n;n=R(e,t);for(var r=0;r1&&(t=n[1],i.terminal=this.parseTerminal(t)),""===r[0]&&r.shift(),i.steps=r.map(function(e){return this.parseStep(e)}.bind(this)),i}parseStep(e){var t,i,n,r,s;if((r=e.match(/\[(.*)\]/))&&r[1]&&(s=r[1]),i=parseInt(e),!isNaN(i))return i%2==0?(t="element",n=i/2-1):(t="text",n=(i-1)/2),{type:t,index:n,id:s||null}}parseTerminal(e){var t,i,r=e.match(/\[(.*)\]/);return r&&r[1]?(t=parseInt(e.split("[")[0]),i=r[1]):t=parseInt(e),Object(n.isNumber)(t)||(t=null),{offset:t,assertion:i}}getChapterComponent(e){return e.split("!")[0]}getPathComponent(e){var t=e.split("!");if(t[1]){return t[1].split(",")[0]}}getRange(e){var t=e.split(",");return 3===t.length&&[t[1],t[2]]}getCharecterOffsetComponent(e){return e.split(":")[1]||""}joinSteps(e){return e?e.map((function(e){var t="";return"element"===e.type&&(t+=2*(e.index+1)),"text"===e.type&&(t+=1+2*e.index),e.id&&(t+="["+e.id+"]"),t})).join("/"):""}segmentString(e){var t="/";return t+=this.joinSteps(e.steps),e.terminal&&null!=e.terminal.offset&&(t+=":"+e.terminal.offset),e.terminal&&null!=e.terminal.assertion&&(t+="["+e.terminal.assertion+"]"),t}toString(){var e="epubcfi(";return e+=this.segmentString(this.base),e+="!",e+=this.segmentString(this.path),this.range&&this.start&&(e+=",",e+=this.segmentString(this.start)),this.range&&this.end&&(e+=",",e+=this.segmentString(this.end)),e+=")"}compare(e,t){var i,n,s,o;if("string"==typeof e&&(e=new r(e)),"string"==typeof t&&(t=new r(t)),e.spinePos>t.spinePos)return 1;if(e.spinePosn[a].index)return 1;if(i[a].indexo.offset?1:s.offset=0&&(r.terminal.offset=t,"text"!=r.steps[r.steps.length-1].type&&r.steps.push({type:"text",index:0})),r}equalStep(e,t){return!(!e||!t)&&(e.index===t.index&&e.id===t.id&&e.type===t.type)}fromRange(e,t,i){var n={range:!1,base:{},path:{},start:null,end:null},r=e.startContainer,s=e.endContainer,o=e.startOffset,a=e.endOffset,l=!1;if(i&&(l=null!=r.ownerDocument.querySelector("."+i)),"string"==typeof t?(n.base=this.parseComponent(t),n.spinePos=n.base.steps[1].index):"object"==typeof t&&(n.base=t),e.collapsed)l&&(o=this.patchOffset(r,o,i)),n.path=this.pathTo(r,o,i);else{n.range=!0,l&&(o=this.patchOffset(r,o,i)),n.start=this.pathTo(r,o,i),l&&(a=this.patchOffset(s,a,i)),n.end=this.pathTo(s,a,i),n.path={steps:[],terminal:null};var c,h=n.start.steps.length;for(c=0;c0&&3===r&&3===s?o[n]=a:t===r&&(a+=1,o[n]=a),s=r;return o}position(e){var t,i;return 1===e.nodeType?((t=e.parentNode.children)||(t=Object(n.findChildren)(e.parentNode)),i=Array.prototype.indexOf.call(t,e)):i=(t=this.textNodes(e.parentNode)).indexOf(e),i}filteredPosition(e,t){var i,n;return 1===e.nodeType?(i=e.parentNode.children,n=this.normalizedMap(i,1,t)):(i=e.parentNode.childNodes,e.parentNode.classList.contains(t)&&(i=(e=e.parentNode).parentNode.childNodes),n=this.normalizedMap(i,3,t)),n[Array.prototype.indexOf.call(i,e)]}stepsToXpath(e){var t=[".","*"];return e.forEach((function(e){var i=e.index+1;e.id?t.push("*[position()="+i+" and @id='"+e.id+"']"):"text"===e.type?t.push("text()["+i+"]"):t.push("*["+i+"]")})),t.join("/")}stepsToQuerySelector(e){var t=["html"];return e.forEach((function(e){var i=e.index+1;e.id?t.push("#"+e.id):"text"===e.type||t.push("*:nth-child("+i+")")})),t.join(">")}textNodes(e,t){return Array.prototype.slice.call(e.childNodes).filter((function(e){return 3===e.nodeType||!(!t||!e.classList.contains(t))}))}walkToNode(e,t,i){var r,s,o=t||document,a=o.documentElement,l=e.length;for(s=0;s(s=(r=a[e]).textContent.length))){o=1===r.nodeType?r.childNodes[0]:r;break}t-=s}}return{container:o,offset:t}}toRange(e,t){var i,r,s,o,a,l,c,h,u=e||document,d=!!t&&null!=u.querySelector("."+t);if(i=void 0!==u.createRange?u.createRange():new n.RangeObject,this.range?(r=this.start,l=this.path.steps.concat(r.steps),o=this.findNode(l,u,d?t:null),s=this.end,c=this.path.steps.concat(s.steps),a=this.findNode(c,u,d?t:null)):(r=this.path,l=this.path.steps,o=this.findNode(this.path.steps,u,d?t:null)),!o)return console.log("No startContainer found for",this.toString()),null;try{null!=r.terminal.offset?i.setStart(o,r.terminal.offset):i.setStart(o,0)}catch(e){h=this.fixMiss(l,r.terminal.offset,u,d?t:null),i.setStart(h.container,h.offset)}if(a)try{null!=s.terminal.offset?i.setEnd(a,s.terminal.offset):i.setEnd(a,0)}catch(e){h=this.fixMiss(c,this.end.terminal.offset,u,d?t:null),i.setEnd(h.container,h.offset)}return i}isCfiString(e){return"string"==typeof e&&0===e.indexOf("epubcfi(")&&")"===e[e.length-1]}generateChapterComponent(e,t,i){var n="/"+2*(e+1)+"/";return n+=2*(parseInt(t)+1),i&&(n+="["+i+"]"),n}collapse(e){this.range&&(this.range=!1,e?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}}t.a=r},function(e,t,i){"use strict";var n,r,s,o,a,l,c,h=i(31),u=i(45),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var i,r;return u(t),r=this,n.call(this,e,i=function(){s.call(r,e,i),d.call(t,this,arguments)}),i.__eeOnceListener__=t,this},a={on:n=function(e,t){var i;return u(t),v.call(this,"__ee__")?i=this.__ee__:(i=y.value=p(null),g(this,"__ee__",y),y.value=null),i[e]?"object"==typeof i[e]?i[e].push(t):i[e]=[i[e],t]:i[e]=t,this},once:r,off:s=function(e,t){var i,n,r,s;if(u(t),!v.call(this,"__ee__"))return this;if(!(i=this.__ee__)[e])return this;if("object"==typeof(n=i[e]))for(s=0;r=n[s];++s)r!==t&&r.__eeOnceListener__!==t||(2===n.length?i[e]=n[s?0:1]:n.splice(s,1));else n!==t&&n.__eeOnceListener__!==t||delete i[e];return this},emit:o=function(e){var t,i,n,r,s;if(v.call(this,"__ee__")&&(r=this.__ee__[e]))if("object"==typeof r){for(i=arguments.length,s=new Array(i-1),t=1;t-1&&(e=new URL(e).pathname),t=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=t.dir+"/",this.filename=t.base,this.extension=t.ext.slice(1)}parse(e){return r.a.parse(e)}isAbsolute(e){return r.a.isAbsolute(e||this.path)}isDirectory(e){return"/"===e.charAt(e.length-1)}resolve(e){return r.a.resolve(this.directory,e)}relative(e){return e&&e.indexOf("://")>-1?e:r.a.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}}},function(e,t,i){"use strict";var n=i(4),r=i(7),s=i.n(r);t.a=class{constructor(e,t){var i=e.indexOf("://")>-1,r=e;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=t,!i&&!1!==t&&"string"!=typeof t&&window&&window.location&&(this.base=window.location.href),i||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,r=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch(e){this.Url=void 0,this.base&&(r=new n.a(this.base).resolve(r))}this.Path=new n.a(r),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var t;return e.indexOf("://")>-1?e:(t=s.a.resolve(this.directory,e),this.origin+t)}relative(e){return s.a.relative(e,this.directory)}toString(){return this.href}}},function(e,t,i){"use strict";t.a=class{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e2){for(var a=n.length-1,l=a;l>=0&&47!==n.charCodeAt(l);--l);if(l!==a){n=-1===l?"":n.slice(0,l),r=o,s=0;continue}}else if(2===n.length||1===n.length){n="",r=o,s=0;continue}t&&(n.length>0?n+="/..":n="..")}else n.length>0?n+="/"+e.slice(r+1,o):n=e.slice(r+1,o);r=o,s=0}else 46===i&&-1!==s?++s:s=-1}return n}var o={resolve:function(){for(var e,t="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=n.cwd()),a=e),r(a),0!==a.length&&(t=a+"/"+t,i=47===a.charCodeAt(0))}return t=s(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=s(e,!t)).length||t||(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var i=1;ic){if(47===t.charCodeAt(a+u))return t.slice(a+u+1);if(0===u)return t.slice(a+u)}else s>c&&(47===e.charCodeAt(i+u)?h=u:0===u&&(h=0));break}var d=e.charCodeAt(i+u);if(d!==t.charCodeAt(a+u))break;47===d&&(h=u)}var f="";for(u=i+h+1;u<=n;++u)u!==n&&47!==e.charCodeAt(u)||(0===f.length?f+="..":f+="/..");return f.length>0?f+t.slice(a+h):(a+=h,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),i=47===t,n=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!s){n=o;break}}else s=!1;return-1===n?i?"/":".":i&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var i,n=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,l=-1;for(i=e.length-1;i>=0;--i){var c=e.charCodeAt(i);if(47===c){if(!o){n=i+1;break}}else-1===l&&(o=!1,l=i+1),a>=0&&(c===t.charCodeAt(a)?-1==--a&&(s=i):(a=-1,s=l))}return n===s?s=l:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname:function(e){r(e);for(var t=-1,i=0,n=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===n&&(s=!1,n=a+1),46===l?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){i=a+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===i+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof e);return function(e,t){var i=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return i?i===t.root?i+n:i+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var i,n=e.charCodeAt(0),s=47===n;s?(t.root="/",i=1):i=0;for(var o=-1,a=0,l=-1,c=!0,h=e.length-1,u=0;h>=i;--h)if(47!==(n=e.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===n?-1===o?o=h:1!==u&&(u=1):-1!==o&&(u=-1);else if(!c){a=h+1;break}return-1===o||-1===l||0===u||1===u&&o===l-1&&o===a+1?-1!==l&&(t.base=t.name=0===a&&s?e.slice(1,l):e.slice(a,l)):(0===a&&s?(t.name=e.slice(1,o),t.base=e.slice(1,l)):(t.name=e.slice(a,o),t.base=e.slice(a,l)),t.ext=e.slice(o,l)),a>0?t.dir=e.slice(0,a-1):s&&(t.dir="/"),t},sep:"/",delimiter:":",posix:null};e.exports=o},function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return o})),i.d(t,"d",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"e",(function(){return c}));var n=i(0),r=i(5);i(4);function s(e,t){var i,r,s=t.url,o=s.indexOf("://")>-1;e&&(r=Object(n.qs)(e,"head"),(i=Object(n.qs)(r,"base"))||(i=e.createElement("base"),r.insertBefore(i,r.firstChild)),!o&&window&&window.location&&(s=window.location.origin+s),i.setAttribute("href",s))}function o(e,t){var i,r,s=t.canonical;e&&(i=Object(n.qs)(e,"head"),(r=Object(n.qs)(i,"link[rel='canonical']"))?r.setAttribute("href",s):((r=e.createElement("link")).setAttribute("rel","canonical"),r.setAttribute("href",s),i.appendChild(r)))}function a(e,t){var i,r,s=t.idref;e&&(i=Object(n.qs)(e,"head"),(r=Object(n.qs)(i,"link[property='dc.identifier']"))?r.setAttribute("content",s):((r=e.createElement("meta")).setAttribute("name","dc.identifier"),r.setAttribute("content",s),i.appendChild(r)))}function l(e,t){var i=e.querySelectorAll("a[href]");if(i.length)for(var s=Object(n.qs)(e.ownerDocument,"base"),o=s?s.getAttribute("href"):void 0,a=function(e){var i=e.getAttribute("href");if(0!==i.indexOf("mailto:"))if(i.indexOf("://")>-1)e.setAttribute("target","_blank");else{var n;try{n=new r.a(i,o)}catch(e){}e.onclick=function(){return n&&n.hash?t(n.Path.path+n.hash):t(n?n.Path.path:i),!1}}}.bind(this),l=0;l{this._q.length?this.dequeue().then(function(){this.run()}.bind(this)):(this.defered.resolve(),this.running=void 0)}),1==this.paused&&(this.paused=!1),this.defered.promise}flush(){return this.running?this.running:this._q.length?(this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running):void 0}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}}},function(e,t,i){"use strict";var n=i(3),r=i.n(n),s=i(0);function o(){var e="reverse",t=function(){var e=document.createElement("div");e.dir="rtl",e.style.position="fixed",e.style.width="1px",e.style.height="1px",e.style.top="0px",e.style.left="0px",e.style.overflow="hidden";var t=document.createElement("div");t.style.width="2px";var i=document.createElement("span");i.style.width="1px",i.style.display="inline-block";var n=document.createElement("span");return n.style.width="1px",n.style.display="inline-block",t.appendChild(i),t.appendChild(n),e.appendChild(t),e}();return document.body.appendChild(t),t.scrollLeft>0?e="default":"undefined"!=typeof Element&&Element.prototype.scrollIntoView?(t.children[0].children[1].scrollIntoView(),t.scrollLeft<0&&(e="negative")):(t.scrollLeft=1,0===t.scrollLeft&&(e="negative")),document.body.removeChild(t),e}var a=i(11),l=i(9),c=i(28),h=i.n(c);var u=class{constructor(e){this.settings=e||{},this.id="epubjs-container-"+Object(s.uuid)(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let t=e.height,i=e.width,n=e.overflow||!1,r=e.axis||"vertical",o=e.direction;Object(s.extend)(this.settings,e),e.height&&Object(s.isNumber)(e.height)&&(t=e.height+"px"),e.width&&Object(s.isNumber)(e.width)&&(i=e.width+"px");let a=document.createElement("div");return a.id=this.id,a.classList.add("epub-container"),a.style.wordSpacing="0",a.style.lineHeight="0",a.style.verticalAlign="top",a.style.position="relative","horizontal"===r&&(a.style.display="flex",a.style.flexDirection="row",a.style.flexWrap="nowrap"),i&&(a.style.width=i),t&&(a.style.height=t),n&&("scroll"===n&&"vertical"===r?(a.style["overflow-y"]=n,a.style["overflow-x"]="hidden"):"scroll"===n&&"horizontal"===r?(a.style["overflow-y"]="hidden",a.style["overflow-x"]=n):a.style.overflow=n),o&&(a.dir=o,a.style.direction=o),o&&this.settings.fullsize&&(document.body.style.direction=o),a}wrap(e){var t=document.createElement("div");return t.style.visibility="hidden",t.style.overflow="hidden",t.style.width="0",t.style.height="0",t.appendChild(e),t}getElement(e){var t;if(Object(s.isElement)(e)?t=e:"string"==typeof e&&(t=document.getElementById(e)),!t)throw new Error("Not an Element");return t}attachTo(e){var t,i=this.getElement(e);if(i)return t=this.settings.hidden?this.wrapper:this.container,i.appendChild(t),this.element=i,i}getContainer(){return this.container}onResize(e){Object(s.isNumber)(this.settings.width)&&Object(s.isNumber)(this.settings.height)||(this.resizeFunc=h()(e,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(e,t){var i;let n=e||this.settings.width,r=t||this.settings.height;null===e?(i=this.element.getBoundingClientRect()).width&&(e=Math.floor(i.width),this.container.style.width=e+"px"):Object(s.isNumber)(e)?this.container.style.width=e+"px":this.container.style.width=e,null===t?(i=i||this.element.getBoundingClientRect()).height&&(t=i.height,this.container.style.height=t+"px"):Object(s.isNumber)(t)?this.container.style.height=t+"px":this.container.style.height=t,Object(s.isNumber)(e)||(e=this.container.clientWidth),Object(s.isNumber)(t)||(t=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};let o=Object(s.windowBounds)(),a=window.getComputedStyle(document.body),l=parseFloat(a["padding-left"])||0,c=parseFloat(a["padding-right"])||0,h=parseFloat(a["padding-top"])||0,u=parseFloat(a["padding-bottom"])||0;return n||(e=o.width-l-c),(this.settings.fullsize&&!r||!r)&&(t=o.height-h-u),{width:e-this.containerPadding.left-this.containerPadding.right,height:t-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return"visible"!==this.container.style.overflow&&(e=this.container&&this.container.getBoundingClientRect()),e&&e.width&&e.height?e:Object(s.windowBounds)()}getSheet(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet}addStyleRules(e,t){var i="#"+this.id+" ",n="";this.sheet||(this.sheet=this.getSheet()),t.forEach((function(e){for(var t in e)e.hasOwnProperty(t)&&(n+=t+":"+e[t]+";")})),this.sheet.insertRule(i+e+" {"+n+"}",0)}axis(e){"horizontal"===e?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&("scroll"===e&&"vertical"===this.settings.axis?(this.container.style["overflow-y"]=e,this.container.style["overflow-x"]="hidden"):"scroll"===e&&"horizontal"===this.settings.axis?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=e):this.container.style.overflow=e),this.settings.overflow=e}destroy(){this.element&&(this.settings.hidden?this.wrapper:this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))}};var d=class{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,t){return this._views.splice(t,0,e),this.container&&(t-1&&this._views.splice(t,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e,t=this.length;if(this.length){for(var i=0;i1){if(e||0===t.index)return;if(n=t.next(),n&&!n.properties.includes("page-spread-left"))return i.call(this,n)}}display(e,t){var i=new s.defer,n=i.promise;(t===e.href||Object(s.isNumber)(t))&&(t=void 0);var r=this.views.find(e);if(r&&e&&"pre-paginated"!==this.layout.name){let e=r.offset();if("ltr"===this.settings.direction)this.scrollTo(e.left,e.top,!0);else{let t=r.width();this.scrollTo(e.left+t,e.top,!0)}if(t){let e=r.locationOf(t),i=r.width();this.moveTo(e,i)}return i.resolve(),n}this.clear();let o=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&e.properties.includes("page-spread-right")&&(o=!0),this.add(e,o).then(function(e){if(t){let i=e.locationOf(t),n=e.width();this.moveTo(i,n)}}.bind(this),e=>{i.reject(e)}).then(function(){return this.handleNextPrePaginated(o,e,this.add)}.bind(this)).then(function(){this.views.show(),i.resolve()}.bind(this)),n}afterDisplayed(e){this.emit(f.c.MANAGERS.ADDED,e)}afterResized(e){this.emit(f.c.MANAGERS.RESIZE,e.section)}moveTo(e,t){var i=0,n=0;this.isPaginated?((i=Math.floor(e.left/this.layout.delta)*this.layout.delta)+this.layout.delta>this.container.scrollWidth&&(i=this.container.scrollWidth-this.layout.delta),(n=Math.floor(e.top/this.layout.delta)*this.layout.delta)+this.layout.delta>this.container.scrollHeight&&(n=this.container.scrollHeight-this.layout.delta)):n=e.top,"rtl"===this.settings.direction&&(i+=this.layout.delta,i-=t),this.scrollTo(i,n,!0)}add(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(f.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),i.on(f.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),i.display(this.request)}append(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(f.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),i.on(f.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),i.display(this.request)}prepend(e,t){var i=this.createView(e,t);return i.on(f.c.VIEWS.RESIZED,e=>{this.counter(e)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(f.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),i.on(f.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),i.display(this.request)}counter(e){"vertical"===this.settings.axis?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e;let t=this.settings.direction;if(this.views.length){if(!this.isPaginated||"horizontal"!==this.settings.axis||t&&"ltr"!==t)if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===t)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?this.container.scrollLeft>0?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next():this.container.scrollLeft+-1*this.layout.delta>-1*this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next();else if(this.isPaginated&&"vertical"===this.settings.axis){this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeighte).then(function(){this.isPaginated||"horizontal"!==this.settings.axis||"rtl"!==this.settings.direction||"default"!==this.settings.rtlScrollType||this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}.bind(this))}}}prev(){var e;let t=this.settings.direction;if(this.views.length){if(!this.isPaginated||"horizontal"!==this.settings.axis||t&&"ltr"!==t)if(this.isPaginated&&"horizontal"===this.settings.axis&&"rtl"===t)this.scrollLeft=this.container.scrollLeft,"default"===this.settings.rtlScrollType?this.container.scrollLeft+this.container.offsetWidth0?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()}else e=this.views.first().section.prev();else this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft>0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev();if(e){this.clear(),this.updateLayout();let t=!1;return"pre-paginated"===this.layout.name&&2===this.layout.divisor&&"object"!=typeof e.prev()&&(t=!0),this.prepend(e,t).then(function(){var t;if("pre-paginated"===this.layout.name&&this.layout.divisor>1&&(t=e.prev()))return this.prepend(t)}.bind(this),e=>e).then(function(){this.isPaginated&&"horizontal"===this.settings.axis&&("rtl"===this.settings.direction?"default"===this.settings.rtlScrollType?this.scrollTo(0,0,!0):this.scrollTo(-1*this.container.scrollWidth+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}.bind(this))}}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&"horizontal"===this.settings.axis?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=t.height{let o,a,l,c,{index:h,href:u}=e.section,d=e.position(),f=e.width(),p=e.height();r?(o=s+t.top-d.top+0,a=o+i-0,c=this.layout.count(p,i).pages,l=i):(o=s+t.left-d.left+0,a=o+n-0,c=this.layout.count(f,n).pages,l=n);let g=Math.ceil(o/l),m=[],v=Math.ceil(a/l);if("rtl"===this.settings.direction&&!r){let e=g;g=c-v,v=c-e}m=[];for(var y=g;y<=v;y++){let e=y+1;m.push(e)}return{index:h,href:u,pages:m,totalPages:c,mapping:this.mapping.page(e.contents,e.section.cfiBase,o,a)}})}paginatedLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=0,n=0;return this.settings.fullsize&&(i=window.scrollX),e.map(e=>{let r,s,o,a,{index:l,href:c}=e.section,h=e.position(),u=e.width();"rtl"===this.settings.direction?(r=t.right-i,a=Math.min(Math.abs(r-h.left),this.layout.width)-n,o=h.width-(h.right-r)-n,s=o-a):(r=t.left+i,a=Math.min(h.right-r,this.layout.width)-n,s=r-h.left+n,o=s+a),n+=a;let d=this.mapping.page(e.contents,e.section.cfiBase,s,o),f=this.layout.count(u).pages,p=Math.floor(s/this.layout.pageWidth),g=[],m=Math.floor(o/this.layout.pageWidth);if(p<0&&(p=0,m+=1),"rtl"===this.settings.direction){let e=p;p=f-m,m=f-e}for(var v=p+1;v<=m;v++){let e=v;g.push(e)}return{index:l,href:c,pages:g,totalPages:f,mapping:d}})}isVisible(e,t,i,n){var r=e.position(),s=n||this.bounds();return"horizontal"===this.settings.axis&&r.right>s.left-t&&r.lefts.top-t&&r.top0&&"pre-paginated"===this.layout.name&&this.display(this.views.first().section)}updateLayout(){this.stage&&(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new a.a(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach((function(t){t&&t.setLayout(e)}))}updateWritingMode(e){this.writingMode=e}updateAxis(e,t){(t||e!==this.settings.axis)&&(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&(this.mapping=new a.a(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&("vertical"===e?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,t="auto"){let i="paginated"===e||"auto"===e;this.isPaginated=i,"scrolled-doc"===e||"scrolled-continuous"===e||"scrolled"===e?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=e,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=i?"hidden":t,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views?(this.views.forEach((function(t){const i=t&&t.contents;i&&e.push(i)})),e):e}direction(e="ltr"){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}}r()(p.prototype);t.a=p},function(e,t,i){"use strict";var n=i(2),r=i(0);t.a=class{constructor(e,t,i,n=!1){this.layout=e,this.horizontal="horizontal"===i,this.direction=t||"ltr",this._dev=n}section(e){var t=this.findRanges(e);return this.rangeListToCfiList(e.section.cfiBase,t)}page(e,t,i,r){var s,o=!(!e||!e.document)&&e.document.body;if(o){if(s=this.rangePairToCfiPair(t,{start:this.findStart(o,i,r),end:this.findEnd(o,i,r)}),!0===this._dev){let t=e.document,i=new n.a(s.start).toRange(t),r=new n.a(s.end).toRange(t),o=t.defaultView.getSelection(),a=t.createRange();o.removeAllRanges(),a.setStart(i.startContainer,i.startOffset),a.setEnd(r.endContainer,r.endOffset),o.addRange(a)}return s}}walk(e,t){if(!e||e.nodeType!==Node.TEXT_NODE){var i=function(e){return e.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},n=i;n.acceptNode=i;for(var r,s,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,n,!1);(r=o.nextNode())&&!(s=t(r)););return s}}findRanges(e){for(var t,i,n=[],r=e.contents.scrollWidth(),s=Math.ceil(r/this.layout.spreadWidth)*this.layout.divisor,o=this.layout.columnWidth,a=this.layout.gap,l=0;l{var n,s,l,c,h;if(h=Object(r.nodeBounds)(e),this.horizontal&&"ltr"===this.direction){if(n=this.horizontal?h.left:h.top,s=this.horizontal?h.right:h.bottom,n>=t&&n<=i)return e;if(s>t)return e;a=e,o.push(e)}else if(this.horizontal&&"rtl"===this.direction){if(n=h.left,(s=h.right)<=i&&s>=t)return e;if(n=t&&l<=i)return e;if(c>t)return e;a=e,o.push(e)}}))return this.findTextStartRange(s,t,i);return this.findTextStartRange(a,t,i)}findEnd(e,t,i){for(var n,s,o=[e],a=e;o.length;)if(n=o.shift(),s=this.walk(n,e=>{var n,s,l,c,h;if(h=Object(r.nodeBounds)(e),this.horizontal&&"ltr"===this.direction){if(n=Math.round(h.left),s=Math.round(h.right),n>i&&a)return a;if(s>i)return e;a=e,o.push(e)}else if(this.horizontal&&"rtl"===this.direction){if(n=Math.round(this.horizontal?h.left:h.top),(s=Math.round(this.horizontal?h.right:h.bottom))i&&a)return a;if(c>i)return e;a=e,o.push(e)}}))return this.findTextEndRange(s,t,i);return this.findTextEndRange(a,t,i)}findTextStartRange(e,t,i){for(var n,r,s=this.splitTextNodeIntoRanges(e),o=0;o=t)return n}else if(this.horizontal&&"rtl"===this.direction){if(r.right<=i)return n}else if(r.top>=t)return n;return s[0]}findTextEndRange(e,t,i){for(var n,r,s,o,a,l,c,h=this.splitTextNodeIntoRanges(e),u=0;ui&&n)return n;if(a>i)return r}else if(this.horizontal&&"rtl"===this.direction){if(o=s.left,(a=s.right)i&&n)return n;if(c>i)return r}n=r}return h[h.length-1]}splitTextNodeIntoRanges(e,t){var i,n=[],r=(e.textContent||"").trim(),s=e.ownerDocument,o=t||" ",a=r.indexOf(o);if(-1===a||e.nodeType!=Node.TEXT_NODE)return(i=s.createRange()).selectNodeContents(e),[i];for((i=s.createRange()).setStart(e,0),i.setEnd(e,a),n.push(i),i=!1;-1!=a;)(a=r.indexOf(o,a+1))>0&&(i&&(i.setEnd(e,a),n.push(i)),(i=s.createRange()).setStart(e,a+1));return i&&(i.setEnd(e,r.length),n.push(i)),n}rangePairToCfiPair(e,t){var i=t.start,r=t.end;return i.collapse(!0),r.collapse(!1),{start:new n.a(i,e).toString(),end:new n.a(r,e).toString()}}rangeListToCfiList(e,t){for(var i,n=[],r=0;r{"visible"===document.visibilityState&&!1===this.active?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",e.style.transitionDuration="0.001ms",e.style.transitionTimingFunction="linear",e.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,t=function(e){e.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this),i=0;i{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(e=>{this.resizeCheck()});this.observer.observe(this.document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})}imageLoadListeners(){for(var e,t=this.document.querySelectorAll("img"),i=0;i0?(t.setStart(e,r.startOffset-2),t.setEnd(e,r.startOffset),i=t.getBoundingClientRect()):i=e.parentNode.getBoundingClientRect()}catch(e){console.error(e,e.stack)}}else i=r.getBoundingClientRect()}}else if("string"==typeof e&&e.indexOf("#")>-1){let t=e.substring(e.indexOf("#")+1),n=this.document.getElementById(t);if(n)if(d){let e=new Range;e.selectNode(n),i=e.getBoundingClientRect()}else i=n.getBoundingClientRect()}return i&&(n.left=i.left,n.top=i.top),n}addStylesheet(e){return new Promise(function(t,i){var n,r=!1;this.document?(n=this.document.querySelector("link[href='"+e+"']"))?t(!0):((n=this.document.createElement("link")).type="text/css",n.rel="stylesheet",n.href=e,n.onload=n.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout(()=>{t(!0)},1))},this.document.head.appendChild(n)):t(!1)}.bind(this))}_getStylesheetNode(e){var t;return e="epubjs-inserted-css-"+(e||""),!!this.document&&((t=this.document.getElementById(e))||((t=this.document.createElement("style")).id=e,this.document.head.appendChild(t)),t)}addStylesheetCss(e,t){return!(!this.document||!e)&&(this._getStylesheetNode(t).innerHTML=e,!0)}addStylesheetRules(e,t){var i;if(this.document&&e&&0!==e.length)if(i=this._getStylesheetNode(t).sheet,"[object Array]"===Object.prototype.toString.call(e))for(var n=0,r=e.length;n{const n=e[t];if(Array.isArray(n))n.forEach(e=>{const n=Object.keys(e).map(t=>`${t}:${e[t]}`).join(";");i.insertRule(`${t}{${n}}`,i.cssRules.length)});else{const e=Object.keys(n).map(e=>`${e}:${n[e]}`).join(";");i.insertRule(`${t}{${e}}`,i.cssRules.length)}})}}addScript(e){return new Promise(function(t,i){var n,r=!1;this.document?((n=this.document.createElement("script")).type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){r||this.readyState&&"complete"!=this.readyState||(r=!0,setTimeout((function(){t(!0)}),1))},this.document.head.appendChild(n)):t(!1)}.bind(this))}addClass(e){var t;this.document&&(t=this.content||this.document.body)&&t.classList.add(e)}removeClass(e){var t;this.document&&(t=this.content||this.document.body)&&t.classList.remove(e)}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),c.a.forEach((function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})}),this))}removeEventListeners(){this.document&&(c.a.forEach((function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})}),this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}addSelectionListeners(){this.document&&(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){this.document&&(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var e=this.window.getSelection();this.triggerSelectedEvent(e)}.bind(this),250)}triggerSelectedEvent(e){var t,i;e&&e.rangeCount>0&&((t=e.getRangeAt(0)).collapsed||(i=new o.a(t,this.cfiBase).toString(),this.emit(c.c.CONTENTS.SELECTED,i),this.emit(c.c.CONTENTS.SELECTED_RANGE,t)))}range(e,t){return new o.a(e).toRange(this.document,t)}cfiFromRange(e,t){return new o.a(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new o.a(e,this.cfiBase,t).toString()}map(e){return new a.a(e).section()}size(e,t){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),e>=0&&(this.width(e),i.width=e,this.css("padding","0 "+e/12+"px")),t>=0&&(this.height(t),i.height=t),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(e,t,i,n,r){let o=Object(s.prefixed)("column-axis"),a=Object(s.prefixed)("column-gap"),l=Object(s.prefixed)("column-width"),c=Object(s.prefixed)("column-fill"),h=0===this.writingMode().indexOf("vertical")?"vertical":"horizontal";this.layoutStyle("paginated"),"rtl"===r&&"horizontal"===h&&this.direction(r),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),"vertical"===h?(this.css("padding-top",n/2+"px",!0),this.css("padding-bottom",n/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(o,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",n/2+"px",!0),this.css("padding-right",n/2+"px",!0),this.css(o,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(c,"auto"),this.css(a,n+"px"),this.css(l,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,t,i){var n="scale("+e+")",r="";this.css("transform-origin","top left"),(t>=0||i>=0)&&(r=" translate("+(t||0)+"px, "+(i||0)+"px )"),this.css("transform",n+r)}fit(e,t,i){var n=this.viewport(),r=parseInt(n.width),s=parseInt(n.height),o=e/r,a=t/s,l=o{this.emit(c.c.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let t=Object(s.prefixed)("writing-mode");return e&&this.documentElement&&(this.documentElement.style[t]=e),this.window.getComputedStyle(this.documentElement)[t]||""}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(e,t){return navigator.epubReadingSystem={name:e,version:t,layoutStyle:this.layoutStyle(),hasFeature:function(e){switch(e){case"dom-manipulation":case"layout-changes":case"touch-events":case"mouse-events":case"keyboard-events":return!0;case"spine-scripting":default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}}r()(f.prototype),t.a=f},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Underline=t.Highlight=t.Mark=t.Pane=void 0;var n=function(){function e(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:document.body;c(this,e),this.target=t,this.element=r.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),s.default.proxyMouse(this.target,this.marks),this.container=i,this.container.appendChild(this.element),this.render()}return n(e,[{key:"addMark",value:function(e){var t=r.default.createElement("g");return this.element.appendChild(t),e.bind(t,this.container),this.marks.push(e),e.render(),e}},{key:"removeMark",value:function(e){var t=this.marks.indexOf(e);if(-1!==t){var i=e.unbind();this.element.removeChild(i),this.marks.splice(t,1)}}},{key:"render",value:function(){var e,t,i,n;!function(e,t){e.style.setProperty("top",t.top+"px","important"),e.style.setProperty("left",t.left+"px","important"),e.style.setProperty("height",t.height+"px","important"),e.style.setProperty("width",t.width+"px","important")}(this.element,(e=this.target,t=this.container,i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),{top:n.top-i.top,left:n.left-i.left,height:e.scrollHeight,width:e.scrollWidth}));var r=!0,s=!1,o=void 0;try{for(var a,l=this.marks[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){a.value.render()}}catch(e){s=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(s)throw o}}}}]),e}();var h=t.Mark=function(){function e(){c(this,e),this.element=null}return n(e,[{key:"bind",value:function(e,t){this.element=e,this.container=t}},{key:"unbind",value:function(){var e=this.element;return this.element=null,e}},{key:"render",value:function(){}},{key:"dispatchEvent",value:function(e){this.element&&this.element.dispatchEvent(e)}},{key:"getBoundingClientRect",value:function(){return this.element.getBoundingClientRect()}},{key:"getClientRects",value:function(){for(var e=[],t=this.element.firstChild;t;)e.push(t.getBoundingClientRect()),t=t.nextSibling;return e}},{key:"filteredRanges",value:function(){var e=Array.from(this.range.getClientRects());return e.filter((function(t){for(var i=0;i=n.left&&r.top>=n.top&&r.bottom<=n.bottom)return!1}var n,r;return!0}))}}]),e}(),u=t.Highlight=function(e){function t(e,i,n,r){c(this,t);var s=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return s.range=e,s.className=i,s.data=n||{},s.attributes=r||{},s}return l(t,e),n(t,[{key:"bind",value:function(e,i){for(var n in function e(t,i,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,i);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,i,n)}if("value"in r)return r.value;var o=r.get;return void 0!==o?o.call(n):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"bind",this).call(this,e,i),this.data)this.data.hasOwnProperty(n)&&(this.element.dataset[n]=this.data[n]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&this.element.setAttribute(n,this.attributes[n]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var e=this.element.ownerDocument.createDocumentFragment(),t=this.filteredRanges(),i=this.element.getBoundingClientRect(),n=this.container.getBoundingClientRect(),s=0,o=t.length;s=0&&(this._minSpreadWidth=t),this._spread}calculate(e,t,i){var n,r,s,o,a=1,l=i||0,c=e,h=t,u=Math.floor(c/12);a=this._spread&&c>=this._minSpreadWidth?2:1,"reflowable"!==this.name||"paginated"!==this._flow||i>=0||(l=u%2==0?u:u-1),"pre-paginated"===this.name&&(l=0),a>1?s=(n=c/a-l)+l:(n=c,s=c),"pre-paginated"===this.name&&a>1&&(c=n),r=n*a+l,o=c,this.width=c,this.height=h,this.spreadWidth=r,this.pageWidth=s,this.delta=o,this.columnWidth=n,this.gap=l,this.divisor=a,this.update({width:c,height:h,spreadWidth:r,pageWidth:s,delta:o,columnWidth:n,gap:l,divisor:a})}format(e,t,i){return"pre-paginated"===this.name?e.fit(this.columnWidth,this.height,t):"paginated"===this._flow?e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):i&&"horizontal"===i?e.size(null,this.height):e.size(this.width,null)}count(e,t){let i,n;return"pre-paginated"===this.name?(i=1,n=1):"paginated"===this._flow?(t=t||this.delta,i=Math.ceil(e/t),n=i*this.divisor):(t=t||this.height,i=Math.ceil(e/t),n=i),{spreads:i,pages:n}}update(e){if(Object.keys(e).forEach(t=>{this.props[t]===e[t]&&delete e[t]}),Object.keys(e).length>0){let t=Object(s.extend)(this.props,e);this.emit(c.c.LAYOUT.UPDATED,t,e)}}}r()(h.prototype);var u=h,d=i(5);var f=class{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){if(0!==arguments.length)return 1===arguments.length&&"object"==typeof arguments[0]?this.registerThemes(arguments[0]):1===arguments.length&&"string"==typeof arguments[0]?this.default(arguments[0]):2===arguments.length&&"string"==typeof arguments[1]?this.registerUrl(arguments[0],arguments[1]):2===arguments.length&&"object"==typeof arguments[1]?this.registerRules(arguments[0],arguments[1]):void 0}default(e){if(e)return"string"==typeof e?this.registerUrl("default",e):"object"==typeof e?this.registerRules("default",e):void 0}registerThemes(e){for(var t in e)e.hasOwnProperty(t)&&("string"==typeof e[t]?this.registerUrl(t,e[t]):this.registerRules(t,e[t]))}registerCss(e,t){this._themes[e]={serialized:t},(this._injected[e]||"default"==e)&&this.update(e)}registerUrl(e,t){var i=new d.a(t);this._themes[e]={url:i.toString()},(this._injected[e]||"default"==e)&&this.update(e)}registerRules(e,t){this._themes[e]={rules:t},(this._injected[e]||"default"==e)&&this.update(e)}select(e){var t=this._current;this._current=e,this.update(e),this.rendition.getContents().forEach(i=>{i.removeClass(t),i.addClass(e)})}update(e){this.rendition.getContents().forEach(t=>{this.add(e,t)})}inject(e){var t,i=[],n=this._themes;for(var r in n)!n.hasOwnProperty(r)||r!==this._current&&"default"!==r||(((t=n[r]).rules&&Object.keys(t.rules).length>0||t.url&&-1===i.indexOf(t.url))&&this.add(r,e),this._injected.push(r));"default"!=this._current&&e.addClass(this._current)}add(e,t){var i=this._themes[e];i&&t&&(i.url?t.addStylesheet(i.url):i.serialized?(t.addStylesheetCss(i.serialized,e),i.injected=!0):i.rules&&(t.addStylesheetRules(i.rules,e),i.injected=!0))}override(e,t,i){var n=this.rendition.getContents();this._overrides[e]={value:t,priority:!0===i},n.forEach(t=>{t.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var t=this.rendition.getContents();delete this._overrides[e],t.forEach(t=>{t.css(e)})}overrides(e){var t=this._overrides;for(var i in t)t.hasOwnProperty(i)&&e.css(i,t[i].value,t[i].priority)}fontSize(e){this.override("font-size",e)}font(e){this.override("font-family",e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}};i(12);class p{constructor({type:e,cfiRange:t,data:i,sectionIndex:n,cb:r,className:s,styles:o}){this.type=e,this.cfiRange=t,this.data=i,this.sectionIndex=n,this.mark=void 0,this.cb=r,this.className=s,this.styles=o}update(e){this.data=e}attach(e){let t,{cfiRange:i,data:n,type:r,mark:s,cb:o,className:a,styles:l}=this;return"highlight"===r?t=e.highlight(i,n,o,a,l):"underline"===r?t=e.underline(i,n,o,a,l):"mark"===r&&(t=e.mark(i,n,o)),this.mark=t,this.emit(c.c.ANNOTATION.ATTACH,t),t}detach(e){let t,{cfiRange:i,type:n}=this;return e&&("highlight"===n?t=e.unhighlight(i):"underline"===n?t=e.ununderline(i):"mark"===n&&(t=e.unmark(i))),this.mark=void 0,this.emit(c.c.ANNOTATION.DETACH,t),t}text(){}}r()(p.prototype);var g=class{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,t,i,n,r,s){let o=encodeURI(t+e),l=new a.a(t).spinePos,c=new p({type:e,cfiRange:t,data:i,sectionIndex:l,cb:n,className:r,styles:s});return this._annotations[o]=c,l in this._annotationsBySectionIndex?this._annotationsBySectionIndex[l].push(o):this._annotationsBySectionIndex[l]=[o],this.rendition.views().forEach(e=>{c.sectionIndex===e.index&&c.attach(e)}),c}remove(e,t){let i=encodeURI(e+t);if(i in this._annotations){let e=this._annotations[i];if(t&&e.type!==t)return;this.rendition.views().forEach(t=>{this._removeFromAnnotationBySectionIndex(e.sectionIndex,i),e.sectionIndex===t.index&&e.detach(t)}),delete this._annotations[i]}}_removeFromAnnotationBySectionIndex(e,t){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(e=>e!==t)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,t,i,n,r){return this.add("highlight",e,t,i,n,r)}underline(e,t,i,n,r){return this.add("underline",e,t,i,n,r)}mark(e,t,i){return this.add("mark",e,t,i)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let t=e.index;if(t in this._annotationsBySectionIndex){this._annotationsBySectionIndex[t].forEach(t=>{this._annotations[t].attach(e)})}}clear(e){let t=e.index;if(t in this._annotationsBySectionIndex){this._annotationsBySectionIndex[t].forEach(t=>{this._annotations[t].detach(e)})}}show(){}hide(){}},m=i(20),v=i(10),y=i(22);class b{constructor(e,t){this.settings=Object(s.extend)(this.settings||{},{width:null,height:null,ignoreClass:"",manager:"default",view:"iframe",flow:null,layout:null,spread:null,minSpreadWidth:800,stylesheet:null,resizeOnOrientationChange:!0,script:null,snap:!1,defaultDirection:"ltr",allowScriptedContent:!1,allowPopups:!1}),Object(s.extend)(this.settings,t),"object"==typeof this.settings.manager&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new o.a(this),this.hooks.serialize=new o.a(this),this.hooks.content=new o.a(this),this.hooks.unloaded=new o.a(this),this.hooks.layout=new o.a(this),this.hooks.render=new o.a(this),this.hooks.show=new o.a(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.book.spine.hooks.content.register(this.injectIdentifier.bind(this)),this.settings.stylesheet&&this.book.spine.hooks.content.register(this.injectStylesheet.bind(this)),this.settings.script&&this.book.spine.hooks.content.register(this.injectScript.bind(this)),this.themes=new f(this),this.annotations=new g(this),this.epubcfi=new a.a,this.q=new l.a(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new s.defer,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){return"string"==typeof e&&"default"===e?v.a:"string"==typeof e&&"continuous"===e?y.a:e}requireView(e){return"string"==typeof e&&"iframe"===e?m.a:e}start(){switch(this.settings.layout||"pre-paginated"!==this.book.package.metadata.layout&&"true"!==this.book.displayOptions.fixedLayout||(this.settings.layout="pre-paginated"),this.book.package.metadata.spread){case"none":this.settings.spread="none";break;case"both":this.settings.spread=!0}this.manager||(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),this.manager=new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.direction(this.book.package.metadata.direction||this.settings.defaultDirection),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on(c.c.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(c.c.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(c.c.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(c.c.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(c.c.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(c.c.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue(function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit(c.c.RENDITION.ATTACHED)}.bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(this.book){this.epubcfi.isCfiString(e);var t,i=new s.defer,n=i.promise;return this.displaying=i,this.book.locations.length()&&Object(s.isFloat)(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),(t=this.book.spine.get(e))?(this.manager.display(t,e).then(()=>{i.resolve(t),this.displaying=void 0,this.emit(c.c.RENDITION.DISPLAYED,t),this.reportLocation()},e=>{this.emit(c.c.RENDITION.DISPLAY_ERROR,e)}),n):(i.reject(new Error("No Section Found")),n)}}afterDisplayed(e){e.on(c.c.VIEWS.MARK_CLICKED,(t,i)=>this.triggerMarkEvent(t,i,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit(c.c.RENDITION.RENDERED,e.section,e)}):this.emit(c.c.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit(c.c.RENDITION.REMOVED,e.section,e)})}onResized(e,t){this.emit(c.c.RENDITION.RESIZED,{width:e.width,height:e.height},t),this.location&&this.location.start&&this.display(t||this.location.start.cfi)}onOrientationChange(e){this.emit(c.c.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,t,i){e&&(this.settings.width=e),t&&(this.settings.height=t),this.manager.resize(e,t,i)}clear(){this.manager.clear()}next(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}prev(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}determineLayoutProperties(e){var t=this.settings.layout||e.layout||"reflowable",i=this.settings.spread||e.spread||"auto",n=this.settings.orientation||e.orientation||"auto",r=this.settings.flow||e.flow||"auto",s=e.viewport||"",o=this.settings.minSpreadWidth||e.minSpreadWidth||800,a=this.settings.direction||e.direction||"ltr";return(0===this.settings.width||this.settings.width>0)&&(0===this.settings.height||this.settings.height),{layout:t,spread:i,orientation:n,flow:r,viewport:s,minSpreadWidth:o,direction:a}}flow(e){var t=e;"scrolled"!==e&&"scrolled-doc"!==e&&"scrolled-continuous"!==e||(t="scrolled"),"auto"!==e&&"paginated"!==e||(t="paginated"),this.settings.flow=e,this._layout&&this._layout.flow(t),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(t),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new u(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on(c.c.LAYOUT.UPDATED,(e,t)=>{this.emit(c.c.RENDITION.LAYOUT,e,t)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,t){this.settings.spread=e,t&&(this.settings.minSpreadWidth=t),this._layout&&this._layout.spread(e,t),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue(function(){requestAnimationFrame(function(){var e=this.manager.currentLocation();if(e&&e.then&&"function"==typeof e.then)e.then(function(e){let t=this.located(e);t&&t.start&&t.end&&(this.location=t,this.emit(c.c.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(c.c.RENDITION.RELOCATED,this.location))}.bind(this));else if(e){let t=this.located(e);if(!t||!t.start||!t.end)return;this.location=t,this.emit(c.c.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(c.c.RENDITION.RELOCATED,this.location)}}.bind(this))}.bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&"function"==typeof e.then)e.then(function(e){return this.located(e)}.bind(this));else if(e){return this.located(e)}}located(e){if(!e.length)return{};let t=e[0],i=e[e.length-1],n={start:{index:t.index,href:t.href,cfi:t.mapping.start,displayed:{page:t.pages[0]||1,total:t.totalPages}},end:{index:i.index,href:i.href,cfi:i.mapping.end,displayed:{page:i.pages[i.pages.length-1]||1,total:i.totalPages}}},r=this.book.locations.locationFromCfi(t.mapping.start),s=this.book.locations.locationFromCfi(i.mapping.end);null!=r&&(n.start.location=r,n.start.percentage=this.book.locations.percentageFromLocation(r)),null!=s&&(n.end.location=s,n.end.percentage=this.book.locations.percentageFromLocation(s));let o=this.book.pageList.pageFromCfi(t.mapping.start),a=this.book.pageList.pageFromCfi(i.mapping.end);return-1!=o&&(n.start.page=o),-1!=a&&(n.end.page=a),i.index===this.book.spine.last().index&&n.end.displayed.page>=n.end.displayed.total&&(n.atEnd=!0),t.index===this.book.spine.first().index&&1===n.start.displayed.page&&(n.atStart=!0),n}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(e){c.a.forEach(t=>{e.on(t,t=>this.triggerViewEvent(t,e))}),e.on(c.c.CONTENTS.SELECTED,t=>this.triggerSelectedEvent(t,e))}triggerViewEvent(e,t){this.emit(e.type,e,t)}triggerSelectedEvent(e,t){this.emit(c.c.RENDITION.SELECTED,e,t)}triggerMarkEvent(e,t,i){this.emit(c.c.RENDITION.MARK_CLICKED,e,t,i)}getRange(e,t){var i=new a.a(e),n=this.manager.visible().filter((function(e){if(i.spinePos===e.index)return!0}));if(n.length)return n[0].contents.range(i,t)}adjustImages(e){if("pre-paginated"===this._layout.name)return new Promise((function(e){e()}));let t=e.window.getComputedStyle(e.content,null),i=.95*(e.content.offsetHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom))),n=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-n+"px":"100%")+"!important","max-height":i+"px!important","object-fit":"contain","page-break-inside":"avoid","break-inside":"avoid","box-sizing":"border-box"},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-n+"px":"100%")+"!important","max-height":i+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise((function(e,t){setTimeout((function(){e()}),1)}))}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(e){e&&e.on(c.c.CONTENTS.LINK_CLICKED,e=>{let t=this.book.path.relative(e);this.display(t)})}injectStylesheet(e,t){let i=e.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",this.settings.stylesheet),e.getElementsByTagName("head")[0].appendChild(i)}injectScript(e,t){let i=e.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",this.settings.script),i.textContent=" ",e.getElementsByTagName("head")[0].appendChild(i)}injectIdentifier(e,t){let i=this.book.packaging.metadata.identifier,n=e.createElement("meta");n.setAttribute("name","dc.relation.ispartof"),i&&n.setAttribute("content",i),e.getElementsByTagName("head")[0].appendChild(n)}}r()(b.prototype);t.a=b},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";var n=i(38)();e.exports=function(e){return e!==n&&null!==e}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,i){"use strict";var n=i(3),r=i.n(n),s=i(0),o=i(2),a=i(12),l=i(1),c=i(13);class h{constructor(e,t){this.settings=Object(s.extend)({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1,allowPopups:!1},t||{}),this.id="epubjs-view-"+Object(s.uuid)(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new o.a,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var t=document.createElement("div");return t.classList.add("epub-view"),t.style.height="0px",t.style.width="0px",t.style.overflow="hidden",t.style.position="relative",t.style.display="block",t.style.flex=e&&"horizontal"==e?"none":"initial",t}create(){return this.iframe||(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.sandbox="allow-same-origin",this.settings.allowScriptedContent&&(this.iframe.sandbox+=" allow-scripts"),this.settings.allowPopups&&(this.iframe.sandbox+=" allow-popups"),this.iframe.setAttribute("enable-annotation","true"),this.resizing=!0,this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this.element.setAttribute("ref",this.index),this.added=!0,this.elementBounds=Object(s.bounds)(this.element),"srcdoc"in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write")),this.iframe}render(e,t){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(e)),this.sectionRender.then(function(e){return this.load(e)}.bind(this)).then(function(){let e,t=this.contents.writingMode();return e="scrolled"===this.settings.flow?0===t.indexOf("vertical")?"horizontal":"vertical":0===t.indexOf("vertical")?"vertical":"horizontal",0===t.indexOf("vertical")&&"paginated"===this.settings.flow&&(this.layout.delta=this.layout.height),this.setAxis(e),this.emit(l.c.VIEWS.AXIS,e),this.setWritingMode(t),this.emit(l.c.VIEWS.WRITING_MODE,t),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((e,t)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),e()})}.bind(this),function(e){return this.emit(l.c.VIEWS.LOAD_ERROR,e),new Promise((t,i)=>{i(e)})}.bind(this)).then(function(){this.emit(l.c.VIEWS.RENDERED,this.section)}.bind(this))}reset(){this.iframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,t){var i=e||this.settings.width,n=t||this.settings.height;"pre-paginated"===this.layout.name?this.lock("both",i,n):"horizontal"===this.settings.axis?this.lock("height",i,n):this.lock("width",i,n),this.settings.width=i,this.settings.height=n}lock(e,t,i){var n,r=Object(s.borders)(this.element);n=this.iframe?Object(s.borders)(this.iframe):{width:0,height:0},"width"==e&&Object(s.isNumber)(t)&&(this.lockedWidth=t-r.width-n.width),"height"==e&&Object(s.isNumber)(i)&&(this.lockedHeight=i-r.height-n.height),"both"===e&&Object(s.isNumber)(t)&&Object(s.isNumber)(i)&&(this.lockedWidth=t-r.width-n.width,this.lockedHeight=i-r.height-n.height),this.displayed&&this.iframe&&this.expand()}expand(e){var t,i=this.lockedWidth,n=this.lockedHeight;this.iframe&&!this._expanding&&(this._expanding=!0,"pre-paginated"===this.layout.name?(i=this.layout.columnWidth,n=this.layout.height):"horizontal"===this.settings.axis?((i=this.contents.textWidth())%this.layout.pageWidth>0&&(i=Math.ceil(i/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(t=i/this.layout.pageWidth,this.layout.divisor>1&&"reflowable"===this.layout.name&&t%2>0&&(i+=this.layout.pageWidth))):"vertical"===this.settings.axis&&(n=this.contents.textHeight(),"paginated"===this.settings.flow&&n%this.layout.height>0&&(n=Math.ceil(n/this.layout.height)*this.layout.height)),(this._needsReframe||i!=this._width||n!=this._height)&&this.reframe(i,n),this._expanding=!1)}reframe(e,t){var i;Object(s.isNumber)(e)&&(this.element.style.width=e+"px",this.iframe.style.width=e+"px",this._width=e),Object(s.isNumber)(t)&&(this.element.style.height=t+"px",this.iframe.style.height=t+"px",this._height=t),i={width:e,height:t,widthDelta:this.prevBounds?e-this.prevBounds.width:e,heightDelta:this.prevBounds?t-this.prevBounds.height:t},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let e;for(let t in this.marks)this.marks.hasOwnProperty(t)&&(e=this.marks[t],this.placeMark(e.element,e.range))}),this.onResize(this,i),this.emit(l.c.VIEWS.RESIZED,i),this.prevBounds=i,this.elementBounds=Object(s.bounds)(this.element)}load(e){var t=new s.defer,i=t.promise;if(!this.iframe)return t.reject(new Error("No Iframe Available")),i;if(this.iframe.onload=function(e){this.onLoad(e,t)}.bind(this),"blobUrl"===this.settings.method)this.blobUrl=Object(s.createBlobUrl)(e,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if("srcdoc"===this.settings.method)this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return t.reject(new Error("No Document Available")),i;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var n=this;MSApp.execUnsafeLocalFunction((function(){n.iframe.contentDocument.write(e)}))}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return i}onLoad(e,t){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new a.a(this.document,this.document.body,this.section.cfiBase,this.section.index),this.rendering=!1;var i=this.document.querySelector("link[rel='canonical']");i?i.setAttribute("href",this.section.canonical):((i=this.document.createElement("link")).setAttribute("rel","canonical"),i.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(i)),this.contents.on(l.c.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(l.c.CONTENTS.RESIZE,e=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),t.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,this.element.style.flex="horizontal"==e?"none":"initial",this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(e){}display(e){var t=new s.defer;return this.displayed?t.resolve(this):this.render(e).then(function(){this.emit(l.c.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,t.resolve(this)}.bind(this),(function(e){t.reject(e,this)})),t.promise}show(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit(l.c.VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(l.c.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){this.iframe.getBoundingClientRect();var t=this.contents.locationOf(e,this.settings.ignoreClass);return{left:t.left,top:t.top}}onDisplayed(e){}onResize(e,t){}bounds(e){return!e&&this.elementBounds||(this.elementBounds=Object(s.bounds)(this.element)),this.elementBounds}highlight(e,t={},i,n="epubjs-hl",r={}){if(!this.contents)return;const s=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},r);let o=this.contents.range(e),a=()=>{this.emit(l.c.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new c.Pane(this.iframe,this.element));let h=new c.Highlight(o,n,t,s),u=this.pane.addMark(h);return this.highlights[e]={mark:u,element:u.element,listeners:[a,i]},u.element.setAttribute("ref",n),u.element.addEventListener("click",a),u.element.addEventListener("touchstart",a),i&&(u.element.addEventListener("click",i),u.element.addEventListener("touchstart",i)),u}underline(e,t={},i,n="epubjs-ul",r={}){if(!this.contents)return;const s=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},r);let o=this.contents.range(e),a=()=>{this.emit(l.c.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new c.Pane(this.iframe,this.element));let h=new c.Underline(o,n,t,s),u=this.pane.addMark(h);return this.underlines[e]={mark:u,element:u.element,listeners:[a,i]},u.element.setAttribute("ref",n),u.element.addEventListener("click",a),u.element.addEventListener("touchstart",a),i&&(u.element.addEventListener("click",i),u.element.addEventListener("touchstart",i)),u}mark(e,t={},i){if(!this.contents)return;if(e in this.marks){return this.marks[e]}let n=this.contents.range(e);if(!n)return;let r=n.commonAncestorContainer,s=1===r.nodeType?r:r.parentNode,o=i=>{this.emit(l.c.VIEWS.MARK_CLICKED,e,t)};n.collapsed&&1===r.nodeType?(n=new Range,n.selectNodeContents(r)):n.collapsed&&(n=new Range,n.selectNodeContents(s));let a=this.document.createElement("a");return a.setAttribute("ref","epubjs-mk"),a.style.position="absolute",a.dataset.epubcfi=e,t&&Object.keys(t).forEach(e=>{a.dataset[e]=t[e]}),i&&(a.addEventListener("click",i),a.addEventListener("touchstart",i)),a.addEventListener("click",o),a.addEventListener("touchstart",o),this.placeMark(a,n),this.element.appendChild(a),this.marks[e]={element:a,range:n,listeners:[o,i]},s}placeMark(e,t){let i,n,r;if("pre-paginated"===this.layout.name||"horizontal"!==this.settings.axis){let e=t.getBoundingClientRect();i=e.top,n=e.right}else{let e,o=t.getClientRects();for(var s=0;s!=o.length;s++)e=o[s],(!r||e.left{e&&(t.element.removeEventListener("click",e),t.element.removeEventListener("touchstart",e))}),delete this.highlights[e])}ununderline(e){let t;e in this.underlines&&(t=this.underlines[e],this.pane.removeMark(t.mark),t.listeners.forEach(e=>{e&&(t.element.removeEventListener("click",e),t.element.removeEventListener("touchstart",e))}),delete this.underlines[e])}unmark(e){let t;e in this.marks&&(t=this.marks[e],this.element.removeChild(t.element),t.listeners.forEach(e=>{e&&(t.element.removeEventListener("click",e),t.element.removeEventListener("touchstart",e))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&Object(s.revokeBlobUrl)(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.pane&&(this.pane.element.remove(),this.pane=void 0),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}}r()(h.prototype),t.a=h},function(e,t,i){var n=i(19),r=i(51),s=i(53),o=Math.max,a=Math.min;e.exports=function(e,t,i){var l,c,h,u,d,f,p=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var i=l,n=c;return l=c=void 0,p=t,u=e.apply(n,i)}function b(e){return p=e,d=setTimeout(x,t),g?y(e):u}function w(e){var i=e-f;return void 0===f||i>=t||i<0||m&&e-p>=h}function x(){var e=r();if(w(e))return _(e);d=setTimeout(x,function(e){var i=t-(e-f);return m?a(i,h-(e-p)):i}(e))}function _(e){return d=void 0,v&&l?y(e):(l=c=void 0,u)}function E(){var e=r(),i=w(e);if(l=arguments,c=this,f=e,i){if(void 0===d)return b(f);if(m)return clearTimeout(d),d=setTimeout(x,t),y(f)}return void 0===d&&(d=setTimeout(x,t)),u}return t=s(t)||0,n(i)&&(g=!!i.leading,h=(m="maxWait"in i)?o(s(i.maxWait)||0,t):h,v="trailing"in i?!!i.trailing:v),E.cancel=function(){void 0!==d&&clearTimeout(d),p=0,l=f=c=d=void 0},E.flush=function(){return void 0===d?u:_(r())},E}},function(e,t,i){"use strict";var n=i(0),r=i(10),s=i(1),o=i(3),a=i.n(o);const l=Math.PI/2,c={easeOutSine:function(e){return Math.sin(e*l)},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInOutQuint:function(e){return(e/=.5)<1?.5*Math.pow(e,5):.5*(Math.pow(e-2,5)+2)},easeInCubic:function(e){return Math.pow(e,3)}};class h{constructor(e,t){this.settings=Object(n.extend)({duration:80,minVelocity:.2,minDistance:10,easing:c.easeInCubic},t||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=2*this.settings.duration,this.isVertical="vertical"===this.manager.settings.axis,this.manager.isPaginated&&!this.isVertical&&(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.scrollLeft,this.scrollTop,this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0,this.addListeners())}supportsTouch(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}disableScroll(){this.element.style.overflow="hidden"}enableScroll(){this.element.style.overflow=""}addListeners(){this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll),this._onTouchStart=this.onTouchStart.bind(this),this.scroller.addEventListener("touchstart",this._onTouchStart,{passive:!0}),this.on("touchstart",this._onTouchStart),this._onTouchMove=this.onTouchMove.bind(this),this.scroller.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.on("touchmove",this._onTouchMove),this._onTouchEnd=this.onTouchEnd.bind(this),this.scroller.addEventListener("touchend",this._onTouchEnd,{passive:!0}),this.on("touchend",this._onTouchEnd),this._afterDisplayed=this.afterDisplayed.bind(this),this.manager.on(s.c.MANAGERS.ADDED,this._afterDisplayed)}removeListeners(){window.removeEventListener("resize",this._onResize),this._onResize=void 0,this.scroller.removeEventListener("scroll",this._onScroll),this._onScroll=void 0,this.scroller.removeEventListener("touchstart",this._onTouchStart,{passive:!0}),this.off("touchstart",this._onTouchStart),this._onTouchStart=void 0,this.scroller.removeEventListener("touchmove",this._onTouchMove,{passive:!0}),this.off("touchmove",this._onTouchMove),this._onTouchMove=void 0,this.scroller.removeEventListener("touchend",this._onTouchEnd,{passive:!0}),this.off("touchend",this._onTouchEnd),this._onTouchEnd=void 0,this.manager.off(s.c.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let t=e.contents;["touchstart","touchmove","touchend"].forEach(e=>{t.on(e,e=>this.triggerViewEvent(e,t))})}triggerViewEvent(e,t){this.emit(e.type,e,t)}onScroll(e){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(e){this.resizeCanceler=!0}onTouchStart(e){let{screenX:t,screenY:i}=e.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=t,this.startTouchY=i,this.startTime=this.now()),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchMove(e){let{screenX:t,screenY:i}=e.touches[0],n=Math.abs(i-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&n<10&&(this.element.scrollLeft-=t-this.endTouchX),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchEnd(e){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let t=this.wasSwiped();0!==t?this.snap(t):this.snap(),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0}wasSwiped(){let e=this.layout.pageWidth*this.layout.divisor,t=this.endTouchX-this.startTouchX,i=Math.abs(t),n=t/(this.endTime-this.startTime),r=this.settings.minVelocity;return i<=this.settings.minDistance||i>=e?0:n>r?-1:n<-r?1:void 0}needsSnap(){return this.scrollLeft%(this.layout.pageWidth*this.layout.divisor)!=0}snap(e=0){let t=this.scrollLeft,i=this.layout.pageWidth*this.layout.divisor,n=Math.round(t/i)*i;return e&&(n+=e*i),this.smoothScrollTo(n)}smoothScrollTo(e){const t=new n.defer,i=this.scrollLeft,r=this.now(),s=this.settings.duration,o=this.settings.easing;return this.snapping=!0,function n(){const a=this.now(),l=Math.min(1,(a-r)/s);if(o(l),this.touchCanceler||this.resizeCanceler)return this.resizeCanceler=!1,this.snapping=!1,void t.resolve();l<1?(window.requestAnimationFrame(n.bind(this)),this.scrollTo(i+(e-i)*l,0)):(this.scrollTo(e,0),this.snapping=!1,t.resolve())}.call(this),t.promise}scrollTo(e=0,t=0){this.fullsize?window.scroll(e,t):(this.scroller.scrollLeft=e,this.scroller.scrollTop=t)}now(){return"now"in window.performance?performance.now():(new Date).getTime()}destroy(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}}a()(h.prototype);var u=h,d=i(21),f=i.n(d);class p extends r.a{constructor(e){super(e),this.name="continuous",this.settings=Object(n.extend)(this.settings||{},{infinite:!0,overflow:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10,allowScriptedContent:!1,allowPopups:!1}),Object(n.extend)(this.settings,e.settings||{}),"undefined"!=e.settings.gap&&0===e.settings.gap&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.scrollTop=0,this.scrollLeft=0}display(e,t){return r.a.prototype.display.call(this,e,t).then(function(){return this.fill()}.bind(this))}fill(e){var t=e||new n.defer;return this.q.enqueue(()=>this.check()).then(e=>{e?this.fill(t):t.resolve()}),t.promise}moveTo(e){var t=0,i=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,this.settings.offsetDelta):(i=e.top,e.top,this.settings.offsetDelta),(t>0||i>0)&&this.scrollBy(t,i,!0)}afterResized(e){this.emit(s.c.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var t=this.createView(e);return this.views.append(t),t.on(s.c.VIEWS.RESIZED,e=>{t.expanded=!0}),t.on(s.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on(s.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.display(this.request)}append(e){var t=this.createView(e);return t.on(s.c.VIEWS.RESIZED,e=>{t.expanded=!0}),t.on(s.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on(s.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t}prepend(e){var t=this.createView(e);return t.on(s.c.VIEWS.RESIZED,e=>{this.counter(e),t.expanded=!0}),t.on(s.c.VIEWS.AXIS,e=>{this.updateAxis(e)}),t.on(s.c.VIEWS.WRITING_MODE,e=>{this.updateWritingMode(e)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t}counter(e){"vertical"===this.settings.axis?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var t,i=this.bounds(),r=this.views.all(),s=r.length,o=[],a=void 0!==e?e:this.settings.offset||0,l=new n.defer,c=[],h=0;h{t.hide()});c.push(e)}o.push(t)}else this.q.enqueue(t.destroy.bind(t)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250);return c.length?Promise.all(c).catch(e=>{l.reject(e)}):(l.resolve(),l.promise)}check(e,t){var i=new n.defer,r=[],s="horizontal"===this.settings.axis,o=this.settings.offset||0;e&&s&&(o=e),t&&!s&&(o=t);var a=this._bounds;let l=s?this.scrollLeft:this.scrollTop,c=s?Math.floor(a.width):a.height,h=s?this.container.scrollWidth:this.container.scrollHeight,u=this.writingMode&&0===this.writingMode.indexOf("vertical")?"vertical":"horizontal",d=this.settings.rtlScrollType,f="rtl"===this.settings.direction;this.settings.fullsize?(s&&f&&"negative"===d||!s&&f&&"default"===d)&&(l*=-1):(f&&"default"===d&&"horizontal"===u&&(l=h-c-l),f&&"negative"===d&&"horizontal"===u&&(l*=-1));let p=()=>{let e=this.views.first(),t=e&&e.section.prev();t&&r.push(this.prepend(t))},g=l-o;l+c+o>=h&&(()=>{let e=this.views.last(),t=e&&e.section.next();t&&r.push(this.append(t))})(),g<0&&p();let m=r.map(e=>e.display(this.request));return r.length?Promise.all(m).then(()=>this.check()).then(()=>this.update(o),e=>e):(this.q.enqueue(function(){this.update()}.bind(this)),i.resolve(!1),i.promise)}trim(){for(var e=new n.defer,t=this.views.displayed(),i=t[0],r=t[t.length-1],s=this.views.indexOf(i),o=this.views.indexOf(r),a=this.views.slice(0,s),l=this.views.slice(o+1),c=0;c=43)}})).catch((function(){return!1}))}(e).then((function(e){return u=e}))}function g(e){var t=d[e.name],i={};i.promise=new o((function(e,t){i.resolve=e,i.reject=t})),t.deferredOperations.push(i),t.dbReady?t.dbReady=t.dbReady.then((function(){return i.promise})):t.dbReady=i.promise}function m(e){var t=d[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function v(e,t){var i=d[e.name].deferredOperations.pop();if(i)return i.reject(t),i.promise}function y(e,t){return new o((function(i,n){if(d[e.name]=d[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return i(e.db);g(e),e.db.close()}var s=[e.name];t&&s.push(e.version);var o=r.open.apply(r,s);t&&(o.onupgradeneeded=function(t){var i=o.result;try{i.createObjectStore(e.storeName),t.oldVersion<=1&&i.createObjectStore("local-forage-detect-blob-support")}catch(i){if("ConstraintError"!==i.name)throw i;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),n(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},i(t),m(e)}}))}function b(e){return y(e,!1)}function w(e){return y(e,!0)}function x(e,t){if(!e.db)return!0;var i=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),r||i){if(i){var s=e.db.version+1;s>e.version&&(e.version=s)}return!0}return!1}function _(e){return s([function(e){for(var t=e.length,i=new ArrayBuffer(t),n=new Uint8Array(i),r=0;r0&&(!e.db||"InvalidStateError"===r.name||"NotFoundError"===r.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===r.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),w(e)})).then((function(){return function(e){g(e);for(var t=d[e.name],i=t.forages,n=0;n>4,h[l++]=(15&n)<<4|r>>2,h[l++]=(3&r)<<6|63&s;return c}function D(e){var t,i=new Uint8Array(e),n="";for(t=0;t>2],n+=C[(3&i[t])<<4|i[t+1]>>4],n+=C[(15&i[t+1])<<2|i[t+2]>>6],n+=C[63&i[t+2]];return i.length%3==2?n=n.substring(0,n.length-1)+"=":i.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var j={serialize:function(e,t){var i="";if(e&&(i=I.call(e)),e&&("[object ArrayBuffer]"===i||e.buffer&&"[object ArrayBuffer]"===I.call(e.buffer))){var n,r="__lfsc__:";e instanceof ArrayBuffer?(n=e,r+="arbf"):(n=e.buffer,"[object Int8Array]"===i?r+="si08":"[object Uint8Array]"===i?r+="ui08":"[object Uint8ClampedArray]"===i?r+="uic8":"[object Int16Array]"===i?r+="si16":"[object Uint16Array]"===i?r+="ur16":"[object Int32Array]"===i?r+="si32":"[object Uint32Array]"===i?r+="ui32":"[object Float32Array]"===i?r+="fl32":"[object Float64Array]"===i?r+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(r+D(n))}else if("[object Blob]"===i){var s=new FileReader;s.onload=function(){var i="~~local_forage_type~"+e.type+"~"+D(this.result);t("__lfsc__:blob"+i)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(i){console.error("Couldn't convert value into a JSON string: ",e),t(null,i)}},deserialize:function(e){if("__lfsc__:"!==e.substring(0,O))return JSON.parse(e);var t,i=e.substring(A),n=e.substring(O,A);if("blob"===n&&N.test(i)){var r=i.match(N);t=r[1],i=i.substring(r[0].length)}var o=R(i);switch(n){case"arbf":return o;case"blob":return s([o],{type:t});case"si08":return new Int8Array(o);case"ui08":return new Uint8Array(o);case"uic8":return new Uint8ClampedArray(o);case"si16":return new Int16Array(o);case"ur16":return new Uint16Array(o);case"si32":return new Int32Array(o);case"ui32":return new Uint32Array(o);case"fl32":return new Float32Array(o);case"fl64":return new Float64Array(o);default:throw new Error("Unkown type: "+n)}},stringToBuffer:R,bufferToString:D};function z(e,t,i,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,n)}function L(e,t,i,n,r,s){e.executeSql(i,n,r,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?s(e,o):z(e,t,(function(){e.executeSql(i,n,r,s)}),s)}),s):s(e,o)}),s)}function B(e,t,i,n){var r=this;e=c(e);var s=new o((function(s,o){r.ready().then((function(){void 0===t&&(t=null);var a=t,l=r._dbInfo;l.serializer.serialize(t,(function(t,c){c?o(c):l.db.transaction((function(i){L(i,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){s(a)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void s(B.apply(r,[e,a,i,n-1]));o(t)}}))}))})).catch(o)}));return a(s,i),s}function P(e){return new o((function(t,i){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(i,n){for(var r=[],s=0;s0}var U={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=F(e,this._defaultConfig),q()?(this._dbInfo=t,t.serializer=j,o.resolve()):o.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var i=this,n=i.ready().then((function(){for(var t=i._dbInfo,n=t.keyPrefix,r=n.length,s=localStorage.length,o=1,a=0;a=0;i--){var n=localStorage.key(i);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return a(i,e),i},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var i=this,n=i.ready().then((function(){var t,n=i._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return a(n,t),n},keys:function(e){var t=this,i=t.ready().then((function(){for(var e=t._dbInfo,i=localStorage.length,n=[],r=0;r=0;t--){var i=localStorage.key(t);0===i.indexOf(e)&&localStorage.removeItem(i)}})):o.reject("Invalid arguments"),t),n}},W=function(e,t){for(var i,n,r=e.length,s=0;s=0,i=new("undefined"==typeof XMLSerializer||t?d.DOMParser:XMLSerializer);return this.output=i.serializeToString(e),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){t.resolve(this.output)}.bind(this)).catch((function(e){t.reject(e)})),i}find(e){var t=this,i=[],n=e.toLowerCase();return Object(s.sprint)(t.document,(function(e){!function(e){for(var r,s,o,a=e.textContent.toLowerCase(),l=t.document.createRange(),c=-1;-1!=s;)-1!=(s=a.indexOf(n,c+1))&&((l=t.document.createRange()).setStart(e,s),l.setEnd(e,s+n.length),r=t.cfiFromRange(l),o=e.textContent.length<150?e.textContent:"..."+(o=e.textContent.substring(s-75,s+75))+"...",i.push({cfi:r,excerpt:o})),c=s}(e)})),i}search(e,t=5){if(void 0===document.createTreeWalker)return this.find(e);let i=[];const n=this,r=e.toLowerCase(),s=function(e){const t=e.reduce((e,t)=>e+t.textContent,"").toLowerCase().indexOf(r);if(-1!=t){const s=0,o=t+r.length;let a=0,l=0;if(te+t.textContent.length,0);u.setEnd(h,d>o?o:o-d),r=n.cfiFromRange(u);let f=e.slice(0,a+1).reduce((e,t)=>e+t.textContent,"");f.length>150&&(f=f.substring(t-75,t+75),f="..."+f+"..."),i.push({cfi:r,excerpt:f})}}},o=document.createTreeWalker(n.document,NodeFilter.SHOW_TEXT,null,!1);let a,l=[];for(;a=o.nextNode();)l.push(a),l.length==t&&(s(l.slice(0,t)),l=l.slice(1,t));return l.length>0&&s(l),i}reconcileLayoutSettings(e){var t={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach((function(e){var i,n,r=e.replace("rendition:",""),s=r.indexOf("-");-1!=s&&(i=r.slice(0,s),n=r.slice(s+1),t[i]=n)})),t}cfiFromRange(e){return new l.a(e,this.cfiBase).toString()}cfiFromElement(e){return new l.a(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}};var p=class{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new c.a,this.hooks.content=new c.a,this.hooks.content.register(h.a),this.hooks.content.register(h.b),this.hooks.content.register(h.d),this.epubcfi=new l.a,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,t,i){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||"",this.length=this.items.length,this.items.forEach((e,n)=>{var r,s=this.manifest[e.idref];e.index=n,e.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,e.index,e.id),e.href&&(e.url=t(e.href,!0),e.canonical=i(e.href)),s&&(e.href=s.href,e.url=t(e.href,!0),e.canonical=i(e.href),s.properties.length&&e.properties.push.apply(e.properties,s.properties)),"yes"===e.linear?(e.prev=function(){let t=e.index;for(;t>0;){let e=this.get(t-1);if(e&&e.linear)return e;t-=1}}.bind(this),e.next=function(){let t=e.index;for(;t-1)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(t,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let t=this.get(e);if(t&&t.linear)return t;e+=1}while(e=0)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}},g=i(9),m=i(1);class v{constructor(e,t,i){this.spine=e,this.request=t,this.pause=i||100,this.q=new g.a(this),this.epubcfi=new l.a,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each(function(e){e.linear&&this.q.enqueue(this.process.bind(this),e)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))}createRange(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}process(e){return e.load(this.request).then(function(t){var i=new s.defer,n=this.parse(t,e.cfiBase);return this._locations=this._locations.concat(n),e.unload(),this.processingTimeout=setTimeout(()=>i.resolve(n),this.pause),i.promise}.bind(this))}parse(e,t,i){var n,r,o=[],a=e.ownerDocument,c=Object(s.qs)(a,"body"),h=0,u=i||this.break;if(Object(s.sprint)(c,function(e){var i,s=e.length,a=0;if(0===e.textContent.trim().length)return!1;for(0==h&&((n=this.createRange()).startContainer=e,n.startOffset=0),(i=u-h)>s&&(h+=s,a=s);a=s)h+=s-a,a=s;else{a+=i,n.endContainer=e,n.endOffset=a;let r=new l.a(n,t).toString();o.push(r),h=0}r=e}.bind(this)),n&&n.startContainer&&r){n.endContainer=r,n.endOffset=r.length;let e=new l.a(n,t).toString();o.push(e),h=0}return o}generateFromWords(e,t,i){var n=e?new l.a(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each(function(e){e.linear&&(n?e.index>=n.spinePos&&this.q.enqueue(this.processWords.bind(this),e,t,n,i):this.q.enqueue(this.processWords.bind(this),e,t,n,i))}.bind(this)),this.q.run().then(function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}.bind(this))}processWords(e,t,i,n){return n&&this._locationsWords.length>=n?Promise.resolve():e.load(this.request).then(function(r){var o=new s.defer,a=this.parseWords(r,e,t,i),l=n-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(a.length>=n?a.slice(0,l):a),e.unload(),this.processingTimeout=setTimeout(()=>o.resolve(a),this.pause),o.promise}.bind(this))}countWords(e){return(e=(e=(e=e.replace(/(^\s*)|(\s*$)/gi,"")).replace(/[ ]{2,}/gi," ")).replace(/\n /,"\n")).split(" ").length}parseWords(e,t,i,n){var r,o=t.cfiBase,a=[],c=e.ownerDocument,h=Object(s.qs)(c,"body"),u=i,d=!n||n.spinePos!==t.index;n&&t.index===n.spinePos&&(r=n.findNode(n.range?n.path.steps.concat(n.start.steps):n.path.steps,e.ownerDocument));return Object(s.sprint)(h,function(e){if(!d){if(e!==r)return!1;d=!0}if(e.textContent.length<10&&0===e.textContent.trim().length)return!1;var t,i=this.countWords(e.textContent),n=0;if(0===i)return!1;for((t=u-this._wordCounter)>i&&(this._wordCounter+=i,n=i);n=i)this._wordCounter+=i-n,n=i;else{n+=t;let i=new l.a(e,o);a.push({cfi:i.toString(),wordCount:this._wordCounter}),this._wordCounter=0}e}.bind(this)),a}locationFromCfi(e){let t;return l.a.prototype.isCfiString(e)&&(e=new l.a(e)),0===this._locations.length?-1:(t=Object(s.locationOf)(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(0===this._locations.length)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return e&&this.total?e/this.total:0}cfiFromLocation(e){var t=-1;return"number"!=typeof e&&(e=parseInt(e)),e>=0&&e1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),e>=1){let e=new l.a(this._locations[this.total]);return e.collapse(),e.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return this._locations="string"==typeof e?JSON.parse(e):e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if("string"==typeof e)this._currentCfi=e;else{if("number"!=typeof e)return;this._current=e}0!==this._locations.length&&("string"==typeof e?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit(m.c.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}}r()(v.prototype);var y=v,b=i(7),w=i.n(b);var x=class{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var t;if(!e)throw new Error("Container File Not Found");if(!(t=Object(s.qs)(e,"rootfile")))throw new Error("No RootFile Found");this.packagePath=t.getAttribute("full-path"),this.directory=w.a.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}};var _=class{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,i,n;if(!e)throw new Error("Package File Not Found");if(!(t=Object(s.qs)(e,"metadata")))throw new Error("No Metadata Found");if(!(i=Object(s.qs)(e,"manifest")))throw new Error("No Manifest Found");if(!(n=Object(s.qs)(e,"spine")))throw new Error("No Spine Found");return this.manifest=this.parseManifest(i),this.navPath=this.findNavPath(i),this.ncxPath=this.findNcxPath(i,n),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=Object(s.indexOfElementNode)(n),this.spine=this.parseSpine(n,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=n.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var t={};return t.title=this.getElementText(e,"title"),t.creator=this.getElementText(e,"creator"),t.description=this.getElementText(e,"description"),t.pubdate=this.getElementText(e,"date"),t.publisher=this.getElementText(e,"publisher"),t.identifier=this.getElementText(e,"identifier"),t.language=this.getElementText(e,"language"),t.rights=this.getElementText(e,"rights"),t.modified_date=this.getPropertyText(e,"dcterms:modified"),t.layout=this.getPropertyText(e,"rendition:layout"),t.orientation=this.getPropertyText(e,"rendition:orientation"),t.flow=this.getPropertyText(e,"rendition:flow"),t.viewport=this.getPropertyText(e,"rendition:viewport"),t.media_active_class=this.getPropertyText(e,"media:active-class"),t.spread=this.getPropertyText(e,"rendition:spread"),t}parseManifest(e){var t={},i=Object(s.qsa)(e,"item");return Array.prototype.slice.call(i).forEach((function(e){var i=e.getAttribute("id"),n=e.getAttribute("href")||"",r=e.getAttribute("media-type")||"",s=e.getAttribute("media-overlay")||"",o=e.getAttribute("properties")||"";t[i]={href:n,type:r,overlay:s,properties:o.length?o.split(" "):[]}})),t}parseSpine(e,t){var i=[],n=Object(s.qsa)(e,"itemref");return Array.prototype.slice.call(n).forEach((function(e,t){var n=e.getAttribute("idref"),r=e.getAttribute("properties")||"",s=r.length?r.split(" "):[],o={id:e.getAttribute("id"),idref:n,linear:e.getAttribute("linear")||"yes",properties:s,index:t};i.push(o)})),i}findUniqueIdentifier(e){var t=e.documentElement.getAttribute("unique-identifier");if(!t)return"";var i=e.getElementById(t);return i&&"identifier"===i.localName&&"http://purl.org/dc/elements/1.1/"===i.namespaceURI&&i.childNodes.length>0?i.childNodes[0].nodeValue.trim():""}findNavPath(e){var t=Object(s.qsp)(e,"item",{properties:"nav"});return!!t&&t.getAttribute("href")}findNcxPath(e,t){var i,n=Object(s.qsp)(e,"item",{"media-type":"application/x-dtbncx+xml"});return n||(i=t.getAttribute("toc"))&&(n=e.querySelector("#"+i)),!!n&&n.getAttribute("href")}findCoverPath(e){Object(s.qs)(e,"package").getAttribute("version");var t=Object(s.qsp)(e,"item",{properties:"cover-image"});if(t)return t.getAttribute("href");var i=Object(s.qsp)(e,"meta",{name:"cover"});if(i){var n=i.getAttribute("content"),r=e.getElementById(n);return r?r.getAttribute("href"):""}return!1}getElementText(e,t){var i,n=e.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",t);return n&&0!==n.length&&(i=n[0]).childNodes.length?i.childNodes[0].nodeValue:""}getPropertyText(e,t){var i=Object(s.qsp)(e,"meta",{property:t});return i&&i.childNodes.length?i.childNodes[0].nodeValue:""}load(e){this.metadata=e.metadata;let t=e.readingOrder||e.spine;return this.spine=t.map((e,t)=>(e.index=t,e.linear=e.linear||"yes",e)),e.resources.forEach((e,t)=>{this.manifest[t]=e,e.rel&&"cover"===e.rel[0]&&(this.coverPath=e.href)}),this.spineNodeIndex=0,this.toc=e.toc.map((e,t)=>(e.label=e.title,e)),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}}destroy(){this.manifest=void 0,this.navPath=void 0,this.ncxPath=void 0,this.coverPath=void 0,this.spineNodeIndex=void 0,this.spine=void 0,this.metadata=void 0}};var E=class{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let t,i,n=e.nodeType;n&&(t=Object(s.qs)(e,"html"),i=Object(s.qs)(e,"ncx")),n?t?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):i&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var t,i=0;i(e.label=e.title,e.subitems=e.children?this.load(e.children):[],e))}forEach(e){return this.toc.forEach(e)}},k={application:{ecmascript:["es","ecma"],javascript:"js",ogg:"ogx",pdf:"pdf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],"rdf+xml":"rdf",smil:["smi","smil"],"xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","opf","ncx"],zip:"zip","x-httpd-eruby":"rhtml","x-latex":"latex","x-maker":["frm","maker","frame","fm","fb","book","fbdoc"],"x-object":"o","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","epub+zip":"epub","font-tdpfr":"pfr","inkml+xml":["ink","inkml"],json:"json","jsonml+json":"jsonml","mathml+xml":"mathml","metalink+xml":"metalink",mp4:"mp4s","omdoc+xml":"omdoc",oxps:"oxps","vnd.amazon.ebook":"azw",widget:"wgt","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-otf":"otf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-font-woff":"woff","x-mobipocket-ebook":["prc","mobi"],"x-mspublisher":"pub","x-nzb":"nzb","x-tgif":"obj","xaml+xml":"xaml","xml-dtd":"dtd","xproc+xml":"xpl","xslt+xml":"xslt","internet-property-stream":"acx","x-compress":"z","x-compressed":"tgz","x-gzip":"gz"},audio:{flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp2","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"x-aiff":["aif","aiff","aifc"],"x-ms-wma":"wma","x-wav":"wav",adpcm:"adp",mp4:"mp4a",webm:"weba","x-aac":"aac","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",mid:["mid","rmi"]},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"x-icon":"ico",bmp:"bmp",webp:"webp","x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod"},text:{"cache-manifest":["manifest","appcache"],css:"css",csv:"csv",html:["html","htm","shtml","stm"],mathml:"mml",plain:["txt","text","brf","conf","def","list","log","in","bas"],richtext:"rtx","tab-separated-values":"tsv","x-bibtex":"bib"},video:{mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv"}},T=function(){var e,t,i,n,r={};for(e in k)if(k.hasOwnProperty(e))for(t in k[e])if(k[e].hasOwnProperty(t))if("string"==typeof(i=k[e][t]))r[i]=e+"/"+t;else for(n=0;nObject(s.blob2base64)(e)).then(e=>Object(s.createBase64Url)(e,i)):this.settings.request(e,"blob").then(e=>Object(s.createBlobUrl)(e,i))}replacements(){if("none"===this.settings.replacements)return new Promise(function(e){e(this.urls)}.bind(this));var e=this.urls.map(e=>{var t=this.settings.resolver(e);return this.createUrl(t).catch(e=>(console.error(e),null))});return Promise.all(e).then(e=>(this.replacementUrls=e.filter(e=>"string"==typeof e),e))}replaceCss(e,t){var i=[];return e=e||this.settings.archive,t=t||this.settings.resolver,this.cssUrls.forEach(function(n){var r=this.createCssFile(n,e,t).then(function(e){var t=this.urls.indexOf(n);t>-1&&(this.replacementUrls[t]=e)}.bind(this));i.push(r)}.bind(this)),Promise.all(i)}createCssFile(e){if(w.a.isAbsolute(e))return new Promise((function(e){e()}));var t,i=this.settings.resolver(e);t=this.settings.archive?this.settings.archive.getText(i):this.settings.request(i,"text");var n=this.urls.map(e=>{var t=this.settings.resolver(e);return new a.a(i).relative(t)});return t?t.then(e=>(e=Object(h.e)(e,n,this.replacementUrls),"base64"===this.settings.replacements?Object(s.createBase64Url)(e,"text/css"):Object(s.createBlobUrl)(e,"text/css")),e=>new Promise((function(e){e()}))):new Promise((function(e){e()}))}relativeTo(e,t){return t=t||this.settings.resolver,this.urls.map(function(i){var n=t(i);return new a.a(e).relative(n)}.bind(this))}get(e){var t=this.urls.indexOf(e);if(-1!==t)return this.replacementUrls.length?new Promise(function(e,i){e(this.replacementUrls[t])}.bind(this)):this.createUrl(e)}substitute(e,t){var i;return i=t?this.relativeTo(t):this.urls,Object(h.e)(e,i,this.replacementUrls)}destroy(){this.settings=void 0,this.manifest=void 0,this.resources=void 0,this.replacementUrls=void 0,this.html=void 0,this.assets=void 0,this.css=void 0,this.urls=void 0,this.cssUrls=void 0}};var N=class{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new l.a,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var t=Object(s.qs)(e,"html"),i=Object(s.qs)(e,"ncx");return t?this.parseNav(e):i?this.parseNcx(e):void 0}parseNav(e){var t,i,n=Object(s.querySelectorByType)(e,"nav","page-list"),r=n?Object(s.qsa)(n,"li"):[],o=r.length,a=[];if(!r||0===o)return a;for(t=0;t1&&t[1],href:r,packageUrl:i,page:a}):{href:r,page:a}}process(e){e.forEach((function(e){this.pages.push(e.page),e.cfi&&this.locations.push(e.cfi)}),this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(e){var t=-1;if(0===this.locations.length)return-1;var i=Object(s.indexOfSorted)(e,this.locations,this.epubcfi.compare);return-1!=i?t=this.pages[i]:void 0!==(t=(i=Object(s.locationOf)(e,this.locations,this.epubcfi.compare))-1>=0?this.pages[i-1]:this.pages[0])||(t=-1),t}cfiFromPage(e){var t=-1;"number"!=typeof e&&(e=parseInt(e));var i=this.pages.indexOf(e);return-1!=i&&(t=this.locations[i]),t}pageFromPercentage(e){return Math.round(this.totalPages*e)}percentageFromPage(e){var t=(e-this.firstPage)/this.totalPages;return Math.round(1e3*t)/1e3}percentageFromCfi(e){var t=this.pageFromCfi(e);return this.percentageFromPage(t)}destroy(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0}},O=i(16),A=i(29),I=i.n(A);var R=class{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new I.a}catch(e){throw new Error("JSZip lib not loaded")}}open(e,t){return this.zip.loadAsync(e,{base64:t})}openUrl(e,t){return u(e,"binary").then(function(e){return this.zip.loadAsync(e,{base64:t})}.bind(this))}request(e,t){var i,n=new s.defer,r=new a.a(e);return t||(t=r.extension),(i="blob"==t?this.getBlob(e):this.getText(e))?i.then(function(e){let i=this.handleResponse(e,t);n.resolve(i)}.bind(this)):n.reject({message:"File not found in the epub: "+e,stack:(new Error).stack}),n.promise}handleResponse(e,t){return"json"==t?JSON.parse(e):Object(s.isXml)(t)?Object(s.parse)(e,"text/xml"):"xhtml"==t?Object(s.parse)(e,"application/xhtml+xml"):"html"==t||"htm"==t?Object(s.parse)(e,"text/html"):e}getBlob(e,t){var i=window.decodeURIComponent(e.substr(1)),n=this.zip.file(i);if(n)return t=t||S.lookup(n.name),n.async("uint8array").then((function(e){return new Blob([e],{type:t})}))}getText(e,t){var i=window.decodeURIComponent(e.substr(1)),n=this.zip.file(i);if(n)return n.async("string").then((function(e){return e}))}getBase64(e,t){var i=window.decodeURIComponent(e.substr(1)),n=this.zip.file(i);if(n)return t=t||S.lookup(n.name),n.async("base64").then((function(e){return"data:"+t+";base64,"+e}))}createUrl(e,t){var i,n,r=new s.defer,o=window.URL||window.webkitURL||window.mozURL,a=t&&t.base64;return e in this.urlCache?(r.resolve(this.urlCache[e]),r.promise):(a?(n=this.getBase64(e))&&n.then(function(t){this.urlCache[e]=t,r.resolve(t)}.bind(this)):(n=this.getBlob(e))&&n.then(function(t){i=o.createObjectURL(t),this.urlCache[e]=i,r.resolve(i)}.bind(this)),n||r.reject({message:"File not found in the epub: "+e,stack:(new Error).stack}),r.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.zip=void 0,this.urlCache={}}},D=i(23),j=i.n(D);class z{constructor(e,t,i){this.urlCache={},this.storage=void 0,this.name=e,this.requester=t||u,this.resolver=i,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let e;void 0===j.a&&(e=j.a),this.storage=e.createInstance({name:this.name})}catch(e){throw new Error("localForage lib not loaded")}}addListeners(){this._status=this.status.bind(this),window.addEventListener("online",this._status),window.addEventListener("offline",this._status)}removeListeners(){window.removeEventListener("online",this._status),window.removeEventListener("offline",this._status),this._status=void 0}status(e){let t=navigator.onLine;this.online=t,t?this.emit("online",this):this.emit("offline",this)}add(e,t){let i=e.resources.map(e=>{let{href:i}=e,n=this.resolver(i),r=window.encodeURIComponent(n);return this.storage.getItem(r).then(e=>!e||t?this.requester(n,"binary").then(e=>this.storage.setItem(r,e)):e)});return Promise.all(i)}put(e,t,i){let n=window.encodeURIComponent(e);return this.storage.getItem(n).then(r=>r||this.requester(e,"binary",t,i).then(e=>this.storage.setItem(n,e)))}request(e,t,i,n){return this.online?this.requester(e,t,i,n).then(t=>(this.put(e),t)):this.retrieve(e,t)}retrieve(e,t){new s.defer;var i=new a.a(e);return t||(t=i.extension),("blob"==t?this.getBlob(e):this.getText(e)).then(i=>{var n,r=new s.defer;return i?(n=this.handleResponse(i,t),r.resolve(n)):r.reject({message:"File not found in storage: "+e,stack:(new Error).stack}),r.promise})}handleResponse(e,t){return"json"==t?JSON.parse(e):Object(s.isXml)(t)?Object(s.parse)(e,"text/xml"):"xhtml"==t?Object(s.parse)(e,"application/xhtml+xml"):"html"==t||"htm"==t?Object(s.parse)(e,"text/html"):e}getBlob(e,t){let i=window.encodeURIComponent(e);return this.storage.getItem(i).then((function(i){if(i)return t=t||S.lookup(e),new Blob([i],{type:t})}))}getText(e,t){let i=window.encodeURIComponent(e);return t=t||S.lookup(e),this.storage.getItem(i).then((function(e){var i,n=new s.defer,r=new FileReader;if(e)return i=new Blob([e],{type:t}),r.addEventListener("loadend",()=>{n.resolve(r.result)}),r.readAsText(i,t),n.promise}))}getBase64(e,t){let i=window.encodeURIComponent(e);return t=t||S.lookup(e),this.storage.getItem(i).then(e=>{var i,n=new s.defer,r=new FileReader;if(e)return i=new Blob([e],{type:t}),r.addEventListener("loadend",()=>{n.resolve(r.result)}),r.readAsDataURL(i,t),n.promise})}createUrl(e,t){var i,n,r=new s.defer,o=window.URL||window.webkitURL||window.mozURL,a=t&&t.base64;return e in this.urlCache?(r.resolve(this.urlCache[e]),r.promise):(a?(n=this.getBase64(e))&&n.then(function(t){this.urlCache[e]=t,r.resolve(t)}.bind(this)):(n=this.getBlob(e))&&n.then(function(t){i=o.createObjectURL(t),this.urlCache[e]=i,r.resolve(i)}.bind(this)),n||r.reject({message:"File not found in storage: "+e,stack:(new Error).stack}),r.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.urlCache={},this.removeListeners()}}r()(z.prototype);var L=z;var B=class{constructor(e){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",e&&this.parse(e)}parse(e){if(!e)return this;const t=Object(s.qs)(e,"display_options");if(!t)return this;return Object(s.qsa)(t,"option").forEach(e=>{let t="";switch(e.childNodes.length&&(t=e.childNodes[0].nodeValue),e.attributes.name.value){case"interactive":this.interactive=t;break;case"fixed-layout":this.fixedLayout=t;break;case"open-to-spread":this.openToSpread=t;break;case"orientation-lock":this.orientationLock=t}}),this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}};const P="binary",M="base64",F="epub",q="opf",U="json",W="directory";class H{constructor(e,t){void 0===t&&"string"!=typeof e&&e instanceof Blob==!1&&e instanceof ArrayBuffer==!1&&(t=e,e=void 0),this.settings=Object(s.extend)(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:void 0,canonical:void 0,openAs:void 0,store:void 0}),Object(s.extend)(this.settings,t),this.opening=new s.defer,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new s.defer,spine:new s.defer,metadata:new s.defer,cover:new s.defer,navigation:new s.defer,pageList:new s.defer,resources:new s.defer,displayOptions:new s.defer},this.loaded={manifest:this.loading.manifest.promise,spine:this.loading.spine.promise,metadata:this.loading.metadata.promise,cover:this.loading.cover.promise,navigation:this.loading.navigation.promise,pageList:this.loading.pageList.promise,resources:this.loading.resources.promise,displayOptions:this.loading.displayOptions.promise},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources,this.loaded.displayOptions]),this.isRendered=!1,this.request=this.settings.requestMethod||u,this.spine=new p,this.locations=new y(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),e&&this.open(e,this.settings.openAs).catch(t=>{var i=new Error("Cannot load book at "+e);this.emit(m.c.BOOK.OPEN_FAILED,i)})}open(e,t){var i,n=t||this.determineType(e);return n===P?(this.archived=!0,this.url=new o.a("/",""),i=this.openEpub(e)):n===M?(this.archived=!0,this.url=new o.a("/",""),i=this.openEpub(e,n)):n===F?(this.archived=!0,this.url=new o.a("/",""),i=this.request(e,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))):n==q?(this.url=new o.a(e),i=this.openPackaging(this.url.Path.toString())):n==U?(this.url=new o.a(e),i=this.openManifest(this.url.Path.toString())):(this.url=new o.a(e),i=this.openContainer("META-INF/container.xml").then(this.openPackaging.bind(this))),i}openEpub(e,t){return this.unarchive(e,t||this.settings.encoding).then(()=>this.openContainer("META-INF/container.xml")).then(e=>this.openPackaging(e))}openContainer(e){return this.load(e).then(e=>(this.container=new x(e),this.resolve(this.container.packagePath)))}openPackaging(e){return this.path=new a.a(e),this.load(e).then(e=>(this.packaging=new _(e),this.unpack(this.packaging)))}openManifest(e){return this.path=new a.a(e),this.load(e).then(e=>(this.packaging=new _,this.packaging.load(e),this.unpack(this.packaging)))}load(e){var t=this.resolve(e);return this.archived?this.archive.request(t):this.request(t,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(e,t){if(e){var i=e;return e.indexOf("://")>-1?e:(this.path&&(i=this.path.resolve(e)),0!=t&&this.url&&(i=this.url.resolve(i)),i)}}canonical(e){return e?this.settings.canonical?this.settings.canonical(e):this.resolve(e,!0):""}determineType(e){var t;return"base64"===this.settings.encoding?M:"string"!=typeof e?P:((t=new o.a(e).path().extension)&&(t=t.replace(/\?.*$/,"")),t?"epub"===t?F:"opf"===t?q:"json"===t?U:void 0:W)}unpack(e){this.package=e,""===this.packaging.metadata.layout?this.load(this.url.resolve("META-INF/com.apple.ibooks.display-options.xml")).then(e=>{this.displayOptions=new B(e),this.loading.displayOptions.resolve(this.displayOptions)}).catch(e=>{this.displayOptions=new B,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new B,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new C(this.packaging.manifest,{archive:this.archive,resolver:this.resolve.bind(this),request:this.request.bind(this),replacements:this.settings.replacements||(this.archived?"blobUrl":"base64")}),this.loadNavigation(this.packaging).then(()=>{this.loading.navigation.resolve(this.navigation)}),this.packaging.coverPath&&(this.cover=this.resolve(this.packaging.coverPath)),this.loading.manifest.resolve(this.packaging.manifest),this.loading.metadata.resolve(this.packaging.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived||this.settings.replacements&&"none"!=this.settings.replacements?this.replacements().then(()=>{this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}).catch(e=>{console.error(e)}):this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}loadNavigation(e){let t=e.navPath||e.ncxPath,i=e.toc;return i?new Promise((t,n)=>{this.navigation=new E(i),e.pageList&&(this.pageList=new N(e.pageList)),t(this.navigation)}):t?this.load(t,"xml").then(e=>(this.navigation=new E(e),this.pageList=new N(e),this.navigation)):new Promise((e,t)=>{this.navigation=new E,this.pageList=new N,e(this.navigation)})}section(e){return this.spine.get(e)}renderTo(e,t){return this.rendition=new O.a(this,t),this.rendition.attachTo(e),this.rendition}setRequestCredentials(e){this.settings.requestCredentials=e}setRequestHeaders(e){this.settings.requestHeaders=e}unarchive(e,t){return this.archive=new R,this.archive.open(e,t)}store(e){let t=this.settings.replacements&&"none"!==this.settings.replacements,i=this.url,n=this.settings.requestMethod||u.bind(this);return this.storage=new L(e,n,this.resolve.bind(this)),this.request=this.storage.request.bind(this.storage),this.opened.then(()=>{this.archived&&(this.storage.requester=this.archive.request.bind(this.archive));let e=(e,t)=>{t.output=this.resources.substitute(e,t.url)};this.resources.settings.replacements=t||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new o.a("/",""),this.spine.hooks.serialize.register(e)}),this.storage.on("online",()=>{this.url=i,this.spine.hooks.serialize.deregister(e)})}),this.storage}coverUrl(){return this.loaded.cover.then(()=>this.cover?this.archived?this.archive.createUrl(this.cover):this.cover:null)}replacements(){return this.spine.hooks.serialize.register((e,t)=>{t.output=this.resources.substitute(e,t.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(e){var t=new l.a(e),i=this.spine.get(t.spinePos),n=this.load.bind(this);return i?i.load(n).then((function(e){return t.toRange(i.document)})):new Promise((e,t)=>{t("CFI could not be found")})}key(e){var t=e||this.packaging.metadata.identifier||this.url.filename;return`epubjs:${m.b}:${t}`}destroy(){this.opened=void 0,this.loading=void 0,this.loaded=void 0,this.ready=void 0,this.isOpen=!1,this.isRendered=!1,this.spine&&this.spine.destroy(),this.locations&&this.locations.destroy(),this.pageList&&this.pageList.destroy(),this.archive&&this.archive.destroy(),this.resources&&this.resources.destroy(),this.container&&this.container.destroy(),this.packaging&&this.packaging.destroy(),this.rendition&&this.rendition.destroy(),this.displayOptions&&this.displayOptions.destroy(),this.spine=void 0,this.locations=void 0,this.pageList=void 0,this.archive=void 0,this.resources=void 0,this.container=void 0,this.packaging=void 0,this.rendition=void 0,this.navigation=void 0,this.url=void 0,this.path=void 0,this.archived=!1}}r()(H.prototype);t.a=H},function(e,t,i){var n=i(14).NAMESPACE;function r(e){return""!==e}function s(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function o(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(r):[]}(e);return Object.keys(t.reduce(s,{}))}function a(e,t){for(var i in e)t[i]=e[i]}function l(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,a(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var c={},h=c.ELEMENT_NODE=1,u=c.ATTRIBUTE_NODE=2,d=c.TEXT_NODE=3,f=c.CDATA_SECTION_NODE=4,p=c.ENTITY_REFERENCE_NODE=5,g=c.ENTITY_NODE=6,m=c.PROCESSING_INSTRUCTION_NODE=7,v=c.COMMENT_NODE=8,y=c.DOCUMENT_NODE=9,b=c.DOCUMENT_TYPE_NODE=10,w=c.DOCUMENT_FRAGMENT_NODE=11,x=c.NOTATION_NODE=12,_={},E={},k=(_.INDEX_SIZE_ERR=(E[1]="Index size error",1),_.DOMSTRING_SIZE_ERR=(E[2]="DOMString size error",2),_.HIERARCHY_REQUEST_ERR=(E[3]="Hierarchy request error",3)),T=(_.WRONG_DOCUMENT_ERR=(E[4]="Wrong document",4),_.INVALID_CHARACTER_ERR=(E[5]="Invalid character",5),_.NO_DATA_ALLOWED_ERR=(E[6]="No data allowed",6),_.NO_MODIFICATION_ALLOWED_ERR=(E[7]="No modification allowed",7),_.NOT_FOUND_ERR=(E[8]="Not found",8)),S=(_.NOT_SUPPORTED_ERR=(E[9]="Not supported",9),_.INUSE_ATTRIBUTE_ERR=(E[10]="Attribute in use",10));_.INVALID_STATE_ERR=(E[11]="Invalid state",11),_.SYNTAX_ERR=(E[12]="Syntax error",12),_.INVALID_MODIFICATION_ERR=(E[13]="Invalid modification",13),_.NAMESPACE_ERR=(E[14]="Invalid namespace",14),_.INVALID_ACCESS_ERR=(E[15]="Invalid access",15);function C(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,E[e]),this.message=E[e],Error.captureStackTrace&&Error.captureStackTrace(this,C);return i.code=e,t&&(this.message=this.message+": "+t),i}function N(){}function O(e,t){this._node=e,this._refresh=t,A(this)}function A(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var i=e._refresh(e._node);ae(e,"length",i.length),a(i,e),e._inc=t}}function I(){}function R(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function D(e,t,i,r){if(r?t[R(t,r)]=i:t[t.length++]=i,e){i.ownerElement=e;var s=e.ownerDocument;s&&(r&&F(s,e,r),function(e,t,i){e&&e._inc++,i.namespaceURI===n.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(s,e,i))}}function j(e,t,i){var n=R(t,i);if(!(n>=0))throw C(T,new Error(e.tagName+"@"+i));for(var r=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function P(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(P(e,t))return!0}while(e=e.nextSibling)}function M(){}function F(e,t,i,r){e&&e._inc++,i.namespaceURI===n.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function q(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,s=0;r;)n[s++]=r,r=r.nextSibling;n.length=s}}}function U(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,q(e.ownerDocument,e),t}function W(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===w){var r=t.firstChild;if(null==r)return t;var s=t.lastChild}else r=s=t;var o=i?i.previousSibling:e.lastChild;r.previousSibling=o,s.nextSibling=i,o?o.nextSibling=r:e.firstChild=r,null==i?e.lastChild=s:i.previousSibling=s;do{r.parentNode=e}while(r!==s&&(r=r.nextSibling));return q(e.ownerDocument||e,e),t.nodeType==w&&(t.firstChild=t.lastChild=null),t}function H(){this._nsMap={}}function $(){}function X(){}function Y(){}function V(){}function Z(){}function G(){}function K(){}function Q(){}function J(){}function ee(){}function te(){}function ie(){}function ne(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&null==r&&null==(r=n.lookupPrefix(s)))var o=[{namespace:s,prefix:null}];return oe(this,i,e,t,o),i.join("")}function re(e,t,i){var r=e.prefix||"",s=e.namespaceURI;if(!s)return!1;if("xml"===r&&s===n.XML||s===n.XMLNS)return!1;for(var o=i.length;o--;){var a=i[o];if(a.prefix===r)return a.namespace!==s}return!0}function se(e,t,i){e.push(" ",t,'="',i.replace(/[<&"]/g,B),'"')}function oe(e,t,i,r,s){if(s||(s=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case h:var o=e.attributes,a=o.length,l=e.firstChild,c=e.tagName,g=c;if(!(i=n.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var x,_=0;_=0;E--){if(""===(k=s[E]).prefix&&k.namespace===e.namespaceURI){x=k.namespace;break}}if(x!==e.namespaceURI)for(E=s.length-1;E>=0;E--){var k;if((k=s[E]).namespace===e.namespaceURI){k.prefix&&(g=k.prefix+":"+c);break}}}t.push("<",g);for(var T=0;T"),i&&/^script$/i.test(c))for(;l;)l.data?t.push(l.data):oe(l,t,i,r,s.slice()),l=l.nextSibling;else for(;l;)oe(l,t,i,r,s.slice()),l=l.nextSibling;t.push("")}else t.push("/>");return;case y:case w:for(l=e.firstChild;l;)oe(l,t,i,r,s.slice()),l=l.nextSibling;return;case u:return se(t,e.name,e.value);case d:return t.push(e.data.replace(/[<&]/g,B).replace(/]]>/g,"]]>"));case f:return t.push("");case v:return t.push("\x3c!--",e.data,"--\x3e");case b:var O=e.publicId,A=e.systemId;if(t.push("");else if(A&&"."!=A)t.push(" SYSTEM ",A,">");else{var I=e.internalSubset;I&&t.push(" [",I,"]"),t.push(">")}return;case m:return t.push("");case p:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ae(e,t,i){e[t]=i}C.prototype=Error.prototype,a(_,C),N.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==u?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==u?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},a(c,L),a(c,L.prototype),M.prototype={nodeName:"#document",nodeType:y,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==w){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==h&&(this.documentElement=e),W(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),U(this,e)},importNode:function(e,t){return function e(t,i,n){var r;switch(i.nodeType){case h:(r=i.cloneNode(!1)).ownerDocument=t;case w:break;case u:n=!0}r||(r=i.cloneNode(!1));if(r.ownerDocument=t,r.parentNode=null,n)for(var s=i.firstChild;s;)r.appendChild(e(t,s,n)),s=s.nextSibling;return r}(this,e,t)},getElementById:function(e){var t=null;return P(this.documentElement,(function(i){if(i.nodeType==h&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=o(e);return new O(this,(function(i){var n=[];return t.length>0&&P(i.documentElement,(function(r){if(r!==i&&r.nodeType===h){var s=r.getAttribute("class");if(s){var a=e===s;if(!a){var l=o(s);a=t.every((c=l,function(e){return c&&-1!==c.indexOf(e)}))}a&&n.push(r)}}var c})),n}))},createElement:function(e){var t=new H;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new N,(t.attributes=new I)._ownerElement=t,t},createDocumentFragment:function(){var e=new ee;return e.ownerDocument=this,e.childNodes=new N,e},createTextNode:function(e){var t=new Y;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new V;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Z;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new te;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new $;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new H,n=t.split(":"),r=i.attributes=new I;return i.childNodes=new N,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new $,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},l(M,L),H.prototype={nodeType:h,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===w?this.insertBefore(e,null):function(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t);n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,q(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new O(this,(function(t){var i=[];return P(t,(function(n){n===t||n.nodeType!=h||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new O(this,(function(i){var n=[];return P(i,(function(r){r===i||r.nodeType!==h||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},M.prototype.getElementsByTagName=H.prototype.getElementsByTagName,M.prototype.getElementsByTagNameNS=H.prototype.getElementsByTagNameNS,l(H,L),$.prototype.nodeType=u,l($,L),X.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(E[k])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},l(X,L),Y.prototype={nodeName:"#text",nodeType:d,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},l(Y,X),V.prototype={nodeName:"#comment",nodeType:v},l(V,X),Z.prototype={nodeName:"#cdata-section",nodeType:f},l(Z,X),G.prototype.nodeType=b,l(G,L),K.prototype.nodeType=x,l(K,L),Q.prototype.nodeType=g,l(Q,L),J.prototype.nodeType=p,l(J,L),ee.prototype.nodeName="#document-fragment",ee.prototype.nodeType=w,l(ee,L),te.prototype.nodeType=m,l(te,L),ie.prototype.serializeToString=function(e,t,i){return ne.call(e,t,i)},L.prototype.toString=ne;try{if(Object.defineProperty){Object.defineProperty(O.prototype,"length",{get:function(){return A(this),this.$$length}}),Object.defineProperty(L.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case h:case w:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case h:case w:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ae=function(e,t,i){e["$$"+t]=i}}}catch(e){}t.DocumentType=G,t.DOMException=C,t.DOMImplementation=z,t.Element=H,t.Node=L,t.NodeList=N,t.XMLSerializer=ie},function(e,t,i){var n=i(52),r="object"==typeof self&&self&&self.Object===Object&&self,s=n||r||Function("return this")();e.exports=s},function(e,t,i){var n=i(26).Symbol;e.exports=n},function(e,t,i){var n=i(21),r=i(19);e.exports=function(e,t,i){var s=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(i)&&(s="leading"in i?!!i.leading:s,o="trailing"in i?!!i.trailing:o),n(e,t,{leading:s,maxWait:t,trailing:o})}},function(t,i){t.exports=e},function(e,t,i){"use strict";i.r(t),function(e){var n=i(24),r=i(16),s=i(2),o=i(12),a=i(0),l=i(1);i(20),i(10),i(22);function c(e,t){return new n.a(e,t)}c.VERSION=l.b,void 0!==e&&(e.EPUBJS_VERSION=l.b),c.Book=n.a,c.Rendition=r.a,c.Contents=o.a,c.CFI=s.a,c.utils=a,t.default=c}.call(this,i(17))},function(e,t,i){"use strict";var n=i(32),r=i(40),s=i(41),o=i(42);(e.exports=function(e,t){var i,s,a,l,c;return arguments.length<2||"string"!=typeof e?(l=t,t=e,e=null):l=arguments[2],null==e?(i=a=!0,s=!1):(i=o.call(e,"c"),s=o.call(e,"e"),a=o.call(e,"w")),c={value:t,configurable:i,enumerable:s,writable:a},l?n(r(l),c):c}).gs=function(e,t,i){var a,l,c,h;return"string"!=typeof e?(c=i,i=t,t=e,e=null):c=arguments[3],null==t?t=void 0:s(t)?null==i?i=void 0:s(i)||(c=i,i=void 0):(c=t,t=i=void 0),null==e?(a=!0,l=!1):(a=o.call(e,"c"),l=o.call(e,"e")),h={get:t,set:i,configurable:a,enumerable:l},c?n(r(c),h):h}},function(e,t,i){"use strict";e.exports=i(33)()?Object.assign:i(34)},function(e,t,i){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,i){"use strict";var n=i(35),r=i(39),s=Math.max;e.exports=function(e,t){var i,o,a,l=s(arguments.length,2);for(e=Object(r(e)),a=function(n){try{e[n]=t[n]}catch(e){i||(i=e)}},o=1;o-1}},function(e,t,i){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,i){var n=i(14),r=i(25),s=i(47),o=i(48),a=r.DOMImplementation,l=n.NAMESPACE,c=o.ParseError,h=o.XMLReader;function u(e){this.options=e||{locator:{}}}function d(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function p(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function m(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}u.prototype.parseFromString=function(e,t){var i=this.options,n=new h,r=i.domBuilder||new d,o=i.errorHandler,a=i.locator,c=i.xmlns||{},u=/\/x?html?$/.test(t),f=u?s.HTML_ENTITIES:s.XML_ENTITIES;return a&&r.setDocumentLocator(a),n.errorHandler=function(e,t,i){if(!e){if(t instanceof d)return t;e=t}var n={},r=e instanceof Function;function s(t){var s=e[t];!s&&r&&(s=2==e.length?function(i){e(t,i)}:e),n[t]=s&&function(e){s("[xmldom "+t+"]\t"+e+p(i))}||function(){}}return i=i||{},s("warning"),s("error"),s("fatalError"),n}(o,r,a),n.domBuilder=i.domBuilder||r,u&&(c[""]=l.HTML),c.xml=c.xml||l.XML,e&&"string"==typeof e?n.parse(e,c,f):n.errorHandler.error("invalid doc source"),r.doc},d.prototype={startDocument:function(){this.doc=(new a).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,s=r.createElementNS(e,i||t),o=n.length;m(this,s),this.currentElement=s,this.locator&&f(this.locator,s);for(var a=0;a",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),t.entityMap=t.HTML_ENTITIES},function(e,t,i){var n=i(14).NAMESPACE,r=/[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]/,s=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),o=new RegExp("^"+r.source+s.source+"*(?::"+r.source+s.source+"*)?$");function a(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,a)}function l(){}function c(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function h(e,t,i,r,s,o){function a(e,t,n){i.attributeNames.hasOwnProperty(e)&&o.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}for(var l,c=++t,h=0;;){var u=e.charAt(c);switch(u){case"=":if(1===h)l=e.slice(t,c),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 "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(u,t))>0))throw new Error("attribute value no end '"+u+"' match");a(l,d=e.slice(t,c).replace(/&#?\w+;/g,s),t-1),h=5}else{if(4!=h)throw new Error('attribute value must after "="');a(l,d=e.slice(t,c).replace(/&#?\w+;/g,s),t),o.warning('attribute "'+l+'" missed start quot('+u+")!!"),t=c+1,h=5}break;case"/":switch(h){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:h=7,i.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&&i.setTagName(e.slice(t,c)),c;case">":switch(h){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,c)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===h&&(d=l),4==h?(o.warning('attribute "'+d+'" missed quot(")!'),a(l,d.replace(/&#?\w+;/g,s),t)):(n.isHTML(r[""])&&d.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return c;case"€":u=" ";default:if(u<=" ")switch(h){case 0:i.setTagName(e.slice(t,c)),h=6;break;case 1:l=e.slice(t,c),h=2;break;case 4:var d=e.slice(t,c).replace(/&#?\w+;/g,s);o.warning('attribute "'+d+'" missed quot(")!!'),a(l,d,t);case 5:h=6}else switch(h){case 2:i.tagName;n.isHTML(r[""])&&l.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,t),t=c,h=1;break;case 5:o.warning('attribute space is required"'+l+'"!!');case 6:h=1,t=c;break;case 3:h=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function u(e,t,i){for(var r=e.tagName,s=null,o=e.length;o--;){var a=e[o],l=a.qName,c=a.value;if((f=l.indexOf(":"))>0)var h=a.prefix=l.slice(0,f),u=l.slice(f+1),d="xmlns"===h&&u;else u=l,h=null,d="xmlns"===l&&"";a.localName=u,!1!==d&&(null==s&&(s={},p(i,i={})),i[d]=s[d]=c,a.uri=n.XMLNS,t.startPrefixMapping(d,c))}for(o=e.length;o--;){(h=(a=e[o]).prefix)&&("xml"===h&&(a.uri=n.XML),"xmlns"!==h&&(a.uri=i[h||""]))}var f;(f=r.indexOf(":"))>0?(h=e.prefix=r.slice(0,f),u=e.localName=r.slice(f+1)):(h=null,u=e.localName=r);var g=e.uri=i[h||""];if(t.startElement(g,u,r,e),!e.closed)return e.currentNSMap=i,e.localNSMap=s,!0;if(t.endElement(g,u,r),s)for(h in s)t.endPrefixMapping(h)}function d(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=e.indexOf("",t),o=e.substring(t+1,s);if(/[&<]/.test(o))return/^script$/i.test(i)?(r.characters(o,0,o.length),s):(o=o.replace(/&#?\w+;/g,n),r.characters(o,0,o.length),s)}return t+1}function f(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf(""))t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var s=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),o=s.length;if(o>1&&/!doctype/i.test(s[0][0])){var a=s[1][0],l=!1,c=!1;o>3&&(/^public$/i.test(s[2][0])?(l=s[3][0],c=o>4&&s[4][0]):/^system$/i.test(s[2][0])&&(c=s[3][0]));var h=s[o-1];return i.startDTD(a,l,c),i.endDTD(),h.index+h[0].length}}return-1}function m(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return i.processingInstruction(r[1],r[2]),n+2}return-1}return-1}function v(){this.attributeNames={}}a.prototype=new Error,a.prototype.name=a.name,l.prototype={parse:function(e,t,i){var r=this.domBuilder;r.startDocument(),p(t,t={}),function(e,t,i,r,s){function o(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(s.error("entity not found:"+e),e)}function l(t){if(t>k){var i=e.substring(k,t).replace(/&#?\w+;/g,o);x&&p(k),r.characters(i,0,t-k),k=t}}function p(t,i){for(;t>=b&&(i=w.exec(e));)y=i.index,b=y+i[0].length,x.lineNumber++;x.columnNumber=t-y+1}var y=0,b=0,w=/.*(?:\r\n?|\n)|.*$/g,x=r.locator,_=[{currentNSMap:t}],E={},k=0;for(;;){try{var T=e.indexOf("<",k);if(T<0){if(!e.substr(k).match(/^\s*$/)){var S=r.doc,C=S.createTextNode(e.substr(k));S.appendChild(C),r.currentElement=C}return}switch(T>k&&l(T),e.charAt(T+1)){case"/":var N=e.indexOf(">",T+3),O=e.substring(T+2,N).replace(/[ \t\n\r]+$/g,""),A=_.pop();N<0?(O=e.substring(T+2).replace(/[\s<].*/,""),s.error("end tag name: "+O+" is not complete:"+A.tagName),N=T+1+O.length):O.match(/\sk?k=N:l(Math.max(T,k)+1)}}(e,t,i,r,this.errorHandler),r.endDocument()}},v.prototype={setTagName:function(e){if(!o.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!o.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=l,t.ParseError=a},function(e,t,i){"use strict";function n(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=n,t.default={createElement:n}},function(e,t,i){"use strict";function n(e,t){function i(i){for(var n=t.length-1;n>=0;n--){var o=t[n],a=i.clientX,l=i.clientY;if(i.touches&&i.touches.length&&(a=i.touches[0].clientX,l=i.touches[0].clientY),s(o,e,a,l)){o.dispatchEvent(r(i));break}}}if("iframe"===e.nodeName||"IFRAME"===e.nodeName)try{this.target=e.contentDocument}catch(t){this.target=e}else this.target=e;for(var n=["mouseup","mousedown","click","touchstart"],o=0;oi&&a>t}if(!s(e.getBoundingClientRect(),i,n))return!1;for(var o=e.getClientRects(),a=0,l=o.length;a0&&e-1 in t)}function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}x.fn=x.prototype={jquery:"3.7.1",constructor:x,length:0,toArray:function(){return r.call(this)},get:function(t){return null==t?r.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=x.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return x.each(this,t)},map:function(t){return this.pushStack(x.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i+~]|"+C+")"+C+"*"),q=new RegExp(C+"|>"),U=new RegExp(P),W=new RegExp("^"+z+"$"),$={ID:new RegExp("^#("+z+")"),CLASS:new RegExp("^\\.("+z+")"),TAG:new RegExp("^("+z+"|[*])"),ATTR:new RegExp("^"+L),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+C+"*(even|odd|(([+-]|)(\\d*)n|)"+C+"*(?:([+-]|)"+C+"*(\\d+)|))"+C+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+C+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+C+"*((?:-\\d)?\\d*)"+C+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,V=/[+~]/,Z=new RegExp("\\\\[\\da-fA-F]{1,6}"+C+"?|\\\\([^\\r\\n\\f])","g"),G=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},K=function(){lt()},Q=dt((function(t){return!0===t.disabled&&E(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(i=r.call(A.childNodes),A.childNodes),i[A.childNodes.length].nodeType}catch(t){m={apply:function(t,e){R.apply(t,r.call(e))},call:function(t){R.apply(t,r.call(arguments,1))}}}function J(t,e,i,n){var r,s,o,a,l,c,u,g=e&&e.ownerDocument,y=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return i;if(!n&&(lt(e),e=e||h,d)){if(11!==y&&(l=Y.exec(t)))if(r=l[1]){if(9===y){if(!(o=e.getElementById(r)))return i;if(o.id===r)return m.call(i,o),i}else if(g&&(o=g.getElementById(r))&&J.contains(e,o)&&o.id===r)return m.call(i,o),i}else{if(l[2])return m.apply(i,e.getElementsByTagName(t)),i;if((r=l[3])&&e.getElementsByClassName)return m.apply(i,e.getElementsByClassName(r)),i}if(!(I[t+" "]||p&&p.test(t))){if(u=t,g=e,1===y&&(q.test(t)||F.test(t))){for((g=V.test(t)&&at(e.parentNode)||e)==e&&f.scope||((a=e.getAttribute("id"))?a=x.escapeSelector(a):e.setAttribute("id",a=v)),s=(c=ct(t)).length;s--;)c[s]=(a?"#"+a:":scope")+" "+ut(c[s]);u=c.join(",")}try{return m.apply(i,g.querySelectorAll(u)),i}catch(e){I(t,!0)}finally{a===v&&e.removeAttribute("id")}}}return yt(t.replace(N,"$1"),e,i,n)}function tt(){var t=[];return function e(i,r){return t.push(i+" ")>n.cacheLength&&delete e[t.shift()],e[i+" "]=r}}function et(t){return t[v]=!0,t}function it(t){var e=h.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return E(e,"input")&&e.type===t}}function rt(t){return function(e){return(E(e,"input")||E(e,"button"))&&e.type===t}}function st(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Q(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ot(t){return et((function(e){return e=+e,et((function(i,n){for(var r,s=t([],i.length,e),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))}))}))}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var e,i=t?t.ownerDocument||t:A;return i!=h&&9===i.nodeType&&i.documentElement?(u=(h=i).documentElement,d=!x.isXMLDoc(h),g=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&A!=h&&(e=h.defaultView)&&e.top!==e&&e.addEventListener("unload",K),f.getById=it((function(t){return u.appendChild(t).id=x.expando,!h.getElementsByName||!h.getElementsByName(x.expando).length})),f.disconnectedMatch=it((function(t){return g.call(t,"*")})),f.scope=it((function(){return h.querySelectorAll(":scope")})),f.cssHas=it((function(){try{return h.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),f.getById?(n.filter.ID=function(t){var e=t.replace(Z,G);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var i=e.getElementById(t);return i?[i]:[]}}):(n.filter.ID=function(t){var e=t.replace(Z,G);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var i,n,r,s=e.getElementById(t);if(s){if((i=s.getAttributeNode("id"))&&i.value===t)return[s];for(r=e.getElementsByName(t),n=0;s=r[n++];)if((i=s.getAttributeNode("id"))&&i.value===t)return[s]}return[]}}),n.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},n.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&d)return e.getElementsByClassName(t)},p=[],it((function(t){var e;u.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||p.push("\\["+C+"*(?:value|"+j+")"),t.querySelectorAll("[id~="+v+"-]").length||p.push("~="),t.querySelectorAll("a#"+v+"+*").length||p.push(".#.+[+~]"),t.querySelectorAll(":checked").length||p.push(":checked"),(e=h.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),u.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&p.push(":enabled",":disabled"),(e=h.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||p.push("\\["+C+"*name"+C+"*="+C+"*(?:''|\"\")")})),f.cssHas||p.push(":has"),p=p.length&&new RegExp(p.join("|")),D=function(t,e){if(t===e)return l=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!f.sortDetached&&e.compareDocumentPosition(t)===i?t===h||t.ownerDocument==A&&J.contains(A,t)?-1:e===h||e.ownerDocument==A&&J.contains(A,e)?1:o?a.call(o,t)-a.call(o,e):0:4&i?-1:1)},h):h}for(e in J.matches=function(t,e){return J(t,null,null,e)},J.matchesSelector=function(t,e){if(lt(t),d&&!I[e+" "]&&(!p||!p.test(e)))try{var i=g.call(t,e);if(i||f.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){I(e,!0)}return J(e,h,null,[t]).length>0},J.contains=function(t,e){return(t.ownerDocument||t)!=h&<(t),x.contains(t,e)},J.attr=function(t,e){(t.ownerDocument||t)!=h&<(t);var i=n.attrHandle[e.toLowerCase()],r=i&&c.call(n.attrHandle,e.toLowerCase())?i(t,e,!d):void 0;return void 0!==r?r:t.getAttribute(e)},J.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},x.uniqueSort=function(t){var e,i=[],n=0,s=0;if(l=!f.sortStable,o=!f.sortStable&&r.call(t,0),T.call(t,D),l){for(;e=t[s++];)e===t[s]&&(n=i.push(s));for(;n--;)S.call(t,i[n],1)}return o=null,t},x.fn.uniqueSort=function(){return this.pushStack(x.uniqueSort(r.apply(this)))},(n=x.expr={cacheLength:50,createPseudo:et,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,G),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,G),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||J.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&J.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return $.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&U.test(i)&&(e=ct(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,G).toLowerCase();return"*"===t?function(){return!0}:function(t){return E(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+C+")"+t+"("+C+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var r=J.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r.replace(B," ")+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var s="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var h,c,u,d,f,p=s!==o?"nextSibling":"previousSibling",g=e.parentNode,m=a&&e.nodeName.toLowerCase(),b=!l&&!a,w=!1;if(g){if(s){for(;p;){for(u=e;u=u[p];)if(a?E(u,m):1===u.nodeType)return!1;f=p="only"===t&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&b){for(w=(d=(h=(c=g[v]||(g[v]={}))[t]||[])[0]===y&&h[1])&&h[2],u=d&&g.childNodes[d];u=++d&&u&&u[p]||(w=d=0)||f.pop();)if(1===u.nodeType&&++w&&u===e){c[t]=[y,d,w];break}}else if(b&&(w=d=(h=(c=e[v]||(e[v]={}))[t]||[])[0]===y&&h[1]),!1===w)for(;(u=++d&&u&&u[p]||(w=d=0)||f.pop())&&(!(a?E(u,m):1===u.nodeType)||!++w||(b&&((c=u[v]||(u[v]={}))[t]=[y,w]),u!==e)););return(w-=r)===n||w%n==0&&w/n>=0}}},PSEUDO:function(t,e){var i,r=n.pseudos[t]||n.setFilters[t.toLowerCase()]||J.error("unsupported pseudo: "+t);return r[v]?r(e):r.length>1?(i=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,i){for(var n,s=r(t,e),o=s.length;o--;)t[n=a.call(t,s[o])]=!(i[n]=s[o])})):function(t){return r(t,0,i)}):r}},pseudos:{not:et((function(t){var e=[],i=[],n=vt(t.replace(N,"$1"));return n[v]?et((function(t,e,i,r){for(var s,o=n(t,null,r,[]),a=t.length;a--;)(s=o[a])&&(t[a]=!(e[a]=s))})):function(t,r,s){return e[0]=t,n(e,null,s,i),e[0]=null,!i.pop()}})),has:et((function(t){return function(e){return J(t,e).length>0}})),contains:et((function(t){return t=t.replace(Z,G),function(e){return(e.textContent||x.text(e)).indexOf(t)>-1}})),lang:et((function(t){return W.test(t||"")||J.error("unsupported lang: "+t),t=t.replace(Z,G).toLowerCase(),function(e){var i;do{if(i=d?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===u},focus:function(t){return t===function(){try{return h.activeElement}catch(t){}}()&&h.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:st(!1),disabled:st(!0),checked:function(t){return E(t,"input")&&!!t.checked||E(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return X.test(t.nodeName)},input:function(t){return H.test(t.nodeName)},button:function(t){return E(t,"input")&&"button"===t.type||E(t,"button")},text:function(t){var e;return E(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:ot((function(){return[0]})),last:ot((function(t,e){return[e-1]})),eq:ot((function(t,e,i){return[i<0?i+e:i]})),even:ot((function(t,e){for(var i=0;ie?e:i;--n>=0;)t.push(n);return t})),gt:ot((function(t,e,i){for(var n=i<0?i+e:i;++n1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function pt(t,e,i,n,r){for(var s,o=[],a=0,l=t.length,h=null!=e;a-1&&(s[c]=!(o[c]=d))}}else f=pt(f===o?f.splice(v,f.length):f),r?r(null,o,f,h):m.apply(o,f)}))}function mt(t){for(var e,i,r,o=t.length,l=n.relative[t[0].type],h=l||n.relative[" "],c=l?1:0,u=dt((function(t){return t===e}),h,!0),d=dt((function(t){return a.call(e,t)>-1}),h,!0),f=[function(t,i,n){var r=!l&&(n||i!=s)||((e=i).nodeType?u(t,i,n):d(t,i,n));return e=null,r}];c1&&ft(f),c>1&&ut(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(N,"$1"),i,c0,r=t.length>0,o=function(o,a,l,c,u){var f,p,g,v=0,b="0",w=o&&[],_=[],E=s,T=o||r&&n.find.TAG("*",u),S=y+=null==E?1:Math.random()||.1,C=T.length;for(u&&(s=a==h||a||u);b!==C&&null!=(f=T[b]);b++){if(r&&f){for(p=0,a||f.ownerDocument==h||(lt(f),l=!d);g=t[p++];)if(g(f,a||h,l)){m.call(c,f);break}u&&(y=S)}i&&((f=!g&&f)&&v--,o&&w.push(f))}if(v+=b,i&&b!==v){for(p=0;g=e[p++];)g(w,_,a,l);if(o){if(v>0)for(;b--;)w[b]||_[b]||(_[b]=k.call(c));_=pt(_)}m.apply(c,_),u&&!o&&_.length>0&&v+e.length>1&&x.uniqueSort(c)}return u&&(y=S,s=E),w};return i?et(o):o}(o,r))).selector=t}return a}function yt(t,e,i,r){var s,o,a,l,h,c="function"==typeof t&&t,u=!r&&ct(t=c.selector||t);if(i=i||[],1===u.length){if((o=u[0]=u[0].slice(0)).length>2&&"ID"===(a=o[0]).type&&9===e.nodeType&&d&&n.relative[o[1].type]){if(!(e=(n.find.ID(a.matches[0].replace(Z,G),e)||[])[0]))return i;c&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(s=$.needsContext.test(t)?0:o.length;s--&&(a=o[s],!n.relative[l=a.type]);)if((h=n.find[l])&&(r=h(a.matches[0].replace(Z,G),V.test(o[0].type)&&at(e.parentNode)||e))){if(o.splice(s,1),!(t=r.length&&ut(o)))return m.apply(i,r),i;break}}return(c||vt(t,u))(r,e,!d,i,!e||V.test(t)&&at(e.parentNode)||e),i}ht.prototype=n.filters=n.pseudos,n.setFilters=new ht,f.sortStable=v.split("").sort(D).join("")===v,lt(),f.sortDetached=it((function(t){return 1&t.compareDocumentPosition(h.createElement("fieldset"))})),x.find=J,x.expr[":"]=x.expr.pseudos,x.unique=x.uniqueSort,J.compile=vt,J.select=yt,J.setDocument=lt,J.tokenize=ct,J.escape=x.escapeSelector,J.getText=x.text,J.isXML=x.isXMLDoc,J.selectors=x.expr,J.support=x.support,J.uniqueSort=x.uniqueSort}();var D=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&x(t).is(i))break;n.push(t)}return n},j=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},z=x.expr.match.needsContext,L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(t,e,i){return p(e)?x.grep(t,(function(t,n){return!!e.call(t,n,t)!==i})):e.nodeType?x.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?x.grep(t,(function(t){return a.call(e,t)>-1!==i})):x.filter(e,t,i)}x.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?x.find.matchesSelector(n,t)?[n]:[]:x.find.matches(t,x.grep(e,(function(t){return 1===t.nodeType})))},x.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(x(t).filter((function(){for(e=0;e1?x.uniqueSort(i):i},filter:function(t){return this.pushStack(P(this,t||[],!1))},not:function(t){return this.pushStack(P(this,t||[],!0))},is:function(t){return!!P(this,"string"==typeof t&&z.test(t)?x(t):t||[],!1).length}});var B,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||B,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:M.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof x?e[0]:e,x.merge(this,x.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:m,!0)),L.test(n[1])&&x.isPlainObject(e))for(n in e)p(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(r=m.getElementById(n[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):p(t)?void 0!==i.ready?i.ready(t):t(x):x.makeArray(t,this)}).prototype=x.fn,B=x(m);var F=/^(?:parents|prev(?:Until|All))/,q={children:!0,contents:!0,next:!0,prev:!0};function U(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}x.fn.extend({has:function(t){var e=x(t,this),i=e.length;return this.filter((function(){for(var t=0;t-1:1===i.nodeType&&x.find.matchesSelector(i,t))){s.push(i);break}return this.pushStack(s.length>1?x.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?a.call(x(t),this[0]):a.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),x.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,i){return D(t,"parentNode",i)},next:function(t){return U(t,"nextSibling")},prev:function(t){return U(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,i){return D(t,"nextSibling",i)},prevUntil:function(t,e,i){return D(t,"previousSibling",i)},siblings:function(t){return j((t.parentNode||{}).firstChild,t)},children:function(t){return j(t.firstChild)},contents:function(t){return null!=t.contentDocument&&n(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),x.merge([],t.childNodes))}},(function(t,e){x.fn[t]=function(i,n){var r=x.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=x.filter(n,r)),this.length>1&&(q[t]||x.uniqueSort(r),F.test(t)&&r.reverse()),this.pushStack(r)}}));var W=/[^\x20\t\r\n\f]+/g;function $(t){return t}function H(t){throw t}function X(t,e,i,n){var r;try{t&&p(r=t.promise)?r.call(t).done(e).fail(i):t&&p(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}x.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return x.each(t.match(W)||[],(function(t,i){e[i]=!0})),e}(t):x.extend({},t);var e,i,n,r,s=[],o=[],a=-1,l=function(){for(r=r||t.once,n=e=!0;o.length;a=-1)for(i=o.shift();++a-1;)s.splice(i,1),i<=a&&a--})),this},has:function(t){return t?x.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=o=[],s=i="",this},disabled:function(){return!s},lock:function(){return r=o=[],i||e||(s=i=""),this},locked:function(){return!!r},fireWith:function(t,i){return r||(i=[t,(i=i||[]).slice?i.slice():i],o.push(i),e||l()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},x.extend({Deferred:function(e){var i=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return x.Deferred((function(e){x.each(i,(function(i,n){var r=p(t[n[4]])&&t[n[4]];s[n[1]]((function(){var t=r&&r.apply(this,arguments);t&&p(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[n[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(e,n,r){var s=0;function o(e,i,n,r){return function(){var a=this,l=arguments,h=function(){var t,h;if(!(e=s&&(n!==H&&(a=void 0,l=[t]),i.rejectWith(a,l))}};e?c():(x.Deferred.getErrorHook?c.error=x.Deferred.getErrorHook():x.Deferred.getStackHook&&(c.error=x.Deferred.getStackHook()),t.setTimeout(c))}}return x.Deferred((function(t){i[0][3].add(o(0,t,p(r)?r:$,t.notifyWith)),i[1][3].add(o(0,t,p(e)?e:$)),i[2][3].add(o(0,t,p(n)?n:H))})).promise()},promise:function(t){return null!=t?x.extend(t,r):r}},s={};return x.each(i,(function(t,e){var o=e[2],a=e[5];r[e[1]]=o.add,a&&o.add((function(){n=a}),i[3-t][2].disable,i[3-t][3].disable,i[0][2].lock,i[0][3].lock),o.add(e[3].fire),s[e[0]]=function(){return s[e[0]+"With"](this===s?void 0:this,arguments),this},s[e[0]+"With"]=o.fireWith})),r.promise(s),e&&e.call(s,s),s},when:function(t){var e=arguments.length,i=e,n=Array(i),s=r.call(arguments),o=x.Deferred(),a=function(t){return function(i){n[t]=this,s[t]=arguments.length>1?r.call(arguments):i,--e||o.resolveWith(n,s)}};if(e<=1&&(X(t,o.done(a(i)).resolve,o.reject,!e),"pending"===o.state()||p(s[i]&&s[i].then)))return o.then();for(;i--;)X(s[i],a(i),o.reject);return o.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,i){t.console&&t.console.warn&&e&&Y.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},x.readyException=function(e){t.setTimeout((function(){throw e}))};var V=x.Deferred();function Z(){m.removeEventListener("DOMContentLoaded",Z),t.removeEventListener("load",Z),x.ready()}x.fn.ready=function(t){return V.then(t).catch((function(t){x.readyException(t)})),this},x.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==t&&--x.readyWait>0||V.resolveWith(m,[x]))}}),x.ready.then=V.then,"complete"===m.readyState||"loading"!==m.readyState&&!m.documentElement.doScroll?t.setTimeout(x.ready):(m.addEventListener("DOMContentLoaded",Z),t.addEventListener("load",Z));var G=function(t,e,i,n,r,s,o){var a=0,l=t.length,h=null==i;if("object"===b(i))for(a in r=!0,i)G(t,e,a,i[a],!0,s,o);else if(void 0!==n&&(r=!0,p(n)||(o=!0),h&&(o?(e.call(t,n),e=null):(h=e,e=function(t,e,i){return h.call(x(t),i)})),e))for(;a1,null,!0)},removeData:function(t){return this.each((function(){rt.remove(this,t)}))}}),x.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=nt.get(t,e),i&&(!n||Array.isArray(i)?n=nt.access(t,e,x.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=x.queue(t,e),n=i.length,r=i.shift(),s=x._queueHooks(t,e);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete s.stop,r.call(t,(function(){x.dequeue(t,e)}),s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return nt.get(t,i)||nt.access(t,i,{empty:x.Callbacks("once memory").add((function(){nt.remove(t,[e+"queue",i])}))})}}),x.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length\x20\t\r\n\f]*)/i,Et=/^$|^module$|\/(?:java|ecma)script/i;bt=m.createDocumentFragment().appendChild(m.createElement("div")),(wt=m.createElement("input")).setAttribute("type","radio"),wt.setAttribute("checked","checked"),wt.setAttribute("name","t"),bt.appendChild(wt),f.checkClone=bt.cloneNode(!0).cloneNode(!0).lastChild.checked,bt.innerHTML="",f.noCloneChecked=!!bt.cloneNode(!0).lastChild.defaultValue,bt.innerHTML="",f.option=!!bt.lastChild;var kt={thead:[1,"
","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Tt(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?x.merge([t],i):i}function St(t,e){for(var i=0,n=t.length;i",""]);var Ct=/<|&#?\w+;/;function Nt(t,e,i,n,r){for(var s,o,a,l,h,c,u=e.createDocumentFragment(),d=[],f=0,p=t.length;f-1)r&&r.push(s);else if(h=dt(s),o=Tt(u.appendChild(s),"script"),h&&St(o),i)for(c=0;s=o[c++];)Et.test(s.type||"")&&i.push(s);return u}var Ot=/^([^.]*)(?:\.(.+)|)/;function It(){return!0}function At(){return!1}function Rt(t,e,i,n,r,s){var o,a;if("object"==typeof e){for(a in"string"!=typeof i&&(n=n||i,i=void 0),e)Rt(t,a,i,n,e[a],s);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=At;else if(!r)return t;return 1===s&&(o=r,(r=function(t){return x().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=x.guid++)),t.each((function(){x.event.add(this,e,r,n,i)}))}function Dt(t,e,i){i?(nt.set(t,e,!1),x.event.add(t,e,{namespace:!1,handler:function(t){var i,n=nt.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(x.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=r.call(arguments),nt.set(this,e,n),this[e](),i=nt.get(this,e),nt.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(nt.set(this,e,x.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=It)}})):void 0===nt.get(t,e)&&x.event.add(t,e,It)}x.event={global:{},add:function(t,e,i,n,r){var s,o,a,l,h,c,u,d,f,p,g,m=nt.get(t);if(et(t))for(i.handler&&(i=(s=i).handler,r=s.selector),r&&x.find.matchesSelector(ut,r),i.guid||(i.guid=x.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(e){return void 0!==x&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):void 0}),h=(e=(e||"").match(W)||[""]).length;h--;)f=g=(a=Ot.exec(e[h])||[])[1],p=(a[2]||"").split(".").sort(),f&&(u=x.event.special[f]||{},f=(r?u.delegateType:u.bindType)||f,u=x.event.special[f]||{},c=x.extend({type:f,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&x.expr.match.needsContext.test(r),namespace:p.join(".")},s),(d=l[f])||((d=l[f]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,n,p,o)||t.addEventListener&&t.addEventListener(f,o)),u.add&&(u.add.call(t,c),c.handler.guid||(c.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),x.event.global[f]=!0)},remove:function(t,e,i,n,r){var s,o,a,l,h,c,u,d,f,p,g,m=nt.hasData(t)&&nt.get(t);if(m&&(l=m.events)){for(h=(e=(e||"").match(W)||[""]).length;h--;)if(f=g=(a=Ot.exec(e[h])||[])[1],p=(a[2]||"").split(".").sort(),f){for(u=x.event.special[f]||{},d=l[f=(n?u.delegateType:u.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=d.length;s--;)c=d[s],!r&&g!==c.origType||i&&i.guid!==c.guid||a&&!a.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(d.splice(s,1),c.selector&&d.delegateCount--,u.remove&&u.remove.call(t,c));o&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,p,m.handle)||x.removeEvent(t,f,m.handle),delete l[f])}else for(f in l)x.event.remove(t,f+e[h],i,n,!0);x.isEmptyObject(l)&&nt.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,s,o,a=new Array(arguments.length),l=x.event.fix(t),h=(nt.get(this,"events")||Object.create(null))[l.type]||[],c=x.event.special[l.type]||{};for(a[0]=l,e=1;e=1))for(;h!==this;h=h.parentNode||this)if(1===h.nodeType&&("click"!==t.type||!0!==h.disabled)){for(s=[],o={},i=0;i-1:x.find(r,this,null,[h]).length),o[r]&&s.push(n);s.length&&a.push({elem:h,handlers:s})}return h=this,l\s*$/g;function Pt(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&x(t).children("tbody")[0]||t}function Bt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ft(t,e){var i,n,r,s,o,a;if(1===e.nodeType){if(nt.hasData(t)&&(a=nt.get(t).events))for(r in nt.remove(e,"handle events"),a)for(i=0,n=a[r].length;i1&&"string"==typeof m&&!f.checkClone&&zt.test(m))return t.each((function(r){var s=t.eq(r);v&&(e[0]=m.call(this,r,s.html())),Ut(s,e,i,n)}));if(d&&(o=(r=Nt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===r.childNodes.length&&(r=o),o||n)){for(l=(a=x.map(Tt(r,"script"),Bt)).length;u0&&St(o,!l&&Tt(t,"script")),a},cleanData:function(t){for(var e,i,n,r=x.event.special,s=0;void 0!==(i=t[s]);s++)if(et(i)){if(e=i[nt.expando]){if(e.events)for(n in e.events)r[n]?x.event.remove(i,n):x.removeEvent(i,n,e.handle);i[nt.expando]=void 0}i[rt.expando]&&(i[rt.expando]=void 0)}}}),x.fn.extend({detach:function(t){return Wt(this,t,!0)},remove:function(t){return Wt(this,t)},text:function(t){return G(this,(function(t){return void 0===t?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Ut(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Pt(this,t).appendChild(t)}))},prepend:function(){return Ut(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Pt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Ut(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Ut(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(x.cleanData(Tt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return x.clone(this,t,e)}))},html:function(t){return G(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!jt.test(t)&&!kt[(_t.exec(t)||["",""])[1].toLowerCase()]){t=x.htmlPrefilter(t);try{for(;i=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-l-a-.5))||0),l+h}function oe(t,e,i){var n=Xt(t),r=(!f.boxSizingReliable()||i)&&"border-box"===x.css(t,"boxSizing",!1,n),s=r,o=Zt(t,e,n),a="offset"+e[0].toUpperCase()+e.slice(1);if($t.test(o)){if(!i)return o;o="auto"}return(!f.boxSizingReliable()&&r||!f.reliableTrDimensions()&&E(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===x.css(t,"display",!1,n))&&t.getClientRects().length&&(r="border-box"===x.css(t,"boxSizing",!1,n),(s=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+se(t,e,i||(r?"border":"content"),s,n,o)+"px"}function ae(t,e,i,n,r){return new ae.prototype.init(t,e,i,n,r)}x.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Zt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,s,o,a=tt(e),l=Ht.test(e),h=t.style;if(l||(e=te(a)),o=x.cssHooks[e]||x.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(r=o.get(t,!1,n))?r:h[e];"string"===(s=typeof i)&&(r=ht.exec(i))&&r[1]&&(i=gt(t,e,r),s="number"),null!=i&&i==i&&("number"!==s||l||(i+=r&&r[3]||(x.cssNumber[a]?"":"px")),f.clearCloneStyle||""!==i||0!==e.indexOf("background")||(h[e]="inherit"),o&&"set"in o&&void 0===(i=o.set(t,i,n))||(l?h.setProperty(e,i):h[e]=i))}},css:function(t,e,i,n){var r,s,o,a=tt(e);return Ht.test(e)||(e=te(a)),(o=x.cssHooks[e]||x.cssHooks[a])&&"get"in o&&(r=o.get(t,!0,i)),void 0===r&&(r=Zt(t,e,n)),"normal"===r&&e in ne&&(r=ne[e]),""===i||i?(s=parseFloat(r),!0===i||isFinite(s)?s||0:r):r}}),x.each(["height","width"],(function(t,e){x.cssHooks[e]={get:function(t,i,n){if(i)return!ee.test(x.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?oe(t,e,n):Yt(t,ie,(function(){return oe(t,e,n)}))},set:function(t,i,n){var r,s=Xt(t),o=!f.scrollboxSize()&&"absolute"===s.position,a=(o||n)&&"border-box"===x.css(t,"boxSizing",!1,s),l=n?se(t,e,n,a,s):0;return a&&o&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-se(t,e,"border",!1,s)-.5)),l&&(r=ht.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=x.css(t,e)),re(0,i,l)}}})),x.cssHooks.marginLeft=Gt(f.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-Yt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(t,e){x.cssHooks[t+e]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+ct[n]+e]=s[n]||s[n-2]||s[0];return r}},"margin"!==t&&(x.cssHooks[t+e].set=re)})),x.fn.extend({css:function(t,e){return G(this,(function(t,e,i){var n,r,s={},o=0;if(Array.isArray(e)){for(n=Xt(t),r=e.length;o1)}}),x.Tween=ae,ae.prototype={constructor:ae,init:function(t,e,i,n,r,s){this.elem=t,this.prop=i,this.easing=r||x.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(x.cssNumber[i]?"":"px")},cur:function(){var t=ae.propHooks[this.prop];return t&&t.get?t.get(this):ae.propHooks._default.get(this)},run:function(t){var e,i=ae.propHooks[this.prop];return this.options.duration?this.pos=e=x.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ae.propHooks._default.set(this),this}},ae.prototype.init.prototype=ae.prototype,ae.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=x.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){x.fx.step[t.prop]?x.fx.step[t.prop](t):1!==t.elem.nodeType||!x.cssHooks[t.prop]&&null==t.elem.style[te(t.prop)]?t.elem[t.prop]=t.now:x.style(t.elem,t.prop,t.now+t.unit)}}},ae.propHooks.scrollTop=ae.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},x.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},x.fx=ae.prototype.init,x.fx.step={};var le,he,ce=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function de(){he&&(!1===m.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(de):t.setTimeout(de,x.fx.interval),x.fx.tick())}function fe(){return t.setTimeout((function(){le=void 0})),le=Date.now()}function pe(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)r["margin"+(i=ct[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function ge(t,e,i){for(var n,r=(me.tweeners[e]||[]).concat(me.tweeners["*"]),s=0,o=r.length;s1)},removeAttr:function(t){return this.each((function(){x.removeAttr(this,t)}))}}),x.extend({attr:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?x.prop(t,e,i):(1===s&&x.isXMLDoc(t)||(r=x.attrHooks[e.toLowerCase()]||(x.expr.match.bool.test(e)?ve:void 0)),void 0!==i?null===i?void x.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:null==(n=x.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!f.radioValue&&"radio"===e&&E(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(W);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),ve={set:function(t,e,i){return!1===e?x.removeAttr(t,i):t.setAttribute(i,i),i}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=ye[e]||x.find.attr;ye[e]=function(t,e,n){var r,s,o=e.toLowerCase();return n||(s=ye[o],ye[o]=r,r=null!=i(t,e,n)?o:null,ye[o]=s),r}}));var be=/^(?:input|select|textarea|button)$/i,we=/^(?:a|area)$/i;function xe(t){return(t.match(W)||[]).join(" ")}function _e(t){return t.getAttribute&&t.getAttribute("class")||""}function Ee(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(W)||[]}x.fn.extend({prop:function(t,e){return G(this,x.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[x.propFix[t]||t]}))}}),x.extend({prop:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&x.isXMLDoc(t)||(e=x.propFix[e]||e,r=x.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=x.find.attr(t,"tabindex");return e?parseInt(e,10):be.test(t.nodeName)||we.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),f.optSelected||(x.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(t){var e,i,n,r,s,o;return p(t)?this.each((function(e){x(this).addClass(t.call(this,e,_e(this)))})):(e=Ee(t)).length?this.each((function(){if(n=_e(this),i=1===this.nodeType&&" "+xe(n)+" "){for(s=0;s-1;)i=i.replace(" "+r+" "," ");o=xe(i),n!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,n,r,s,o=typeof t,a="string"===o||Array.isArray(t);return p(t)?this.each((function(i){x(this).toggleClass(t.call(this,i,_e(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(i=Ee(t),this.each((function(){if(a)for(s=x(this),r=0;r-1)return!0;return!1}});var ke=/\r/g;x.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=p(t),this.each((function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,x(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=x.map(r,(function(t){return null==t?"":t+""}))),(e=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=x.valHooks[r.type]||x.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(ke,""):null==i?"":i:void 0}}),x.extend({valHooks:{option:{get:function(t){var e=x.find.attr(t,"value");return null!=e?e:xe(x.text(t))}},select:{get:function(t){var e,i,n,r=t.options,s=t.selectedIndex,o="select-one"===t.type,a=o?null:[],l=o?s+1:r.length;for(n=s<0?l:o?s:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=x.inArray(x(t).val(),e)>-1}},f.checkOn||(x.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Te=t.location,Se={guid:Date.now()},Ce=/\?/;x.parseXML=function(e){var i,n;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return n=i&&i.getElementsByTagName("parsererror")[0],i&&!n||x.error("Invalid XML: "+(n?x.map(n.childNodes,(function(t){return t.textContent})).join("\n"):e)),i};var Ne=/^(?:focusinfocus|focusoutblur)$/,Oe=function(t){t.stopPropagation()};x.extend(x.event,{trigger:function(e,i,n,r){var s,o,a,l,h,u,d,f,v=[n||m],y=c.call(e,"type")?e.type:e,b=c.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||m,3!==n.nodeType&&8!==n.nodeType&&!Ne.test(y+x.event.triggered)&&(y.indexOf(".")>-1&&(b=y.split("."),y=b.shift(),b.sort()),h=y.indexOf(":")<0&&"on"+y,(e=e[x.expando]?e:new x.Event(y,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=b.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:x.makeArray(i,[e]),d=x.event.special[y]||{},r||!d.trigger||!1!==d.trigger.apply(n,i))){if(!r&&!d.noBubble&&!g(n)){for(l=d.delegateType||y,Ne.test(l+y)||(o=o.parentNode);o;o=o.parentNode)v.push(o),a=o;a===(n.ownerDocument||m)&&v.push(a.defaultView||a.parentWindow||t)}for(s=0;(o=v[s++])&&!e.isPropagationStopped();)f=o,e.type=s>1?l:d.bindType||y,(u=(nt.get(o,"events")||Object.create(null))[e.type]&&nt.get(o,"handle"))&&u.apply(o,i),(u=h&&o[h])&&u.apply&&et(o)&&(e.result=u.apply(o,i),!1===e.result&&e.preventDefault());return e.type=y,r||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),i)||!et(n)||h&&p(n[y])&&!g(n)&&((a=n[h])&&(n[h]=null),x.event.triggered=y,e.isPropagationStopped()&&f.addEventListener(y,Oe),n[y](),e.isPropagationStopped()&&f.removeEventListener(y,Oe),x.event.triggered=void 0,a&&(n[h]=a)),e.result}},simulate:function(t,e,i){var n=x.extend(new x.Event,i,{type:t,isSimulated:!0});x.event.trigger(n,null,e)}}),x.fn.extend({trigger:function(t,e){return this.each((function(){x.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return x.event.trigger(t,e,i,!0)}});var Ie=/\[\]$/,Ae=/\r?\n/g,Re=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;function je(t,e,i,n){var r;if(Array.isArray(e))x.each(e,(function(e,r){i||Ie.test(t)?n(t,r):je(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,i,n)}));else if(i||"object"!==b(e))n(t,e);else for(r in e)je(t+"["+r+"]",e[r],i,n)}x.param=function(t,e){var i,n=[],r=function(t,e){var i=p(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!x.isPlainObject(t))x.each(t,(function(){r(this.name,this.value)}));else for(i in t)je(i,t[i],e,r);return n.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=x.prop(this,"elements");return t?x.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!x(this).is(":disabled")&&De.test(this.nodeName)&&!Re.test(t)&&(this.checked||!xt.test(t))})).map((function(t,e){var i=x(this).val();return null==i?null:Array.isArray(i)?x.map(i,(function(t){return{name:e.name,value:t.replace(Ae,"\r\n")}})):{name:e.name,value:i.replace(Ae,"\r\n")}})).get()}});var ze=/%20/g,Le=/#.*$/,Pe=/([?&])_=[^&]*/,Be=/^(.*?):[ \t]*([^\r\n]*)$/gm,Me=/^(?:GET|HEAD)$/,Fe=/^\/\//,qe={},Ue={},We="*/".concat("*"),$e=m.createElement("a");function He(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,s=e.toLowerCase().match(W)||[];if(p(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Xe(t,e,i,n){var r={},s=t===Ue;function o(a){var l;return r[a]=!0,x.each(t[a]||[],(function(t,a){var h=a(e,i,n);return"string"!=typeof h||s||r[h]?s?!(l=h):void 0:(e.dataTypes.unshift(h),o(h),!1)})),l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function Ye(t,e){var i,n,r=x.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&x.extend(!0,t,n),t}$e.href=Te.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Te.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Te.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":We,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ye(Ye(t,x.ajaxSettings),e):Ye(x.ajaxSettings,t)},ajaxPrefilter:He(qe),ajaxTransport:He(Ue),ajax:function(e,i){"object"==typeof e&&(i=e,e=void 0),i=i||{};var n,r,s,o,a,l,h,c,u,d,f=x.ajaxSetup({},i),p=f.context||f,g=f.context&&(p.nodeType||p.jquery)?x(p):x.event,v=x.Deferred(),y=x.Callbacks("once memory"),b=f.statusCode||{},w={},_={},E="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(h){if(!o)for(o={};e=Be.exec(s);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return h?s:null},setRequestHeader:function(t,e){return null==h&&(t=_[t.toLowerCase()]=_[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==h&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(h)k.always(t[k.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||E;return n&&n.abort(e),T(0,e),this}};if(v.promise(k),f.url=((e||f.url||Te.href)+"").replace(Fe,Te.protocol+"//"),f.type=i.method||i.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(W)||[""],null==f.crossDomain){l=m.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=$e.protocol+"//"+$e.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=x.param(f.data,f.traditional)),Xe(qe,f,i,k),h)return k;for(u in(c=x.event&&f.global)&&0==x.active++&&x.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Me.test(f.type),r=f.url.replace(Le,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(ze,"+")):(d=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(Ce.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Pe,"$1"),d=(Ce.test(r)?"&":"?")+"_="+Se.guid+++d),f.url=r+d),f.ifModified&&(x.lastModified[r]&&k.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&k.setRequestHeader("If-None-Match",x.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||i.contentType)&&k.setRequestHeader("Content-Type",f.contentType),k.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+We+"; q=0.01":""):f.accepts["*"]),f.headers)k.setRequestHeader(u,f.headers[u]);if(f.beforeSend&&(!1===f.beforeSend.call(p,k,f)||h))return k.abort();if(E="abort",y.add(f.complete),k.done(f.success),k.fail(f.error),n=Xe(Ue,f,i,k)){if(k.readyState=1,c&&g.trigger("ajaxSend",[k,f]),h)return k;f.async&&f.timeout>0&&(a=t.setTimeout((function(){k.abort("timeout")}),f.timeout));try{h=!1,n.send(w,T)}catch(t){if(h)throw t;T(-1,t)}}else T(-1,"No Transport");function T(e,i,o,l){var u,d,m,w,_,E=i;h||(h=!0,a&&t.clearTimeout(a),n=void 0,s=l||"",k.readyState=e>0?4:0,u=e>=200&&e<300||304===e,o&&(w=function(t,e,i){for(var n,r,s,o,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){l.unshift(r);break}if(l[0]in i)s=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),i[s]}(f,k,o)),!u&&x.inArray("script",f.dataTypes)>-1&&x.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),w=function(t,e,i,n){var r,s,o,a,l,h={},c=t.dataTypes.slice();if(c[1])for(o in t.converters)h[o.toLowerCase()]=t.converters[o];for(s=c.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=c.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=h[l+" "+s]||h["* "+s]))for(r in h)if((a=r.split(" "))[1]===s&&(o=h[l+" "+a[0]]||h["* "+a[0]])){!0===o?o=h[r]:!0!==h[r]&&(s=a[0],c.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}(f,w,k,u),u?(f.ifModified&&((_=k.getResponseHeader("Last-Modified"))&&(x.lastModified[r]=_),(_=k.getResponseHeader("etag"))&&(x.etag[r]=_)),204===e||"HEAD"===f.type?E="nocontent":304===e?E="notmodified":(E=w.state,d=w.data,u=!(m=w.error))):(m=E,!e&&E||(E="error",e<0&&(e=0))),k.status=e,k.statusText=(i||E)+"",u?v.resolveWith(p,[d,E,k]):v.rejectWith(p,[k,E,m]),k.statusCode(b),b=void 0,c&&g.trigger(u?"ajaxSuccess":"ajaxError",[k,f,u?d:m]),y.fireWith(p,[k,E]),c&&(g.trigger("ajaxComplete",[k,f]),--x.active||x.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,i){return x.get(t,e,i,"json")},getScript:function(t,e){return x.get(t,void 0,e,"script")}}),x.each(["get","post"],(function(t,e){x[e]=function(t,i,n,r){return p(i)&&(r=r||n,n=i,i=void 0),x.ajax(x.extend({url:t,type:e,dataType:r,data:i,success:n},x.isPlainObject(t)&&t))}})),x.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),x._evalUrl=function(t,e,i){return x.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){x.globalEval(t,e,i)}})},x.fn.extend({wrapAll:function(t){var e;return this[0]&&(p(t)&&(t=t.call(this[0])),e=x(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return p(t)?this.each((function(e){x(this).wrapInner(t.call(this,e))})):this.each((function(){var e=x(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=p(t);return this.each((function(i){x(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(t){return!x.expr.pseudos.visible(t)},x.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},Ze=x.ajaxSettings.xhr();f.cors=!!Ze&&"withCredentials"in Ze,f.ajax=Ze=!!Ze,x.ajaxTransport((function(e){var i,n;if(f.cors||Ze&&!e.crossDomain)return{send:function(r,s){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);i=function(t){return function(){i&&(i=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Ve[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=i(),n=a.onerror=a.ontimeout=i("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout((function(){i&&n()}))},i=i("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}})),x.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return x.globalEval(t),t}}}),x.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),x.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,r){e=x("