asteroid/reader/resources/scripts/polyfills/bundle.js

17 lines
No EOL
34 KiB
JavaScript

/*!
*
* # Polyfill Bundle for Bibi
*
* * Consists of:
* - classlist-polyfill : by Yola Inc. - https://github.com/yola/classlist-polyfill / Released into the public domain under the Unlicense - https://github.com/yola/classlist-polyfill/blob/master/LICENSE
* - text-encoding-utf-8 : by Erik Arvidsson - https://github.com/arv/text-encoding-utf-8 / Released into the public domain under the Unlicense - https://github.com/arv/text-encoding-utf-8/blob/master/LICENSE.md
* - IntersectionObserver polyfill : © W3C - https://github.com/w3c/IntersectionObserver / Licensed under the W3C Software and Document License - https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
* - custom-event-polyfill : © Evan Krambuhl - https://github.com/kumarharsh/custom-event-polyfill / Licensed under the MIT License - https://github.com/kumarharsh/custom-event-polyfill/blob/master/LICENSE
* - document.currentScript Polyfill : © Adam Miller - https://github.com/amiller-gh/currentScript-polyfill / Licensed under the MIT License - https://github.com/amiller-gh/currentScript-polyfill/blob/master/LICENSE
* - ES6 Object.assign() : © Rubén Norte - https://github.com/rubennorte/es6-object-assign / Licensed under the MIT License - https://github.com/rubennorte/es6-object-assign/blob/master/LICENSE
* - Native Promise Only (NPO) : © Kyle Simpson - https://github.com/getify/native-promise-only / Licensed under the MIT License - https://getify.mit-license.org/
* - Polyfill Array.prototype.includes : © Kevin Latusinski - https://github.com/latusinski/polyfill-array-includes / Licensed under the MIT License - https://github.com/kevlatus/polyfill-array-includes/blob/master/LICENSE
* - String.prototype.padStart : © Khaled Al-Ansari - https://github.com/KhaledElAnsari/String.prototype.padStart / Licensed under the MIT License - https://github.com/KhaledElAnsari/String.prototype.padStart/blob/master/LICENSE
* - url-polyfill : © Valentin Richard - https://github.com/lifaon74/url-polyfill / Licensed under the MIT License - https://github.com/lifaon74/url-polyfill/blob/master/LICENSE
*
*/!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=31)}([function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n){return e<=t&&t<=n}function i(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}n.d(e,"a",(function(){return u}));function s(t){this.tokens=[].slice.call(t)}s.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};function c(t,e){if(t)throw TypeError("Decoder error");return e||65533}function u(t,e){if(!(this instanceof u))return new u(t,e);if("utf-8"!==(t=void 0!==t?String(t).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function a(t){var e=t.fatal,n=0,r=0,i=0,s=128,u=191;this.handler=function(t,a){if(-1===a&&0!==i)return i=0,c(e);if(-1===a)return-1;if(0===i){if(o(a,0,127))return a;if(o(a,194,223))i=1,n=a-192;else if(o(a,224,239))224===a&&(s=160),237===a&&(u=159),i=2,n=a-224;else{if(!o(a,240,244))return c(e);240===a&&(s=144),244===a&&(u=143),i=3,n=a-240}return n<<=6*i,null}if(!o(a,s,u))return n=i=r=0,s=128,u=191,t.prepend(a),c(e);if(s=128,u=191,n+=a-128<<6*(i-(r+=1)),r!==i)return null;var f=n;return n=i=r=0,f}}u.prototype={decode:function(t,e){var n;n="object"===r(t)&&t instanceof ArrayBuffer?new Uint8Array(t):"object"===r(t)&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=i(e),this._streaming||(this._decoder=new a({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var o,c=new s(n),u=[];!c.endOfStream()&&-1!==(o=this._decoder.handler(c,c.read()));)null!==o&&(Array.isArray(o)?u.push.apply(u,o):u.push(o));if(!this._streaming){do{if(-1===(o=this._decoder.handler(c,c.read())))break;null!==o&&(Array.isArray(o)?u.push.apply(u,o):u.push(o))}while(!c.endOfStream());this._decoder=null}return u.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===u[0]?(this._BOMseen=!0,u.shift()):this._BOMseen=!0)),function(t){for(var e="",n=0;n<t.length;++n){var r=t[n];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode(55296+(r>>10),56320+(1023&r)))}return e}(u)}}},,,,function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(6),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,o,i,s,c,u=1,a={},f=!1,l=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){d(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},r=function(t){i.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(o=l.documentElement,r=function(t){var e=l.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,o.removeChild(e),e=null},o.appendChild(e)}):r=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",c=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",c,!1):t.attachEvent("onmessage",c),r=function(e){t.postMessage(s+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var o={callback:t,args:e};return a[u]=o,r(u),u++},h.clearImmediate=p}function p(t){delete a[t]}function d(t){if(f)setTimeout(d,0,t);else{var e=a[t];if(e){f=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{p(t),f=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(0),n(7))},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var u,a=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?a=u.concat(a):l=-1,a.length&&p())}function p(){if(!f){var t=c(h);f=!0;for(var e=a.length;e;){for(u=a,a=[];++l<e;)u&&u[l].run();l=-1,e=a.length}u=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function m(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];a.push(new d(t,e)),1!==a.length||f||c(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){"use strict";if("object"===("undefined"==typeof window?"undefined":n(window)))if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=function(t){for(var e=window.document,n=i(e);n;)n=i(e=n.ownerDocument);return e}(),e=[],r=null,o=null;c.prototype.THROTTLE_TIMEOUT=100,c.prototype.POLL_INTERVAL=null,c.prototype.USE_MUTATION_OBSERVER=!0,c._setupCrossOriginUpdater=function(){return r||(r=function(t,n){o=t&&n?h(t,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},e.forEach((function(t){t._checkForIntersections()}))}),r},c._resetCrossOriginUpdater=function(){r=null,o=null},c.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(t.ownerDocument),this._checkForIntersections()}},c.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._unmonitorIntersections(t.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},c.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},c.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},c.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},c.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},c.prototype._monitorIntersections=function(e){var n=e.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(e)){var r=this._checkForIntersections,o=null,s=null;if(this.POLL_INTERVAL?o=n.setInterval(r,this.POLL_INTERVAL):(u(n,"resize",r,!0),u(e,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(s=new n.MutationObserver(r)).observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(e),this._monitoringUnsubscribes.push((function(){var t=e.defaultView;t&&(o&&t.clearInterval(o),a(t,"resize",r,!0)),a(e,"scroll",r,!0),s&&s.disconnect()})),e!=(this.root&&this.root.ownerDocument||t)){var c=i(e);c&&this._monitorIntersections(c.ownerDocument)}}},c.prototype._unmonitorIntersections=function(e){var n=this._monitoringDocuments.indexOf(e);if(-1!=n){var r=this.root&&this.root.ownerDocument||t;if(!this._observationTargets.some((function(t){var n=t.element.ownerDocument;if(n==e)return!0;for(;n&&n!=r;){var o=i(n);if((n=o&&o.ownerDocument)==e)return!0}return!1}))){var o=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),o(),e!=r){var s=i(e);s&&this._unmonitorIntersections(s.ownerDocument)}}}},c.prototype._unmonitorAllIntersections=function(){var t=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var e=0;e<t.length;e++)t[e]()},c.prototype._checkForIntersections=function(){if(this.root||!r||o){var t=this._rootIsInDom(),e=t?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(n){var o=n.element,i=f(o),c=this._rootContainsTarget(o),u=n.entry,a=t&&c&&this._computeTargetAndRootIntersection(o,i,e),l=n.entry=new s({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:i,rootBounds:r&&!this.root?null:e,intersectionRect:a});u?t&&c?this._hasCrossedThreshold(u,l)&&this._queuedEntries.push(l):u&&u.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},c.prototype._computeTargetAndRootIntersection=function(e,n,i){if("none"!=window.getComputedStyle(e).display){for(var s,c,u,a,l,p,m,y,g=n,v=d(e),b=!1;!b&&v;){var w=null,_=1==v.nodeType?window.getComputedStyle(v):{};if("none"==_.display)return null;if(v==this.root||9==v.nodeType)if(b=!0,v==this.root||v==t)r&&!this.root?!o||0==o.width&&0==o.height?(v=null,w=null,g=null):w=o:w=i;else{var E=d(v),T=E&&f(E),O=E&&this._computeTargetAndRootIntersection(E,T,i);T&&O?(v=E,w=h(T,O)):(v=null,g=null)}else{var S=v.ownerDocument;v!=S.body&&v!=S.documentElement&&"visible"!=_.overflow&&(w=f(v))}if(w&&(s=w,c=g,u=void 0,a=void 0,l=void 0,p=void 0,m=void 0,y=void 0,u=Math.max(s.top,c.top),a=Math.min(s.bottom,c.bottom),l=Math.max(s.left,c.left),p=Math.min(s.right,c.right),y=a-u,g=(m=p-l)>=0&&y>=0&&{top:u,bottom:a,left:l,right:p,width:m,height:y}||null),!g)break;v=v&&d(v)}return g}},c.prototype._getRootRect=function(){var e;if(this.root)e=f(this.root);else{var n=t.documentElement,r=t.body;e={top:0,left:0,right:n.clientWidth||r.clientWidth,width:n.clientWidth||r.clientWidth,bottom:n.clientHeight||r.clientHeight,height:n.clientHeight||r.clientHeight}}return this._expandRectByRootMargin(e)},c.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},c.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},c.prototype._rootIsInDom=function(){return!this.root||p(t,this.root)},c.prototype._rootContainsTarget=function(e){return p(this.root||t,e)&&(!this.root||this.root.ownerDocument==e.ownerDocument)},c.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},c.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=c,window.IntersectionObserverEntry=s}function i(t){try{return t.defaultView&&t.defaultView.frameElement||null}catch(t){return null}}function s(t){this.time=t.time,this.target=t.target,this.rootBounds=l(t.rootBounds),this.boundingClientRect=l(t.boundingClientRect),this.intersectionRect=l(t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function c(t,e){var n,r,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout((function(){n(),o=null}),r))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function u(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function a(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function f(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function l(t){return!t||"x"in t?t:{top:t.top,y:t.top,bottom:t.bottom,left:t.left,x:t.left,right:t.right,width:t.width,height:t.height}}function h(t,e){var n=e.top-t.top,r=e.left-t.left;return{top:n,left:r,height:e.height,width:e.width,bottom:n+e.height,right:r+e.width}}function p(t,e){for(var n=e;n;){if(n==t)return!0;n=d(n)}return!1}function d(e){var n=e.parentNode;return 9==e.nodeType&&e!=t?i(e):n&&11==n.nodeType&&n.host?n.host:n&&n.assignedSlot?n.assignedSlot.parentNode:n}}()},,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);n(32);var r=n(1);n(8),n(33),n(34),n(35),n(37),n(38),n(39),n(40);self.TextDecoder=r.a},function(t,e){"document"in window.self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(t){"use strict";if("Element"in t){var e=t.Element.prototype,n=Object,r=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},i=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},s=function(t,e){if(""===e)throw new i("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new i("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e)},c=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;o<i;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=c.prototype=[],a=function(){return new c(this)};if(i.prototype=Error.prototype,u.item=function(t){return this[t]||null},u.contains=function(t){return-1!==s(this,t+="")},u.add=function(){var t,e=arguments,n=0,r=e.length,o=!1;do{t=e[n]+"",-1===s(this,t)&&(this.push(t),o=!0)}while(++n<r);o&&this._updateClassName()},u.remove=function(){var t,e,n=arguments,r=0,o=n.length,i=!1;do{for(t=n[r]+"",e=s(this,t);-1!==e;)this.splice(e,1),i=!0,e=s(this,t)}while(++r<o);i&&this._updateClassName()},u.toggle=function(t,e){t+="";var n=this.contains(t),r=n?!0!==e&&"remove":!1!==e&&"add";return r&&this[r](t),!0===e||!1===e?e:!n},u.toString=function(){return this.join(" ")},n.defineProperty){var f={get:a,enumerable:!0,configurable:!0};try{n.defineProperty(e,"classList",f)}catch(t){void 0!==t.number&&-2146823252!==t.number||(f.enumerable=!1,n.defineProperty(e,"classList",f))}}else n.prototype.__defineGetter__&&e.__defineGetter__("classList",a)}}(window.self),function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,r=arguments.length;for(n=0;n<r;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}())},function(t,e){!function(){if("undefined"!=typeof window)try{var t=new window.CustomEvent("test",{cancelable:!0});if(t.preventDefault(),!0!==t.defaultPrevented)throw new Error("Could not prevent default")}catch(t){var e=function(t,e){var n,r;return(e=e||{}).bubbles=!!e.bubbles,e.cancelable=!!e.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(t){this.defaultPrevented=!0}},n};e.prototype=window.Event.prototype,window.CustomEvent=e}}()},function(t,e){!function(t){var e=t.getElementsByTagName("script");"currentScript"in t||Object.defineProperty(t,"currentScript",{get:function(){try{throw new Error}catch(r){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in e)if(e[t].src==n||"interactive"==e[t].readyState)return e[t];return null}}})}(document)},function(t,e,n){"use strict";n(36).polyfill()},function(t,e,n){"use strict";function r(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var n=Object(t),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var i=Object.keys(Object(o)),s=0,c=i.length;s<c;s++){var u=i[s],a=Object.getOwnPropertyDescriptor(o,u);void 0!==a&&a.enumerable&&(n[u]=o[u])}}return n}t.exports={assign:r,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}}},function(t,e,n){(function(r,o){var i,s,c,u;function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}u=function(){"use strict";var t,e,n,r=Object.prototype.toString,i=void 0!==o?function(t){return o(t)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(t,e,n,r){return Object.defineProperty(t,e,{value:n,writable:!0,configurable:!1!==r})}}catch(e){t=function(t,e,n){return t[e]=n,t}}function s(t,r){n.add(t,r),e||(e=i(n.drain))}function c(t){var e,n=a(t);return null==t||"object"!=n&&"function"!=n||(e=t.then),"function"==typeof e&&e}function u(){for(var t=0;t<this.chain.length;t++)f(this,1===this.state?this.chain[t].success:this.chain[t].failure,this.chain[t]);this.chain.length=0}function f(t,e,n){var r,o;try{!1===e?n.reject(t.msg):(r=!0===e?t.msg:e.call(void 0,t.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(o=c(r))?o.call(r,n.resolve,n.reject):n.resolve(r)}catch(t){n.reject(t)}}function l(t){var e,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(e=c(t))?s((function(){var r=new d(n);try{e.call(t,(function(){l.apply(r,arguments)}),(function(){h.apply(r,arguments)}))}catch(t){h.call(r,t)}})):(n.msg=t,n.state=1,n.chain.length>0&&s(u,n))}catch(t){h.call(new d(n),t)}}}function h(t){var e=this;e.triggered||(e.triggered=!0,e.def&&(e=e.def),e.msg=t,e.state=2,e.chain.length>0&&s(u,e))}function p(t,e,n,r){for(var o=0;o<e.length;o++)!function(o){t.resolve(e[o]).then((function(t){n(o,t)}),r)}(o)}function d(t){this.def=t,this.triggered=!1}function m(t){this.promise=t,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function y(t){if("function"!=typeof t)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var e=new m(this);this.then=function(t,n){var r={success:"function"!=typeof t||t,failure:"function"==typeof n&&n};return r.promise=new this.constructor((function(t,e){if("function"!=typeof t||"function"!=typeof e)throw TypeError("Not a function");r.resolve=t,r.reject=e})),e.chain.push(r),0!==e.state&&s(u,e),r.promise},this.catch=function(t){return this.then(void 0,t)};try{t.call(void 0,(function(t){l.call(e,t)}),(function(t){h.call(e,t)}))}catch(t){h.call(e,t)}}n=function(){var t,n,r;function o(t,e){this.fn=t,this.self=e,this.next=void 0}return{add:function(e,i){r=new o(e,i),n?n.next=r:t=r,n=r,r=void 0},drain:function(){var r=t;for(t=n=e=void 0;r;)r.fn.call(r.self),r=r.next}}}();var g=t({},"constructor",y,!1);return y.prototype=g,t(g,"__NPO__",0,!1),t(y,"resolve",(function(t){return t&&"object"==a(t)&&1===t.__NPO__?t:new this((function(e,n){if("function"!=typeof e||"function"!=typeof n)throw TypeError("Not a function");e(t)}))})),t(y,"reject",(function(t){return new this((function(e,n){if("function"!=typeof e||"function"!=typeof n)throw TypeError("Not a function");n(t)}))})),t(y,"all",(function(t){var e=this;return"[object Array]"!=r.call(t)?e.reject(TypeError("Not an array")):0===t.length?e.resolve([]):new e((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");var o=t.length,i=Array(o),s=0;p(e,t,(function(t,e){i[t]=e,++s===o&&n(i)}),r)}))})),t(y,"race",(function(t){var e=this;return"[object Array]"!=r.call(t)?e.reject(TypeError("Not an array")):new e((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");p(e,t,(function(t,e){n(e)}),r)}))})),y},(c=void 0!==r?r:this)[s="Promise"]=c[s]||u(),t.exports?t.exports=c[s]:void 0===(i=function(){return c[s]}.call(e,n,e,t))||(t.exports=i)}).call(this,n(0),n(5).setImmediate)},function(t,e){Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;for(var o=0|e,i=Math.max(o>=0?o:r-Math.abs(o),0);i<r;){if(function(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}(n[i],t))return!0;i++}return!1}})},function(t,e,n){String.prototype.padStart=String.prototype.padStart?String.prototype.padStart:function(t,e){if((t=Math.floor(t)||0)<this.length)return String(this);e=e?String(e):" ";for(var n="",r=t-this.length,o=0;n.length<r;)e[o]||(o=0),n+=e[o],o++;return n+String(this).slice(0)},t.exports&&(t.exports=String.prototype.padStart)},function(t,e,n){(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){var n=function(){try{return!!Symbol.iterator}catch(t){return!1}}(),r=function(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e},o=function(t){return encodeURIComponent(t).replace(/%20/g,"+")},i=function(t){return decodeURIComponent(String(t).replace(/\+/g," "))};(function(){try{var e=t.URLSearchParams;return"a=1"===new e("?a=1").toString()&&"function"==typeof e.prototype.set}catch(t){return!1}})()||function(){var i=function t(n){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var r=e(n);if("undefined"===r);else if("string"===r)""!==n&&this._fromString(n);else if(n instanceof t){var o=this;n.forEach((function(t,e){o.append(e,t)}))}else{if(null===n||"object"!==r)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(n))for(var i=0;i<n.length;i++){var s=n[i];if("[object Array]"!==Object.prototype.toString.call(s)&&2===s.length)throw new TypeError("Expected [string, any] as entry at index "+i+" of URLSearchParams's input");this.append(s[0],s[1])}else for(var c in n)n.hasOwnProperty(c)&&this.append(c,n[c])}},s=i.prototype;s.append=function(t,e){t in this._entries?this._entries[t].push(String(e)):this._entries[t]=[String(e)]},s.delete=function(t){delete this._entries[t]},s.get=function(t){return t in this._entries?this._entries[t][0]:null},s.getAll=function(t){return t in this._entries?this._entries[t].slice(0):[]},s.has=function(t){return t in this._entries},s.set=function(t,e){this._entries[t]=[String(e)]},s.forEach=function(t,e){var n;for(var r in this._entries)if(this._entries.hasOwnProperty(r)){n=this._entries[r];for(var o=0;o<n.length;o++)t.call(e,n[o],r,this)}},s.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),r(t)},s.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),r(t)},s.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),r(t)},n&&(s[Symbol.iterator]=s.entries),s.toString=function(){var t=[];return this.forEach((function(e,n){t.push(o(n)+"="+o(e))})),t.join("&")},t.URLSearchParams=i}();var s=t.URLSearchParams.prototype;"function"!=typeof s.sort&&(s.sort=function(){var t=this,e=[];this.forEach((function(n,r){e.push([r,n]),t._entries||t.delete(r)})),e.sort((function(t,e){return t[0]<e[0]?-1:t[0]>e[0]?1:0})),t._entries&&(t._entries={});for(var n=0;n<e.length;n++)this.append(e[n][0],e[n][1])}),"function"!=typeof s._fromString&&Object.defineProperty(s,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(t){if(this._entries)this._entries={};else{var e=[];this.forEach((function(t,n){e.push(n)}));for(var n=0;n<e.length;n++)this.delete(e[n])}var r,o=(t=t.replace(/^\?/,"")).split("&");for(n=0;n<o.length;n++)r=o[n].split("="),this.append(i(r[0]),r.length>1?i(r[1]):"")}})}(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this),function(t){var e,n,r;if(function(){try{var e=new t.URL("b","http://a");return e.pathname="c d","http://a/c%20d"===e.href&&e.searchParams}catch(t){return!1}}()||(e=t.URL,r=(n=function(e,n){"string"!=typeof e&&(e=String(e));var r,o=document;if(n&&(void 0===t.location||n!==t.location.href)){(r=(o=document.implementation.createHTMLDocument("")).createElement("base")).href=n,o.head.appendChild(r);try{if(0!==r.href.indexOf(n))throw new Error(r.href)}catch(t){throw new Error("URL unable to set base "+n+" due to "+t)}}var i=o.createElement("a");i.href=e,r&&(o.body.appendChild(i),i.href=i.href);var s=o.createElement("input");if(s.type="url",s.value=e,":"===i.protocol||!/:/.test(i.href)||!s.checkValidity()&&!n)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:i});var c=new t.URLSearchParams(this.search),u=!0,a=!0,f=this;["append","delete","set"].forEach((function(t){var e=c[t];c[t]=function(){e.apply(c,arguments),u&&(a=!1,f.search=c.toString(),a=!0)}})),Object.defineProperty(this,"searchParams",{value:c,enumerable:!0});var l=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==l&&(l=this.search,a&&(u=!1,this.searchParams._fromString(this.search),u=!0))}})}).prototype,["hash","host","hostname","port","protocol"].forEach((function(t){!function(t){Object.defineProperty(r,t,{get:function(){return this._anchorElement[t]},set:function(e){this._anchorElement[t]=e},enumerable:!0})}(t)})),Object.defineProperty(r,"search",{get:function(){return this._anchorElement.search},set:function(t){this._anchorElement.search=t,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(r,{toString:{get:function(){var t=this;return function(){return t.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(t){this._anchorElement.href=t,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(t){this._anchorElement.pathname=t},enumerable:!0},origin:{get:function(){var t={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],e=this._anchorElement.port!=t&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(e?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(t){},enumerable:!0},username:{get:function(){return""},set:function(t){},enumerable:!0}}),n.createObjectURL=function(t){return e.createObjectURL.apply(e,arguments)},n.revokeObjectURL=function(t){return e.revokeObjectURL.apply(e,arguments)},t.URL=n),void 0!==t.location&&!("origin"in t.location)){var o=function(){return t.location.protocol+"//"+t.location.hostname+(t.location.port?":"+t.location.port:"")};try{Object.defineProperty(t.location,"origin",{get:o,enumerable:!0})}catch(e){setInterval((function(){t.location.origin=o()}),100)}}}(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this)}).call(this,n(0))}]);