=0&&(s.terminal.offset=e,"text"!=s.steps[s.steps.length-1].type&&s.steps.push({type:"text",index:0})),s},n.prototype.equalStep=function(t,e){return!(!t||!e)&&(t.index===e.index&&t.id===e.id&&t.type===e.type)},n.prototype.fromRange=function(t,e,i){var n={range:!1,base:{},path:{},start:null,end:null},s=t.startContainer,o=t.endContainer,r=t.startOffset,h=t.endOffset,a=!1;if(i&&(a=null!=s.ownerDocument.querySelector("."+i)),"string"==typeof e?(n.base=this.parseComponent(e),n.spinePos=n.base.steps[1].index):"object"==typeof e&&(n.base=e),t.collapsed)a&&(r=this.patchOffset(s,r,i)),n.path=this.pathTo(s,r,i);else{n.range=!0,a&&(r=this.patchOffset(s,r,i)),n.start=this.pathTo(s,r,i),a&&(h=this.patchOffset(o,h,i)),n.end=this.pathTo(o,h,i),n.path={steps:[],terminal:null};var c,p=n.start.steps.length;for(c=0;c0&&s===Node.TEXT_NODE&&o===Node.TEXT_NODE?r[n]=h:e===s&&(h+=1,r[n]=h),o=s;return r},n.prototype.position=function(t){var e,i;return t.nodeType===Node.ELEMENT_NODE?(e=t.parentNode.children,i=Array.prototype.indexOf.call(e,t)):(e=this.textNodes(t.parentNode),i=e.indexOf(t)),i},n.prototype.filteredPosition=function(t,e){var i,n,s;return t.nodeType===Node.ELEMENT_NODE?(i=t.parentNode.children,s=this.normalizedMap(i,Node.ELEMENT_NODE,e)):(i=t.parentNode.childNodes,t.parentNode.classList.contains(e)&&(t=t.parentNode,i=t.parentNode.childNodes),s=this.normalizedMap(i,Node.TEXT_NODE,e)),n=Array.prototype.indexOf.call(i,t),s[n]},n.prototype.stepsToXpath=function(t){var e=[".","*"];return t.forEach(function(t){var i=t.index+1;t.id?e.push("*[position()="+i+" and @id='"+t.id+"']"):"text"===t.type?e.push("text()["+i+"]"):e.push("*["+i+"]")}),e.join("/")},n.prototype.stepsToQuerySelector=function(t){var e=["html"];return t.forEach(function(t){var i=t.index+1;t.id?e.push("#"+t.id):"text"===t.type||e.push("*:nth-child("+i+")")}),e.join(">")},n.prototype.textNodes=function(t,e){return Array.prototype.slice.call(t.childNodes).filter(function(t){return t.nodeType===Node.TEXT_NODE||!(!e||!t.classList.contains(e))})},n.prototype.walkToNode=function(t,e,i){var n,s,o=e||document,r=o.documentElement,h=t.length;for(s=0;so)){h=s.nodeType===Node.ELEMENT_NODE?s.childNodes[0]:s;break}e-=o}}return{container:h,offset:e}},n.prototype.toRange=function(t,e){var i,n,s,o,r,h,a,c=t||document,p=c.createRange(),l=this,u=!!e&&null!=c.querySelector("."+e);if(l.range?(i=l.start,r=l.path.steps.concat(i.steps),s=this.findNode(r,c,u?e:null),n=l.end,h=l.path.steps.concat(n.steps),o=this.findNode(h,c,u?e:null)):(i=l.path,r=l.path.steps,s=this.findNode(l.path.steps,c,u?e:null)),!s)return null;try{null!=i.terminal.offset?p.setStart(s,i.terminal.offset):p.setStart(s,0)}catch(d){a=this.fixMiss(r,i.terminal.offset,c,u?e:null),p.setStart(a.container,a.offset)}if(o)try{null!=n.terminal.offset?p.setEnd(o,n.terminal.offset):p.setEnd(o,0)}catch(d){a=this.fixMiss(h,l.end.terminal.offset,c,u?e:null),p.setEnd(a.container,a.offset)}return p},n.prototype.isCfiString=function(t){return"string"==typeof t&&0===t.indexOf("epubcfi(")&&")"===t[t.length-1]},n.prototype.generateChapterComponent=function(t,e,i){var n=parseInt(e),s=t+1,o="/"+s+"/";return o+=2*(n+1),i&&(o+="["+i+"]"),o},t.exports=n},function(t,e,i){"use strict";(function(e){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+t)}function n(t,e){for(var i,n="",s=-1,o=0,r=0;r<=t.length;++r){if(r2){for(var h=n.length-1,a=h;a>=0&&47!==n.charCodeAt(a);--a);if(a!==h){n=a===-1?"":n.slice(0,a),s=r,o=0;continue}}else if(2===n.length||1===n.length){n="",s=r,o=0;continue}e&&(n.length>0?n+="/..":n="..")}else n.length>0?n+="/"+t.slice(s+1,r):n=t.slice(s+1,r);s=r,o=0}else 46===i&&o!==-1?++o:o=-1}return n}function s(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}var o={resolve:function(){for(var t,s="",o=!1,r=arguments.length-1;r>=-1&&!o;r--){var h;r>=0?h=arguments[r]:(void 0===t&&(t=e.cwd()),h=t),i(h),0!==h.length&&(s=h+"/"+s,o=47===h.charCodeAt(0))}return s=n(s,!o),o?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),s=47===t.charCodeAt(t.length-1);return t=n(t,!e),0!==t.length||e||(t="."),t.length>0&&s&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":o.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if(t=o.resolve(t),e=o.resolve(e),t===e)return"";for(var n=1;np){if(47===e.charCodeAt(h+u))return e.slice(h+u+1);if(0===u)return e.slice(h+u)}else r>p&&(47===t.charCodeAt(n+u)?l=u:0===u&&(l=0));break}var d=t.charCodeAt(n+u),f=e.charCodeAt(h+u);if(d!==f)break;47===d&&(l=u)}var g="";for(u=n+l+1;u<=s;++u)u!==s&&47!==t.charCodeAt(u)||(g+=0===g.length?"..":"/..");return g.length>0?g+e.slice(h+l):(h+=l,47===e.charCodeAt(h)&&++h,e.slice(h))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,s=-1,o=!0,r=t.length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!o){s=r;break}}else o=!1;return s===-1?n?"/":".":n&&1===s?"//":t.slice(0,s)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,s=0,o=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var h=e.length-1,a=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!r){s=n+1;break}}else a===-1&&(r=!1,a=n+1),h>=0&&(c===e.charCodeAt(h)?--h===-1&&(o=n):(h=-1,o=a))}return s===o?o=a:o===-1&&(o=t.length),t.slice(s,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!r){s=n+1;break}}else o===-1&&(r=!1,o=n+1);return o===-1?"":t.slice(s,o)},extname:function(t){i(t);for(var e=-1,n=0,s=-1,o=!0,r=0,h=t.length-1;h>=0;--h){var a=t.charCodeAt(h);if(47!==a)s===-1&&(o=!1,s=h+1),46===a?e===-1?e=h:1!==r&&(r=1):e!==-1&&(r=-1);else if(!o){n=h+1;break}}return e===-1||s===-1||0===r||1===r&&e===s-1&&e===n+1?"":t.slice(e,s)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof t);return s("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,s=t.charCodeAt(0),o=47===s;o?(e.root="/",n=1):n=0;for(var r=-1,h=0,a=-1,c=!0,p=t.length-1,l=0;p>=n;--p)if(s=t.charCodeAt(p),47!==s)a===-1&&(c=!1,a=p+1),46===s?r===-1?r=p:1!==l&&(l=1):r!==-1&&(l=-1);else if(!c){h=p+1;break}return r===-1||a===-1||0===l||1===l&&r===a-1&&r===h+1?a!==-1&&(0===h&&o?e.base=e.name=t.slice(1,a):e.base=e.name=t.slice(h,a)):(0===h&&o?(e.name=t.slice(1,r),e.base=t.slice(1,a)):(e.name=t.slice(h,r),e.base=t.slice(h,a)),e.ext=t.slice(r,a)),h>0?e.dir=t.slice(0,h-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",posix:null};t.exports=o}).call(e,i(4))},function(t,e,i){"use strict";var n,s,o,r,h,a,c,p=i(21),l=i(30),u=Function.prototype.apply,d=Function.prototype.call,f=Object.create,g=Object.defineProperty,m=Object.defineProperties,y=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var i;return l(e),y.call(this,"__ee__")?i=this.__ee__:(i=v.value=f(null),g(this,"__ee__",v),v.value=null),i[t]?"object"==typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},s=function(t,e){var i,s;return l(e),s=this,n.call(this,t,i=function(){o.call(s,t,i),u.call(e,this,arguments)}),i.__eeOnceListener__=e,this},o=function(t,e){var i,n,s,o;if(l(e),!y.call(this,"__ee__"))return this;if(i=this.__ee__,!i[t])return this;if(n=i[t],"object"==typeof n)for(o=0;s=n[o];++o)s!==e&&s.__eeOnceListener__!==e||(2===n.length?i[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},r=function(t){var e,i,n,s,o;if(y.call(this,"__ee__")&&(s=this.__ee__[t]))if("object"==typeof s){for(i=arguments.length,o=new Array(i-1),e=1;e1)for(var i=1;i0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1);(i=s.nextNode())&&!(n=e(i)););return n},n.prototype.findRanges=function(t){for(var e,i,n=[],s=t.contents.scrollWidth(),o=this.layout.count(s),r=this.layout.column,h=this.layout.gap,a=0;a=e&&n<=i?t:s>e?t:(r=t,void o.push(t))}))return this.findTextStartRange(s,e,i);return this.findTextStartRange(r,e,i)},n.prototype.findEnd=function(t,e,i){for(var n,s,o=[t],r=t;o.length;)if(n=o.shift(),s=this.walk(n,function(t){var e,n,s,h;return t.nodeType==Node.TEXT_NODE?(h=document.createRange(),h.selectNodeContents(t),s=h.getBoundingClientRect()):s=t.getBoundingClientRect(),e=s.left,n=s.right,e>i&&r?r:n>i?t:(r=t,void o.push(t))}))return this.findTextEndRange(s,e,i);return this.findTextEndRange(r,e,i)},n.prototype.findTextStartRange=function(t,e,i){for(var n,s,o,r=this.splitTextNodeIntoRanges(t),h=0;h=e)return s;n=s}return r[0]},n.prototype.findTextEndRange=function(t,e,i){for(var n,s,o,r=this.splitTextNodeIntoRanges(t),h=0;hi&&n)return n;if(o.right>i)return s;n=s}return r[r.length-1]},n.prototype.splitTextNodeIntoRanges=function(t,e){var i,n=[],s=t.textContent||"",o=s.trim(),r=t.ownerDocument,h=e||" ";if(pos=o.indexOf(h),pos===-1||t.nodeType!=Node.TEXT_NODE)return i=r.createRange(),i.selectNodeContents(t),[i];for(i=r.createRange(),i.setStart(t,0),i.setEnd(t,pos),n.push(i),i=!1;pos!=-1;)pos=o.indexOf(h,pos+1),pos>0&&(i&&(i.setEnd(t,pos),n.push(i)),i=r.createRange(),i.setStart(t,pos+1));return i&&(i.setEnd(t,o.length),n.push(i)),n},n.prototype.rangePairToCfiPair=function(t,e){var i=e.start,n=e.end;return i.collapse(!0),n.collapse(!0),startCfi=new s(i,t).toString(),endCfi=new s(n,t).toString(),{start:startCfi,end:endCfi}},n.prototype.rangeListToCfiList=function(t,e){for(var i,n=[],s=0;s-1&&(id=t.substring(t.indexOf("#")+1),el=this.document.getElementById(id),el&&(i=el.getBoundingClientRect(),n.left=i.left,n.top=i.top)),n},n.prototype.addStylesheet=function(t){return new Promise(function(e,i){var n,s=!1;return this.document?(n=this.document.createElement("link"),n.type="text/css",n.rel="stylesheet",n.href=t,n.onload=n.onreadystatechange=function(){s||this.readyState&&"complete"!=this.readyState||(s=!0,setTimeout(function(){e(!0)},1))},void this.document.head.appendChild(n)):void e(!1)}.bind(this))},n.prototype.addStylesheetRules=function(t){var e,i;if(this.document){e=this.document.createElement("style"),this.document.head.appendChild(e),i=e.sheet;for(var n=0,s=t.length;n0&&(e=t.getRangeAt(0),e.collapsed||(i=new r(e,this.cfiBase).toString(),this.emit("selected",i),this.emit("selectedRange",e)))},n.prototype.range=function(t,e){var i=new r(t);return i.toRange(this.document,e)},n.prototype.map=function(t){var e=new h(t);return e.section()},n.prototype.size=function(t,e){t>=0&&this.width(t),e>=0&&this.height(e),this.css("margin","0"),this.css("boxSizing","border-box")},n.prototype.columns=function(t,e,i,n){var s=o.prefixed("columnAxis"),r=o.prefixed("columnGap"),h=o.prefixed("columnWidth"),a=o.prefixed("columnFill");this.width(t),this.height(e),this.viewport({width:t,height:e,scale:1}),this.css("overflowY","hidden"),this.css("margin","0"),this.css("boxSizing","border-box"),this.css("maxWidth","inherit"),this.css(s,"horizontal"),this.css(a,"auto"),this.css(r,n+"px"),this.css(h,i+"px")},n.prototype.scale=function(t,e,i){var t="scale("+t+")",n="";this.css("transformOrigin","top left"),(e>=0||i>=0)&&(n=" translate("+(e||0)+"px, "+(i||0)+"px )"),this.css("transform",t+n)},n.prototype.fit=function(t,e){var i=this.viewport(),n=t/i.width,s=e/i.height,o=n1&&(e=t.next()))return this.add(e)}.bind(this)).then(function(t){e&&(offset=t.locationOf(e),this.moveTo(offset)),this.views.show(),i.resolve()}.bind(this)),n)},n.prototype.afterDisplayed=function(t){this.emit("added",t)},n.prototype.afterResized=function(t){this.emit("resize",t.section)},n.prototype.moveTo=function(t){var e=0,i=0;"vertical"===this.settings.axis?i=t.top:(e=Math.floor(t.left/this.layout.delta)*this.layout.delta,e+this.layout.delta>this.container.scrollWidth&&(e=this.container.scrollWidth-this.layout.delta)),this.scrollTo(e,i)},n.prototype.add=function(t){var e=this.createView(t);return this.views.append(e),e.onDisplayed=this.afterDisplayed.bind(this),e.onResize=this.afterResized.bind(this),e.display(this.request)},n.prototype.append=function(t){var e=this.createView(t);return this.views.append(e),e.display(this.request)},n.prototype.prepend=function(t){var e=this.createView(t);return this.views.prepend(e),e.display(this.request)},n.prototype.next=function(){var t,e;if(this.views.length)return"horizontal"===this.settings.axis?(this.scrollLeft=this.container.scrollLeft,e=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,e1&&(e=t.next()))return this.append(e)}.bind(this)).then(function(){this.views.show()}.bind(this))):void 0},n.prototype.prev=function(){var t,e;if(this.views.length)return"horizontal"===this.settings.axis?(this.scrollLeft=this.container.scrollLeft,e=this.container.scrollLeft,e>0?this.scrollBy(-this.layout.delta,0):t=this.views.first().section.prev()):t=this.views.first().section.prev(),t?(this.views.clear(),this.prepend(t).then(function(){var e;if(this.layout.name&&this.layout.divisor>1&&(e=t.prev()))return this.prepend(e)}.bind(this)).then(function(){"horizontal"===this.settings.axis&&this.scrollTo(this.container.scrollWidth-this.layout.delta,0),this.views.show()}.bind(this))):void 0},n.prototype.current=function(){var t=this.visible();return t.length?t[t.length-1]:null},n.prototype.currentLocation=function(){var t,e,i;if(this.views.length)return t=this.views.first(),e=container.left-t.position().left,i=e+this.layout.spread,this.mapping.page(t,t.section.cfiBase)},n.prototype.isVisible=function(t,e,i,n){var s=t.position(),o=n||this.bounds();return"horizontal"===this.settings.axis&&s.right>o.left-e&&s.lefto.top-e&&s.top-1&&(i=t.substring(t.indexOf("#")+1)),n&&(i=t),this.manager.display(e,i).then(function(){this.emit("displayed",e)}.bind(this))):(s.reject(new Error("No Section Found")),r)},n.prototype.afterDisplayed=function(t){this.hooks.content.trigger(t,this),this.emit("rendered",t.section),this.reportLocation()},n.prototype.onResized=function(){this.location&&this.display(this.location.start),this.emit("resized",{width:size.width,height:size.height})},n.prototype.moveTo=function(t){this.manager.moveTo(t)},n.prototype.next=function(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))},n.prototype.prev=function(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))},n.prototype.determineLayoutProperties=function(t){var e,i=this.settings.layout||t.layout||"reflowable",n=this.settings.spread||t.spread||"auto",s=this.settings.orientation||t.orientation||"auto",o=this.settings.flow||t.flow||"auto",r=t.viewport||"",h=this.settings.minSpreadWidth||t.minSpreadWidth||800;return this.settings.width>=0&&this.settings.height>=0&&(r="width="+this.settings.width+", height="+this.settings.height),e={layout:i,spread:n,orientation:s,flow:o,viewport:r,minSpreadWidth:h}},n.prototype.flow=function(t){var e;"scrolled-doc"!==t&&"scrolled-continuous"!==t||(e="scrolled"),"auto"!==t&&"paginated"!==t||(e="paginated"),this._layout&&this._layout.flow(e),this.manager&&this.manager.updateFlow(e)},n.prototype.layout=function(t){return t&&(this._layout=new p(t),this._layout.spread(t.spread,this.settings.minSpreadWidth),this.mapping=new l(this._layout)),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout},n.prototype.spread=function(t,e){this._layout.spread(t,e),this.manager.isRendered()&&this.manager.updateLayout()},n.prototype.reportLocation=function(){return this.q.enqueue(function(){var t=this.manager.currentLocation();t&&t.then&&"function"==typeof t.then?t.then(function(t){this.location=t,this.emit("locationChanged",this.location)}.bind(this)):t&&(this.location=t,this.emit("locationChanged",this.location))}.bind(this))},n.prototype.destroy=function(){this.q.clear(),this.manager.destroy()},n.prototype.passViewEvents=function(t){t.contents.listenedEvents.forEach(function(e){t.on(e,this.triggerViewEvent.bind(this))}.bind(this)),t.on("selected",this.triggerSelectedEvent.bind(this))},n.prototype.triggerViewEvent=function(t){this.emit(t.type,t)},n.prototype.triggerSelectedEvent=function(t){this.emit("selected",t)},n.prototype.range=function(t,e){var i=new a(t),n=this.visible().filter(function(t){if(i.spinePos===t.index)return!0});if(n.length)return n[0].range(i,e)},n.prototype.adjustImages=function(t){return t.addStylesheetRules([["img",["max-width",t.layout.spreadWidth+"px"],["max-height",t.layout.height+"px"]]]),new Promise(function(t,e){setTimeout(function(){t()},1)})},s(n.prototype),t.exports=n},function(t,i){t.exports=e},,,function(t,e,i){function n(t,e){"undefined"==typeof e&&"object"==typeof t&&(e=t,t=void 0),this.settings=o.extend(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:"base64"}),o.extend(this.settings,e),this.opening=new o.defer,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new o.defer,spine:new o.defer,metadata:new o.defer,cover:new o.defer,navigation:new o.defer,pageList:new o.defer,resources:new o.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},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources]),this.isRendered=!1,this.request=this.settings.requestMethod||y,this.spine=new a,this.locations=new c(this.spine,this.load),this.navigation=void 0,this.pageList=new f,this.url=void 0,this.path=void 0,this.archived=!1,t&&this.open(t)["catch"](function(e){var i=new Error("Cannot load book at "+t);console.error(i),this.emit("openFailed",i),console.log(e)}.bind(this))}var s=i(3),o=(i(2),i(0)),r=i(0).Url,h=i(0).Path,a=i(47),c=i(39),p=i(37),l=i(43),u=i(42),d=i(45),f=i(44),g=i(12),m=i(36),y=i(9),v=i(1),w="META-INF/container.xml";n.prototype.open=function(t,e){var i,n=e||this.determineType(t);return"binary"===n?(this.archived=!0,this.url=new r("/",""),i=this.openEpub(t)):"epub"===n?(this.archived=!0,this.url=new r("/",""),i=this.request(t,"binary").then(this.openEpub.bind(this))):"opf"==n?(this.url=new r(t),i=this.openPackaging(t)):(this.url=new r(t),i=this.openContainer(w).then(this.openPackaging.bind(this))),i},n.prototype.openEpub=function(t,e){return this.unarchive(t,e||this.settings.encoding).then(function(){return this.openContainer(w)}.bind(this)).then(function(t){return this.openPackaging(t)}.bind(this))},n.prototype.openContainer=function(t){return this.load(t).then(function(t){return this.container=new p(t),this.resolve(this.container.packagePath)}.bind(this))},n.prototype.openPackaging=function(t){return this.path=new h(t),this.load(t).then(function(t){return this.packaging=new l(t),this.unpack(this.packaging)}.bind(this))},n.prototype.load=function(t){var e;return this.archived?(e=this.resolve(t),this.archive.request(e)):(e=this.resolve(t),this.request(e,null,this.settings.requestCredentials,this.settings.requestHeaders))},n.prototype.resolve=function(t,e){var i=t,n=t.indexOf("://")>-1;return n?t:(this.path&&(i=this.path.resolve(t)),0!=e&&this.url&&(i=this.url.resolve(i)),i)},n.prototype.determineType=function(t){var e,i,n;return"string"!=typeof t?"binary":(e=new r(t),i=e.path(),n=i.extension,n?"epub"===n?"epub":"opf"===n?"opf":void 0:"directory")},n.prototype.unpack=function(t){this["package"]=t,this.spine.unpack(this["package"],this.resolve.bind(this)),this.resources=new d(this["package"].manifest,{archive:this.archive,resolver:this.resolve.bind(this),replacements:this.settings.replacements}),this.loadNavigation(this["package"]).then(function(t){this.toc=t,this.loading.navigation.resolve(this.toc)}.bind(this)),this.cover=this.resolve(this["package"].coverPath),this.loading.manifest.resolve(this["package"].manifest),this.loading.metadata.resolve(this["package"].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.replacements().then(function(){this.opening.resolve(this)}.bind(this)):this.opening.resolve(this)},n.prototype.loadNavigation=function(t){var e=t.navPath||t.ncxPath;if(e)return this.load(e,"xml").then(function(t){this.navigation=new u(t),this.pageList=new f(t)}.bind(this))},n.prototype.section=function(t){return this.spine.get(t)},n.prototype.renderTo=function(t,e){return this.rendition=new g(this,e),this.rendition.attachTo(t),this.rendition},n.prototype.setRequestCredentials=function(t){this.settings.requestCredentials=t},n.prototype.setRequestHeaders=function(t){this.settings.requestHeaders=t},n.prototype.unarchive=function(t,e){return this.archive=new m,this.archive.open(t,e)},n.prototype.coverUrl=function(){var t=this.loaded.cover.then(function(t){return this.archived?this.resources.get(this.cover):this.cover}.bind(this));return t},n.prototype.replacements=function(){return this.spine.hooks.serialize.register(function(t,e){e.output=this.resources.substitute(t,e.url)}.bind(this)),this.resources.replacements().then(function(){return this.resources.replaceCss()}.bind(this))},n.prototype.range=function(t){var e=new v(t),i=this.spine.get(e.spinePos);return i.load().then(function(t){var n=e.toRange(i.document);return n})},s(n.prototype),t.exports=n},function(t,e,i){function n(t){o.apply(this,arguments),this.name="continuous",this.settings=s.extend(this.settings||{},{infinite:!0,overflow:"auto",axis:"vertical",offset:500,offsetDelta:250,width:void 0,height:void 0}),s.extend(this.settings,t.settings||{}),"undefined"!=t.settings.gap&&0===t.settings.gap&&(this.settings.gap=t.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,layout:this.layout,width:0,height:0},this.scrollTop=0,this.scrollLeft=0}var s=i(0),o=i(11);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,n.prototype.display=function(t,e){return o.prototype.display.call(this,t,e).then(function(){return this.fill()}.bind(this))},n.prototype.fill=function(t){var e=t||new s.defer;return this.check().then(function(t){t?this.fill(e):e.resolve()}.bind(this)),e.promise},n.prototype.moveTo=function(t){var e=0,i=0,n=0,s=0;return"vertical"===this.settings.axis?(i=t.top,s=t.top+this.settings.offset):(e=Math.floor(t.left/this.layout.delta)*this.layout.delta,n=e+this.settings.offset),this.check(n,s).then(function(){this.scrollBy(e,i)}.bind(this))},n.prototype.resize=function(t,e){this.q.clear(),this._stageSize=this.stage.size(t,e),this._bounds=this.bounds(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.views.each(function(t){t.size(this._stageSize.width,this._stageSize.height)}.bind(this)),this.updateLayout(),this.emit("resized",{width:this.stage.width,height:this.stage.height})},n.prototype.onResized=function(t){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){this.resize()}.bind(this),150)},n.prototype.afterResized=function(t){this.emit("resize",t.section)},n.prototype.removeShownListeners=function(t){t.onDisplayed=function(){}},n.prototype.append=function(t){var e=this.createView(t);return this.views.append(e),e},n.prototype.prepend=function(t){var e=this.createView(t);return e.on("resized",this.counter.bind(this)),this.views.prepend(e),e},n.prototype.counter=function(t){"vertical"===this.settings.axis?this.scrollBy(0,t.heightDelta,!0):this.scrollBy(t.widthDelta,0,!0)},n.prototype.update=function(t){for(var e,i,n=this.bounds(),o=this.views.all(),r=o.length,h=[],a="undefined"!=typeof t?t:this.settings.offset||0,c=new s.defer,p=[],l=0;l=f&&(i=this.views.last(),o=i&&i.section.next(),o&&a.push(this.append(o))),u-p<0&&(n=this.views.first(),r=n&&n.section.prev(),r&&a.push(this.prepend(r))),a.length?this.q.enqueue(function(){return this.update(p)}.bind(this)):(h.resolve(!1),h.promise)},n.prototype.trim=function(){for(var t=new s.defer,e=this.views.displayed(),i=e[0],n=e[e.length-1],o=this.views.indexOf(i),r=this.views.indexOf(n),h=this.views.slice(0,o),a=this.views.slice(r+1),c=0;cthis.settings.offsetDelta||this.scrollDeltaHorz>this.settings.offsetDelta)&&(this.q.enqueue(function(){this.check()}.bind(this)),this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.emit("scroll",{top:scrollTop,left:scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit("scrolled",{top:this.scrollTop,left:this.scrollLeft})}.bind(this))),this.scrollDeltaVert+=Math.abs(scrollTop-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(scrollLeft-this.prevScrollLeft),this.prevScrollTop=scrollTop,this.prevScrollLeft=scrollLeft,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),this.scrolled=!1},n.prototype.currentLocation=function(){return"vertical"===this.settings.axis?this.location=this.scrolledLocation():this.location=this.paginatedLocation(),this.location},n.prototype.scrolledLocation=function(){var t,e,i=this.visible();this.container.getBoundingClientRect();return 1===i.length?this.mapping.page(i[0].contents,i[0].section.cfiBase):i.length>1?(t=this.mapping.page(i[0].contents,i[0].section.cfiBase),e=this.mapping.page(i[i.length-1].contents,i[i.length-1].section.cfiBase),{start:t.start,end:e.end}):void 0},n.prototype.paginatedLocation=function(){var t,e,i,n,s,o,r=this.visible(),h=this.container.getBoundingClientRect();return 1===r.length?(t=h.left-r[0].position().left,i=t+this.layout.spreadWidth,this.mapping.page(r[0].contents,r[0].section.cfiBase,t,i)):r.length>1?(t=h.left-r[0].position().left,i=t+this.layout.columnWidth,e=h.left+this.layout.spreadWidth-r[r.length-1].position().left,n=e+this.layout.columnWidth,s=this.mapping.page(r[0].contents,r[0].section.cfiBase,t,i),o=this.mapping.page(r[r.length-1].contents,r[r.length-1].section.cfiBase,e,n),{start:s.start,end:o.end}):void 0},n.prototype.updateLayout=function(){this.stage&&("vertical"===this.settings.axis?this.layout.calculate(this._stageSize.width,this._stageSize.height):(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),
+this.settings.offset=this.layout.delta,this.stage.addStyleRules("iframe",[{"margin-right":this.layout.gap+"px"}])),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))},n.prototype.next=function(){"horizontal"===this.settings.axis?(this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft+this.container.offsetWidth+this.layout.delta1&&"reflowable"===this.settings.layout.name&&e%2>0&&(s+=this.settings.layout.gap+this.settings.layout.columnWidth),this._textWidth=i,this._contentWidth=s):s=this._contentWidth):"vertical"===this.settings.axis&&(n=this.contents.textHeight(),n!=this._textHeight?(o=this.contentHeight(n),this._textHeight=n,this._contentHeight=o):o=this._contentHeight),(this._needsReframe||s!=this._width||o!=this._height)&&this.resize(s,o),this._expanding=!1)},n.prototype.contentWidth=function(t){var e,i;return e=this.iframe.style.width,this.iframe.style.width=(t||0)+"px",i=this.contents.scrollWidth(),this.iframe.style.width=e,i},n.prototype.contentHeight=function(t){var e,i;return e=this.iframe.style.height,this.iframe.style.height=(t||0)+"px",i=this.contents.scrollHeight(),this.iframe.style.height=e,i},n.prototype.resize=function(t,e){this.iframe&&(o.isNumber(t)&&(this.iframe.style.width=t+"px",this._width=t),o.isNumber(e)&&(this.iframe.style.height=e+"px",this._height=e),this.iframeBounds=o.bounds(this.iframe),this.reframe(this.iframeBounds.width,this.iframeBounds.height))},n.prototype.reframe=function(t,e){var i;o.isNumber(t)&&(this.element.style.width=t+"px"),o.isNumber(e)&&(this.element.style.height=e+"px"),this.prevBounds=this.elementBounds,this.elementBounds=o.bounds(this.element),i={width:this.elementBounds.width,height:this.elementBounds.height,widthDelta:this.elementBounds.width-this.prevBounds.width,heightDelta:this.elementBounds.height-this.prevBounds.height},this.onResize(this,i),this.emit("resized",i)},n.prototype.load=function(t){var e=new o.defer,i=e.promise;if(!this.iframe)return e.reject(new Error("No Iframe Available")),i;if(this.iframe.onload=function(t){this.onLoad(t,e)}.bind(this),this.supportsSrcdoc)this.iframe.srcdoc=t;else{if(this.document=this.iframe.contentDocument,!this.document)return e.reject(new Error("No Document Available")),i;this.iframe.contentDocument.open(),this.iframe.contentDocument.write(t),this.iframe.contentDocument.close()}return i},n.prototype.onLoad=function(t,e){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new h(this.document,this.document.body,this.section.cfiBase),this.rendering=!1;var i=this.document.querySelector("link[rel='canonical']");i?i.setAttribute("href",this.section.url):(i=this.document.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",this.section.url),this.document.querySelector("head").appendChild(i)),this.contents.on("expand",function(){this.displayed&&this.iframe&&this.expand()}),e.resolve(this.contents)},n.prototype.setLayout=function(t){this.layout=t},n.prototype.setAxis=function(t){this.settings.axis=t},n.prototype.resizeListenters=function(){clearTimeout(this.expanding),this.expanding=setTimeout(this.expand.bind(this),350)},n.prototype.addListeners=function(){},n.prototype.removeListeners=function(t){},n.prototype.display=function(t){var e=new o.defer;return this.displayed?e.resolve(this):this.render(t).then(function(){this.emit("displayed",this),this.onDisplayed(this),this.displayed=!0,e.resolve(this)}.bind(this)),e.promise},n.prototype.show=function(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible"),this.emit("shown",this)},n.prototype.hide=function(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit("hidden",this)},n.prototype.position=function(){return this.element.getBoundingClientRect()},n.prototype.locationOf=function(t){var e=this.iframe.getBoundingClientRect(),i=this.contents.locationOf(t,this.settings.ignoreClass);return{left:window.scrollX+e.left+i.left,top:window.scrollY+e.top+i.top}},n.prototype.onDisplayed=function(t){},n.prototype.onResize=function(t,e){},n.prototype.bounds=function(){return this.elementBounds||(this.elementBounds=o.bounds(this.element)),this.elementBounds},n.prototype.destroy=function(){this.displayed&&(this.displayed=!1,this.removeListeners(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.displayed=!1,this.iframe=null,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)},s(n.prototype),t.exports=n},function(t,e){function i(t){return t&&s[t.split(".").pop().toLowerCase()]||o}var n={application:{ecmascript:["es","ecma"],javascript:"js",ogg:"ogx",pdf:"pdf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],"rdf+xml":"rdf",smil:["smi","smil"],"xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","opf","ncx"],zip:"zip","x-httpd-eruby":"rhtml","x-latex":"latex","x-maker":["frm","maker","frame","fm","fb","book","fbdoc"],"x-object":"o","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","epub+zip":"epub","font-tdpfr":"pfr","inkml+xml":["ink","inkml"],json:"json","jsonml+json":"jsonml","mathml+xml":"mathml","metalink+xml":"metalink",mp4:"mp4s","omdoc+xml":"omdoc",oxps:"oxps","vnd.amazon.ebook":"azw",widget:"wgt","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-otf":"otf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-font-woff":"woff","x-mobipocket-ebook":["prc","mobi"],"x-mspublisher":"pub","x-nzb":"nzb","x-tgif":"obj","xaml+xml":"xaml","xml-dtd":"dtd","xproc+xml":"xpl","xslt+xml":"xslt","internet-property-stream":"acx","x-compress":"z","x-compressed":"tgz","x-gzip":"gz"},audio:{flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp2","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"x-aiff":["aif","aiff","aifc"],"x-ms-wma":"wma","x-wav":"wav",adpcm:"adp",mp4:"mp4a",webm:"weba","x-aac":"aac","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",mid:["mid","rmi"]},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"x-icon":"ico",bmp:"bmp",webp:"webp","x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod"},text:{"cache-manifest":["manifest","appcache"],css:"css",csv:"csv",html:["html","htm","shtml","stm"],mathml:"mml",plain:["txt","text","brf","conf","def","list","log","in","bas"],richtext:"rtx","tab-separated-values":"tsv","x-bibtex":"bib"},video:{mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv"}},s=function(){var t,e,i,s,o={};for(t in n)if(n.hasOwnProperty(t))for(e in n[t])if(n[t].hasOwnProperty(e))if(i=n[t][e],"string"==typeof i)o[i]=t+"/"+e;else for(s=0;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-i(t)}function s(t){var e,n,s,o,r,h,a=t.length;r=i(t),h=new p(3*a/4-r),s=r>0?a-4:a;var l=0;for(e=0,n=0;e>16&255,h[l++]=o>>8&255,h[l++]=255&o;return 2===r?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,h[l++]=255&o):1===r&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,h[l++]=o>>8&255,h[l++]=255&o),h}function o(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}function r(t,e,i){for(var n,s=[],r=e;rp?p:c+h));return 1===n?(e=t[i-1],s+=a[e>>2],s+=a[e<<4&63],s+="=="):2===n&&(e=(t[i-2]<<8)+t[i-1],s+=a[e>>10],s+=a[e>>4&63],s+=a[e<<2&63],s+="="),o.push(s),o.join("")}e.byteLength=n,e.toByteArray=s,e.fromByteArray=h;for(var a=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,d=l.length;u-1}},,function(t,e,i){function n(){this.zip=void 0,this.checkRequirements(),this.urlCache={}}var s=i(0),o=i(9),r=i(19),h=i(0).Path;n.prototype.checkRequirements=function(){try{"undefined"==typeof JSZip&&(JSZip=i(48)),this.zip=new JSZip}catch(t){console.error("JSZip lib not loaded")}},n.prototype.open=function(t,e){return this.zip.loadAsync(t,{base64:e})},n.prototype.openUrl=function(t,e){return o(t,"binary").then(function(t){return this.zip.loadAsync(t,{base64:e})}.bind(this))},n.prototype.request=function(t,e){var i,n=new s.defer,o=new h(t);return e||(e=o.extension),i="blob"==e?this.getBlob(t):this.getText(t),i?i.then(function(t){result=this.handleResponse(t,e),n.resolve(result)}.bind(this)):n.reject({message:"File not found in the epub: "+t,stack:(new Error).stack}),n.promise},n.prototype.handleResponse=function(t,e){var i;return i="json"==e?JSON.parse(t):s.isXml(e)?s.parse(t,"text/xml"):"xhtml"==e?s.parse(t,"application/xhtml+xml"):"html"==e||"htm"==e?s.parse(t,"text/html"):t},n.prototype.getBlob=function(t,e){var i=window.decodeURIComponent(t.substr(1)),n=this.zip.file(i);if(n)return e=e||r.lookup(n.name),n.async("uint8array").then(function(t){return new Blob([t],{type:e})})},n.prototype.getText=function(t,e){var i=window.decodeURIComponent(t.substr(1)),n=this.zip.file(i);if(n)return n.async("string").then(function(t){return t})},n.prototype.getBase64=function(t,e){var i=window.decodeURIComponent(t.substr(1)),n=this.zip.file(i);if(n)return e=e||r.lookup(n.name),n.async("base64").then(function(t){return"data:"+e+";base64,"+t})},n.prototype.createUrl=function(t,e){var i,n,o=new s.defer,r=window.URL||window.webkitURL||window.mozURL,h=e&&e.base64;return t in this.urlCache?(o.resolve(this.urlCache[t]),o.promise):(h?(n=this.getBase64(t),n&&n.then(function(e){this.urlCache[t]=e,o.resolve(e)}.bind(this))):(n=this.getBlob(t),n&&n.then(function(e){i=r.createObjectURL(e),this.urlCache[t]=i,o.resolve(i)}.bind(this))),n||o.reject({message:"File not found in the epub: "+t,stack:(new Error).stack}),o.promise)},n.prototype.revokeUrl=function(t){var e=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[t];i&&e.revokeObjectURL(i)},t.exports=n},function(t,e,i){function n(t){t&&this.parse(t)}var s=i(2),o=i(0);i(1);n.prototype.parse=function(t){var e;return t?(e=o.qs(t,"rootfile"))?(this.packagePath=e.getAttribute("full-path"),this.directory=s.dirname(this.packagePath),void(this.encoding=t.xmlEncoding)):void console.error("No RootFile Found"):void console.error("Container File Not Found")},t.exports=n},function(t,e,i){function n(t){this.name=t.layout||"reflowable",this._spread="none"!==t.spread,this._minSpreadWidth=t.minSpreadWidth||800,this._evenSpreads=t.evenSpreads||!1,"scrolled-continuous"===t.flow||"scrolled-doc"===t.flow?this._flow="scrolled":this._flow="paginated",this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1}i(0);n.prototype.flow=function(t){this._flow="paginated"===t?"paginated":"scrolled"},n.prototype.spread=function(t,e){this._spread="none"!==t,e>=0&&(this._minSpreadWidth=e)},n.prototype.calculate=function(t,e,i){var n,s,o,r=1,h=i||0,a=(Math.floor(t),t),c=Math.floor(a/8);r=this._spread&&a>=this._minSpreadWidth?2:1,"reflowable"!==this.name||"paginated"!==this._flow||i>=0||(h=c%2===0?c:c-1),"pre-paginated"===this.name&&(h=0),n=r>1?Math.floor((a-h)/r):a,"pre-paginated"===this.name&&r>1&&(a=n),s=n*r,o=(n+h)*r,this.width=a,this.height=e,this.spreadWidth=s,this.delta=o,this.columnWidth=n,this.gap=h,this.divisor=r},n.prototype.format=function(t){var e;return e="pre-paginated"===this.name?t.fit(this.columnWidth,this.height):"paginated"===this._flow?t.columns(this.width,this.height,this.columnWidth,this.gap):t.size(this.width,null)},n.prototype.count=function(t){var e=Math.ceil(t/this.spreadWidth);return{spreads:e,pages:e*this.divisor}},t.exports=n},function(t,e,i){function n(t,e){this.spine=t,this.request=e,this.q=new o(this),this.epubcfi=new r,this._locations=[],this.total=0,this["break"]=150,this._current=0}var s=i(0),o=i(7),r=i(1),h=i(3);n.prototype.generate=function(t){return t&&(this["break"]=t),this.q.pause(),this.spine.each(function(t){this.q.enqueue(this.process,t)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))},n.prototype.process=function(t){return t.load(this.request).then(function(e){var i,n=e.ownerDocument,s=0;this.sprint(e,function(e){var o,r=e.length,h=0;for(0==s&&(i=n.createRange(),i.setStart(e,0)),o=this["break"]-s,o>r&&(s+=r,h=r);h=r?s=r-(h-this["break"]):(i.setEnd(e,h),cfi=t.cfiFromRange(i),this._locations.push(cfi),s=0,h+=1,i=n.createRange(),i.setStart(e,h))}.bind(this)),i&&(i.setEnd(prev,prev.length),cfi=t.cfiFromRange(i),this._locations.push(cfi),s=0)}.bind(this))},n.prototype.sprint=function(t,e){for(var i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1);node=i.nextNode();)e(node)},n.prototype.locationFromCfi=function(t){return 0===this._locations.length?-1:s.locationOf(t,this._locations,this.epubcfi.compare)},n.prototype.precentageFromCfi=function(t){var e=this.locationFromCfi(t);return this.precentageFromLocation(e)},n.prototype.percentageFromLocation=function(t){return t&&this.total?t/this.total:0},n.prototype.cfiFromLocation=function(t){var e=-1;return"number"!=typeof t&&(t=parseInt(pg)),t>=0&&t1?t/100:t,i=Math.ceil(this.total*e);return this.cfiFromLocation(i)},n.prototype.load=function(t){return this._locations=JSON.parse(t),this.total=this._locations.length-1,this._locations},n.prototype.save=function(t){return JSON.stringify(this._locations)},n.prototype.getCurrent=function(t){return this._current},n.prototype.setCurrent=function(t){var e;if("string"==typeof t)this._currentCfi=t;else{if("number"!=typeof t)return;this._current=t}0!==this._locations.length&&("string"==typeof t?(e=this.locationFromCfi(t),this._current=e):e=t,this.emit("changed",{percentage:this.precentageFromLocation(e)}))},Object.defineProperty(n.prototype,"currentLocation",{get:function(){return this._current},set:function(t){this.setCurrent(t)}}),h(n.prototype),t.exports=n},function(t,e,i){function n(t){this.settings=t||{},this.id="epubjs-container-"+s.uuid(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}var s=i(0);n.prototype.create=function(t){var e=t.height,i=t.width,n=t.overflow||!1,o=t.axis||"vertical";return t.height&&s.isNumber(t.height)&&(e=t.height+"px"),t.width&&s.isNumber(t.width)&&(i=t.width+"px"),container=document.createElement("div"),container.id=this.id,container.classList.add("epub-container"),container.style.wordSpacing="0",container.style.lineHeight="0",container.style.verticalAlign="top","horizontal"===o&&(container.style.whiteSpace="nowrap"),i&&(container.style.width=i),e&&(container.style.height=e),n&&(container.style.overflow=n),container},n.wrap=function(t){var e=document.createElement("div");return e.style.visibility="hidden",e.style.overflow="hidden",e.style.width="0",e.style.height="0",e.appendChild(t),e},n.prototype.getElement=function(t){var e;return s.isElement(t)?e=t:"string"==typeof t&&(e=document.getElementById(t)),e?e:void console.error("Not an Element")},n.prototype.attachTo=function(t){var e,i=this.getElement(t);if(i)return e=this.settings.hidden?this.wrapper:this.container,i.appendChild(e),this.element=i,i},n.prototype.getContainer=function(){return this.container},n.prototype.onResize=function(t){s.isNumber(this.settings.width)&&s.isNumber(this.settings.height)||window.addEventListener("resize",t,!1)},n.prototype.size=function(t,e){var i;return null===t&&(i=this.element.getBoundingClientRect(),i.width&&(t=i.width,this.container.style.width=i.width+"px")),null===e&&(i=i||this.element.getBoundingClientRect(),i.height&&(e=i.height,this.container.style.height=i.height+"px")),s.isNumber(t)||(i=this.container.getBoundingClientRect(),t=i.width),s.isNumber(e)||(i=i||this.container.getBoundingClientRect(),e=i.height),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},{width:t-this.containerPadding.left-this.containerPadding.right,height:e-this.containerPadding.top-this.containerPadding.bottom}},n.prototype.bounds=function(){return this.container?this.container.getBoundingClientRect():s.windowBounds()},n.prototype.getSheet=function(){var t=document.createElement("style");return t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet},n.prototype.addStyleRules=function(t,e){var i="#"+this.id+" ",n="";this.sheet||(this.sheet=this.getSheet()),e.forEach(function(t){for(var e in t)t.hasOwnProperty(e)&&(n+=e+":"+t[e]+";")}),this.sheet.insertRule(i+t+" {"+n+"}",0)},t.exports=n},function(t,e){function i(t){this.container=t,this._views=[],this.length=0,this.hidden=!1}i.prototype.all=function(){return this._views},i.prototype.first=function(){return this._views[0]},i.prototype.last=function(){return this._views[this._views.length-1]},i.prototype.indexOf=function(t){return this._views.indexOf(t)},i.prototype.slice=function(){return this._views.slice.apply(this._views,arguments)},i.prototype.get=function(t){return this._views[t]},i.prototype.append=function(t){return this._views.push(t),this.container&&this.container.appendChild(t.element),this.length++,t},i.prototype.prepend=function(t){return this._views.unshift(t),this.container&&this.container.insertBefore(t.element,this.container.firstChild),this.length++,t},i.prototype.insert=function(t,e){return this._views.splice(e,0,t),this.container&&(e-1&&this._views.splice(e,1),this.destroy(t),this.length--},i.prototype.destroy=function(t){t.displayed&&t.destroy(),this.container&&this.container.removeChild(t.element),t=null},i.prototype.each=function(){return this._views.forEach.apply(this._views,arguments)},i.prototype.clear=function(){var t,e=this.length;if(this.length){for(var i=0;i1&&e[1],{cfi:n,href:r,packageUrl:i,page:a}):{href:r,page:a}},n.prototype.process=function(t){t.forEach(function(t){this.pages.push(t.page),t.cfi&&this.locations.push(t.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage},n.prototype.addCFIs=function(){this.pageList.forEach(function(t){!t.cfi})},n.prototype.pageFromCfi=function(t){var e=-1;if(0===this.locations.length)return-1;var i=o.indexOfSorted(t,this.locations,this.epubcfi.compare);return i!=-1?e=this.pages[i]:(i=EPUBJS.core.locationOf(t,this.locations,this.epubcfi.compare),e=i-1>=0?this.pages[i-1]:this.pages[0],void 0!==e||(e=-1)),e},n.prototype.cfiFromPage=function(t){var e=-1;"number"!=typeof t&&(t=parseInt(t));
+var i=this.pages.indexOf(t);return i!=-1&&(e=this.locations[i]),e},n.prototype.pageFromPercentage=function(t){var e=Math.round(this.totalPages*t);return e},n.prototype.percentageFromPage=function(t){var e=(t-this.firstPage)/this.totalPages;return Math.round(1e3*e)/1e3},n.prototype.percentageFromCfi=function(t){var e=this.pageFromCfi(t),i=this.percentageFromPage(e);return i},t.exports=n},function(t,e,i){function n(t,e){this.settings={replacements:e&&e.replacements||"base64",archive:e&&e.archive,resolver:e&&e.resolver},this.manifest=t,this.resources=Object.keys(t).map(function(e){return t[e]}),this.replacementUrls=[],this.split(),this.splitUrls()}var s=i(8),o=i(0),r=i(0).Path,h=i(2);n.prototype.split=function(){this.html=this.resources.filter(function(t){if("application/xhtml+xml"===t.type||"text/html"===t.type)return!0}),this.assets=this.resources.filter(function(t){if("application/xhtml+xml"!==t.type&&"text/html"!==t.type)return!0}),this.css=this.resources.filter(function(t){if("text/css"===t.type)return!0})},n.prototype.splitUrls=function(){this.urls=this.assets.map(function(t){return t.href}.bind(this)),this.cssUrls=this.css.map(function(t){return t.href})},n.prototype.replacements=function(t,e){if(t=t||this.settings.archive,e=e||this.settings.resolver,"none"===this.settings.replacements)return new Promise(function(t,e){t(this.urls)}.bind(this));var i=this.urls.map(function(i){var n=e(i);return t.createUrl(n,{base64:"base64"===this.settings.replacements})}.bind(this));return Promise.all(i).then(function(t){return this.replacementUrls=t,t}.bind(this))},n.prototype.replaceCss=function(t,e){var i=[];return t=t||this.settings.archive,e=e||this.settings.resolver,this.cssUrls.forEach(function(n){var s=this.createCssFile(n,t,e).then(function(t){var e=this.urls.indexOf(n);e>-1&&(this.replacementUrls[e]=t)}.bind(this));i.push(s)}.bind(this)),Promise.all(i)},n.prototype.createCssFile=function(t,e,i){var n;if(e=e||this.settings.archive,i=i||this.settings.resolver,h.isAbsolute(t))return new Promise(function(t,e){t(urls,replacementUrls)});var a=i(t),c=e.getText(a),p=this.urls.map(function(t){var e=i(t),n=new r(a).relative(e);return n}.bind(this));return c.then(function(t){return t=s.substitute(t,p,this.replacementUrls),n="base64"===this.settings.replacements?o.createBase64Url(t,"text/css"):o.createBlobUrl(t,"text/css")}.bind(this))},n.prototype.relativeTo=function(t,e){return e=e||this.settings.resolver,this.urls.map(function(i){var n=e(i),s=new r(t).relative(n);return s}.bind(this))},n.prototype.get=function(t){var e=this.urls.indexOf(t);if(e!==-1)return this.replacementUrls.length?new Promise(function(t,i){t(this.replacementUrls[e])}.bind(this)):archive.createUrl(absolute,{base64:"base64"===this.settings.replacements})},t.exports=n},function(t,e,i){function n(t,e){this.idref=t.idref,this.linear=t.linear,this.properties=t.properties,this.index=t.index,this.href=t.href,this.url=t.url,this.next=t.next,this.prev=t.prev,this.cfiBase=t.cfiBase,e?this.hooks=e:(this.hooks={},this.hooks.serialize=new r(this),this.hooks.content=new r(this))}var s=i(0),o=i(1),r=i(5),h=i(0).Url;n.prototype.load=function(t){var e=t||this.request||i(9),n=new s.defer,o=n.promise;return this.contents?n.resolve(this.contents):e(this.url).then(function(t){new h(this.url).directory;return this.document=t,this.contents=t.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){n.resolve(this.contents)}.bind(this))["catch"](function(t){n.reject(t)}),o},n.prototype.base=function(t){var e,i=new s.defer,n=t.createElement("base");return n.setAttribute("href",window.location.origin+"/"+this.url),t&&(e=t.querySelector("head")),e?(e.insertBefore(n,e.firstChild),i.resolve()):i.reject(new Error("No head to insert into")),i.promise},n.prototype.render=function(t){var e=new s.defer,n=e.promise;return this.output,this.load(t).then(function(t){var e;return"undefined"==typeof XMLSerializer&&(XMLSerializer=i(13).XMLSerializer),e=new XMLSerializer,this.output=e.serializeToString(t),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){e.resolve(this.output)}.bind(this))["catch"](function(t){e.reject(t)}),n},n.prototype.find=function(t){},n.prototype.reconcileLayoutSettings=function(t){var e={layout:t.layout,spread:t.spread,orientation:t.orientation};return this.properties.forEach(function(t){var i,n,s=t.replace("rendition:",""),o=s.indexOf("-");o!=-1&&(i=s.slice(0,o),n=s.slice(o+1),e[i]=n)}),e},n.prototype.cfiFromRange=function(t){return new o(t,this.cfiBase).toString()},n.prototype.cfiFromElement=function(t){return new o(t,this.cfiBase).toString()},t.exports=n},function(t,e,i){function n(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new o,this.hooks.content=new o,this.hooks.content.register(h.base),this.hooks.content.register(h.canonical),this.epubcfi=new s,this.loaded=!1}var s=(i(0),i(1)),o=i(5),r=i(46),h=i(8);n.prototype.unpack=function(t,e){this.items=t.spine,this.manifest=t.manifest,this.spineNodeIndex=t.spineNodeIndex,this.baseUrl=t.baseUrl||t.basePath||"",this.length=this.items.length,this.items.forEach(function(t,i){var n,s=this.manifest[t.idref];t.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,t.index,t.idref),s&&(t.href=s.href,t.url=e(t.href,!0),s.properties.length&&t.properties.push.apply(t.properties,s.properties)),t.prev=function(){return this.get(i-1)}.bind(this),t.next=function(){return this.get(i+1)}.bind(this),n=new r(t,this.hooks),this.append(n)}.bind(this)),this.loaded=!0},n.prototype.get=function(t){var e=0;return this.epubcfi.isCfiString(t)?(cfi=new s(t),e=cfi.spinePos):!t||"number"!=typeof t&&isNaN(t)!==!1?t&&0===t.indexOf("#")?e=this.spineById[t.substring(1)]:t&&(t=t.split("#")[0],e=this.spineByHref[t]):e=t,this.spineItems[e]||null},n.prototype.append=function(t){var e=this.spineItems.length;return t.index=e,this.spineItems.push(t),this.spineByHref[t.href]=e,this.spineById[t.idref]=e,e},n.prototype.prepend=function(t){this.spineItems.unshift(t);return this.spineByHref[t.href]=0,this.spineById[t.idref]=0,this.spineItems.forEach(function(t,e){t.index=e}),0},n.prototype.remove=function(t){var e=this.spineItems.indexOf(t);if(e>-1)return delete this.spineByHref[t.href],delete this.spineById[t.idref],this.spineItems.splice(e,1)},n.prototype.each=function(){return this.spineItems.forEach.apply(this.spineItems,arguments)},t.exports=n},function(e,i){if("undefined"==typeof t){var n=new Error('Cannot find module "JSZip"');throw n.code="MODULE_NOT_FOUND",n}e.exports=t},,function(t,e,i){function n(t,e){return new s(t,e)}var s=i(16),o=i(1),r=i(12),h=i(10);n.VERSION="0.3.0",n.CFI=o,n.Rendition=r,n.Contents=h,n.ViewManagers={},n.Views={},n.register={manager:function(t,e){return n.ViewManagers[t]=e},view:function(t,e){return n.Views[t]=e}},n.register.view("iframe",i(18)),n.register.manager("default",i(11)),n.register.manager("continuous",i(17)),t.exports=n}])});
\ No newline at end of file
diff --git a/dist/polyfills.js b/dist/polyfills.js
index 9300144..0f38ec3 100644
--- a/dist/polyfills.js
+++ b/dist/polyfills.js
@@ -71,11 +71,639 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = "/dist/";
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 48);
+/******/ return __webpack_require__(__webpack_require__.s = 51);
/******/ })
/************************************************************************/
/******/ ({
+/***/ 14:
+/***/ function(module, exports) {
+
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+(function(scope) {
+ 'use strict';
+
+ // feature detect for URL constructor
+ var hasWorkingUrl = false;
+ if (!scope.forceJURL) {
+ try {
+ var u = new URL('b', 'http://a');
+ u.pathname = 'c%20d';
+ hasWorkingUrl = u.href === 'http://a/c%20d';
+ } catch(e) {}
+ }
+
+ if (hasWorkingUrl)
+ return;
+
+ var relative = Object.create(null);
+ relative['ftp'] = 21;
+ relative['file'] = 0;
+ relative['gopher'] = 70;
+ relative['http'] = 80;
+ relative['https'] = 443;
+ relative['ws'] = 80;
+ relative['wss'] = 443;
+
+ var relativePathDotMapping = Object.create(null);
+ relativePathDotMapping['%2e'] = '.';
+ relativePathDotMapping['.%2e'] = '..';
+ relativePathDotMapping['%2e.'] = '..';
+ relativePathDotMapping['%2e%2e'] = '..';
+
+ function isRelativeScheme(scheme) {
+ return relative[scheme] !== undefined;
+ }
+
+ function invalid() {
+ clear.call(this);
+ this._isInvalid = true;
+ }
+
+ function IDNAToASCII(h) {
+ if ('' == h) {
+ invalid.call(this)
+ }
+ // XXX
+ return h.toLowerCase()
+ }
+
+ function percentEscape(c) {
+ var unicode = c.charCodeAt(0);
+ if (unicode > 0x20 &&
+ unicode < 0x7F &&
+ // " # < > ? `
+ [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1
+ ) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+
+ function percentEscapeQuery(c) {
+ // XXX This actually needs to encode c using encoding and then
+ // convert the bytes one-by-one.
+
+ var unicode = c.charCodeAt(0);
+ if (unicode > 0x20 &&
+ unicode < 0x7F &&
+ // " # < > ` (do not escape '?')
+ [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1
+ ) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+
+ var EOF = undefined,
+ ALPHA = /[a-zA-Z]/,
+ ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/;
+
+ function parse(input, stateOverride, base) {
+ function err(message) {
+ errors.push(message)
+ }
+
+ var state = stateOverride || 'scheme start',
+ cursor = 0,
+ buffer = '',
+ seenAt = false,
+ seenBracket = false,
+ errors = [];
+
+ loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {
+ var c = input[cursor];
+ switch (state) {
+ case 'scheme start':
+ if (c && ALPHA.test(c)) {
+ buffer += c.toLowerCase(); // ASCII-safe
+ state = 'scheme';
+ } else if (!stateOverride) {
+ buffer = '';
+ state = 'no scheme';
+ continue;
+ } else {
+ err('Invalid scheme.');
+ break loop;
+ }
+ break;
+
+ case 'scheme':
+ if (c && ALPHANUMERIC.test(c)) {
+ buffer += c.toLowerCase(); // ASCII-safe
+ } else if (':' == c) {
+ this._scheme = buffer;
+ buffer = '';
+ if (stateOverride) {
+ break loop;
+ }
+ if (isRelativeScheme(this._scheme)) {
+ this._isRelative = true;
+ }
+ if ('file' == this._scheme) {
+ state = 'relative';
+ } else if (this._isRelative && base && base._scheme == this._scheme) {
+ state = 'relative or authority';
+ } else if (this._isRelative) {
+ state = 'authority first slash';
+ } else {
+ state = 'scheme data';
+ }
+ } else if (!stateOverride) {
+ buffer = '';
+ cursor = 0;
+ state = 'no scheme';
+ continue;
+ } else if (EOF == c) {
+ break loop;
+ } else {
+ err('Code point not allowed in scheme: ' + c)
+ break loop;
+ }
+ break;
+
+ case 'scheme data':
+ if ('?' == c) {
+ this._query = '?';
+ state = 'query';
+ } else if ('#' == c) {
+ this._fragment = '#';
+ state = 'fragment';
+ } else {
+ // XXX error handling
+ if (EOF != c && '\t' != c && '\n' != c && '\r' != c) {
+ this._schemeData += percentEscape(c);
+ }
+ }
+ break;
+
+ case 'no scheme':
+ if (!base || !(isRelativeScheme(base._scheme))) {
+ err('Missing scheme.');
+ invalid.call(this);
+ } else {
+ state = 'relative';
+ continue;
+ }
+ break;
+
+ case 'relative or authority':
+ if ('/' == c && '/' == input[cursor+1]) {
+ state = 'authority ignore slashes';
+ } else {
+ err('Expected /, got: ' + c);
+ state = 'relative';
+ continue
+ }
+ break;
+
+ case 'relative':
+ this._isRelative = true;
+ if ('file' != this._scheme)
+ this._scheme = base._scheme;
+ if (EOF == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._username = base._username;
+ this._password = base._password;
+ break loop;
+ } else if ('/' == c || '\\' == c) {
+ if ('\\' == c)
+ err('\\ is an invalid code point.');
+ state = 'relative slash';
+ } else if ('?' == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = '?';
+ this._username = base._username;
+ this._password = base._password;
+ state = 'query';
+ } else if ('#' == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._fragment = '#';
+ this._username = base._username;
+ this._password = base._password;
+ state = 'fragment';
+ } else {
+ var nextC = input[cursor+1]
+ var nextNextC = input[cursor+2]
+ if (
+ 'file' != this._scheme || !ALPHA.test(c) ||
+ (nextC != ':' && nextC != '|') ||
+ (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ this._path = base._path.slice();
+ this._path.pop();
+ }
+ state = 'relative path';
+ continue;
+ }
+ break;
+
+ case 'relative slash':
+ if ('/' == c || '\\' == c) {
+ if ('\\' == c) {
+ err('\\ is an invalid code point.');
+ }
+ if ('file' == this._scheme) {
+ state = 'file host';
+ } else {
+ state = 'authority ignore slashes';
+ }
+ } else {
+ if ('file' != this._scheme) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ }
+ state = 'relative path';
+ continue;
+ }
+ break;
+
+ case 'authority first slash':
+ if ('/' == c) {
+ state = 'authority second slash';
+ } else {
+ err("Expected '/', got: " + c);
+ state = 'authority ignore slashes';
+ continue;
+ }
+ break;
+
+ case 'authority second slash':
+ state = 'authority ignore slashes';
+ if ('/' != c) {
+ err("Expected '/', got: " + c);
+ continue;
+ }
+ break;
+
+ case 'authority ignore slashes':
+ if ('/' != c && '\\' != c) {
+ state = 'authority';
+ continue;
+ } else {
+ err('Expected authority, got: ' + c);
+ }
+ break;
+
+ case 'authority':
+ if ('@' == c) {
+ if (seenAt) {
+ err('@ already seen.');
+ buffer += '%40';
+ }
+ seenAt = true;
+ for (var i = 0; i < buffer.length; i++) {
+ var cp = buffer[i];
+ if ('\t' == cp || '\n' == cp || '\r' == cp) {
+ err('Invalid whitespace in authority.');
+ continue;
+ }
+ // XXX check URL code points
+ if (':' == cp && null === this._password) {
+ this._password = '';
+ continue;
+ }
+ var tempC = percentEscape(cp);
+ (null !== this._password) ? this._password += tempC : this._username += tempC;
+ }
+ buffer = '';
+ } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) {
+ cursor -= buffer.length;
+ buffer = '';
+ state = 'host';
+ continue;
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case 'file host':
+ if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) {
+ if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {
+ state = 'relative path';
+ } else if (buffer.length == 0) {
+ state = 'relative path start';
+ } else {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = '';
+ state = 'relative path start';
+ }
+ continue;
+ } else if ('\t' == c || '\n' == c || '\r' == c) {
+ err('Invalid whitespace in file host.');
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case 'host':
+ case 'hostname':
+ if (':' == c && !seenBracket) {
+ // XXX host parsing
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = '';
+ state = 'port';
+ if ('hostname' == stateOverride) {
+ break loop;
+ }
+ } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = '';
+ state = 'relative path start';
+ if (stateOverride) {
+ break loop;
+ }
+ continue;
+ } else if ('\t' != c && '\n' != c && '\r' != c) {
+ if ('[' == c) {
+ seenBracket = true;
+ } else if (']' == c) {
+ seenBracket = false;
+ }
+ buffer += c;
+ } else {
+ err('Invalid code point in host/hostname: ' + c);
+ }
+ break;
+
+ case 'port':
+ if (/[0-9]/.test(c)) {
+ buffer += c;
+ } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) {
+ if ('' != buffer) {
+ var temp = parseInt(buffer, 10);
+ if (temp != relative[this._scheme]) {
+ this._port = temp + '';
+ }
+ buffer = '';
+ }
+ if (stateOverride) {
+ break loop;
+ }
+ state = 'relative path start';
+ continue;
+ } else if ('\t' == c || '\n' == c || '\r' == c) {
+ err('Invalid code point in port: ' + c);
+ } else {
+ invalid.call(this);
+ }
+ break;
+
+ case 'relative path start':
+ if ('\\' == c)
+ err("'\\' not allowed in path.");
+ state = 'relative path';
+ if ('/' != c && '\\' != c) {
+ continue;
+ }
+ break;
+
+ case 'relative path':
+ if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) {
+ if ('\\' == c) {
+ err('\\ not allowed in relative path.');
+ }
+ var tmp;
+ if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
+ buffer = tmp;
+ }
+ if ('..' == buffer) {
+ this._path.pop();
+ if ('/' != c && '\\' != c) {
+ this._path.push('');
+ }
+ } else if ('.' == buffer && '/' != c && '\\' != c) {
+ this._path.push('');
+ } else if ('.' != buffer) {
+ if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {
+ buffer = buffer[0] + ':';
+ }
+ this._path.push(buffer);
+ }
+ buffer = '';
+ if ('?' == c) {
+ this._query = '?';
+ state = 'query';
+ } else if ('#' == c) {
+ this._fragment = '#';
+ state = 'fragment';
+ }
+ } else if ('\t' != c && '\n' != c && '\r' != c) {
+ buffer += percentEscape(c);
+ }
+ break;
+
+ case 'query':
+ if (!stateOverride && '#' == c) {
+ this._fragment = '#';
+ state = 'fragment';
+ } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) {
+ this._query += percentEscapeQuery(c);
+ }
+ break;
+
+ case 'fragment':
+ if (EOF != c && '\t' != c && '\n' != c && '\r' != c) {
+ this._fragment += c;
+ }
+ break;
+ }
+
+ cursor++;
+ }
+ }
+
+ function clear() {
+ this._scheme = '';
+ this._schemeData = '';
+ this._username = '';
+ this._password = null;
+ this._host = '';
+ this._port = '';
+ this._path = [];
+ this._query = '';
+ this._fragment = '';
+ this._isInvalid = false;
+ this._isRelative = false;
+ }
+
+ // Does not process domain names or IP addresses.
+ // Does not handle encoding for the query parameter.
+ function jURL(url, base /* , encoding */) {
+ if (base !== undefined && !(base instanceof jURL))
+ base = new jURL(String(base));
+
+ this._url = url;
+ clear.call(this);
+
+ var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, '');
+ // encoding = encoding || 'utf-8'
+
+ parse.call(this, input, null, base);
+ }
+
+ jURL.prototype = {
+ toString: function() {
+ return this.href;
+ },
+ get href() {
+ if (this._isInvalid)
+ return this._url;
+
+ var authority = '';
+ if ('' != this._username || null != this._password) {
+ authority = this._username +
+ (null != this._password ? ':' + this._password : '') + '@';
+ }
+
+ return this.protocol +
+ (this._isRelative ? '//' + authority + this.host : '') +
+ this.pathname + this._query + this._fragment;
+ },
+ set href(href) {
+ clear.call(this);
+ parse.call(this, href);
+ },
+
+ get protocol() {
+ return this._scheme + ':';
+ },
+ set protocol(protocol) {
+ if (this._isInvalid)
+ return;
+ parse.call(this, protocol + ':', 'scheme start');
+ },
+
+ get host() {
+ return this._isInvalid ? '' : this._port ?
+ this._host + ':' + this._port : this._host;
+ },
+ set host(host) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ parse.call(this, host, 'host');
+ },
+
+ get hostname() {
+ return this._host;
+ },
+ set hostname(hostname) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ parse.call(this, hostname, 'hostname');
+ },
+
+ get port() {
+ return this._port;
+ },
+ set port(port) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ parse.call(this, port, 'port');
+ },
+
+ get pathname() {
+ return this._isInvalid ? '' : this._isRelative ?
+ '/' + this._path.join('/') : this._schemeData;
+ },
+ set pathname(pathname) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ this._path = [];
+ parse.call(this, pathname, 'relative path start');
+ },
+
+ get search() {
+ return this._isInvalid || !this._query || '?' == this._query ?
+ '' : this._query;
+ },
+ set search(search) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ this._query = '?';
+ if ('?' == search[0])
+ search = search.slice(1);
+ parse.call(this, search, 'query');
+ },
+
+ get hash() {
+ return this._isInvalid || !this._fragment || '#' == this._fragment ?
+ '' : this._fragment;
+ },
+ set hash(hash) {
+ if (this._isInvalid)
+ return;
+ this._fragment = '#';
+ if ('#' == hash[0])
+ hash = hash.slice(1);
+ parse.call(this, hash, 'fragment');
+ },
+
+ get origin() {
+ var host;
+ if (this._isInvalid || !this._scheme) {
+ return '';
+ }
+ // javascript: Gecko returns String(""), WebKit/Blink String("null")
+ // Gecko throws error for "data://"
+ // data: Gecko returns "", Blink returns "data://", WebKit returns "null"
+ // Gecko returns String("") for file: mailto:
+ // WebKit/Blink returns String("SCHEME://") for file: mailto:
+ switch (this._scheme) {
+ case 'data':
+ case 'file':
+ case 'javascript':
+ case 'mailto':
+ return 'null';
+ }
+ host = this.host;
+ if (!host) {
+ return '';
+ }
+ return this._scheme + '://' + host;
+ }
+ };
+
+ // Copy over the static methods
+ var OriginalURL = scope.URL;
+ if (OriginalURL) {
+ jURL.createObjectURL = function(blob) {
+ // IE extension allows a second optional options argument.
+ // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx
+ return OriginalURL.createObjectURL.apply(OriginalURL, arguments);
+ };
+ jURL.revokeObjectURL = function(url) {
+ OriginalURL.revokeObjectURL(url);
+ };
+ }
+
+ scope.URL = jURL;
+
+ // Export for CommonJS
+ if (typeof module === 'object' && module.exports) {
+ module.exports = jURL;
+ }
+
+})(this);
+
+
+/***/ },
+
/***/ 15:
/***/ function(module, exports, __webpack_require__) {
@@ -215,7 +843,7 @@ function flush() {
function attemptVertx() {
try {
var r = require;
- var vertx = __webpack_require__(46);
+ var vertx = __webpack_require__(49);
vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer();
} catch (e) {
@@ -1238,442 +1866,11 @@ return Promise;
ES6Promise.polyfill();
//# sourceMappingURL=es6-promise.auto.map
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(36)))
+/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(35)))
/***/ },
-/***/ 16:
-/***/ function(module, exports) {
-
-// URL Polyfill
-// Draft specification: https://url.spec.whatwg.org
-
-// Notes:
-// - Primarily useful for parsing URLs and modifying query parameters
-// - Should work in IE8+ and everything more modern
-
-(function (global) {
- 'use strict';
-
- // Browsers may have:
- // * No global URL object
- // * URL with static methods only - may have a dummy constructor
- // * URL with members except searchParams
- // * Full URL API support
- var origURL = global.URL;
- var nativeURL;
- try {
- if (origURL) {
- nativeURL = new global.URL('http://example.com');
- if ('searchParams' in nativeURL)
- return;
- if (!('href' in nativeURL))
- nativeURL = undefined;
- }
- } catch (_) {}
-
- // NOTE: Doesn't do the encoding/decoding dance
- function urlencoded_serialize(pairs) {
- var output = '', first = true;
- pairs.forEach(function (pair) {
- var name = encodeURIComponent(pair.name);
- var value = encodeURIComponent(pair.value);
- if (!first) output += '&';
- output += name + '=' + value;
- first = false;
- });
- return output.replace(/%20/g, '+');
- }
-
- // NOTE: Doesn't do the encoding/decoding dance
- function urlencoded_parse(input, isindex) {
- var sequences = input.split('&');
- if (isindex && sequences[0].indexOf('=') === -1)
- sequences[0] = '=' + sequences[0];
- var pairs = [];
- sequences.forEach(function (bytes) {
- if (bytes.length === 0) return;
- var index = bytes.indexOf('=');
- if (index !== -1) {
- var name = bytes.substring(0, index);
- var value = bytes.substring(index + 1);
- } else {
- name = bytes;
- value = '';
- }
- name = name.replace(/\+/g, ' ');
- value = value.replace(/\+/g, ' ');
- pairs.push({ name: name, value: value });
- });
- var output = [];
- pairs.forEach(function (pair) {
- output.push({
- name: decodeURIComponent(pair.name),
- value: decodeURIComponent(pair.value)
- });
- });
- return output;
- }
-
-
- function URLUtils(url) {
- if (nativeURL)
- return new origURL(url);
- var anchor = document.createElement('a');
- anchor.href = url;
- return anchor;
- }
-
- function URLSearchParams(init) {
- var $this = this;
- this._list = [];
-
- if (init === undefined || init === null)
- init = '';
-
- if (Object(init) !== init || (init instanceof URLSearchParams))
- init = String(init);
-
- if (typeof init === 'string') {
- if (init.substring(0, 1) === '?') {
- init = init.substring(1);
- }
- this._list = urlencoded_parse(init);
- }
-
- this._url_object = null;
- this._setList = function (list) { if (!updating) $this._list = list; };
-
- var updating = false;
- this._update_steps = function() {
- if (updating) return;
- updating = true;
-
- if (!$this._url_object) return;
-
- // Partial workaround for IE issue with 'about:'
- if ($this._url_object.protocol === 'about:' &&
- $this._url_object.pathname.indexOf('?') !== -1) {
- $this._url_object.pathname = $this._url_object.pathname.split('?')[0];
- }
-
- $this._url_object.search = urlencoded_serialize($this._list);
-
- updating = false;
- };
- }
-
-
- Object.defineProperties(URLSearchParams.prototype, {
- append: {
- value: function (name, value) {
- this._list.push({ name: name, value: value });
- this._update_steps();
- }, writable: true, enumerable: true, configurable: true
- },
-
- 'delete': {
- value: function (name) {
- for (var i = 0; i < this._list.length;) {
- if (this._list[i].name === name)
- this._list.splice(i, 1);
- else
- ++i;
- }
- this._update_steps();
- }, writable: true, enumerable: true, configurable: true
- },
-
- get: {
- value: function (name) {
- for (var i = 0; i < this._list.length; ++i) {
- if (this._list[i].name === name)
- return this._list[i].value;
- }
- return null;
- }, writable: true, enumerable: true, configurable: true
- },
-
- getAll: {
- value: function (name) {
- var result = [];
- for (var i = 0; i < this._list.length; ++i) {
- if (this._list[i].name === name)
- result.push(this._list[i].value);
- }
- return result;
- }, writable: true, enumerable: true, configurable: true
- },
-
- has: {
- value: function (name) {
- for (var i = 0; i < this._list.length; ++i) {
- if (this._list[i].name === name)
- return true;
- }
- return false;
- }, writable: true, enumerable: true, configurable: true
- },
-
- set: {
- value: function (name, value) {
- var found = false;
- for (var i = 0; i < this._list.length;) {
- if (this._list[i].name === name) {
- if (!found) {
- this._list[i].value = value;
- found = true;
- ++i;
- } else {
- this._list.splice(i, 1);
- }
- } else {
- ++i;
- }
- }
-
- if (!found)
- this._list.push({ name: name, value: value });
-
- this._update_steps();
- }, writable: true, enumerable: true, configurable: true
- },
-
- entries: {
- value: function() {
- var $this = this, index = 0;
- return { next: function() {
- if (index >= $this._list.length)
- return {done: true, value: undefined};
- var pair = $this._list[index++];
- return {done: false, value: [pair.name, pair.value]};
- }};
- }, writable: true, enumerable: true, configurable: true
- },
-
- keys: {
- value: function() {
- var $this = this, index = 0;
- return { next: function() {
- if (index >= $this._list.length)
- return {done: true, value: undefined};
- var pair = $this._list[index++];
- return {done: false, value: pair.name};
- }};
- }, writable: true, enumerable: true, configurable: true
- },
-
- values: {
- value: function() {
- var $this = this, index = 0;
- return { next: function() {
- if (index >= $this._list.length)
- return {done: true, value: undefined};
- var pair = $this._list[index++];
- return {done: false, value: pair.value};
- }};
- }, writable: true, enumerable: true, configurable: true
- },
-
- forEach: {
- value: function(callback) {
- var thisArg = (arguments.length > 1) ? arguments[1] : undefined;
- this._list.forEach(function(pair, index) {
- callback.call(thisArg, pair.value, pair.name);
- });
-
- }, writable: true, enumerable: true, configurable: true
- },
-
- toString: {
- value: function () {
- return urlencoded_serialize(this._list);
- }, writable: true, enumerable: false, configurable: true
- }
- });
-
- if ('Symbol' in global && 'iterator' in global.Symbol) {
- Object.defineProperty(URLSearchParams.prototype, global.Symbol.iterator, {
- value: URLSearchParams.prototype.entries,
- writable: true, enumerable: true, configurable: true});
- }
-
- function URL(url, base) {
- if (!(this instanceof global.URL))
- throw new TypeError("Failed to construct 'URL': Please use the 'new' operator.");
-
- if (base) {
- url = (function () {
- if (nativeURL) return new origURL(url, base).href;
-
- var doc;
- // Use another document/base tag/anchor for relative URL resolution, if possible
- if (document.implementation && document.implementation.createHTMLDocument) {
- doc = document.implementation.createHTMLDocument('');
- } else if (document.implementation && document.implementation.createDocument) {
- doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null);
- doc.documentElement.appendChild(doc.createElement('head'));
- doc.documentElement.appendChild(doc.createElement('body'));
- } else if (window.ActiveXObject) {
- doc = new window.ActiveXObject('htmlfile');
- doc.write('<\/head><\/body>');
- doc.close();
- }
-
- if (!doc) throw Error('base not supported');
-
- var baseTag = doc.createElement('base');
- baseTag.href = base;
- doc.getElementsByTagName('head')[0].appendChild(baseTag);
- var anchor = doc.createElement('a');
- anchor.href = url;
- return anchor.href;
- }());
- }
-
- // An inner object implementing URLUtils (either a native URL
- // object or an HTMLAnchorElement instance) is used to perform the
- // URL algorithms. With full ES5 getter/setter support, return a
- // regular object For IE8's limited getter/setter support, a
- // different HTMLAnchorElement is returned with properties
- // overridden
-
- var instance = URLUtils(url || '');
-
- // Detect for ES5 getter/setter support
- // (an Object.defineProperties polyfill that doesn't support getters/setters may throw)
- var ES5_GET_SET = (function() {
- if (!('defineProperties' in Object)) return false;
- try {
- var obj = {};
- Object.defineProperties(obj, { prop: { 'get': function () { return true; } } });
- return obj.prop;
- } catch (_) {
- return false;
- }
- })();
-
- var self = ES5_GET_SET ? this : document.createElement('a');
-
-
-
- var query_object = new URLSearchParams(
- instance.search ? instance.search.substring(1) : null);
- query_object._url_object = self;
-
- Object.defineProperties(self, {
- href: {
- get: function () { return instance.href; },
- set: function (v) { instance.href = v; tidy_instance(); update_steps(); },
- enumerable: true, configurable: true
- },
- origin: {
- get: function () {
- if ('origin' in instance) return instance.origin;
- return this.protocol + '//' + this.host;
- },
- enumerable: true, configurable: true
- },
- protocol: {
- get: function () { return instance.protocol; },
- set: function (v) { instance.protocol = v; },
- enumerable: true, configurable: true
- },
- username: {
- get: function () { return instance.username; },
- set: function (v) { instance.username = v; },
- enumerable: true, configurable: true
- },
- password: {
- get: function () { return instance.password; },
- set: function (v) { instance.password = v; },
- enumerable: true, configurable: true
- },
- host: {
- get: function () {
- // IE returns default port in |host|
- var re = {'http:': /:80$/, 'https:': /:443$/, 'ftp:': /:21$/}[instance.protocol];
- return re ? instance.host.replace(re, '') : instance.host;
- },
- set: function (v) { instance.host = v; },
- enumerable: true, configurable: true
- },
- hostname: {
- get: function () { return instance.hostname; },
- set: function (v) { instance.hostname = v; },
- enumerable: true, configurable: true
- },
- port: {
- get: function () { return instance.port; },
- set: function (v) { instance.port = v; },
- enumerable: true, configurable: true
- },
- pathname: {
- get: function () {
- // IE does not include leading '/' in |pathname|
- if (instance.pathname.charAt(0) !== '/') return '/' + instance.pathname;
- return instance.pathname;
- },
- set: function (v) { instance.pathname = v; },
- enumerable: true, configurable: true
- },
- search: {
- get: function () { return instance.search; },
- set: function (v) {
- if (instance.search === v) return;
- instance.search = v; tidy_instance(); update_steps();
- },
- enumerable: true, configurable: true
- },
- searchParams: {
- get: function () { return query_object; },
- enumerable: true, configurable: true
- },
- hash: {
- get: function () { return instance.hash; },
- set: function (v) { instance.hash = v; tidy_instance(); },
- enumerable: true, configurable: true
- },
- toString: {
- value: function() { return instance.toString(); },
- enumerable: false, configurable: true
- },
- valueOf: {
- value: function() { return instance.valueOf(); },
- enumerable: false, configurable: true
- }
- });
-
- function tidy_instance() {
- var href = instance.href.replace(/#$|\?$|\?(?=#)/g, '');
- if (instance.href !== href)
- instance.href = href;
- }
-
- function update_steps() {
- query_object._setList(instance.search ? urlencoded_parse(instance.search.substring(1)) : []);
- query_object._update_steps();
- };
-
- return self;
- }
-
- if (origURL) {
- for (var i in origURL) {
- if (origURL.hasOwnProperty(i) && typeof origURL[i] === 'function')
- URL[i] = origURL[i];
- }
- }
-
- global.URL = URL;
- global.URLSearchParams = URLSearchParams;
-
-}(self));
-
-
-/***/ },
-
-/***/ 36:
+/***/ 35:
/***/ function(module, exports) {
var g;
@@ -1699,23 +1896,7 @@ module.exports = g;
/***/ },
-/***/ 46:
-/***/ function(module, exports) {
-
-/* (ignored) */
-
-/***/ },
-
-/***/ 48:
-/***/ function(module, exports, __webpack_require__) {
-
-__webpack_require__(15);
-module.exports = __webpack_require__(16);
-
-
-/***/ },
-
-/***/ 5:
+/***/ 4:
/***/ function(module, exports) {
// shim for using process in browser
@@ -1900,6 +2081,22 @@ process.chdir = function (dir) {
process.umask = function() { return 0; };
+/***/ },
+
+/***/ 49:
+/***/ function(module, exports) {
+
+/* (ignored) */
+
+/***/ },
+
+/***/ 51:
+/***/ function(module, exports, __webpack_require__) {
+
+__webpack_require__(15);
+module.exports = __webpack_require__(14);
+
+
/***/ }
/******/ })
diff --git a/dist/polyfills.js.map b/dist/polyfills.js.map
index 21d5967..e317100 100644
--- a/dist/polyfills.js.map
+++ b/dist/polyfills.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///webpack/bootstrap 07404e07252e3f8682e4?e8ce","webpack:///./~/es6-promise/dist/es6-promise.auto.js","webpack:///./~/js-polyfills/url.js","webpack:///(webpack)/buildin/global.js","webpack:///vertx (ignored)","webpack:///./~/process/browser.js?82e4"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;uDC9DA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC,qBAAqB;;AAEtB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iFAAiF;;AAEjF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,uCAAuC;AACxD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,MAAM;AAChB,UAAU,OAAO;AACjB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU,MAAM;AAChB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,UAAU,SAAS;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;AACA,yC;;;;;;;;ACtoCA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,kBAAkB,2BAA2B;AAC7C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mCAAmC;;AAExE;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA,yBAAyB,2BAA2B;AACpD;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA,2BAA2B,2BAA2B;;AAEtD;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oBAAoB;AACpB;AACA,kBAAkB;AAClB;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oBAAoB;AACpB;AACA,kBAAkB;AAClB;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB;AAChB;AACA,oBAAoB;AACpB;AACA,kBAAkB;AAClB;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;;AAEH;AACA;AACA;AACA,2DAA2D;AAC3D;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,QAAQ,qBAAqB,aAAa,EAAE,EAAE,EAAE;AACtF;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;;;;AAIA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,sBAAsB,EAAE;AAClD,2BAA2B,mBAAmB,iBAAiB,gBAAgB,EAAE;AACjF;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA,0BAA0B,0BAA0B,EAAE;AACtD,2BAA2B,uBAAuB,EAAE;AACpD;AACA,OAAO;AACP;AACA,0BAA0B,0BAA0B,EAAE;AACtD,2BAA2B,uBAAuB,EAAE;AACpD;AACA,OAAO;AACP;AACA,0BAA0B,0BAA0B,EAAE;AACtD,2BAA2B,uBAAuB,EAAE;AACpD;AACA,OAAO;AACP;AACA;AACA;AACA,oBAAoB,mDAAmD;AACvE;AACA,SAAS;AACT,2BAA2B,mBAAmB,EAAE;AAChD;AACA,OAAO;AACP;AACA,0BAA0B,0BAA0B,EAAE;AACtD,2BAA2B,uBAAuB,EAAE;AACpD;AACA,OAAO;AACP;AACA,0BAA0B,sBAAsB,EAAE;AAClD,2BAA2B,mBAAmB,EAAE;AAChD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2BAA2B,uBAAuB,EAAE;AACpD;AACA,OAAO;AACP;AACA,0BAA0B,wBAAwB,EAAE;AACpD;AACA;AACA,8BAA8B,iBAAiB;AAC/C,SAAS;AACT;AACA,OAAO;AACP;AACA,0BAA0B,qBAAqB,EAAE;AACjD;AACA,OAAO;AACP;AACA,0BAA0B,sBAAsB,EAAE;AAClD,2BAA2B,mBAAmB,iBAAiB,EAAE;AACjE;AACA,OAAO;AACP;AACA,2BAA2B,4BAA4B,EAAE;AACzD;AACA,OAAO;AACP;AACA,2BAA2B,2BAA2B,EAAE;AACxD;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;;;;;;;ACvaD;;AAEA;AACA,iBAAiB,aAAa,EAAE;;AAEhC;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;AClBA,e;;;;;;;;;;;;;;;;ACAA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU","file":"polyfills.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ePub\"] = factory();\n\telse\n\t\troot[\"ePub\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmory imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmory exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tObject.defineProperty(exports, name, {\n \t\t\tconfigurable: false,\n \t\t\tenumerable: true,\n \t\t\tget: getter\n \t\t});\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 48);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 07404e07252e3f8682e4","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version 4.0.5\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n} else {\n _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var _arguments = arguments;\n\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n (function () {\n var callback = _arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n })();\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n _resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n _reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n _reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n _reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return _resolve(promise, value);\n }, function (reason) {\n return _reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$ === GET_THEN_ERROR) {\n _reject(promise, GET_THEN_ERROR.error);\n } else if (then$$ === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$)) {\n handleForeignThenable(promise, maybeThenable, then$$);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction _resolve(promise, value) {\n if (promise === value) {\n _reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction _reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = undefined,\n callback = undefined,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = undefined,\n error = undefined,\n succeeded = undefined,\n failed = undefined;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n _reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n _resolve(promise, value);\n } else if (failed) {\n _reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n _reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n _resolve(promise, value);\n }, function rejectPromise(reason) {\n _reject(promise, reason);\n });\n } catch (e) {\n _reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n _reject(this.promise, validationError());\n }\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n var length = this.length;\n var _input = this._input;\n\n for (var i = 0; this._state === PENDING && i < length; i++) {\n this._eachEntry(_input[i], i);\n }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve$$ = c.resolve;\n\n if (resolve$$ === resolve) {\n var _then = getThen(entry);\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$) {\n return resolve$$(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$(entry), i);\n }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n _reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n};\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n*/\nfunction Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n constructor: Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: then,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nfunction polyfill() {\n var local = undefined;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n\nES6Promise.polyfill();\n//# sourceMappingURL=es6-promise.auto.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es6-promise/dist/es6-promise.auto.js\n// module id = 15\n// module chunks = 1","// URL Polyfill\n// Draft specification: https://url.spec.whatwg.org\n\n// Notes:\n// - Primarily useful for parsing URLs and modifying query parameters\n// - Should work in IE8+ and everything more modern\n\n(function (global) {\n 'use strict';\n\n // Browsers may have:\n // * No global URL object\n // * URL with static methods only - may have a dummy constructor\n // * URL with members except searchParams\n // * Full URL API support\n var origURL = global.URL;\n var nativeURL;\n try {\n if (origURL) {\n nativeURL = new global.URL('http://example.com');\n if ('searchParams' in nativeURL)\n return;\n if (!('href' in nativeURL))\n nativeURL = undefined;\n }\n } catch (_) {}\n\n // NOTE: Doesn't do the encoding/decoding dance\n function urlencoded_serialize(pairs) {\n var output = '', first = true;\n pairs.forEach(function (pair) {\n var name = encodeURIComponent(pair.name);\n var value = encodeURIComponent(pair.value);\n if (!first) output += '&';\n output += name + '=' + value;\n first = false;\n });\n return output.replace(/%20/g, '+');\n }\n\n // NOTE: Doesn't do the encoding/decoding dance\n function urlencoded_parse(input, isindex) {\n var sequences = input.split('&');\n if (isindex && sequences[0].indexOf('=') === -1)\n sequences[0] = '=' + sequences[0];\n var pairs = [];\n sequences.forEach(function (bytes) {\n if (bytes.length === 0) return;\n var index = bytes.indexOf('=');\n if (index !== -1) {\n var name = bytes.substring(0, index);\n var value = bytes.substring(index + 1);\n } else {\n name = bytes;\n value = '';\n }\n name = name.replace(/\\+/g, ' ');\n value = value.replace(/\\+/g, ' ');\n pairs.push({ name: name, value: value });\n });\n var output = [];\n pairs.forEach(function (pair) {\n output.push({\n name: decodeURIComponent(pair.name),\n value: decodeURIComponent(pair.value)\n });\n });\n return output;\n }\n\n\n function URLUtils(url) {\n if (nativeURL)\n return new origURL(url);\n var anchor = document.createElement('a');\n anchor.href = url;\n return anchor;\n }\n\n function URLSearchParams(init) {\n var $this = this;\n this._list = [];\n\n if (init === undefined || init === null)\n init = '';\n\n if (Object(init) !== init || (init instanceof URLSearchParams))\n init = String(init);\n\n if (typeof init === 'string') {\n if (init.substring(0, 1) === '?') {\n init = init.substring(1);\n }\n this._list = urlencoded_parse(init);\n }\n\n this._url_object = null;\n this._setList = function (list) { if (!updating) $this._list = list; };\n\n var updating = false;\n this._update_steps = function() {\n if (updating) return;\n updating = true;\n\n if (!$this._url_object) return;\n\n // Partial workaround for IE issue with 'about:'\n if ($this._url_object.protocol === 'about:' &&\n $this._url_object.pathname.indexOf('?') !== -1) {\n $this._url_object.pathname = $this._url_object.pathname.split('?')[0];\n }\n\n $this._url_object.search = urlencoded_serialize($this._list);\n\n updating = false;\n };\n }\n\n\n Object.defineProperties(URLSearchParams.prototype, {\n append: {\n value: function (name, value) {\n this._list.push({ name: name, value: value });\n this._update_steps();\n }, writable: true, enumerable: true, configurable: true\n },\n\n 'delete': {\n value: function (name) {\n for (var i = 0; i < this._list.length;) {\n if (this._list[i].name === name)\n this._list.splice(i, 1);\n else\n ++i;\n }\n this._update_steps();\n }, writable: true, enumerable: true, configurable: true\n },\n\n get: {\n value: function (name) {\n for (var i = 0; i < this._list.length; ++i) {\n if (this._list[i].name === name)\n return this._list[i].value;\n }\n return null;\n }, writable: true, enumerable: true, configurable: true\n },\n\n getAll: {\n value: function (name) {\n var result = [];\n for (var i = 0; i < this._list.length; ++i) {\n if (this._list[i].name === name)\n result.push(this._list[i].value);\n }\n return result;\n }, writable: true, enumerable: true, configurable: true\n },\n\n has: {\n value: function (name) {\n for (var i = 0; i < this._list.length; ++i) {\n if (this._list[i].name === name)\n return true;\n }\n return false;\n }, writable: true, enumerable: true, configurable: true\n },\n\n set: {\n value: function (name, value) {\n var found = false;\n for (var i = 0; i < this._list.length;) {\n if (this._list[i].name === name) {\n if (!found) {\n this._list[i].value = value;\n found = true;\n ++i;\n } else {\n this._list.splice(i, 1);\n }\n } else {\n ++i;\n }\n }\n\n if (!found)\n this._list.push({ name: name, value: value });\n\n this._update_steps();\n }, writable: true, enumerable: true, configurable: true\n },\n\n entries: {\n value: function() {\n var $this = this, index = 0;\n return { next: function() {\n if (index >= $this._list.length)\n return {done: true, value: undefined};\n var pair = $this._list[index++];\n return {done: false, value: [pair.name, pair.value]};\n }};\n }, writable: true, enumerable: true, configurable: true\n },\n\n keys: {\n value: function() {\n var $this = this, index = 0;\n return { next: function() {\n if (index >= $this._list.length)\n return {done: true, value: undefined};\n var pair = $this._list[index++];\n return {done: false, value: pair.name};\n }};\n }, writable: true, enumerable: true, configurable: true\n },\n\n values: {\n value: function() {\n var $this = this, index = 0;\n return { next: function() {\n if (index >= $this._list.length)\n return {done: true, value: undefined};\n var pair = $this._list[index++];\n return {done: false, value: pair.value};\n }};\n }, writable: true, enumerable: true, configurable: true\n },\n\n forEach: {\n value: function(callback) {\n var thisArg = (arguments.length > 1) ? arguments[1] : undefined;\n this._list.forEach(function(pair, index) {\n callback.call(thisArg, pair.value, pair.name);\n });\n\n }, writable: true, enumerable: true, configurable: true\n },\n\n toString: {\n value: function () {\n return urlencoded_serialize(this._list);\n }, writable: true, enumerable: false, configurable: true\n }\n });\n\n if ('Symbol' in global && 'iterator' in global.Symbol) {\n Object.defineProperty(URLSearchParams.prototype, global.Symbol.iterator, {\n value: URLSearchParams.prototype.entries,\n writable: true, enumerable: true, configurable: true});\n }\n\n function URL(url, base) {\n if (!(this instanceof global.URL))\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator.\");\n\n if (base) {\n url = (function () {\n if (nativeURL) return new origURL(url, base).href;\n\n var doc;\n // Use another document/base tag/anchor for relative URL resolution, if possible\n if (document.implementation && document.implementation.createHTMLDocument) {\n doc = document.implementation.createHTMLDocument('');\n } else if (document.implementation && document.implementation.createDocument) {\n doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null);\n doc.documentElement.appendChild(doc.createElement('head'));\n doc.documentElement.appendChild(doc.createElement('body'));\n } else if (window.ActiveXObject) {\n doc = new window.ActiveXObject('htmlfile');\n doc.write('<\\/head><\\/body>');\n doc.close();\n }\n\n if (!doc) throw Error('base not supported');\n\n var baseTag = doc.createElement('base');\n baseTag.href = base;\n doc.getElementsByTagName('head')[0].appendChild(baseTag);\n var anchor = doc.createElement('a');\n anchor.href = url;\n return anchor.href;\n }());\n }\n\n // An inner object implementing URLUtils (either a native URL\n // object or an HTMLAnchorElement instance) is used to perform the\n // URL algorithms. With full ES5 getter/setter support, return a\n // regular object For IE8's limited getter/setter support, a\n // different HTMLAnchorElement is returned with properties\n // overridden\n\n var instance = URLUtils(url || '');\n\n // Detect for ES5 getter/setter support\n // (an Object.defineProperties polyfill that doesn't support getters/setters may throw)\n var ES5_GET_SET = (function() {\n if (!('defineProperties' in Object)) return false;\n try {\n var obj = {};\n Object.defineProperties(obj, { prop: { 'get': function () { return true; } } });\n return obj.prop;\n } catch (_) {\n return false;\n }\n })();\n\n var self = ES5_GET_SET ? this : document.createElement('a');\n\n\n\n var query_object = new URLSearchParams(\n instance.search ? instance.search.substring(1) : null);\n query_object._url_object = self;\n\n Object.defineProperties(self, {\n href: {\n get: function () { return instance.href; },\n set: function (v) { instance.href = v; tidy_instance(); update_steps(); },\n enumerable: true, configurable: true\n },\n origin: {\n get: function () {\n if ('origin' in instance) return instance.origin;\n return this.protocol + '//' + this.host;\n },\n enumerable: true, configurable: true\n },\n protocol: {\n get: function () { return instance.protocol; },\n set: function (v) { instance.protocol = v; },\n enumerable: true, configurable: true\n },\n username: {\n get: function () { return instance.username; },\n set: function (v) { instance.username = v; },\n enumerable: true, configurable: true\n },\n password: {\n get: function () { return instance.password; },\n set: function (v) { instance.password = v; },\n enumerable: true, configurable: true\n },\n host: {\n get: function () {\n // IE returns default port in |host|\n var re = {'http:': /:80$/, 'https:': /:443$/, 'ftp:': /:21$/}[instance.protocol];\n return re ? instance.host.replace(re, '') : instance.host;\n },\n set: function (v) { instance.host = v; },\n enumerable: true, configurable: true\n },\n hostname: {\n get: function () { return instance.hostname; },\n set: function (v) { instance.hostname = v; },\n enumerable: true, configurable: true\n },\n port: {\n get: function () { return instance.port; },\n set: function (v) { instance.port = v; },\n enumerable: true, configurable: true\n },\n pathname: {\n get: function () {\n // IE does not include leading '/' in |pathname|\n if (instance.pathname.charAt(0) !== '/') return '/' + instance.pathname;\n return instance.pathname;\n },\n set: function (v) { instance.pathname = v; },\n enumerable: true, configurable: true\n },\n search: {\n get: function () { return instance.search; },\n set: function (v) {\n if (instance.search === v) return;\n instance.search = v; tidy_instance(); update_steps();\n },\n enumerable: true, configurable: true\n },\n searchParams: {\n get: function () { return query_object; },\n enumerable: true, configurable: true\n },\n hash: {\n get: function () { return instance.hash; },\n set: function (v) { instance.hash = v; tidy_instance(); },\n enumerable: true, configurable: true\n },\n toString: {\n value: function() { return instance.toString(); },\n enumerable: false, configurable: true\n },\n valueOf: {\n value: function() { return instance.valueOf(); },\n enumerable: false, configurable: true\n }\n });\n\n function tidy_instance() {\n var href = instance.href.replace(/#$|\\?$|\\?(?=#)/g, '');\n if (instance.href !== href)\n instance.href = href;\n }\n\n function update_steps() {\n query_object._setList(instance.search ? urlencoded_parse(instance.search.substring(1)) : []);\n query_object._update_steps();\n };\n\n return self;\n }\n\n if (origURL) {\n for (var i in origURL) {\n if (origURL.hasOwnProperty(i) && typeof origURL[i] === 'function')\n URL[i] = origURL[i];\n }\n }\n\n global.URL = URL;\n global.URLSearchParams = URLSearchParams;\n\n}(self));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/js-polyfills/url.js\n// module id = 16\n// module chunks = 1","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() { return this; })();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 36\n// module chunks = 1","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// vertx (ignored)\n// module id = 46\n// module chunks = 1","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 5\n// module chunks = 0 1"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///webpack/bootstrap e56d9891783b1b6486a9?8d8d","webpack:///./libs/url/url.js","webpack:///./~/es6-promise/dist/es6-promise.auto.js","webpack:///(webpack)/buildin/global.js","webpack:///./~/process/browser.js?82e4","webpack:///vertx (ignored)"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;AC9DA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;AACtC,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mBAAmB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;;;;;;;uDC5mBD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC,qBAAqB;;AAEtB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iFAAiF;;AAEjF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,sBAAsB;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,uCAAuC;AACxD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,MAAM;AAChB,UAAU,OAAO;AACjB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU,MAAM;AAChB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA,UAAU,IAAI;AACd;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA,UAAU,SAAS;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,YAAY,SAAS;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;AACA,yC;;;;;;;;ACtoCA;;AAEA;AACA,iBAAiB,aAAa,EAAE;;AAEhC;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;AClBA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;ACnLtC,e","file":"polyfills.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ePub\"] = factory();\n\telse\n\t\troot[\"ePub\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmory imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmory exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tObject.defineProperty(exports, name, {\n \t\t\tconfigurable: false,\n \t\t\tenumerable: true,\n \t\t\tget: getter\n \t\t});\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 51);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e56d9891783b1b6486a9","/* Any copyright is dedicated to the Public Domain.\n * http://creativecommons.org/publicdomain/zero/1.0/ */\n\n(function(scope) {\n 'use strict';\n\n // feature detect for URL constructor\n var hasWorkingUrl = false;\n if (!scope.forceJURL) {\n try {\n var u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n hasWorkingUrl = u.href === 'http://a/c%20d';\n } catch(e) {}\n }\n\n if (hasWorkingUrl)\n return;\n\n var relative = Object.create(null);\n relative['ftp'] = 21;\n relative['file'] = 0;\n relative['gopher'] = 70;\n relative['http'] = 80;\n relative['https'] = 443;\n relative['ws'] = 80;\n relative['wss'] = 443;\n\n var relativePathDotMapping = Object.create(null);\n relativePathDotMapping['%2e'] = '.';\n relativePathDotMapping['.%2e'] = '..';\n relativePathDotMapping['%2e.'] = '..';\n relativePathDotMapping['%2e%2e'] = '..';\n\n function isRelativeScheme(scheme) {\n return relative[scheme] !== undefined;\n }\n\n function invalid() {\n clear.call(this);\n this._isInvalid = true;\n }\n\n function IDNAToASCII(h) {\n if ('' == h) {\n invalid.call(this)\n }\n // XXX\n return h.toLowerCase()\n }\n\n function percentEscape(c) {\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F &&\n // \" # < > ? `\n [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponent(c);\n }\n\n function percentEscapeQuery(c) {\n // XXX This actually needs to encode c using encoding and then\n // convert the bytes one-by-one.\n\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F &&\n // \" # < > ` (do not escape '?')\n [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponent(c);\n }\n\n var EOF = undefined,\n ALPHA = /[a-zA-Z]/,\n ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n\n function parse(input, stateOverride, base) {\n function err(message) {\n errors.push(message)\n }\n\n var state = stateOverride || 'scheme start',\n cursor = 0,\n buffer = '',\n seenAt = false,\n seenBracket = false,\n errors = [];\n\n loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {\n var c = input[cursor];\n switch (state) {\n case 'scheme start':\n if (c && ALPHA.test(c)) {\n buffer += c.toLowerCase(); // ASCII-safe\n state = 'scheme';\n } else if (!stateOverride) {\n buffer = '';\n state = 'no scheme';\n continue;\n } else {\n err('Invalid scheme.');\n break loop;\n }\n break;\n\n case 'scheme':\n if (c && ALPHANUMERIC.test(c)) {\n buffer += c.toLowerCase(); // ASCII-safe\n } else if (':' == c) {\n this._scheme = buffer;\n buffer = '';\n if (stateOverride) {\n break loop;\n }\n if (isRelativeScheme(this._scheme)) {\n this._isRelative = true;\n }\n if ('file' == this._scheme) {\n state = 'relative';\n } else if (this._isRelative && base && base._scheme == this._scheme) {\n state = 'relative or authority';\n } else if (this._isRelative) {\n state = 'authority first slash';\n } else {\n state = 'scheme data';\n }\n } else if (!stateOverride) {\n buffer = '';\n cursor = 0;\n state = 'no scheme';\n continue;\n } else if (EOF == c) {\n break loop;\n } else {\n err('Code point not allowed in scheme: ' + c)\n break loop;\n }\n break;\n\n case 'scheme data':\n if ('?' == c) {\n this._query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#';\n state = 'fragment';\n } else {\n // XXX error handling\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._schemeData += percentEscape(c);\n }\n }\n break;\n\n case 'no scheme':\n if (!base || !(isRelativeScheme(base._scheme))) {\n err('Missing scheme.');\n invalid.call(this);\n } else {\n state = 'relative';\n continue;\n }\n break;\n\n case 'relative or authority':\n if ('/' == c && '/' == input[cursor+1]) {\n state = 'authority ignore slashes';\n } else {\n err('Expected /, got: ' + c);\n state = 'relative';\n continue\n }\n break;\n\n case 'relative':\n this._isRelative = true;\n if ('file' != this._scheme)\n this._scheme = base._scheme;\n if (EOF == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n this._username = base._username;\n this._password = base._password;\n break loop;\n } else if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c)\n err('\\\\ is an invalid code point.');\n state = 'relative slash';\n } else if ('?' == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = '?';\n this._username = base._username;\n this._password = base._password;\n state = 'query';\n } else if ('#' == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n this._fragment = '#';\n this._username = base._username;\n this._password = base._password;\n state = 'fragment';\n } else {\n var nextC = input[cursor+1]\n var nextNextC = input[cursor+2]\n if (\n 'file' != this._scheme || !ALPHA.test(c) ||\n (nextC != ':' && nextC != '|') ||\n (EOF != nextNextC && '/' != nextNextC && '\\\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) {\n this._host = base._host;\n this._port = base._port;\n this._username = base._username;\n this._password = base._password;\n this._path = base._path.slice();\n this._path.pop();\n }\n state = 'relative path';\n continue;\n }\n break;\n\n case 'relative slash':\n if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c) {\n err('\\\\ is an invalid code point.');\n }\n if ('file' == this._scheme) {\n state = 'file host';\n } else {\n state = 'authority ignore slashes';\n }\n } else {\n if ('file' != this._scheme) {\n this._host = base._host;\n this._port = base._port;\n this._username = base._username;\n this._password = base._password;\n }\n state = 'relative path';\n continue;\n }\n break;\n\n case 'authority first slash':\n if ('/' == c) {\n state = 'authority second slash';\n } else {\n err(\"Expected '/', got: \" + c);\n state = 'authority ignore slashes';\n continue;\n }\n break;\n\n case 'authority second slash':\n state = 'authority ignore slashes';\n if ('/' != c) {\n err(\"Expected '/', got: \" + c);\n continue;\n }\n break;\n\n case 'authority ignore slashes':\n if ('/' != c && '\\\\' != c) {\n state = 'authority';\n continue;\n } else {\n err('Expected authority, got: ' + c);\n }\n break;\n\n case 'authority':\n if ('@' == c) {\n if (seenAt) {\n err('@ already seen.');\n buffer += '%40';\n }\n seenAt = true;\n for (var i = 0; i < buffer.length; i++) {\n var cp = buffer[i];\n if ('\\t' == cp || '\\n' == cp || '\\r' == cp) {\n err('Invalid whitespace in authority.');\n continue;\n }\n // XXX check URL code points\n if (':' == cp && null === this._password) {\n this._password = '';\n continue;\n }\n var tempC = percentEscape(cp);\n (null !== this._password) ? this._password += tempC : this._username += tempC;\n }\n buffer = '';\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n cursor -= buffer.length;\n buffer = '';\n state = 'host';\n continue;\n } else {\n buffer += c;\n }\n break;\n\n case 'file host':\n if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {\n state = 'relative path';\n } else if (buffer.length == 0) {\n state = 'relative path start';\n } else {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'relative path start';\n }\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid whitespace in file host.');\n } else {\n buffer += c;\n }\n break;\n\n case 'host':\n case 'hostname':\n if (':' == c && !seenBracket) {\n // XXX host parsing\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'port';\n if ('hostname' == stateOverride) {\n break loop;\n }\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'relative path start';\n if (stateOverride) {\n break loop;\n }\n continue;\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n if ('[' == c) {\n seenBracket = true;\n } else if (']' == c) {\n seenBracket = false;\n }\n buffer += c;\n } else {\n err('Invalid code point in host/hostname: ' + c);\n }\n break;\n\n case 'port':\n if (/[0-9]/.test(c)) {\n buffer += c;\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c || stateOverride) {\n if ('' != buffer) {\n var temp = parseInt(buffer, 10);\n if (temp != relative[this._scheme]) {\n this._port = temp + '';\n }\n buffer = '';\n }\n if (stateOverride) {\n break loop;\n }\n state = 'relative path start';\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid code point in port: ' + c);\n } else {\n invalid.call(this);\n }\n break;\n\n case 'relative path start':\n if ('\\\\' == c)\n err(\"'\\\\' not allowed in path.\");\n state = 'relative path';\n if ('/' != c && '\\\\' != c) {\n continue;\n }\n break;\n\n case 'relative path':\n if (EOF == c || '/' == c || '\\\\' == c || (!stateOverride && ('?' == c || '#' == c))) {\n if ('\\\\' == c) {\n err('\\\\ not allowed in relative path.');\n }\n var tmp;\n if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {\n buffer = tmp;\n }\n if ('..' == buffer) {\n this._path.pop();\n if ('/' != c && '\\\\' != c) {\n this._path.push('');\n }\n } else if ('.' == buffer && '/' != c && '\\\\' != c) {\n this._path.push('');\n } else if ('.' != buffer) {\n if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {\n buffer = buffer[0] + ':';\n }\n this._path.push(buffer);\n }\n buffer = '';\n if ('?' == c) {\n this._query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#';\n state = 'fragment';\n }\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n buffer += percentEscape(c);\n }\n break;\n\n case 'query':\n if (!stateOverride && '#' == c) {\n this._fragment = '#';\n state = 'fragment';\n } else if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._query += percentEscapeQuery(c);\n }\n break;\n\n case 'fragment':\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._fragment += c;\n }\n break;\n }\n\n cursor++;\n }\n }\n\n function clear() {\n this._scheme = '';\n this._schemeData = '';\n this._username = '';\n this._password = null;\n this._host = '';\n this._port = '';\n this._path = [];\n this._query = '';\n this._fragment = '';\n this._isInvalid = false;\n this._isRelative = false;\n }\n\n // Does not process domain names or IP addresses.\n // Does not handle encoding for the query parameter.\n function jURL(url, base /* , encoding */) {\n if (base !== undefined && !(base instanceof jURL))\n base = new jURL(String(base));\n\n this._url = url;\n clear.call(this);\n\n var input = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, '');\n // encoding = encoding || 'utf-8'\n\n parse.call(this, input, null, base);\n }\n\n jURL.prototype = {\n toString: function() {\n return this.href;\n },\n get href() {\n if (this._isInvalid)\n return this._url;\n\n var authority = '';\n if ('' != this._username || null != this._password) {\n authority = this._username +\n (null != this._password ? ':' + this._password : '') + '@';\n }\n\n return this.protocol +\n (this._isRelative ? '//' + authority + this.host : '') +\n this.pathname + this._query + this._fragment;\n },\n set href(href) {\n clear.call(this);\n parse.call(this, href);\n },\n\n get protocol() {\n return this._scheme + ':';\n },\n set protocol(protocol) {\n if (this._isInvalid)\n return;\n parse.call(this, protocol + ':', 'scheme start');\n },\n\n get host() {\n return this._isInvalid ? '' : this._port ?\n this._host + ':' + this._port : this._host;\n },\n set host(host) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, host, 'host');\n },\n\n get hostname() {\n return this._host;\n },\n set hostname(hostname) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, hostname, 'hostname');\n },\n\n get port() {\n return this._port;\n },\n set port(port) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, port, 'port');\n },\n\n get pathname() {\n return this._isInvalid ? '' : this._isRelative ?\n '/' + this._path.join('/') : this._schemeData;\n },\n set pathname(pathname) {\n if (this._isInvalid || !this._isRelative)\n return;\n this._path = [];\n parse.call(this, pathname, 'relative path start');\n },\n\n get search() {\n return this._isInvalid || !this._query || '?' == this._query ?\n '' : this._query;\n },\n set search(search) {\n if (this._isInvalid || !this._isRelative)\n return;\n this._query = '?';\n if ('?' == search[0])\n search = search.slice(1);\n parse.call(this, search, 'query');\n },\n\n get hash() {\n return this._isInvalid || !this._fragment || '#' == this._fragment ?\n '' : this._fragment;\n },\n set hash(hash) {\n if (this._isInvalid)\n return;\n this._fragment = '#';\n if ('#' == hash[0])\n hash = hash.slice(1);\n parse.call(this, hash, 'fragment');\n },\n\n get origin() {\n var host;\n if (this._isInvalid || !this._scheme) {\n return '';\n }\n // javascript: Gecko returns String(\"\"), WebKit/Blink String(\"null\")\n // Gecko throws error for \"data://\"\n // data: Gecko returns \"\", Blink returns \"data://\", WebKit returns \"null\"\n // Gecko returns String(\"\") for file: mailto:\n // WebKit/Blink returns String(\"SCHEME://\") for file: mailto:\n switch (this._scheme) {\n case 'data':\n case 'file':\n case 'javascript':\n case 'mailto':\n return 'null';\n }\n host = this.host;\n if (!host) {\n return '';\n }\n return this._scheme + '://' + host;\n }\n };\n\n // Copy over the static methods\n var OriginalURL = scope.URL;\n if (OriginalURL) {\n jURL.createObjectURL = function(blob) {\n // IE extension allows a second optional options argument.\n // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx\n return OriginalURL.createObjectURL.apply(OriginalURL, arguments);\n };\n jURL.revokeObjectURL = function(url) {\n OriginalURL.revokeObjectURL(url);\n };\n }\n\n scope.URL = jURL;\n\n\t// Export for CommonJS\n if (typeof module === 'object' && module.exports) {\n module.exports = jURL;\n }\n\n})(this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./libs/url/url.js\n// module id = 14\n// module chunks = 1","/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version 4.0.5\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n} else {\n _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nfunction setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var r = require;\n var vertx = r('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n var _arguments = arguments;\n\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n (function () {\n var callback = _arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n })();\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nfunction resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n GET_THEN_ERROR.error = error;\n return GET_THEN_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n _resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n _reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n _reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n _reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return _resolve(promise, value);\n }, function (reason) {\n return _reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$ === GET_THEN_ERROR) {\n _reject(promise, GET_THEN_ERROR.error);\n } else if (then$$ === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$)) {\n handleForeignThenable(promise, maybeThenable, then$$);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction _resolve(promise, value) {\n if (promise === value) {\n _reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction _reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = undefined,\n callback = undefined,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = undefined,\n error = undefined,\n succeeded = undefined,\n failed = undefined;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n _reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n _resolve(promise, value);\n } else if (failed) {\n _reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n _reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n _resolve(promise, value);\n }, function rejectPromise(reason) {\n _reject(promise, reason);\n });\n } catch (e) {\n _reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n _reject(this.promise, validationError());\n }\n}\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n var length = this.length;\n var _input = this._input;\n\n for (var i = 0; this._state === PENDING && i < length; i++) {\n this._eachEntry(_input[i], i);\n }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve$$ = c.resolve;\n\n if (resolve$$ === resolve) {\n var _then = getThen(entry);\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$) {\n return resolve$$(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$(entry), i);\n }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n _reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n};\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nfunction all(entries) {\n return new Enumerator(this, entries).promise;\n}\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nfunction race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n*/\nfunction Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n constructor: Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n \n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n \n Chaining\n --------\n \n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n \n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n \n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n \n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n \n Assimilation\n ------------\n \n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n \n If the assimliated promise rejects, then the downstream promise will also reject.\n \n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n \n Simple Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let result;\n \n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n \n Advanced Example\n --------------\n \n Synchronous Example\n \n ```javascript\n let author, books;\n \n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n \n Errback Example\n \n ```js\n \n function foundBooks(books) {\n \n }\n \n function failure(reason) {\n \n }\n \n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n \n Promise Example;\n \n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n \n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: then,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n \n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n \n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n \n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n \n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n};\n\nfunction polyfill() {\n var local = undefined;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n\nES6Promise.polyfill();\n//# sourceMappingURL=es6-promise.auto.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es6-promise/dist/es6-promise.auto.js\n// module id = 15\n// module chunks = 1","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() { return this; })();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 35\n// module chunks = 1","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 4\n// module chunks = 0 1","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// vertx (ignored)\n// module id = 49\n// module chunks = 1"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/polyfills.min.js b/dist/polyfills.min.js
index 3703035..3546369 100644
--- a/dist/polyfills.min.js
+++ b/dist/polyfills.min.js
@@ -1,8 +1,10 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ePub=e():t.ePub=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,e,n){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=48)}({15:function(t,e,n){(function(e,r){/*!
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ePub=e():t.ePub=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,e,i){Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var i=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=51)}({14:function(t,e){/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+!function(e){"use strict";function i(t){return void 0!==_[t]}function n(){c.call(this),this._isInvalid=!0}function r(t){return""==t&&n.call(this),t.toLowerCase()}function s(t){var e=t.charCodeAt(0);return e>32&&e<127&&[34,35,60,62,63,96].indexOf(e)==-1?t:encodeURIComponent(t)}function o(t){var e=t.charCodeAt(0);return e>32&&e<127&&[34,35,60,62,96].indexOf(e)==-1?t:encodeURIComponent(t)}function a(t,e,a){function c(t){y.push(t)}var h=e||"scheme start",u=0,l="",f=!1,b=!1,y=[];t:for(;(t[u-1]!=v||0==u)&&!this._isInvalid;){var g=t[u];switch(h){case"scheme start":if(!g||!d.test(g)){if(e){c("Invalid scheme.");break t}l="",h="no scheme";continue}l+=g.toLowerCase(),h="scheme";break;case"scheme":if(g&&m.test(g))l+=g.toLowerCase();else{if(":"!=g){if(e){if(v==g)break t;c("Code point not allowed in scheme: "+g);break t}l="",u=0,h="no scheme";continue}if(this._scheme=l,l="",e)break t;i(this._scheme)&&(this._isRelative=!0),h="file"==this._scheme?"relative":this._isRelative&&a&&a._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==g?(this._query="?",h="query"):"#"==g?(this._fragment="#",h="fragment"):v!=g&&"\t"!=g&&"\n"!=g&&"\r"!=g&&(this._schemeData+=s(g));break;case"no scheme":if(a&&i(a._scheme)){h="relative";continue}c("Missing scheme."),n.call(this);break;case"relative or authority":if("/"!=g||"/"!=t[u+1]){c("Expected /, got: "+g),h="relative";continue}h="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=a._scheme),v==g){this._host=a._host,this._port=a._port,this._path=a._path.slice(),this._query=a._query,this._username=a._username,this._password=a._password;break t}if("/"==g||"\\"==g)"\\"==g&&c("\\ is an invalid code point."),h="relative slash";else if("?"==g)this._host=a._host,this._port=a._port,this._path=a._path.slice(),this._query="?",this._username=a._username,this._password=a._password,h="query";else{if("#"!=g){var w=t[u+1],j=t[u+2];("file"!=this._scheme||!d.test(g)||":"!=w&&"|"!=w||v!=j&&"/"!=j&&"\\"!=j&&"?"!=j&&"#"!=j)&&(this._host=a._host,this._port=a._port,this._username=a._username,this._password=a._password,this._path=a._path.slice(),this._path.pop()),h="relative path";continue}this._host=a._host,this._port=a._port,this._path=a._path.slice(),this._query=a._query,this._fragment="#",this._username=a._username,this._password=a._password,h="fragment"}break;case"relative slash":if("/"!=g&&"\\"!=g){"file"!=this._scheme&&(this._host=a._host,this._port=a._port,this._username=a._username,this._password=a._password),h="relative path";continue}"\\"==g&&c("\\ is an invalid code point."),h="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=g){c("Expected '/', got: "+g),h="authority ignore slashes";continue}h="authority second slash";break;case"authority second slash":if(h="authority ignore slashes","/"!=g){c("Expected '/', got: "+g);continue}break;case"authority ignore slashes":if("/"!=g&&"\\"!=g){h="authority";continue}c("Expected authority, got: "+g);break;case"authority":if("@"==g){f&&(c("@ already seen."),l+="%40"),f=!0;for(var O=0;O"),t.close()),!t)throw Error("base not supported");var n=t.createElement("base");n.href=o,t.getElementsByTagName("head")[0].appendChild(n);var r=t.createElement("a");return r.href=e,r.href}());var l=r(e||""),f=function(){if(!("defineProperties"in Object))return!1;try{var t={};return Object.defineProperties(t,{prop:{get:function(){return!0}}}),t.prop}catch(e){return!1}}(),h=f?this:document.createElement("a"),p=new i(l.search?l.search.substring(1):null);return p._url_object=h,Object.defineProperties(h,{href:{get:function(){return l.href},set:function(t){l.href=t,s(),c()},enumerable:!0,configurable:!0},origin:{get:function(){return"origin"in l?l.origin:this.protocol+"//"+this.host},enumerable:!0,configurable:!0},protocol:{get:function(){return l.protocol},set:function(t){l.protocol=t},enumerable:!0,configurable:!0},username:{get:function(){return l.username},set:function(t){l.username=t},enumerable:!0,configurable:!0},password:{get:function(){return l.password},set:function(t){l.password=t},enumerable:!0,configurable:!0},host:{get:function(){var t={"http:":/:80$/,"https:":/:443$/,"ftp:":/:21$/}[l.protocol];return t?l.host.replace(t,""):l.host},set:function(t){l.host=t},enumerable:!0,configurable:!0},hostname:{get:function(){return l.hostname},set:function(t){l.hostname=t},enumerable:!0,configurable:!0},port:{get:function(){return l.port},set:function(t){l.port=t},enumerable:!0,configurable:!0},pathname:{get:function(){return"/"!==l.pathname.charAt(0)?"/"+l.pathname:l.pathname},set:function(t){l.pathname=t},enumerable:!0,configurable:!0},search:{get:function(){return l.search},set:function(t){l.search!==t&&(l.search=t,s(),c())},enumerable:!0,configurable:!0},searchParams:{get:function(){return p},enumerable:!0,configurable:!0},hash:{get:function(){return l.hash},set:function(t){l.hash=t,s()},enumerable:!0,configurable:!0},toString:{value:function(){return l.toString()},enumerable:!1,configurable:!0},valueOf:{value:function(){return l.valueOf()},enumerable:!1,configurable:!0}}),h}var u,a=t.URL;try{if(a){if(u=new t.URL("http://example.com"),"searchParams"in u)return;"href"in u||(u=void 0)}}catch(s){}if(Object.defineProperties(i.prototype,{append:{value:function(t,e){this._list.push({name:t,value:e}),this._update_steps()},writable:!0,enumerable:!0,configurable:!0},"delete":{value:function(t){for(var e=0;e=t._list.length)return{done:!0,value:void 0};var n=t._list[e++];return{done:!1,value:[n.name,n.value]}}}},writable:!0,enumerable:!0,configurable:!0},keys:{value:function(){var t=this,e=0;return{next:function(){if(e>=t._list.length)return{done:!0,value:void 0};var n=t._list[e++];return{done:!1,value:n.name}}}},writable:!0,enumerable:!0,configurable:!0},values:{value:function(){var t=this,e=0;return{next:function(){if(e>=t._list.length)return{done:!0,value:void 0};var n=t._list[e++];return{done:!1,value:n.value}}}},writable:!0,enumerable:!0,configurable:!0},forEach:{value:function(t){var e=arguments.length>1?arguments[1]:void 0;this._list.forEach(function(n,r){t.call(e,n.value,n.name)})},writable:!0,enumerable:!0,configurable:!0},toString:{value:function(){return e(this._list)},writable:!0,enumerable:!1,configurable:!0}}),"Symbol"in t&&"iterator"in t.Symbol&&Object.defineProperty(i.prototype,t.Symbol.iterator,{value:i.prototype.entries,writable:!0,enumerable:!0,configurable:!0}),a)for(var c in a)a.hasOwnProperty(c)&&"function"==typeof a[c]&&(o[c]=a[c]);t.URL=o,t.URLSearchParams=i}(self)},36:function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){"object"==typeof window&&(n=window)}t.exports=n},46:function(t,e){},48:function(t,e,n){n(15),t.exports=n(16)},5:function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?m=p.concat(m):d=-1,m.length&&a())}function a(){if(!v){var t=i(u);v=!0;for(var e=m.length;e;){for(p=m,m=[];++d1)for(var n=1;n1)for(var i=1;i 0x20 &&
+ unicode < 0x7F &&
+ // " # < > ? `
+ [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1
+ ) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+
+ function percentEscapeQuery(c) {
+ // XXX This actually needs to encode c using encoding and then
+ // convert the bytes one-by-one.
+
+ var unicode = c.charCodeAt(0);
+ if (unicode > 0x20 &&
+ unicode < 0x7F &&
+ // " # < > ` (do not escape '?')
+ [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1
+ ) {
+ return c;
+ }
+ return encodeURIComponent(c);
+ }
+
+ var EOF = undefined,
+ ALPHA = /[a-zA-Z]/,
+ ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/;
+
+ function parse(input, stateOverride, base) {
+ function err(message) {
+ errors.push(message)
+ }
+
+ var state = stateOverride || 'scheme start',
+ cursor = 0,
+ buffer = '',
+ seenAt = false,
+ seenBracket = false,
+ errors = [];
+
+ loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {
+ var c = input[cursor];
+ switch (state) {
+ case 'scheme start':
+ if (c && ALPHA.test(c)) {
+ buffer += c.toLowerCase(); // ASCII-safe
+ state = 'scheme';
+ } else if (!stateOverride) {
+ buffer = '';
+ state = 'no scheme';
+ continue;
+ } else {
+ err('Invalid scheme.');
+ break loop;
+ }
+ break;
+
+ case 'scheme':
+ if (c && ALPHANUMERIC.test(c)) {
+ buffer += c.toLowerCase(); // ASCII-safe
+ } else if (':' == c) {
+ this._scheme = buffer;
+ buffer = '';
+ if (stateOverride) {
+ break loop;
+ }
+ if (isRelativeScheme(this._scheme)) {
+ this._isRelative = true;
+ }
+ if ('file' == this._scheme) {
+ state = 'relative';
+ } else if (this._isRelative && base && base._scheme == this._scheme) {
+ state = 'relative or authority';
+ } else if (this._isRelative) {
+ state = 'authority first slash';
+ } else {
+ state = 'scheme data';
+ }
+ } else if (!stateOverride) {
+ buffer = '';
+ cursor = 0;
+ state = 'no scheme';
+ continue;
+ } else if (EOF == c) {
+ break loop;
+ } else {
+ err('Code point not allowed in scheme: ' + c)
+ break loop;
+ }
+ break;
+
+ case 'scheme data':
+ if ('?' == c) {
+ this._query = '?';
+ state = 'query';
+ } else if ('#' == c) {
+ this._fragment = '#';
+ state = 'fragment';
+ } else {
+ // XXX error handling
+ if (EOF != c && '\t' != c && '\n' != c && '\r' != c) {
+ this._schemeData += percentEscape(c);
+ }
+ }
+ break;
+
+ case 'no scheme':
+ if (!base || !(isRelativeScheme(base._scheme))) {
+ err('Missing scheme.');
+ invalid.call(this);
+ } else {
+ state = 'relative';
+ continue;
+ }
+ break;
+
+ case 'relative or authority':
+ if ('/' == c && '/' == input[cursor+1]) {
+ state = 'authority ignore slashes';
+ } else {
+ err('Expected /, got: ' + c);
+ state = 'relative';
+ continue
+ }
+ break;
+
+ case 'relative':
+ this._isRelative = true;
+ if ('file' != this._scheme)
+ this._scheme = base._scheme;
+ if (EOF == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._username = base._username;
+ this._password = base._password;
+ break loop;
+ } else if ('/' == c || '\\' == c) {
+ if ('\\' == c)
+ err('\\ is an invalid code point.');
+ state = 'relative slash';
+ } else if ('?' == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = '?';
+ this._username = base._username;
+ this._password = base._password;
+ state = 'query';
+ } else if ('#' == c) {
+ this._host = base._host;
+ this._port = base._port;
+ this._path = base._path.slice();
+ this._query = base._query;
+ this._fragment = '#';
+ this._username = base._username;
+ this._password = base._password;
+ state = 'fragment';
+ } else {
+ var nextC = input[cursor+1]
+ var nextNextC = input[cursor+2]
+ if (
+ 'file' != this._scheme || !ALPHA.test(c) ||
+ (nextC != ':' && nextC != '|') ||
+ (EOF != nextNextC && '/' != nextNextC && '\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ this._path = base._path.slice();
+ this._path.pop();
+ }
+ state = 'relative path';
+ continue;
+ }
+ break;
+
+ case 'relative slash':
+ if ('/' == c || '\\' == c) {
+ if ('\\' == c) {
+ err('\\ is an invalid code point.');
+ }
+ if ('file' == this._scheme) {
+ state = 'file host';
+ } else {
+ state = 'authority ignore slashes';
+ }
+ } else {
+ if ('file' != this._scheme) {
+ this._host = base._host;
+ this._port = base._port;
+ this._username = base._username;
+ this._password = base._password;
+ }
+ state = 'relative path';
+ continue;
+ }
+ break;
+
+ case 'authority first slash':
+ if ('/' == c) {
+ state = 'authority second slash';
+ } else {
+ err("Expected '/', got: " + c);
+ state = 'authority ignore slashes';
+ continue;
+ }
+ break;
+
+ case 'authority second slash':
+ state = 'authority ignore slashes';
+ if ('/' != c) {
+ err("Expected '/', got: " + c);
+ continue;
+ }
+ break;
+
+ case 'authority ignore slashes':
+ if ('/' != c && '\\' != c) {
+ state = 'authority';
+ continue;
+ } else {
+ err('Expected authority, got: ' + c);
+ }
+ break;
+
+ case 'authority':
+ if ('@' == c) {
+ if (seenAt) {
+ err('@ already seen.');
+ buffer += '%40';
+ }
+ seenAt = true;
+ for (var i = 0; i < buffer.length; i++) {
+ var cp = buffer[i];
+ if ('\t' == cp || '\n' == cp || '\r' == cp) {
+ err('Invalid whitespace in authority.');
+ continue;
+ }
+ // XXX check URL code points
+ if (':' == cp && null === this._password) {
+ this._password = '';
+ continue;
+ }
+ var tempC = percentEscape(cp);
+ (null !== this._password) ? this._password += tempC : this._username += tempC;
+ }
+ buffer = '';
+ } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) {
+ cursor -= buffer.length;
+ buffer = '';
+ state = 'host';
+ continue;
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case 'file host':
+ if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) {
+ if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {
+ state = 'relative path';
+ } else if (buffer.length == 0) {
+ state = 'relative path start';
+ } else {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = '';
+ state = 'relative path start';
+ }
+ continue;
+ } else if ('\t' == c || '\n' == c || '\r' == c) {
+ err('Invalid whitespace in file host.');
+ } else {
+ buffer += c;
+ }
+ break;
+
+ case 'host':
+ case 'hostname':
+ if (':' == c && !seenBracket) {
+ // XXX host parsing
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = '';
+ state = 'port';
+ if ('hostname' == stateOverride) {
+ break loop;
+ }
+ } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c) {
+ this._host = IDNAToASCII.call(this, buffer);
+ buffer = '';
+ state = 'relative path start';
+ if (stateOverride) {
+ break loop;
+ }
+ continue;
+ } else if ('\t' != c && '\n' != c && '\r' != c) {
+ if ('[' == c) {
+ seenBracket = true;
+ } else if (']' == c) {
+ seenBracket = false;
+ }
+ buffer += c;
+ } else {
+ err('Invalid code point in host/hostname: ' + c);
+ }
+ break;
+
+ case 'port':
+ if (/[0-9]/.test(c)) {
+ buffer += c;
+ } else if (EOF == c || '/' == c || '\\' == c || '?' == c || '#' == c || stateOverride) {
+ if ('' != buffer) {
+ var temp = parseInt(buffer, 10);
+ if (temp != relative[this._scheme]) {
+ this._port = temp + '';
+ }
+ buffer = '';
+ }
+ if (stateOverride) {
+ break loop;
+ }
+ state = 'relative path start';
+ continue;
+ } else if ('\t' == c || '\n' == c || '\r' == c) {
+ err('Invalid code point in port: ' + c);
+ } else {
+ invalid.call(this);
+ }
+ break;
+
+ case 'relative path start':
+ if ('\\' == c)
+ err("'\\' not allowed in path.");
+ state = 'relative path';
+ if ('/' != c && '\\' != c) {
+ continue;
+ }
+ break;
+
+ case 'relative path':
+ if (EOF == c || '/' == c || '\\' == c || (!stateOverride && ('?' == c || '#' == c))) {
+ if ('\\' == c) {
+ err('\\ not allowed in relative path.');
+ }
+ var tmp;
+ if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {
+ buffer = tmp;
+ }
+ if ('..' == buffer) {
+ this._path.pop();
+ if ('/' != c && '\\' != c) {
+ this._path.push('');
+ }
+ } else if ('.' == buffer && '/' != c && '\\' != c) {
+ this._path.push('');
+ } else if ('.' != buffer) {
+ if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {
+ buffer = buffer[0] + ':';
+ }
+ this._path.push(buffer);
+ }
+ buffer = '';
+ if ('?' == c) {
+ this._query = '?';
+ state = 'query';
+ } else if ('#' == c) {
+ this._fragment = '#';
+ state = 'fragment';
+ }
+ } else if ('\t' != c && '\n' != c && '\r' != c) {
+ buffer += percentEscape(c);
+ }
+ break;
+
+ case 'query':
+ if (!stateOverride && '#' == c) {
+ this._fragment = '#';
+ state = 'fragment';
+ } else if (EOF != c && '\t' != c && '\n' != c && '\r' != c) {
+ this._query += percentEscapeQuery(c);
+ }
+ break;
+
+ case 'fragment':
+ if (EOF != c && '\t' != c && '\n' != c && '\r' != c) {
+ this._fragment += c;
+ }
+ break;
+ }
+
+ cursor++;
+ }
+ }
+
+ function clear() {
+ this._scheme = '';
+ this._schemeData = '';
+ this._username = '';
+ this._password = null;
+ this._host = '';
+ this._port = '';
+ this._path = [];
+ this._query = '';
+ this._fragment = '';
+ this._isInvalid = false;
+ this._isRelative = false;
+ }
+
+ // Does not process domain names or IP addresses.
+ // Does not handle encoding for the query parameter.
+ function jURL(url, base /* , encoding */) {
+ if (base !== undefined && !(base instanceof jURL))
+ base = new jURL(String(base));
+
+ this._url = url;
+ clear.call(this);
+
+ var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, '');
+ // encoding = encoding || 'utf-8'
+
+ parse.call(this, input, null, base);
+ }
+
+ jURL.prototype = {
+ toString: function() {
+ return this.href;
+ },
+ get href() {
+ if (this._isInvalid)
+ return this._url;
+
+ var authority = '';
+ if ('' != this._username || null != this._password) {
+ authority = this._username +
+ (null != this._password ? ':' + this._password : '') + '@';
+ }
+
+ return this.protocol +
+ (this._isRelative ? '//' + authority + this.host : '') +
+ this.pathname + this._query + this._fragment;
+ },
+ set href(href) {
+ clear.call(this);
+ parse.call(this, href);
+ },
+
+ get protocol() {
+ return this._scheme + ':';
+ },
+ set protocol(protocol) {
+ if (this._isInvalid)
+ return;
+ parse.call(this, protocol + ':', 'scheme start');
+ },
+
+ get host() {
+ return this._isInvalid ? '' : this._port ?
+ this._host + ':' + this._port : this._host;
+ },
+ set host(host) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ parse.call(this, host, 'host');
+ },
+
+ get hostname() {
+ return this._host;
+ },
+ set hostname(hostname) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ parse.call(this, hostname, 'hostname');
+ },
+
+ get port() {
+ return this._port;
+ },
+ set port(port) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ parse.call(this, port, 'port');
+ },
+
+ get pathname() {
+ return this._isInvalid ? '' : this._isRelative ?
+ '/' + this._path.join('/') : this._schemeData;
+ },
+ set pathname(pathname) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ this._path = [];
+ parse.call(this, pathname, 'relative path start');
+ },
+
+ get search() {
+ return this._isInvalid || !this._query || '?' == this._query ?
+ '' : this._query;
+ },
+ set search(search) {
+ if (this._isInvalid || !this._isRelative)
+ return;
+ this._query = '?';
+ if ('?' == search[0])
+ search = search.slice(1);
+ parse.call(this, search, 'query');
+ },
+
+ get hash() {
+ return this._isInvalid || !this._fragment || '#' == this._fragment ?
+ '' : this._fragment;
+ },
+ set hash(hash) {
+ if (this._isInvalid)
+ return;
+ this._fragment = '#';
+ if ('#' == hash[0])
+ hash = hash.slice(1);
+ parse.call(this, hash, 'fragment');
+ },
+
+ get origin() {
+ var host;
+ if (this._isInvalid || !this._scheme) {
+ return '';
+ }
+ // javascript: Gecko returns String(""), WebKit/Blink String("null")
+ // Gecko throws error for "data://"
+ // data: Gecko returns "", Blink returns "data://", WebKit returns "null"
+ // Gecko returns String("") for file: mailto:
+ // WebKit/Blink returns String("SCHEME://") for file: mailto:
+ switch (this._scheme) {
+ case 'data':
+ case 'file':
+ case 'javascript':
+ case 'mailto':
+ return 'null';
+ }
+ host = this.host;
+ if (!host) {
+ return '';
+ }
+ return this._scheme + '://' + host;
+ }
+ };
+
+ // Copy over the static methods
+ var OriginalURL = scope.URL;
+ if (OriginalURL) {
+ jURL.createObjectURL = function(blob) {
+ // IE extension allows a second optional options argument.
+ // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx
+ return OriginalURL.createObjectURL.apply(OriginalURL, arguments);
+ };
+ jURL.revokeObjectURL = function(url) {
+ OriginalURL.revokeObjectURL(url);
+ };
+ }
+
+ scope.URL = jURL;
+
+ // Export for CommonJS
+ if (typeof module === 'object' && module.exports) {
+ module.exports = jURL;
+ }
+
+})(this);
diff --git a/package.json b/package.json
index 5ed7903..4810d5e 100644
--- a/package.json
+++ b/package.json
@@ -54,7 +54,6 @@
"dependencies": {
"es6-promise": "^4.0.5",
"event-emitter": "^0.3.4",
- "js-polyfills": "^0.1.27",
"jszip": "^3.1.1",
"xmldom": "^0.1.22",
"path-webpack": "^0.0.2",
diff --git a/webpack.config.js b/webpack.config.js
index 3d40bcf..64d44b3 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -7,7 +7,7 @@ var port = "8080";
module.exports = {
entry: {
epub: "./src/epub.js",
- polyfills: ["./node_modules/es6-promise/dist/es6-promise.auto.js", "./node_modules/js-polyfills/url.js"]
+ polyfills: ["./node_modules/es6-promise/dist/es6-promise.auto.js", "./libs/url/url.js"]
},
devtool: 'source-map',
output: {