cryptpad/www/common/media-tag-nacl.min.js

1 line
120 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.MediaTag=e():t.MediaTag=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=87)}([function(t,e,r){"use strict";var n={IMAGE:"image",AUDIO:"audio",VIDEO:"video",PDF:"pdf",DASH:"dash",DOWNLOAD:"download",CRYPTO:"crypto",CLEAR_KEY:"clear-key",MEDIA_OBJECT:"media-object"};t.exports=n},function(t,e,r){"use strict";var n={MATCHER:"matcher",RENDERER:"renderer",FILTER:"filter",SANITIZER:"sanitizer"};t.exports=n},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(1),s=r(5),c=r(3),f=function(t){function e(t,r){n(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,a.MATCHER,s.ANY));return i.targetType=r,i}return i(e,t),u(e,[{key:"getTargetType",value:function(){return this.targetType}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e,r,o){n(this,t),this.identifier=e,this.type=r,this.occurrence=o}return o(t,[{key:"getIdentifier",value:function(){if(this.identifier)return this.identifier;throw new Error("Plugin has not identifier")}},{key:"getType",value:function(){if(this.type)return this.type;throw new Error("Plugin has no type")}},{key:"getOccurrence",value:function(){if(this.occurrence)return this.occurrence;throw new Error("Plugin has no occurrence")}},{key:"start",value:function(t){return this.process(t)}}]),t}();t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=r(1),a=r(5),s=r(3),c=function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.RENDERER,a.ONCE))}return i(e,t),e}(s);t.exports=c},function(t,e,r){"use strict";var n={EVERY:"every",ANY:"any",ONCE:"once"};t.exports=n},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(){n(this,t),this.map={}}return o(t,[{key:"isStored",value:function(t){return!!this.get(t)}},{key:"store",value:function(t,e){this.isStored(t)&&console.warn('The key "'+t+'" is already registered, the content will be overwritten.'),this.map[t]=e}},{key:"unstore",value:function(t){if(!1!==this.isStored(t)){var e=this.map[t];return delete this.map[t],e}console.warn('The key "'+t+'" not exists in this manager')}},{key:"get",value:function(t){return this.map[t]}},{key:"keys",value:function(){return Object.keys(this.map)}},{key:"values",value:function(){var t=this;return this.keys().map(function(e){return t.get(e)})}}]),t}();t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e){var r=this;n(this,t),Object.keys(e.attributes).forEach(function(t){r[e.attributes[t].name]=e.attributes[t].value})}return o(t,[{key:"getAttribute",value:function(t){return this[t]}},{key:"setAttribute",value:function(t,e){this[t]=e}},{key:"removeAttribute",value:function(t){delete this[t]}},{key:"hasAttributes",value:function(){return Object.keys(this)>0}}]),t}();t.exports=i},function(t,e,r){"use strict";var n=r(16),o=r(15);t.exports=function(t,e){e.mediaObjects.forEach(function(t){n(t)}),e.activeMediaObject=t,o(t)}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=r(1),a=r(5),s=r(3),c=function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.FILTER,a.ANY))}return i(e,t),e}(s);t.exports=c},,,function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(9),s=r(0),c=r(6),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.CRYPTO))}return i(e,t),u(e,[{key:"process",value:function(t){var r=t.getAttribute("data-crypto-key"),n=/\w+:/.exec(r);if(null===n)throw new Error("No algorithm scheme found in data-crypto-key");var o=n[0],i=o.replace(":",""),u=r.replace(o,"");if(t.setAttribute("data-crypto-key",u),!e.functionStore.isStored(i))throw new Error("Algorithm "+i+" is not registered");e.functionStore.get(i)(t)}}]),e}(a);f.functionStore=f.functionStore||new c,f.mediaTypes=[],f.setAllowedMediaTypes=function(t){f.mediaTypes=t},f.getAllowedMediaTypes=function(){return f.mediaTypes},f.addAllowedMediaType=function(t){f.mediaTypes.push(t)},f.addAllAllowedMediaTypes=function(t){t.forEach(function(t){f.addAllowedMediaType(t)})},f.removeAllowedMediaType=function(t){var e=f.mediaTypes.indexOf(t);e>=0&&f.mediaTypes.splice(e,1)},f.removeAllAllowedMediaTypes=function(t){t.forEach(function(t){f.removeAllowedMediaType(t)})},f.isAllowedMediaType=function(t){return f.mediaTypes.some(function(e){return e===t})},t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(4),u=r(9),a=r(2),s=r(18),c=r(3),f=r(27),l=r(28),h=r(1),p=function(){function t(e){var r=this;n(this,t),Object.keys(e).forEach(function(t){r[t]=e[t]})}return o(t,[{key:"isAllowed",value:function(t){return this.permissions&&this.permissions[t]?this.permissions[t]!==l.FORBIDDEN:l.ALLOWED}},{key:"getPermission",value:function(t){return this.permissions&&this.permissions[t]?this.permissions[t]:l.ALLOWED}},{key:"getPermissions",value:function(){return this.permissions||{}}},{key:"getPlugins",value:function(){var t=this;return this.plugins?Object.keys(this.plugins).map(function(e){return Object.keys(t.plugins[e]).map(function(r){var n=void 0;switch(r){case h.RENDERER:n=new i(e);break;case h.FILTER:n=new u(e);break;case h.SANITIZER:n=new s(e);break;case h.MATCHER:n=new a(e);break;case h.GROUP:n=new f(e,r);break;default:n=new c(e,r)}return Object.keys(t.plugins[e][r]).forEach(function(o){var i=t.plugins[e][r][o];n[o]="function"==typeof i&&"process"===o?function(t,e){return function(r){return e(t,r)}}(n,i):i}),n})}).reduce(function(t,e){return t.concat(e)}):[]}},{key:"getDefaultPlugin",value:function(){var t=this.processingEngine.defaultPlugin;return this.getPlugins().filter(function(e){return e.identifier===t}).reduce(function(t,e){return t.getType()!==h.MATCHER?t:e})}}]),t}();t.exports=p},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(){n(this,t),this.content=[]}return o(t,[{key:"stack",value:function(t){this.content.push(t)}},{key:"unstack",value:function(){return this.content.pop()}},{key:"top",value:function(){return this.content[this.content.length-1]}},{key:"base",value:function(){return this.content[0]}},{key:"isEmpty",value:function(){return 0===this.content.length}},{key:"length",value:function(){return this.content.length}}]),t}();t.exports=i},function(t,e,r){"use strict";t.exports=function(t){t.element.style.display="block";var e=!0,r=!1,n=void 0;try{for(var o,i=t.hookedFns.children()[Symbol.iterator]();!(e=(o=i.next()).done);e=!0)o.value.style.display="block"}catch(t){r=!0,n=t}finally{try{!e&&i.return&&i.return()}finally{if(r)throw n}}}},function(t,e,r){"use strict";t.exports=function(t){t.element.style.display="none";var e=!0,r=!1,n=void 0;try{for(var o,i=t.hookedFns.children()[Symbol.iterator]();!(e=(o=i.next()).done);e=!0)o.value.style.display="none"}catch(t){r=!0,n=t}finally{try{!e&&i.return&&i.return()}finally{if(r)throw n}}}},function(t,e,r){"use strict";function n(t){return Array.isArray(t)||(t=[t]),t=t.filter(function(t){return t}),n.loadConfigurations(t).then(function(){return n.start(t)})}var o=r(25),i=r(32),u=r(33),a=r(40);n.start=function(t){var e=n.loadingEngine||n.processingEngine;return Promise.all(t.map(function(t){return new Promise(function(r){t.hasAttribute("src")||t.hasAttribute("sources")?new u(t,n.processingEngine).mediaObjects.forEach(function(o){t.mediaObject=o,o.loader=n.loader,r(e.start(o))}):r(console.warn("Element skipped because has no sources",t))})}))},n.update=function(t){"store"!==t.origin&&t.getPlugins().forEach(function(t){var e=n.pluginStore.getPlugins(t.getType()).filter(function(e){return e.getIdentifier()===t.getIdentifier()&&e.getType()===t.getType()});if(e.length>1)throw new Error("More than one plugin matched to update for this pass");1===e.length?e.forEach(function(e){Object.keys(t).forEach(function(r){e[r]=t[r]})}):n.pluginStore.store(t)})},n.configure=function(t){(n.loadingEngine||n.processingEngine).configure(t)},n.loadConfigurations=function(t){var e=t.filter(function(t){return t.hasAttribute("configuration")}).map(function(t){return t.getAttribute("configuration")}).reduce(function(t,e){return t.includes(e)||t.push(e),t},[]).map(function(t){return n.loader.configuration(t)});return Promise.all(e).then(function(t){var e=[];return t.forEach(function(t){n.update(t),n.configure(t),t.dependencies&&t.dependencies.forEach(function(t){e.includes(t)||e.push(t)})}),Promise.all(e.map(function(t){return n.loader.script(t)}))})},n.pluginStore=n.pluginStore||new i,n.processingEngine=n.processingEngine||new o(n.pluginStore),n.loader=new a,t.exports=n},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=r(1),a=r(5),s=r(3),c=function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,u.SANITIZER,a.EVERY))}return i(e,t),e}(s);t.exports=c},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(4),s=r(0),c=function(t){function e(t,r){n(this,e);var i=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.DOWNLOAD));return i.message=t,i.buttonMessage=r||"Download",i}return i(e,t),u(e,[{key:"process",value:function(t){var e=document.createElement("button");e.innerHTML=this.buttonMessage,e.onclick=function(){var e=new XMLHttpRequest,r=t.getAttribute("src");e.open("GET",r,!0),e.responseType="blob",e.onload=function(){var r=e.response;if(r)if(t.name)saveAs(r,t.name);else if(t.getAttribute("data-attr-type")){var n=t.getAttribute("data-attr-type"),o=n.split("/"),i=new File([r],"download."+(o[1]||"txt"),{type:n});saveAs(i)}else saveAs(r)},e.send()},t.utilsSetAllDataAttributes(e),t.replaceContents([e]),t.return()}}]),e}(a);t.exports=c},,,,,function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u={PluginExists:function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,'Plugin with same "'+t.identifier+'" identifier found.'))}return i(e,t),e}(Error),TypeNotFound:function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"Media Tag could not find the content type of an instance.}."))}return i(e,t),e}(Error),FilterExists:function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,'Filter with same "'+t.identifier+' identifier found."'))}return i(e,t),e}(Error),FetchFail:function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,'Could not fetch "'+t.url+'", received "'+t.status+": "+t.statusText+'".'))}return i(e,t),e}(Error),InvalidCryptoKey:function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"Invalid cryptographic key."))}return i(e,t),e}(Error),InvalidCryptoLib:function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"Invalid cryptographic algorithm name."))}return i(e,t),e}(Error),FailedCrypto:function(t){function e(t){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"Failed to decrypt file"+(t&&t.message?" "+t.message:"")+"."))}return i(e,t),e}(Error)};t.exports=u},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(26),u=r(13),a=r(1),s=r(29),c=r(19),f=r(6),l=r(30),h=r(31),p=r(14),y=function(){function t(e){n(this,t),i.that(e).not(void 0),this.pluginStore=e,this.stacks=new l,this.snapshots=new l,this.stats=new f,this.configuration=new u({}),this.defaultPlugin=new c("<p> MediaTag cannot find a plugin able to render your content </p>"),this.STACK_SIZE=50,this.SNAPSHOTS_LIMIT=50}return o(t,[{key:"key",value:function(t){return t.getId()}},{key:"configure",value:function(t){var e=this;this.configuration=t,t.processingEngine&&Object.keys(t.processingEngine).forEach(function(r){e[r]="defaultPlugin"===r?t.getDefaultPlugin():r})}},{key:"isConfigured",value:function(){return Boolean(this.configuration)}},{key:"prepare",value:function(t){var e=this;!function(){t.return=function(){return e.return(t)},t.state="processing"}();var r=t.getId();this.stacks.store(r,new h),this.snapshots.store(r,new p),this.stats.store(r,{})}},{key:"start",value:function(t){this.prepare(t),this.routine(t),this.run(t)}},{key:"run",value:function(t){var e=this.key(t),r=this.stacks.top(e);if(!r)return this.end(t);this.configuration?this.configuration.isAllowed(r.identifier)?(r.process||console.warn("FALSY PLUGIN",r),r.process(t)):(this.skip(t,r),this.return(t)):r.process(t)}},{key:"routine",value:function(t){this.fill(t),this.snapshot(t),this.check(t)}},{key:"snapshot",value:function(t){var e=this.key(t),r=this.stacks.get(e).clone();this.snapshots.stack(e,r)}},{key:"fill",value:function(t){var e=this,r=this.key(t),n=this.pluginStore.values(),o=n.filter(function(t){return t.getType()===a.MATCHER}).filter(function(e){return e.process(t)}).map(function(t){return t.getIdentifier()}),i=n.filter(function(t){return t.getType()!==a.MATCHER}).filter(function(t){return o.includes(t.getIdentifier())}),u=s.filterByOccurrencies(i);Object.keys(u).forEach(function(n){u[n].forEach(function(n){e.configuration.isAllowed(n.getIdentifier())?e.stacks.get(r).isStackable(n)&&e.stacks.stack(r,n):e.skip(t,n)})})}},{key:"skip",value:function(t,e){var r=t.getId(),n=this.stats.get(r);n?n.skipped||(n.skipped=[]):n={skipped:[]},n.skipped.push(e.identifier)}},{key:"unstack",value:function(t){var e=t.getId();return this.stacks[e]?this.stacks[e].pop():null}},{key:"check",value:function(t){var e=t.getId();if(this.stacks.length(e)>=this.STACK_SIZE)throw console.error("SNAPSHOTS",this.snapshots.get(e)),new Error("Plugin stack size exceed");if(this.snapshots.length(e)>=this.SNAPSHOT_LIMIT)throw console.error("SNAPSHOTS",this.snapshots.get(e)),new Error("Plugin snapshots count exceed");var r=0;if(this.stacks.plugins(e).forEach(function(t){t.type===a.RENDERER&&r++}),r>1)throw console.error("SNAPSHOTS",this.snapshots.get(e)),new Error("More of one renderer in the stack");if(0===this.stacks.length(e)&&!this.stats.get(e)[a.RENDERER]){if(!this.defaultPlugin)throw new Error("No default plugin assignated");this.stacks.stack(e,this.defaultPlugin)}}},{key:"return",value:function(t){var e=t.getId(),r=this.stacks.unstack(e);if(!r)return this.end(t);try{this.stats.get(e)||this.stats.store(e,{}),this.stats.get(e)[r.type]?this.stats.get(e)[r.type]+=1:this.stats.get(e)[r.type]=1}catch(t){console.error(t,this.snapshots.get(e))}r.type!==a.SANITIZER&&r.type!==a.RENDERER&&this.fill(t),this.snapshot(t),this.check(t),this.run(t)}},{key:"end",value:function(t){return t.status="processed",t}},{key:"setDefaultPlugin",value:function(t){this.defaultPlugin=t}}]),t}();t.exports=y},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(e){n(this,t),this.truth=e}return o(t,[{key:"is",value:function(t){if(this.truth===t)return this;throw new Error("Assertion fail on : "+this.truth+" is "+t)}},{key:"not",value:function(t){if(this.truth!==t)return this;throw new Error("Assertion fail on : "+this.truth+" is not "+t)}}],[{key:"that",value:function(e){return new t(e)}}]),t}();t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(3),s=function(t){function e(t,r,i){n(this,e);var u=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r,i));return u.plugins=[],u}return i(e,t),u(e,[{key:"addPlugin",value:function(t){!1===this.plugins.includes(t)&&this.plugins.push(t)}},{key:"removePlugin",value:function(t,e,r){if(!t)throw new Error("Identifier is null or undefined");this.plugin.filter(function(n){return e&&r?t===n.identifier&&e===n.type&&r===n.occurrence:e?t===n.identifier&&e===n.type:t===n.identifier})}},{key:"start",value:function(t){this.plugins.forEach(function(e){e.start(t)})}}]),e}(a);t.exports=s},function(t,e,r){"use strict";var n={ALLOWED:"allowed",REQUIRED:"required",FORBIDDEN:"forbidden"};t.exports=n},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(){n(this,t)}return o(t,null,[{key:"filterByOccurrence",value:function(t,e){return t.filter(function(t){return t.occurrence===e})}},{key:"filterByOccurrencies",value:function(t){var e={once:[],any:[],every:[]},r=!0,n=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var a=i.value;e[a.occurrence]?e[a.occurrence].push(a):e[a.occurrence]=Array.of(a)}}catch(t){n=!0,o=t}finally{try{!r&&u.return&&u.return()}finally{if(n)throw o}}return e}}]),t}();t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(6),s=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),u(e,[{key:"stack",value:function(t,e){this.get(t).stack(e)}},{key:"unstack",value:function(t){return this.get(t).unstack()}},{key:"top",value:function(t){return this.get(t).top()}},{key:"base",value:function(t){return this.get(t).base()}},{key:"isEmpty",value:function(t){return this.get(t).isEmpty()}},{key:"length",value:function(t){return this.get(t).content.length}},{key:"plugins",value:function(t){return this.get(t).content}}]),e}(a);t.exports=s},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function t(e,r,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,r);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,r,n)}if("value"in o)return o.value;var u=o.get;return void 0!==u?u.call(n):void 0},s=r(5),c=r(1),f=r(3),l=r(14),h=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),u(e,[{key:"isPlugin",value:function(t){return t instanceof f}},{key:"isStackable",value:function(t){return[this.isPlugin(t),!this.content.some(function(e){return e.getIdentifier()===t.getIdentifier()&&e.getType()===t.getType()&&e.getOccurrence()===t.getOccurrence()&&(t.occurrence===s.ONCE||t.occurrence===s.ANY)})].reduce(function(t,e){return t&&e})}},{key:"stack",value:function(t){if(!this.isPlugin(t))throw new Error("It can't stacks a non plugin instance");if(!this.isStackable(t))throw new Error("A unique plugin cannot by stacked multiple times");a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stack",this).call(this,t)}},{key:"hasRenderer",value:function(){return this.content.some(function(t){return t.type===c.renderer})}},{key:"isEndingByRenderer",value:function(){return this.base().type===c.RENDERER}},{key:"clone",value:function(){return JSON.parse(JSON.stringify(this))}},{key:"plugins",value:function(){return this.content()}}]),e}(l);t.exports=h},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=function t(e,r,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,r);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,r,n)}if("value"in o)return o.value;var u=o.get;return void 0!==u?u.call(n):void 0},s=r(6),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),u(e,[{key:"getPlugins",value:function(t){return this.values().filter(function(e){return e.type===t})}},{key:"store",value:function(t){a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"store",this).call(this,[t.identifier,t.type],t)}},{key:"unstore",value:function(t){if(!1!==e.isStored([t.identifier,t.type]))return a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"unstore",this).call(this,[t.identifier,t.type]);console.warn('The key "'+[t.identifier,t.type]+'" not exists in this manager')}}]),e}(s);t.exports=c},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(34),u=r(7),a=r(38),s=function(){function t(e,r){var o=this;n(this,t),this.mediaTagElement=e,this.processingEngine=r;var s=new u(e),c=s.getAttribute("sources")||s.getAttribute("srcs");if(c){var f=this.extractSourceObjects(c),l=this.extractMediaElements(f);this.mediaElements=l,this.mediaElements.forEach(function(t){o.mediaTagElement.appendChild(t)}),this.mediaObjects=this.createMediaObjects(l),i.activate(this.mediaObjects[0],this)}else{var h=new a(e);this.mediaObjects=[h],this.activeMediaObject=this.mediaObjects[0]}}return o(t,[{key:"extractSourceObjects",value:function(t){return JSON.parse(t)}},{key:"extractMediaElements",value:function(t){var e=this,r=[];return t.forEach(function(t){r.push(e.extractMediaElement(t))}),r}},{key:"extractMediaElement",value:function(t){var e=document.createElement("media");return Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])}),e}},{key:"createMediaObjects",value:function(t){var e=[];return t.forEach(function(t){var r=new a(t);e.push(r)}),e}}]),t}();t.exports=s},function(t,e,r){"use strict";var n={clear:r(35),show:r(15),hide:r(16),upgrade:r(36),downgrade:r(37),activate:r(8)};t.exports=n},function(t,e,r){"use strict";t.exports=function(t){t.clearContents()}},function(t,e,r){"use strict";var n=r(8);t.exports=function(t){var e=t.mediaObjects.indexOf(t.activeMediaObject);e<t.mediaObjects.length&&n(t.mediaObjects[e+1],t)}},function(t,e,r){"use strict";var n=r(8);t.exports=function(t){var e=t.mediaObjects.indexOf(t.activeMediaObject);e>0&&n(t.mediaObjects[e-1],t)}},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(7),u=r(39),a=function(){function t(e){n(this,t),this.id=t.uid(),this.element=e,this.state="idle",this.attributesObject=new i(e);var r=u.parse(this.attributesObject),o=!0,a=!1,s=void 0;try{for(var c,f=Object.keys(r)[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var l=c.value;this[l]=r[l]}}catch(t){a=!0,s=t}finally{try{!o&&f.return&&f.return()}finally{if(a)throw s}}this.hookedFns={hasChildNodes:e.hasChildNodes.bind(e),removeChild:e.removeChild.bind(e),getLastChild:function(){return e.lastChild},appendChild:e.appendChild.bind(e),children:function(){return e.children}}}return o(t,[{key:"setProperties",value:function(t){for(var e in t){if(this[e])throw new Error("The property "+e+" already exists in this MediaObject !");this[e]=t[e]}}},{key:"getId",value:function(){return this.id}},{key:"getAttribute",value:function(t){return this.attributesObject[t]}},{key:"setAttribute",value:function(t,e){this.attributesObject[t]=e}},{key:"removeAttribute",value:function(t){delete this.attributesObject[t]}},{key:"getAllDataAttrKeys",value:function(){return Object.keys(this.attributesObject).filter(function(t){return t.startsWith("data-attr")})}},{key:"getExtension",value:function(){return this.extension}},{key:"getMimeType",value:function(){return this.mime}},{key:"hasAttribute",value:function(t){return t in this.attributesObject}},{key:"getType",value:function(){return this.type}},{key:"getSource",value:function(){return this.src}},{key:"getSources",value:function(){return this.sources}},{key:"clearContents",value:function(){for(;this.hookedFns.hasChildNodes();)this.hookedFns.removeChild(this.hookedFns.getLastChild())}},{key:"replaceContents",value:function(t){var e=this;this.clearContents(),t.forEach(function(t){return e.hookedFns.appendChild(t)})}},{key:"utilsSetAllDataAttributes",value:function(t){var e=this;this.getAllDataAttrKeys().forEach(function(r){return t.setAttribute(r.substr(10),e.getAttribute(r))})}},{key:"utilsPassAllDataAttributes",value:function(t){var e=this;this.getAllDataAttrKeys().forEach(function(r){return t.setAttribute(r,e.getAttribute(r))})}}]),t}();a.uid=function(t){return function(){return t++}}(0),a.attributesObject=function(t){var e={};if(t.hasAttributes()){var r=t.attributes;Object.keys(r).forEach(function(t){var n=r[t];e[n.name]=n.value})}return e.hasAttribute=function(t){return e[t]},e},t.exports=a},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=function(){function t(){n(this,t)}return o(t,null,[{key:"extension",value:function(t){var e=t.getAttribute("data-type");if(e)return e.split("/")[1]}},{key:"type",value:function(t){var e=t.getAttribute("data-type");if(e)return e.split("/")[0]}},{key:"mime",value:function(t){return t.getAttribute("data-type")}},{key:"protocol",value:function(t){var e=t.getAttribute("src").split("://");return e.length>1?e[0]:window.location.protocol}},{key:"hostname",value:function(t){var e=t.getAttribute("src").split("://");return e.length>1?e[1].split("/")[0]:window.location.hostname}},{key:"source",value:function(t){return t.getAttribute("src")}},{key:"schemes",value:function(t){return/\w+:/.exec(t.getAttribute("src"))}},{key:"sources",value:function(t){var e=t.getAttribute("sources")||t.getAttribute("srcs");return e?JSON.parse(e):null}},{key:"actions",value:function(t){var e=t.getAttribute("actions");return e?JSON.parse(e):null}},{key:"parse",value:function(e){return{protocol:t.protocol(e),hostname:t.hostname(e),src:t.source(e),type:t.type(e),extension:t.extension(e),mime:t.mime(e),sources:t.sources(e),actions:t.actions(e)}}}]),t}();t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=r(6),u=r(13),a=function(){function t(){n(this,t),this.store=new i,this.promiseStore=new i}return o(t,[{key:"isStored",value:function(t){return this.store.isStore(t)}},{key:"script",value:function(t){return this.promiseStore.isStored(t)||this.promiseStore.store(t,new Promise(function(e,r){var n=document.createElement("script");n.type="text/javascript",n.src=t,n.onload=e,n.onerror=r,n.abort=r,document.head.appendChild(n)})),this.promiseStore.get(t)}},{key:"configuration",value:function(t){var e=this;return this.store.isStored(t)?new Promise(function(r){r(new u(e.store.get(t)))}):new Promise(function(r,n){var o=document.createElement("script");o.src=t,o.type="text/javascript",document.addEventListener("Configuration",function(n){var o=n.configuration;e.store.isStored(t)?o.origin="store":(e.store.store(t,n.configuration),o.origin=t),r(new u(o))}),o.onerror=function(t){n(t)},document.head.appendChild(o)})}},{key:"algorithm",value:function(t){var e=this;return this.promiseStore.isStored(t)||this.promiseStore.store(t,new Promise(function(r,n){var o=document.createElement("script");o.src=t,o.type="text/javascript",document.addEventListener("Algorithm",function(n){e.store.isStored(t)||e.store.store(t,n.algorithm),r(e.store.get(t))}),o.onerror=function(t){n(t)},document.head.appendChild(o)})),this.promiseStore.get(t)}}]),t}();t.exports=a},,function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){var e=t.getAttribute("src"),r=t.getAttribute("data-crypto-key"),n=a.getKeyFromStr(r),o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){var e=o.response;if(e){var r=new Uint8Array(e),i=a.decrypt(r,n),u=s.getBlobUrl(i,t.getMimeType()),c=new Event("decryption");c.blob=new Blob([i],{type:t.getMimeType()}),window.document.dispatchEvent(c),t.setAttribute("src",u),t.removeAttribute("data-crypto-key"),t.return()}},o.send(null)}var i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),u=r(24),a=(r(12),function(){function t(){n(this,t)}return i(t,null,[{key:"slice",value:function(t){return Array.prototype.slice.call(t)}},{key:"getRandomKeyStr",value:function(){var t=window.nacl,e=t.randomBytes(18);return t.util.encodeBase64(e)}},{key:"getKeyFromStr",value:function(t){var e=window.nacl;return e.hash(e.util.decodeBase64(t)).subarray(32,64)}},{key:"encrypt",value:function(e,r){var n=e,o=window.nacl.randomBytes(24),i=window.nacl.secretbox(n,o,r);if(i)return new Uint8Array(t.slice(o).concat(t.slice(i)));throw new Error}},{key:"decrypt",value:function(e,r){if(e.length<24)throw new Error;var n=t.slice,o=window.nacl,i=new Uint8Array(n(e).slice(0,24)),u=new Uint8Array(n(e).slice(24)),a=o.secretbox.open(u,i,r);if(a)return a;throw new Error("Decrypted file in undefined")}}]),t}()),s=function(){function t(){n(this,t)}return i(t,null,[{key:"getArrayBuffer",value:function(t){return fetch(t).then(function(t){if(t.ok)return t.arrayBuffer();throw new u.FetchFails}).then(function(t){return t})}},{key:"createUrl",value:function(t){return window.URL.createObjectURL(t)}},{key:"getBlobUrl",value:function(t,e){return window.URL.createObjectURL(new Blob([t],{type:e}))}},{key:"getDataUrl",value:function(t,e){return"data:"+e+";base64,"+window.nacl.util.encodeBase64(t)}}]),t}();t.exports=o},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){var r=e.type.split("/"),n=e.type,o=r[0],i=r[1];c.isAllowedMediaType(n)?(t.setAttribute("data-type",e.type),t.type=o,t.extension=i,t.mime=n):console.log("Not allowed metadata, allowed ones are : ",c.getAllowedMediaTypes()),t.name=e.name,t.setAttribute("data-attr-type",e.type)}function i(t){var e=t.getAttribute("src"),r=t.getAttribute("data-crypto-key"),n=f.getKeyFromStr(r),i=new XMLHttpRequest,u=[e,r].join(""),a=function(e){var r=function(e){s.processingEngine.return(t),"function"==typeof e&&e(t)},n={};n.metadata=e.metadata,o(t,e.metadata);var i=e.content,u=l.getBlobUrl(i,t.getMimeType());if(n.blob=new Blob([i],{type:t.getMimeType()}),n.metadata=e.metadata,c.addAllowedMediaType("audio/mpeg"),t.setAttribute("src",u),t.removeAttribute("data-crypto-key"),/audio\/(mp3|ogg|wav|webm|mpeg)/.test(e.metadata.type)||/application\/pdf/.test(e.metadata.type)||/video\//.test(e.metadata.type)||/image\/(png|jpeg|jpg|gif)/.test(e.metadata.type)||(e.metadata.type="download"),o(t,e.metadata),n.callback=r,!window.MediaTag_onDecrypted)return void setTimeout(r);window.MediaTag_onDecrypted(n)},h=s.__Cryptpad_Cache=s.__Cryptpad_Cache||{};if(h[u])return a(h[u]);i.open("GET",e,!0),i.responseType="arraybuffer";var p=function(t){var e=new Event("decryptionError");e.message="string"==typeof t?t:t.message,window.document.dispatchEvent(e)};i.onload=function(){if(/^4/.test(""+this.status))return p("XHR_ERROR",this.status);var t=i.response;if(t){var e=new Uint8Array(t);f.decrypt(e,n,function(t,e){if(t)return p(t);h[u]=e,a(e)})}},i.send(null)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(24),s=r(17),c=r(12),f=function(){function t(){n(this,t)}return u(t,null,[{key:"createNonce",value:function(){return new Uint8Array(new Array(24).fill(0))}},{key:"increment",value:function(t){for(var e=t.length;e-- >1;){if("number"!=typeof t[e])throw new Error("E_UNSAFE_TYPE");if(t[e]>255)throw new Error("E_OUT_OF_BOUNDS");if(255!==t[e])return void t[e]++;if(t[e]=0,0===e)throw new Error("E_NONCE_TOO_LARGE")}}},{key:"encodePrefix",value:function(t){return[65280,255].map(function(e,r){return(t&e)>>8*(1-r)})}},{key:"decodePrefix",value:function(t){return t[0]<<8|t[1]}},{key:"joinChunks",value:function(t){return new Blob(t)}},{key:"slice",value:function(t){return Array.prototype.slice.call(t)}},{key:"getRandomKeyStr",value:function(){var t=window.nacl,e=t.randomBytes(18);return t.util.encodeBase64(e)}},{key:"getKeyFromStr",value:function(t){return window.nacl.util.decodeBase64(t)}},{key:"encrypt",value:function(e,r){var n=e,o=window.nacl.randomBytes(24),i=window.nacl.secretbox(n,o,r);if(i)return new Uint8Array(t.slice(o).concat(t.slice(i)));throw new Error}},{key:"decrypt",value:function(e,r,n){var o=window.nacl,i=function(t){var r=new Event("decryptionProgress");r.percent=t/e.length*100,window.document.dispatchEvent(r)},u=t.createNonce(),a=0,s=e.subarray(0,2),c=t.decodePrefix(s),f={metadata:void 0},l=new Uint8Array(e.subarray(2,2+c)),h=o.secretbox.open(l,u,r);t.increment(u);try{f.metadata=JSON.parse(o.util.encodeUTF8(h))}catch(t){return n("E_METADATA_DECRYPTION")}if(!f.metadata)return n("NO_METADATA");var p=function(n){setTimeout(function(){var s=131088*a+2+c,f=s+131088;a++;var l=new Uint8Array(e.subarray(s,f)),h=o.secretbox.open(l,u,r);if(t.increment(u),!h)return void n("DECRYPTION_FAILURE");i(Math.min(f,e.length)),n(void 0,h)})},y=[];!function r(){p(function(o,i){return o?setTimeout(function(){n(o)}):i?131088*a<e.length?(y.push(i),r()):(y.push(i),f.content=t.joinChunks(y),n(void 0,f)):void n("UNEXPECTED_ENDING")})}()}}]),t}(),l=function(){function t(){n(this,t)}return u(t,null,[{key:"getArrayBuffer",value:function(t){return fetch(t).then(function(t){if(t.ok)return t.arrayBuffer();throw new a.FetchFails}).then(function(t){return t})}},{key:"createUrl",value:function(t){return window.URL.createObjectURL(t)}},{key:"getBlobUrl",value:function(t,e){return window.URL.createObjectURL(new Blob([t],{type:e}))}},{key:"getDataUrl",value:function(t,e){return"data:"+e+";base64,"+window.nacl.util.encodeBase64(t)}}]),t}();t.exports=i},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(9),s=r(0),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.CLEAR_KEY))}return i(e,t),u(e,[{key:"process",value:function(t){var e=t.getAttribute("data-clear-key"),r=e.substring(0,32),n=e.substring(33,65);t.setAttribute("id",r),t.setAttribute("key",n),t.removeAttribute("data-clear-key"),t.return()}}]),e}(a);t.exports=c},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(18),s=r(0),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.MEDIA_OBJECT))}return i(e,t),u(e,[{key:"process",value:function(t){t.return()}}]),e}(a);t.exports=c},function(t,e,r){"use strict";var n=r(47),o=r(48),i=r(49),u=r(50),a=r(51),s=r(52),c=r(53),f=r(54),l=r(55),h=r(17);h.pluginStore.store(new n),h.pluginStore.store(new o),h.pluginStore.store(new i),h.pluginStore.store(new u),h.pluginStore.store(new a),h.pluginStore.store(new s),h.pluginStore.store(new c),h.pluginStore.store(new f),h.pluginStore.store(new l),t.exports=h},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.IMAGE,s.RENDERER))}return i(e,t),u(e,[{key:"process",value:function(t){var e=/^png|jpg|jpeg|gif|svg[+]xml$/,r=/^image[\/](png|jpg|jpeg|gif|svg[+]xml)$/;return t.hasAttribute("src")&&"image"===t.getType()&&null!==e.exec(t.getExtension())&&null!==r.exec(t.getMimeType())}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.AUDIO,s.RENDERER))}return i(e,t),u(e,[{key:"process",value:function(t){var e=/^mp3|ogg|webm|wav|mpeg$/,r=/^audio[\/](mp3|ogg|webm|wav|mpeg)$/;return t.hasAttribute("src")&&"audio"===t.getType()&&null!==e.exec(t.getExtension())&&null!==r.exec(t.getMimeType())}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.VIDEO,s.RENDERER))}return i(e,t),u(e,[{key:"process",value:function(t){var e=/^mp4|ogg|webm$/,r=/^video[\/](mp4|ogg|webm)$/;return t.hasAttribute("src")&&"video"===t.getType()&&null!==e.exec(t.getExtension())&&null!==r.exec(t.getMimeType())}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.PDF,s.RENDERER))}return i(e,t),u(e,[{key:"process",value:function(t){var e=/^pdf$/,r=/^application[\/]pdf$/;return t.hasAttribute("src")&&"application"===t.getType()&&null!==e.exec(t.getExtension())&&null!==r.exec(t.getMimeType())}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.DASH,s.RENDERER))}return i(e,t),u(e,[{key:"process",value:function(t){var e=/^dash[+]xml$/,r=/^application[\/]dash[+]xml$/;return t.hasAttribute("src")&&"application"===t.getType()&&null!==e.exec(t.getExtension())&&null!==r.exec(t.getMimeType())}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.DOWNLOAD,s.RENDERER))}return i(e,t),u(e,[{key:"process",value:function(t){return t.hasAttribute("src")&&"download"===t.getType()}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.CRYPTO,s.FILTER))}return i(e,t),u(e,[{key:"process",value:function(t){return t.hasAttribute("data-crypto-key")}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.CLEAR_KEY,s.FILTER))}return i(e,t),u(e,[{key:"process",value:function(t){return t.hasAttribute("data-clear-key")}}]),e}(c);t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(0),s=r(1),c=r(2),f=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,a.MEDIA_OBJECT,s.SANITIZER))}return i(e,t),u(e,[{key:"process",value:function(t){return t.hasAttribute("src")&&t.hasAttribute("data-type")}}]),e}(c);t.exports=f},,,,,,,function(t,e,r){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}var o=r(63);document.addEventListener("DOMContentLoaded",function(){function t(t){var o=[];return t.forEach(function(t){t.addedNodes&&t.addedNodes.forEach(function(t){var i=r(t,"MEDIA-TAG").filter(e);o.push.apply(o,n(i)),"MEDIA-TAG"===t.nodeName&&o.push(t)}),"MEDIA-TAG"===t.target.nodeName&&"childList"!==t.type&&(o.includes(t.target)||o.push(t.target))}),o}function e(t){return t.mediaObjects?t.mediaObjects.some(function(t){return"idle"===t.state}):!t.mediaObject||"idle"===t.mediaObject.state}function r(t,e){var n=[];if(!t.children)return n;var o=!0,i=!1,u=void 0;try{for(var a,s=t.children[Symbol.iterator]();!(o=(a=s.next()).done);o=!0){var c=a.value;c.nodeName===e&&n.push(c),n=n.concat(r(c,e))}}catch(t){i=!0,u=t}finally{try{!o&&s.return&&s.return()}finally{if(i)throw u}}return n}function i(t){return new Promise(function(e,r){try{t.length>0&&o(t),e()}catch(t){r(t)}})}function u(e){i(t(e)).catch(function(t){console.error(t)})}var a=new MutationObserver(u),s=document.body,c={characterData:!0,childList:!0,attributes:!0,subtree:!0};a.observe(s,c),i(Array.from(document.getElementsByTagName("media-tag")))}),t.exports=o},function(t,e,r){"use strict";var n=r(42),o=r(43),i=r(64),u=r(65),a=r(66),s=r(67),c=r(68),f=r(19),l=r(12),h=r(44),p=r(45),y=r(46);y.PdfPlugin=s,y.PdfPlugin.viewer="/pdfjs/web/viewer.html",l.functionStore.store("salsa20poly1305",n),l.functionStore.store("cryptpad",o),y.processingEngine.setDefaultPlugin(new f("<p> Media-Tag can't process your content </p>","Download")),y.CryptoFilter=l,y.CryptoFilter.setAllowedMediaTypes(["image/png","image/jpeg","image/jpg","image/gif","audio/mp3","audio/ogg","audio/wav","audio/webm","video/mp4","video/ogg","video/webm","application/pdf","application/dash+xml","download"]),y.pluginStore.store(new i),y.pluginStore.store(new u),y.pluginStore.store(new a),y.pluginStore.store(new s),y.pluginStore.store(new c),y.pluginStore.store(new f),y.pluginStore.store(new l),y.pluginStore.store(new h),y.pluginStore.store(new p),t.exports=y},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(4),s=r(0),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.IMAGE))}return i(e,t),u(e,[{key:"process",value:function(t){var e=document.createElement("img");e.setAttribute("src",t.getAttribute("src")),t.utilsSetAllDataAttributes(e),t.replaceContents([e]),t.return()}}]),e}(a);t.exports=c},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(4),s=r(0),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.AUDIO))}return i(e,t),u(e,[{key:"process",value:function(t){var e=document.createElement("audio");e.setAttribute("src",t.getAttribute("src")),e.setAttribute("controls",!0),t.utilsSetAllDataAttributes(e),t.replaceContents([e]),t.return()}}]),e}(a);t.exports=c},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(4),s=r(0),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.VIDEO))}return i(e,t),u(e,[{key:"process",value:function(t){var e=document.createElement("video");e.setAttribute("src",t.getAttribute("src")),e.setAttribute("controls",!0),t.utilsSetAllDataAttributes(e),t.replaceContents([e]),t.return()}}]),e}(a);t.exports=c},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(4),s=r(0),c={PDFJS:"pdfjs",DEFAULT:"default"},f=function(t){function e(){n(this,e);var t=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.PDF));return t.viewer=e.viewer,t.mode=e.mode,t}return i(e,t),u(e,[{key:"process",value:function(t){var e=t.getAttribute("src"),r=document.createElement("iframe");switch(t.getAttribute("data-attr-width")||r.setAttribute("width","100%"),t.getAttribute("data-attr-height")||r.setAttribute("height",document.body.scrollHeight),this.viewer||(this.mode=c.DEFAULT),this.mode){case c.PDFJS:var n=this.viewer+"?file="+e,o=new XMLHttpRequest;o.onload=function(){o.status<400?r.src=n:(console.warn("The pdfjs viewer has not been found ...\n\t\t\t\t\t\t\tThe browser viewer will be used by default"),r.src=""+e)},o.open("HEAD",n,!0),o.send();break;default:r.src=""+e}t.utilsSetAllDataAttributes(r),t.replaceContents([r]),r.onload=function(){t.return()}}}]),e}(a);f.viewer=null,f.mode=c.PDFJS,t.exports=f},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),a=r(4),s=r(0),c=function(t){function e(){return n(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,s.DASH))}return i(e,t),u(e,[{key:"process",value:function(t){var e=document.createElement("video"),r=new shaka.Player(e),n=t.getAttribute("id"),o=t.getAttribute("key");if(n&&o){var i='{"'+n+'": "'+o+'"}',u=JSON.parse(i);r.configure({drm:{clearKeys:u}})}e.setAttribute("controls",!0),t.utilsSetAllDataAttributes(e),t.replaceContents([e]),r.load(t.getAttribute("src")).then(function(){}),t.return()}}]),e}(a);t.exports=c},,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";window.nacl=r(88),window.nacl.util=r(90),t.exports=r(62)},function(t,e,r){!function(t){"use strict";function e(t,e,r,n){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=n>>24&255,t[e+5]=n>>16&255,t[e+6]=n>>8&255,t[e+7]=255&n}function n(t,e,r,n,o){var i,u=0;for(i=0;i<o;i++)u|=t[e+i]^r[n+i];return(1&u-1>>>8)-1}function o(t,e,r,o){return n(t,e,r,o,16)}function i(t,e,r,o){return n(t,e,r,o,32)}function u(t,e,r,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,u=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,s=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,y=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,d=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,m=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=i,_=u,O=a,A=s,k=c,P=f,T=l,j=h,x=p,R=y,S=b,U=g,C=d,M=v,B=w,I=m,D=0;D<20;D+=2)o=E+C|0,k^=o<<7|o>>>25,o=k+E|0,x^=o<<9|o>>>23,o=x+k|0,C^=o<<13|o>>>19,o=C+x|0,E^=o<<18|o>>>14,o=P+_|0,R^=o<<7|o>>>25,o=R+P|0,M^=o<<9|o>>>23,o=M+R|0,_^=o<<13|o>>>19,o=_+M|0,P^=o<<18|o>>>14,o=S+T|0,B^=o<<7|o>>>25,o=B+S|0,O^=o<<9|o>>>23,o=O+B|0,T^=o<<13|o>>>19,o=T+O|0,S^=o<<18|o>>>14,o=I+U|0,A^=o<<7|o>>>25,o=A+I|0,j^=o<<9|o>>>23,o=j+A|0,U^=o<<13|o>>>19,o=U+j|0,I^=o<<18|o>>>14,o=E+A|0,_^=o<<7|o>>>25,o=_+E|0,O^=o<<9|o>>>23,o=O+_|0,A^=o<<13|o>>>19,o=A+O|0,E^=o<<18|o>>>14,o=P+k|0,T^=o<<7|o>>>25,o=T+P|0,j^=o<<9|o>>>23,o=j+T|0,k^=o<<13|o>>>19,o=k+j|0,P^=o<<18|o>>>14,o=S+R|0,U^=o<<7|o>>>25,o=U+S|0,x^=o<<9|o>>>23,o=x+U|0,R^=o<<13|o>>>19,o=R+x|0,S^=o<<18|o>>>14,o=I+B|0,C^=o<<7|o>>>25,o=C+I|0,M^=o<<9|o>>>23,o=M+C|0,B^=o<<13|o>>>19,o=B+M|0,I^=o<<18|o>>>14;E=E+i|0,_=_+u|0,O=O+a|0,A=A+s|0,k=k+c|0,P=P+f|0,T=T+l|0,j=j+h|0,x=x+p|0,R=R+y|0,S=S+b|0,U=U+g|0,C=C+d|0,M=M+v|0,B=B+w|0,I=I+m|0,t[0]=E>>>0&255,t[1]=E>>>8&255,t[2]=E>>>16&255,t[3]=E>>>24&255,t[4]=_>>>0&255,t[5]=_>>>8&255,t[6]=_>>>16&255,t[7]=_>>>24&255,t[8]=O>>>0&255,t[9]=O>>>8&255,t[10]=O>>>16&255,t[11]=O>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=k>>>0&255,t[17]=k>>>8&255,t[18]=k>>>16&255,t[19]=k>>>24&255,t[20]=P>>>0&255,t[21]=P>>>8&255,t[22]=P>>>16&255,t[23]=P>>>24&255,t[24]=T>>>0&255,t[25]=T>>>8&255,t[26]=T>>>16&255,t[27]=T>>>24&255,t[28]=j>>>0&255,t[29]=j>>>8&255,t[30]=j>>>16&255,t[31]=j>>>24&255,t[32]=x>>>0&255,t[33]=x>>>8&255,t[34]=x>>>16&255,t[35]=x>>>24&255,t[36]=R>>>0&255,t[37]=R>>>8&255,t[38]=R>>>16&255,t[39]=R>>>24&255,t[40]=S>>>0&255,t[41]=S>>>8&255,t[42]=S>>>16&255,t[43]=S>>>24&255,t[44]=U>>>0&255,t[45]=U>>>8&255,t[46]=U>>>16&255,t[47]=U>>>24&255,t[48]=C>>>0&255,t[49]=C>>>8&255,t[50]=C>>>16&255,t[51]=C>>>24&255,t[52]=M>>>0&255,t[53]=M>>>8&255,t[54]=M>>>16&255,t[55]=M>>>24&255,t[56]=B>>>0&255,t[57]=B>>>8&255,t[58]=B>>>16&255,t[59]=B>>>24&255,t[60]=I>>>0&255,t[61]=I>>>8&255,t[62]=I>>>16&255,t[63]=I>>>24&255}function a(t,e,r,n){for(var o,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,u=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,s=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,y=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,d=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,v=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,m=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=i,_=u,O=a,A=s,k=c,P=f,T=l,j=h,x=p,R=y,S=b,U=g,C=d,M=v,B=w,I=m,D=0;D<20;D+=2)o=E+C|0,k^=o<<7|o>>>25,o=k+E|0,x^=o<<9|o>>>23,o=x+k|0,C^=o<<13|o>>>19,o=C+x|0,E^=o<<18|o>>>14,o=P+_|0,R^=o<<7|o>>>25,o=R+P|0,M^=o<<9|o>>>23,o=M+R|0,_^=o<<13|o>>>19,o=_+M|0,P^=o<<18|o>>>14,o=S+T|0,B^=o<<7|o>>>25,o=B+S|0,O^=o<<9|o>>>23,o=O+B|0,T^=o<<13|o>>>19,o=T+O|0,S^=o<<18|o>>>14,o=I+U|0,A^=o<<7|o>>>25,o=A+I|0,j^=o<<9|o>>>23,o=j+A|0,U^=o<<13|o>>>19,o=U+j|0,I^=o<<18|o>>>14,o=E+A|0,_^=o<<7|o>>>25,o=_+E|0,O^=o<<9|o>>>23,o=O+_|0,A^=o<<13|o>>>19,o=A+O|0,E^=o<<18|o>>>14,o=P+k|0,T^=o<<7|o>>>25,o=T+P|0,j^=o<<9|o>>>23,o=j+T|0,k^=o<<13|o>>>19,o=k+j|0,P^=o<<18|o>>>14,o=S+R|0,U^=o<<7|o>>>25,o=U+S|0,x^=o<<9|o>>>23,o=x+U|0,R^=o<<13|o>>>19,o=R+x|0,S^=o<<18|o>>>14,o=I+B|0,C^=o<<7|o>>>25,o=C+I|0,M^=o<<9|o>>>23,o=M+C|0,B^=o<<13|o>>>19,o=B+M|0,I^=o<<18|o>>>14;t[0]=E>>>0&255,t[1]=E>>>8&255,t[2]=E>>>16&255,t[3]=E>>>24&255,t[4]=P>>>0&255,t[5]=P>>>8&255,t[6]=P>>>16&255,t[7]=P>>>24&255,t[8]=S>>>0&255,t[9]=S>>>8&255,t[10]=S>>>16&255,t[11]=S>>>24&255,t[12]=I>>>0&255,t[13]=I>>>8&255,t[14]=I>>>16&255,t[15]=I>>>24&255,t[16]=T>>>0&255,t[17]=T>>>8&255,t[18]=T>>>16&255,t[19]=T>>>24&255,t[20]=j>>>0&255,t[21]=j>>>8&255,t[22]=j>>>16&255,t[23]=j>>>24&255,t[24]=x>>>0&255,t[25]=x>>>8&255,t[26]=x>>>16&255,t[27]=x>>>24&255,t[28]=R>>>0&255,t[29]=R>>>8&255,t[30]=R>>>16&255,t[31]=R>>>24&255}function s(t,e,r,n){u(t,e,r,n)}function c(t,e,r,n){a(t,e,r,n)}function f(t,e,r,n,o,i,u){var a,c,f=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)f[c]=0;for(c=0;c<8;c++)f[c]=i[c];for(;o>=64;){for(s(l,f,u,ht),c=0;c<64;c++)t[e+c]=r[n+c]^l[c];for(a=1,c=8;c<16;c++)a=a+(255&f[c])|0,f[c]=255&a,a>>>=8;o-=64,e+=64,n+=64}if(o>0)for(s(l,f,u,ht),c=0;c<o;c++)t[e+c]=r[n+c]^l[c];return 0}function l(t,e,r,n,o){var i,u,a=new Uint8Array(16),c=new Uint8Array(64);for(u=0;u<16;u++)a[u]=0;for(u=0;u<8;u++)a[u]=n[u];for(;r>=64;){for(s(c,a,o,ht),u=0;u<64;u++)t[e+u]=c[u];for(i=1,u=8;u<16;u++)i=i+(255&a[u])|0,a[u]=255&i,i>>>=8;r-=64,e+=64}if(r>0)for(s(c,a,o,ht),u=0;u<r;u++)t[e+u]=c[u];return 0}function h(t,e,r,n,o){var i=new Uint8Array(32);c(i,n,o,ht);for(var u=new Uint8Array(8),a=0;a<8;a++)u[a]=n[a+16];return l(t,e,r,u,i)}function p(t,e,r,n,o,i,u){var a=new Uint8Array(32);c(a,i,u,ht);for(var s=new Uint8Array(8),l=0;l<8;l++)s[l]=i[l+16];return f(t,e,r,n,o,s,a)}function y(t,e,r,n,o,i){var u=new pt(i);return u.update(r,n,o),u.finish(t,e),0}function b(t,e,r,n,i,u){var a=new Uint8Array(16);return y(a,0,r,n,i,u),o(t,e,a,0)}function g(t,e,r,n,o){var i;if(r<32)return-1;for(p(t,0,e,0,r,n,o),y(t,16,t,32,r-32,t),i=0;i<16;i++)t[i]=0;return 0}function d(t,e,r,n,o){var i,u=new Uint8Array(32);if(r<32)return-1;if(h(u,0,32,n,o),0!==b(e,16,e,32,r-32,u))return-1;for(p(t,0,e,0,r,n,o),i=0;i<32;i++)t[i]=0;return 0}function v(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function w(t){var e,r,n=1;for(e=0;e<16;e++)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function m(t,e,r){for(var n,o=~(r-1),i=0;i<16;i++)n=o&(t[i]^e[i]),t[i]^=n,e[i]^=n}function E(t,e){var r,n,o,i=tt(),u=tt();for(r=0;r<16;r++)u[r]=e[r];for(w(u),w(u),w(u),n=0;n<2;n++){for(i[0]=u[0]-65517,r=1;r<15;r++)i[r]=u[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=u[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,m(u,i,1-o)}for(r=0;r<16;r++)t[2*r]=255&u[r],t[2*r+1]=u[r]>>8}function _(t,e){var r=new Uint8Array(32),n=new Uint8Array(32);return E(r,t),E(n,e),i(r,0,n,0)}function O(t){var e=new Uint8Array(32);return E(e,t),1&e[0]}function A(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function k(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]+r[n]}function P(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]-r[n]}function T(t,e,r){var n,o,i=0,u=0,a=0,s=0,c=0,f=0,l=0,h=0,p=0,y=0,b=0,g=0,d=0,v=0,w=0,m=0,E=0,_=0,O=0,A=0,k=0,P=0,T=0,j=0,x=0,R=0,S=0,U=0,C=0,M=0,B=0,I=r[0],D=r[1],L=r[2],N=r[3],Y=r[4],F=r[5],K=r[6],z=r[7],H=r[8],G=r[9],Z=r[10],J=r[11],$=r[12],X=r[13],V=r[14],q=r[15];n=e[0],i+=n*I,u+=n*D,a+=n*L,s+=n*N,c+=n*Y,f+=n*F,l+=n*K,h+=n*z,p+=n*H,y+=n*G,b+=n*Z,g+=n*J,d+=n*$,v+=n*X,w+=n*V,m+=n*q,n=e[1],u+=n*I,a+=n*D,s+=n*L,c+=n*N,f+=n*Y,l+=n*F,h+=n*K,p+=n*z,y+=n*H,b+=n*G,g+=n*Z,d+=n*J,v+=n*$,w+=n*X,m+=n*V,E+=n*q,n=e[2],a+=n*I,s+=n*D,c+=n*L,f+=n*N,l+=n*Y,h+=n*F,p+=n*K,y+=n*z,b+=n*H,g+=n*G,d+=n*Z,v+=n*J,w+=n*$,m+=n*X,E+=n*V,_+=n*q,n=e[3],s+=n*I,c+=n*D,f+=n*L,l+=n*N,h+=n*Y,p+=n*F,y+=n*K,b+=n*z,g+=n*H,d+=n*G,v+=n*Z,w+=n*J,m+=n*$,E+=n*X,_+=n*V,O+=n*q,n=e[4],c+=n*I,f+=n*D,l+=n*L,h+=n*N,p+=n*Y,y+=n*F,b+=n*K,g+=n*z,d+=n*H,v+=n*G,w+=n*Z,m+=n*J,E+=n*$,_+=n*X,O+=n*V,A+=n*q,n=e[5],f+=n*I,l+=n*D,h+=n*L,p+=n*N,y+=n*Y,b+=n*F,g+=n*K,d+=n*z,v+=n*H,w+=n*G,m+=n*Z,E+=n*J,_+=n*$,O+=n*X,A+=n*V,k+=n*q,n=e[6],l+=n*I,h+=n*D,p+=n*L,y+=n*N,b+=n*Y,g+=n*F,d+=n*K,v+=n*z,w+=n*H,m+=n*G,E+=n*Z,_+=n*J,O+=n*$,A+=n*X,k+=n*V,P+=n*q,n=e[7],h+=n*I,p+=n*D,y+=n*L,b+=n*N,g+=n*Y,d+=n*F,v+=n*K,w+=n*z,m+=n*H,E+=n*G,_+=n*Z,O+=n*J,A+=n*$,k+=n*X,P+=n*V,T+=n*q,n=e[8],p+=n*I,y+=n*D,b+=n*L,g+=n*N,d+=n*Y,v+=n*F,w+=n*K,m+=n*z,E+=n*H,_+=n*G,O+=n*Z,A+=n*J,k+=n*$,P+=n*X,T+=n*V,j+=n*q,n=e[9],y+=n*I,b+=n*D,g+=n*L,d+=n*N,v+=n*Y,w+=n*F,m+=n*K,E+=n*z,_+=n*H,O+=n*G,A+=n*Z,k+=n*J,P+=n*$,T+=n*X,j+=n*V,x+=n*q,n=e[10],b+=n*I,g+=n*D,d+=n*L,v+=n*N,w+=n*Y,m+=n*F,E+=n*K,_+=n*z,O+=n*H,A+=n*G,k+=n*Z,P+=n*J,T+=n*$,j+=n*X,x+=n*V,R+=n*q,n=e[11],g+=n*I,d+=n*D,v+=n*L,w+=n*N,m+=n*Y,E+=n*F,_+=n*K,O+=n*z,A+=n*H,k+=n*G,P+=n*Z,T+=n*J;j+=n*$,x+=n*X,R+=n*V,S+=n*q,n=e[12],d+=n*I,v+=n*D,w+=n*L,m+=n*N,E+=n*Y,_+=n*F,O+=n*K,A+=n*z,k+=n*H,P+=n*G,T+=n*Z,j+=n*J,x+=n*$,R+=n*X,S+=n*V,U+=n*q,n=e[13],v+=n*I,w+=n*D,m+=n*L,E+=n*N,_+=n*Y,O+=n*F,A+=n*K,k+=n*z,P+=n*H,T+=n*G,j+=n*Z,x+=n*J,R+=n*$,S+=n*X,U+=n*V,C+=n*q,n=e[14],w+=n*I,m+=n*D,E+=n*L,_+=n*N,O+=n*Y,A+=n*F,k+=n*K,P+=n*z,T+=n*H,j+=n*G,x+=n*Z,R+=n*J,S+=n*$,U+=n*X,C+=n*V,M+=n*q,n=e[15],m+=n*I,E+=n*D,_+=n*L,O+=n*N,A+=n*Y,k+=n*F,P+=n*K,T+=n*z,j+=n*H,x+=n*G,R+=n*Z,S+=n*J,U+=n*$,C+=n*X,M+=n*V,B+=n*q,i+=38*E,u+=38*_,a+=38*O,s+=38*A,c+=38*k,f+=38*P,l+=38*T,h+=38*j,p+=38*x,y+=38*R,b+=38*S,g+=38*U,d+=38*C,v+=38*M,w+=38*B,o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=p+o+65535,o=Math.floor(n/65536),p=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=g+o+65535,o=Math.floor(n/65536),g=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=m+o+65535,o=Math.floor(n/65536),m=n-65536*o,i+=o-1+37*(o-1),o=1,n=i+o+65535,o=Math.floor(n/65536),i=n-65536*o,n=u+o+65535,o=Math.floor(n/65536),u=n-65536*o,n=a+o+65535,o=Math.floor(n/65536),a=n-65536*o,n=s+o+65535,o=Math.floor(n/65536),s=n-65536*o,n=c+o+65535,o=Math.floor(n/65536),c=n-65536*o,n=f+o+65535,o=Math.floor(n/65536),f=n-65536*o,n=l+o+65535,o=Math.floor(n/65536),l=n-65536*o,n=h+o+65535,o=Math.floor(n/65536),h=n-65536*o,n=p+o+65535,o=Math.floor(n/65536),p=n-65536*o,n=y+o+65535,o=Math.floor(n/65536),y=n-65536*o,n=b+o+65535,o=Math.floor(n/65536),b=n-65536*o,n=g+o+65535,o=Math.floor(n/65536),g=n-65536*o,n=d+o+65535,o=Math.floor(n/65536),d=n-65536*o,n=v+o+65535,o=Math.floor(n/65536),v=n-65536*o,n=w+o+65535,o=Math.floor(n/65536),w=n-65536*o,n=m+o+65535,o=Math.floor(n/65536),m=n-65536*o,i+=o-1+37*(o-1),t[0]=i,t[1]=u,t[2]=a,t[3]=s,t[4]=c,t[5]=f,t[6]=l,t[7]=h,t[8]=p,t[9]=y,t[10]=b,t[11]=g,t[12]=d;t[13]=v,t[14]=w,t[15]=m}function j(t,e){T(t,e,e)}function x(t,e){var r,n=tt();for(r=0;r<16;r++)n[r]=e[r];for(r=253;r>=0;r--)j(n,n),2!==r&&4!==r&&T(n,n,e);for(r=0;r<16;r++)t[r]=n[r]}function R(t,e){var r,n=tt();for(r=0;r<16;r++)n[r]=e[r];for(r=250;r>=0;r--)j(n,n),1!==r&&T(n,n,e);for(r=0;r<16;r++)t[r]=n[r]}function S(t,e,r){var n,o,i=new Uint8Array(32),u=new Float64Array(80),a=tt(),s=tt(),c=tt(),f=tt(),l=tt(),h=tt();for(o=0;o<31;o++)i[o]=e[o];for(i[31]=127&e[31]|64,i[0]&=248,A(u,r),o=0;o<16;o++)s[o]=u[o],f[o]=a[o]=c[o]=0;for(a[0]=f[0]=1,o=254;o>=0;--o)n=i[o>>>3]>>>(7&o)&1,m(a,s,n),m(c,f,n),k(l,a,c),P(a,a,c),k(c,s,f),P(s,s,f),j(f,l),j(h,a),T(a,c,a),T(c,s,l),k(l,a,c),P(a,a,c),j(s,a),P(c,f,h),T(a,c,ut),k(a,a,f),T(c,c,a),T(a,f,h),T(f,s,u),j(s,l),m(a,s,n),m(c,f,n);for(o=0;o<16;o++)u[o+16]=a[o],u[o+32]=c[o],u[o+48]=s[o],u[o+64]=f[o];var p=u.subarray(32),y=u.subarray(16);return x(p,p),T(y,y,p),E(t,y),0}function U(t,e){return S(t,e,nt)}function C(t,e){return et(e,32),U(t,e)}function M(t,e,r){var n=new Uint8Array(32);return S(n,r,e),c(t,rt,n,ht)}function B(t,e,r,n,o,i){var u=new Uint8Array(32);return M(u,o,i),yt(t,e,r,n,u)}function I(t,e,r,n,o,i){var u=new Uint8Array(32);return M(u,o,i),bt(t,e,r,n,u)}function D(t,e,r,n){for(var o,i,u,a,s,c,f,l,h,p,y,b,g,d,v,w,m,E,_,O,A,k,P,T,j,x,R=new Int32Array(16),S=new Int32Array(16),U=t[0],C=t[1],M=t[2],B=t[3],I=t[4],D=t[5],L=t[6],N=t[7],Y=e[0],F=e[1],K=e[2],z=e[3],H=e[4],G=e[5],Z=e[6],J=e[7],$=0;n>=128;){for(_=0;_<16;_++)O=8*_+$,R[_]=r[O+0]<<24|r[O+1]<<16|r[O+2]<<8|r[O+3],S[_]=r[O+4]<<24|r[O+5]<<16|r[O+6]<<8|r[O+7];for(_=0;_<80;_++)if(o=U,i=C,u=M,a=B,s=I,c=D,f=L,l=N,h=Y,p=F,y=K,b=z,g=H,d=G,v=Z,w=J,A=N,k=J,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=(I>>>14|H<<18)^(I>>>18|H<<14)^(H>>>9|I<<23),k=(H>>>14|I<<18)^(H>>>18|I<<14)^(I>>>9|H<<23),P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,A=I&D^~I&L,k=H&G^~H&Z,P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,A=gt[2*_],k=gt[2*_+1],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,A=R[_%16],k=S[_%16],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,m=65535&j|x<<16,E=65535&P|T<<16,A=m,k=E,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=(U>>>28|Y<<4)^(Y>>>2|U<<30)^(Y>>>7|U<<25),k=(Y>>>28|U<<4)^(U>>>2|Y<<30)^(U>>>7|Y<<25),P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,A=U&C^U&M^C&M,k=Y&F^Y&K^F&K,P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,l=65535&j|x<<16,w=65535&P|T<<16,A=a,k=b,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=m,k=E,P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,a=65535&j|x<<16,b=65535&P|T<<16,C=o,M=i,B=u,I=a,D=s,L=c,N=f,U=l,F=h,K=p,z=y,H=b,G=g,Z=d,J=v,Y=w,_%16==15)for(O=0;O<16;O++)A=R[O],k=S[O],P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=R[(O+9)%16],k=S[(O+9)%16],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,m=R[(O+1)%16],E=S[(O+1)%16],A=(m>>>1|E<<31)^(m>>>8|E<<24)^m>>>7,k=(E>>>1|m<<31)^(E>>>8|m<<24)^(E>>>7|m<<25),P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,m=R[(O+14)%16],E=S[(O+14)%16],A=(m>>>19|E<<13)^(E>>>29|m<<3)^m>>>6,k=(E>>>19|m<<13)^(m>>>29|E<<3)^(E>>>6|m<<26),P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,R[O]=65535&j|x<<16,S[O]=65535&P|T<<16;A=U,k=Y,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[0],k=e[0],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[0]=U=65535&j|x<<16,e[0]=Y=65535&P|T<<16,A=C,k=F,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[1],k=e[1],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[1]=C=65535&j|x<<16,e[1]=F=65535&P|T<<16,A=M,k=K,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[2],k=e[2],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[2]=M=65535&j|x<<16,e[2]=K=65535&P|T<<16,A=B,k=z,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[3],k=e[3],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[3]=B=65535&j|x<<16,e[3]=z=65535&P|T<<16,A=I,k=H,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[4],k=e[4],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[4]=I=65535&j|x<<16,e[4]=H=65535&P|T<<16,A=D,k=G,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[5],k=e[5],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[5]=D=65535&j|x<<16,e[5]=G=65535&P|T<<16,A=L,k=Z,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[6],k=e[6],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[6]=L=65535&j|x<<16,e[6]=Z=65535&P|T<<16,A=N,k=J,P=65535&k,T=k>>>16,j=65535&A,x=A>>>16,A=t[7],k=e[7],P+=65535&k,T+=k>>>16,j+=65535&A,x+=A>>>16,T+=P>>>16,j+=T>>>16,x+=j>>>16,t[7]=N=65535&j|x<<16,e[7]=J=65535&P|T<<16,$+=128,n-=128}return n}function L(t,r,n){var o,i=new Int32Array(8),u=new Int32Array(8),a=new Uint8Array(256),s=n;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,u[0]=4089235720,u[1]=2227873595,u[2]=4271175723,u[3]=1595750129,u[4]=2917565137,u[5]=725511199,u[6]=4215389547,u[7]=327033209,D(i,u,r,n),n%=128,o=0;o<n;o++)a[o]=r[s-n+o];for(a[n]=128,n=256-128*(n<112?1:0),a[n-9]=0,e(a,n-8,s/536870912|0,s<<3),D(i,u,a,n),o=0;o<8;o++)e(t,8*o,i[o],u[o]);return 0}function N(t,e){var r=tt(),n=tt(),o=tt(),i=tt(),u=tt(),a=tt(),s=tt(),c=tt(),f=tt();P(r,t[1],t[0]),P(f,e[1],e[0]),T(r,r,f),k(n,t[0],t[1]),k(f,e[0],e[1]),T(n,n,f),T(o,t[3],e[3]),T(o,o,st),T(i,t[2],e[2]),k(i,i,i),P(u,n,r),P(a,i,o),k(s,i,o),k(c,n,r),T(t[0],u,a),T(t[1],c,s),T(t[2],s,a),T(t[3],u,c)}function Y(t,e,r){var n;for(n=0;n<4;n++)m(t[n],e[n],r)}function F(t,e){var r=tt(),n=tt(),o=tt();x(o,e[2]),T(r,e[0],o),T(n,e[1],o),E(t,n),t[31]^=O(r)<<7}function K(t,e,r){var n,o;for(v(t[0],ot),v(t[1],it),v(t[2],it),v(t[3],ot),o=255;o>=0;--o)n=r[o/8|0]>>(7&o)&1,Y(t,e,n),N(e,t),N(t,t),Y(t,e,n)}function z(t,e){var r=[tt(),tt(),tt(),tt()];v(r[0],ct),v(r[1],ft),v(r[2],it),T(r[3],ct,ft),K(t,r,e)}function H(t,e,r){var n,o=new Uint8Array(64),i=[tt(),tt(),tt(),tt()];for(r||et(e,32),L(o,e,32),o[0]&=248,o[31]&=127,o[31]|=64,z(i,o),F(t,i),n=0;n<32;n++)e[n+32]=t[n];return 0}function G(t,e){var r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o<i;++o)e[o]+=r-16*e[n]*dt[o-(n-32)],r=e[o]+128>>8,e[o]-=256*r;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;o++)e[o]+=r-(e[31]>>4)*dt[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;o++)e[o]-=r*dt[o];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function Z(t){var e,r=new Float64Array(64);for(e=0;e<64;e++)r[e]=t[e];for(e=0;e<64;e++)t[e]=0;G(t,r)}function J(t,e,r,n){var o,i,u=new Uint8Array(64),a=new Uint8Array(64),s=new Uint8Array(64),c=new Float64Array(64),f=[tt(),tt(),tt(),tt()];L(u,n,32),u[0]&=248,u[31]&=127,u[31]|=64;var l=r+64;for(o=0;o<r;o++)t[64+o]=e[o];for(o=0;o<32;o++)t[32+o]=u[32+o];for(L(s,t.subarray(32),r+32),Z(s),z(f,s),F(t,f),o=32;o<64;o++)t[o]=n[o];for(L(a,t,r+64),Z(a),o=0;o<64;o++)c[o]=0;for(o=0;o<32;o++)c[o]=s[o];for(o=0;o<32;o++)for(i=0;i<32;i++)c[o+i]+=a[o]*u[i];return G(t.subarray(32),c),l}function $(t,e){var r=tt(),n=tt(),o=tt(),i=tt(),u=tt(),a=tt(),s=tt();return v(t[2],it),A(t[1],e),j(o,t[1]),T(i,o,at),P(o,o,t[2]),k(i,t[2],i),j(u,i),j(a,u),T(s,a,u),T(r,s,o),T(r,r,i),R(r,r),T(r,r,o),T(r,r,i),T(r,r,i),T(t[0],r,i),j(n,t[0]),T(n,n,i),_(n,o)&&T(t[0],t[0],lt),j(n,t[0]),T(n,n,i),_(n,o)?-1:(O(t[0])===e[31]>>7&&P(t[0],ot,t[0]),T(t[3],t[0],t[1]),0)}function X(t,e,r,n){var o,u=new Uint8Array(32),a=new Uint8Array(64),s=[tt(),tt(),tt(),tt()],c=[tt(),tt(),tt(),tt()];if(r<64)return-1;if($(c,n))return-1;for(o=0;o<r;o++)t[o]=e[o];for(o=0;o<32;o++)t[o+32]=n[o];if(L(a,t,r),Z(a),K(s,c,a),z(c,e.subarray(32)),N(s,c),F(u,s),r-=64,i(e,0,u,0)){for(o=0;o<r;o++)t[o]=0;return-1}for(o=0;o<r;o++)t[o]=e[o+64];return r}function V(t,e){if(t.length!==vt)throw new Error("bad key size");if(e.length!==wt)throw new Error("bad nonce size")}function q(t,e){if(t.length!==mt)throw new Error("bad public key size");if(e.length!==Et)throw new Error("bad secret key size")}function W(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Q(t){for(var e=0;e<t.length;e++)t[e]=0}var tt=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;e++)r[e]=t[e];return r},et=function(){throw new Error("no PRNG")},rt=new Uint8Array(16),nt=new Uint8Array(32);nt[0]=9;var ot=tt(),it=tt([1]),ut=tt([56129,1]),at=tt([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),st=tt([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),ct=tt([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),ft=tt([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),lt=tt([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),ht=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),pt=function(t){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var e,r,n,o,i,u,a,s;e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,r=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|r<<3),n=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(r>>>10|n<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(n>>>7|o<<9),i=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,u=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(i>>>14|u<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(u>>>11|a<<5),s=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|s<<8),this.r[9]=s>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};pt.prototype.blocks=function(t,e,r){for(var n,o,i,u,a,s,c,f,l,h,p,y,b,g,d,v,w,m,E,_=this.fin?0:2048,O=this.h[0],A=this.h[1],k=this.h[2],P=this.h[3],T=this.h[4],j=this.h[5],x=this.h[6],R=this.h[7],S=this.h[8],U=this.h[9],C=this.r[0],M=this.r[1],B=this.r[2],I=this.r[3],D=this.r[4],L=this.r[5],N=this.r[6],Y=this.r[7],F=this.r[8],K=this.r[9];r>=16;)n=255&t[e+0]|(255&t[e+1])<<8,O+=8191&n,o=255&t[e+2]|(255&t[e+3])<<8,A+=8191&(n>>>13|o<<3),i=255&t[e+4]|(255&t[e+5])<<8,k+=8191&(o>>>10|i<<6),u=255&t[e+6]|(255&t[e+7])<<8,P+=8191&(i>>>7|u<<9),a=255&t[e+8]|(255&t[e+9])<<8,T+=8191&(u>>>4|a<<12),j+=a>>>1&8191,s=255&t[e+10]|(255&t[e+11])<<8,x+=8191&(a>>>14|s<<2),c=255&t[e+12]|(255&t[e+13])<<8,R+=8191&(s>>>11|c<<5),f=255&t[e+14]|(255&t[e+15])<<8,S+=8191&(c>>>8|f<<8),U+=f>>>5|_,l=0,h=l,h+=O*C,h+=A*(5*K),h+=k*(5*F),h+=P*(5*Y),h+=T*(5*N),l=h>>>13,h&=8191,h+=j*(5*L),h+=x*(5*D),h+=R*(5*I),h+=S*(5*B),h+=U*(5*M),l+=h>>>13,h&=8191,p=l,p+=O*M,p+=A*C,p+=k*(5*K),p+=P*(5*F),p+=T*(5*Y),l=p>>>13,p&=8191,p+=j*(5*N),p+=x*(5*L),p+=R*(5*D),p+=S*(5*I),p+=U*(5*B),l+=p>>>13,p&=8191,y=l,y+=O*B,y+=A*M,y+=k*C,y+=P*(5*K),y+=T*(5*F),l=y>>>13,y&=8191,y+=j*(5*Y),y+=x*(5*N),y+=R*(5*L),y+=S*(5*D),y+=U*(5*I),l+=y>>>13,y&=8191,b=l,b+=O*I,b+=A*B,b+=k*M,b+=P*C,b+=T*(5*K),l=b>>>13,b&=8191,b+=j*(5*F),b+=x*(5*Y),b+=R*(5*N),b+=S*(5*L),b+=U*(5*D),l+=b>>>13,b&=8191,g=l,g+=O*D,g+=A*I,g+=k*B,g+=P*M,g+=T*C,l=g>>>13,g&=8191,g+=j*(5*K),g+=x*(5*F),g+=R*(5*Y),g+=S*(5*N),g+=U*(5*L),l+=g>>>13,g&=8191,d=l,d+=O*L,d+=A*D,d+=k*I,d+=P*B,d+=T*M,l=d>>>13,d&=8191,d+=j*C,d+=x*(5*K),d+=R*(5*F),d+=S*(5*Y),d+=U*(5*N),l+=d>>>13,d&=8191,v=l,v+=O*N,v+=A*L,v+=k*D,v+=P*I,v+=T*B,l=v>>>13,v&=8191,v+=j*M,v+=x*C,v+=R*(5*K),v+=S*(5*F),v+=U*(5*Y),l+=v>>>13,v&=8191,w=l,w+=O*Y,w+=A*N,w+=k*L,w+=P*D,w+=T*I,l=w>>>13,w&=8191,w+=j*B,w+=x*M,w+=R*C,w+=S*(5*K),w+=U*(5*F),l+=w>>>13,w&=8191,m=l,m+=O*F,m+=A*Y,m+=k*N,m+=P*L,m+=T*D,l=m>>>13,m&=8191,m+=j*I,m+=x*B,m+=R*M,m+=S*C,m+=U*(5*K),l+=m>>>13,m&=8191,E=l,E+=O*K,E+=A*F,E+=k*Y,E+=P*N,E+=T*L,l=E>>>13,E&=8191,E+=j*D,E+=x*I,E+=R*B,E+=S*M,E+=U*C,l+=E>>>13,E&=8191,l=(l<<2)+l|0,l=l+h|0,h=8191&l,l>>>=13,p+=l,O=h,A=p,k=y,P=b,T=g,j=d,x=v,R=w,S=m,U=E,e+=16,r-=16;this.h[0]=O,this.h[1]=A,this.h[2]=k,this.h[3]=P,this.h[4]=T,this.h[5]=j,this.h[6]=x,this.h[7]=R,this.h[8]=S,this.h[9]=U},pt.prototype.finish=function(t,e){var r,n,o,i,u=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,u[0]=this.h[0]+5,r=u[0]>>>13,u[0]&=8191,i=1;i<10;i++)u[i]=this.h[i]+r,r=u[i]>>>13,u[i]&=8191;for(u[9]-=8192,n=(1^r)-1,i=0;i<10;i++)u[i]&=n;for(n=~n,i=0;i<10;i++)this.h[i]=this.h[i]&n|u[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;i<8;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},pt.prototype.update=function(t,e,r){var n,o;if(this.leftover){for(o=16-this.leftover,o>r&&(o=r),n=0;n<o;n++)this.buffer[this.leftover+n]=t[e+n];if(r-=o,e+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(o=r-r%16,this.blocks(t,e,o),e+=o,r-=o),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=t[e+n];this.leftover+=r}};var yt=g,bt=d,gt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],dt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vt=32,wt=24,mt=32,Et=32,_t=wt;t.lowlevel={crypto_core_hsalsa20:c,crypto_stream_xor:p,crypto_stream:h,crypto_stream_salsa20_xor:f,crypto_stream_salsa20:l,crypto_onetimeauth:y,crypto_onetimeauth_verify:b,crypto_verify_16:o,crypto_verify_32:i,crypto_secretbox:g,crypto_secretbox_open:d,crypto_scalarmult:S,crypto_scalarmult_base:U,crypto_box_beforenm:M,crypto_box_afternm:yt,crypto_box:B,crypto_box_open:I,crypto_box_keypair:C,crypto_hash:L,crypto_sign:J,crypto_sign_keypair:H,crypto_sign_open:X,crypto_secretbox_KEYBYTES:vt,crypto_secretbox_NONCEBYTES:wt,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:mt,crypto_box_SECRETKEYBYTES:Et,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:_t,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:64,crypto_sign_PUBLICKEYBYTES:32,crypto_sign_SECRETKEYBYTES:64,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64},t.randomBytes=function(t){var e=new Uint8Array(t);return et(e,t),e},t.secretbox=function(t,e,r){W(t,e,r),V(r,e);for(var n=new Uint8Array(32+t.length),o=new Uint8Array(n.length),i=0;i<t.length;i++)n[i+32]=t[i];return g(o,n,n.length,e,r),o.subarray(16)},t.secretbox.open=function(t,e,r){W(t,e,r),V(r,e);for(var n=new Uint8Array(16+t.length),o=new Uint8Array(n.length),i=0;i<t.length;i++)n[i+16]=t[i];return n.length<32?null:0!==d(o,n,n.length,e,r)?null:o.subarray(32)},t.secretbox.keyLength=vt,t.secretbox.nonceLength=wt,t.secretbox.overheadLength=16,t.scalarMult=function(t,e){if(W(t,e),32!==t.length)throw new Error("bad n size");if(32!==e.length)throw new Error("bad p size");var r=new Uint8Array(32);return S(r,t,e),r},t.scalarMult.base=function(t){if(W(t),32!==t.length)throw new Error("bad n size");var e=new Uint8Array(32);return U(e,t),e},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,r,n,o){var i=t.box.before(n,o);return t.secretbox(e,r,i)},t.box.before=function(t,e){W(t,e),q(t,e);var r=new Uint8Array(32);return M(r,t,e),r},t.box.after=t.secretbox,t.box.open=function(e,r,n,o){var i=t.box.before(n,o);return t.secretbox.open(e,r,i)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(mt),e=new Uint8Array(Et);return C(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(W(t),t.length!==Et)throw new Error("bad secret key size");var e=new Uint8Array(mt);return U(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=mt,t.box.secretKeyLength=Et,t.box.sharedKeyLength=32,t.box.nonceLength=_t,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(W(t,e),64!==e.length)throw new Error("bad secret key size");var r=new Uint8Array(64+t.length);return J(r,t,t.length,e),r},t.sign.open=function(t,e){if(W(t,e),32!==e.length)throw new Error("bad public key size");var r=new Uint8Array(t.length),n=X(r,t,t.length,e);if(n<0)return null;for(var o=new Uint8Array(n),i=0;i<o.length;i++)o[i]=r[i];return o},t.sign.detached=function(e,r){for(var n=t.sign(e,r),o=new Uint8Array(64),i=0;i<o.length;i++)o[i]=n[i];return o},t.sign.detached.verify=function(t,e,r){if(W(t,e,r),64!==e.length)throw new Error("bad signature size");if(32!==r.length)throw new Error("bad public key size");var n,o=new Uint8Array(64+t.length),i=new Uint8Array(64+t.length);for(n=0;n<64;n++)o[n]=e[n];for(n=0;n<t.length;n++)o[n+64]=t[n];return X(i,o,o.length,r)>=0},t.sign.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(64);return H(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(W(t),64!==t.length)throw new Error("bad secret key size");for(var e=new Uint8Array(32),r=0;r<e.length;r++)e[r]=t[32+r];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(W(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(32),r=new Uint8Array(64),n=0;n<32;n++)r[n]=t[n];return H(e,r,!0),{publicKey:e,secretKey:r}},t.sign.publicKeyLength=32,t.sign.secretKeyLength=64,t.sign.seedLength=32,t.sign.signatureLength=64,t.hash=function(t){W(t);var e=new Uint8Array(64);return L(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return W(t,e),0!==t.length&&0!==e.length&&t.length===e.length&&0===n(t,0,e,0,t.length)},t.setPRNG=function(t){et=t},function(){var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&e.getRandomValues?t.setPRNG(function(t,r){var n,o=new Uint8Array(r);for(n=0;n<r;n+=65536)e.getRandomValues(o.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)t[n]=o[n];Q(o)}):(e=r(89))&&e.randomBytes&&t.setPRNG(function(t,r){var n,o=e.randomBytes(r);for(n=0;n<r;n++)t[n]=o[n];Q(o)})}()}(void 0!==t&&t.exports?t.exports:self.nacl=self.nacl||{})},function(t,e){},function(t,e,r){(function(e){!function(e,r){"use strict";void 0!==t&&t.exports?t.exports=r():e.nacl?e.nacl.util=r():(e.nacl={},e.nacl.util=r())}(this,function(){"use strict";function t(t){if(!/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(t))throw new TypeError("invalid encoding")}var r={};return r.decodeUTF8=function(t){if("string"!=typeof t)throw new TypeError("expected string");var e,r=unescape(encodeURIComponent(t)),n=new Uint8Array(r.length);for(e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n},r.encodeUTF8=function(t){var e,r=[];for(e=0;e<t.length;e++)r.push(String.fromCharCode(t[e]));return decodeURIComponent(escape(r.join("")))},"undefined"==typeof atob?void 0!==e.from?(r.encodeBase64=function(t){return e.from(t).toString("base64")},r.decodeBase64=function(r){return t(r),new Uint8Array(Array.prototype.slice.call(e.from(r,"base64"),0))}):(r.encodeBase64=function(t){return new e(t).toString("base64")},r.decodeBase64=function(r){return t(r),new Uint8Array(Array.prototype.slice.call(new e(r,"base64"),0))}):(r.encodeBase64=function(t){var e,r=[],n=t.length;for(e=0;e<n;e++)r.push(String.fromCharCode(t[e]));return btoa(r.join(""))},r.decodeBase64=function(e){t(e);var r,n=atob(e),o=new Uint8Array(n.length);for(r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}),r})}).call(e,r(91).Buffer)},function(t,e,r){"use strict";(function(t){function n(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(n()<e)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=i.prototype):(null===t&&(t=new i(e)),t.length=e),t}function i(t,e,r){if(!(i.TYPED_ARRAY_SUPPORT||this instanceof i))return new i(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?h(t,e,r,n):"string"==typeof e?f(t,e,r):p(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,e,r,n){return a(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function c(t,e){if(a(e),t=o(t,e<0?0:0|y(e)),!i.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function f(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!i.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(e,r);t=o(t,n);var u=t.write(e,r);return u!==n&&(t=t.slice(0,u)),t}function l(t,e){var r=e.length<0?0:0|y(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function h(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),i.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=i.prototype):t=l(t,e),t}function p(t,e){if(i.isBuffer(e)){var r=0|y(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||X(e.length)?o(t,0):l(t,e);if("Buffer"===e.type&&W(e.data))return l(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(t){if(t>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|t}function b(t){return+t!=t&&(t=0),i.alloc(+t)}function g(t,e){if(i.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,r);case"utf8":case"utf-8":return j(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){function i(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}var u=1,a=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,a/=2,s/=2,r/=2}var c;if(o){var f=-1;for(c=r;c<a;c++)if(i(t,c)===i(e,-1===f?0:c-f)){if(-1===f&&(f=c),c-f+1===s)return f*u}else-1!==f&&(c-=c-f),f=-1}else for(r+s>a&&(r=a-s),c=r;c>=0;c--){for(var l=!0,h=0;h<s;h++)if(i(t,c+h)!==i(e,h)){l=!1;break}if(l)return c}return-1}function E(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var u=0;u<n;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[r+u]=a}return u}function _(t,e,r,n){return $(H(e,t.length-r),t,r,n)}function O(t,e,r,n){return $(G(e),t,r,n)}function A(t,e,r,n){return O(t,e,r,n)}function k(t,e,r,n){return $(J(e),t,r,n)}function P(t,e,r,n){return $(Z(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?V.fromByteArray(t):V.fromByteArray(t.slice(e,r))}function j(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],u=null,a=i>239?4:i>223?3:i>191?2:1;if(o+a<=r){var s,c,f,l;switch(a){case 1:i<128&&(u=i);break;case 2:128==(192&(s=t[o+1]))&&(l=(31&i)<<6|63&s)>127&&(u=l);break;case 3:s=t[o+1],c=t[o+2],128==(192&s)&&128==(192&c)&&(l=(15&i)<<12|(63&s)<<6|63&c)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:s=t[o+1],c=t[o+2],f=t[o+3],128==(192&s)&&128==(192&c)&&128==(192&f)&&(l=(15&i)<<18|(63&s)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(u=l)}}null===u?(u=65533,a=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=a}return x(n)}function x(t){var e=t.length;if(e<=Q)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Q));return r}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function S(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function U(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=z(t[i]);return o}function C(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function M(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,o,u){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<u)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function D(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return o||L(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),q.write(t,e,r,n,23,4),r+4}function Y(t,e,r,n,o){return o||L(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),q.write(t,e,r,n,52,8),r+8}function F(t){if(t=K(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function K(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],u=0;u<n;++u){if((r=t.charCodeAt(u))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function Z(t,e){for(var r,n,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function J(t){return V.toByteArray(F(t))}function $(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t){return t!==t}var V=r(93),q=r(94),W=r(95);e.Buffer=i,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=n(),i.poolSize=8192,i._augment=function(t){return t.__proto__=i.prototype,t},i.from=function(t,e,r){return u(null,t,e,r)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(t,e,r){return s(null,t,e,r)},i.allocUnsafe=function(t){return c(null,t)},i.allocUnsafeSlow=function(t){return c(null,t)},i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,u=Math.min(r,n);o<u;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!W(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var u=t[r];if(!i.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(n,o),o+=u.length}return n},i.byteLength=g,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},i.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?j(this,0,t):d.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var u=o-n,a=r-e,s=Math.min(u,a),c=this.slice(n,o),f=t.slice(e,r),l=0;l<s;++l)if(c[l]!==f[l]){u=c[l],a=f[l];break}return u<a?-1:a<u?1:0},i.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return O(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n;if(i.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=i.prototype;else{var o=e-t;n=new i(o,void 0);for(var u=0;u<o;++u)n[u]=this[u+t]}return n},i.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},i.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},i.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||M(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),q.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),q.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),q.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),q.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<r&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=r-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return Y(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return Y(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,u=n-r;if(this===t&&r<e&&e<n)for(o=u-1;o>=0;--o)t[o+e]=this[o+r];else if(u<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o<u;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+u),e);return u},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var u;if("number"==typeof t)for(u=e;u<r;++u)this[u]=t;else{var a=i.isBuffer(t)?t:H(new i(t,n).toString()),s=a.length;for(u=0;u<r-e;++u)this[u+e]=a[u%s]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,r(92))},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function o(t){return 3*t.length/4-n(t)}function i(t){var e,r,o,i,u,a=t.length;i=n(t),u=new l(3*a/4-i),r=i>0?a-4:a;var s=0;for(e=0;e<r;e+=4)o=f[t.charCodeAt(e)]<<18|f[t.charCodeAt(e+1)]<<12|f[t.charCodeAt(e+2)]<<6|f[t.charCodeAt(e+3)],u[s++]=o>>16&255,u[s++]=o>>8&255,u[s++]=255&o;return 2===i?(o=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,u[s++]=255&o):1===i&&(o=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,u[s++]=o>>8&255,u[s++]=255&o),u}function u(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function a(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(u(n));return o.join("")}function s(t){for(var e,r=t.length,n=r%3,o="",i=[],u=0,s=r-n;u<s;u+=16383)i.push(a(t,u,u+16383>s?s:u+16383));return 1===n?(e=t[r-1],o+=c[e>>2],o+=c[e<<4&63],o+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],o+=c[e>>10],o+=c[e>>4&63],o+=c[e<<2&63],o+="="),i.push(o),i.join("")}e.byteLength=o,e.toByteArray=i,e.fromByteArray=s;for(var c=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,y=h.length;p<y;++p)c[p]=h[p],f[h.charCodeAt(p)]=p;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<<a)-1,c=s>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(u=i&(1<<-f)-1,i>>=-f,f+=n;f>0;u=256*u+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),i-=c}return(p?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,a,s,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),e+=u+l>=1?h/s:h*Math.pow(2,1-l),e*s>=2&&(u++,s/=2),u+l>=f?(a=0,u=f):u+l>=1?(a=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+p]=255&a,p+=y,a/=256,o-=8);for(u=u<<o|a,c+=o;c>0;t[r+p]=255&u,p+=y,u/=256,c-=8);t[r+p-y]|=128*b}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}}])});