cryptpad/www/common/media-tag.js

1 line
No EOL
50 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MediaTag=t():e.MediaTag=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=82)}([function(e,t,n){"use strict";var r={IMAGE:"image",AUDIO:"audio",VIDEO:"video",PDF:"pdf",DASH:"dash",DOWNLOAD:"download",CRYPTO:"crypto",CLEAR_KEY:"clear-key",MEDIA_OBJECT:"media-object"};e.exports=r},function(e,t,n){"use strict";var r={MATCHER:"matcher",RENDERER:"renderer",FILTER:"filter",SANITIZER:"sanitizer"};e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),c=n(5),s=n(6),f=function(e){function t(e,n){r(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.MATCHER,c.ANY));return i.targetType=n,i}return i(t,e),u(t,[{key:"getTargetType",value:function(){return this.targetType}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),a=n(5),c=n(6),s=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.RENDERER,a.ONCE))}return i(t,e),t}(c);e.exports=s},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),a=n(5),c=n(8),s=n(12),f=function(){function e(){o(this,e)}return i(e,null,[{key:"start",value:function(t){var n=e.unstack(t);n?n.type!==u.SANITIZER&&e.fill(t):e.fill(t),e.snapshot(t),e.check(t),e.run(t)}},{key:"snapshot",value:function(t){var n=t.getId();if(e.stacks[n]){var r=[];e.stacks[n].forEach(function(e){var t={};t.identifier=e.getIdentifier(),t.type=e.getType(),r.push(t)}),e.snapshots[n]?e.snapshots[n].push({stack:r}):e.snapshots[n]=[{stack:r}]}else e.snapshots[n]=[]}},{key:"fill",value:function(t){var n=[],o=t.getId(),i=c.getPlugins(u.MATCHER),s=i.filter(function(e){return e.process(t)}),f=s.map(function(e){return e.getIdentifier()}),l=c.values(),p=l.filter(function(e){return e.type!==u.MATCHER&&f.includes(e.identifier)}),y=c.filterByOccurrencies(p),b=!0,h=!1,v=void 0;try{for(var w,g=y.once[Symbol.iterator]();!(b=(w=g.next()).done);b=!0){var d=w.value;n.push(d),y.every&&n.push.apply(n,r(y.every))}}catch(e){h=!0,v=e}finally{try{!b&&g.return&&g.return()}finally{if(h)throw v}}var m=!0,O=!1,k=void 0;try{for(var E,_=y.any[Symbol.iterator]();!(m=(E=_.next()).done);m=!0){var j=E.value;n.push(j),y.every&&n.push.apply(n,r(y.every))}}catch(e){O=!0,k=e}finally{try{!m&&_.return&&_.return()}finally{if(O)throw k}}if(e.stacks[o]){var P=n.shift();if(P){if(P.occurrence!==a.ONCE)throw new Error("The last plugin is not runnable once");var T;(T=e.stacks[o]).push.apply(T,n)}else{var A;(A=e.stacks[o]).push.apply(A,n)}}else e.stacks[o]=n}},{key:"unstack",value:function(t){var n=t.getId();return e.stacks[n]?e.stacks[n].pop():null}},{key:"check",value:function(t){var n=t.getId();if(e.stacks[n].length>=e.STACK_LIMIT)throw console.error(e.snapshots[n]),new Error("Plugin stack size exceed");if(e.snapshots[n].length>=e.SNAPSHOT_LIMIT)throw console.error(e.snapshots[n]),new Error("Plugin snapshots size exceed");var r=0;if(e.stacks[n].forEach(function(e){e.type===u.RENDERER&&r++}),r<1&&e.stacks[n].unshift(e.defaultPlugin),r>1)throw new Error("More of one renderer in the stack")}},{key:"return",value:function(t){e.start(t)}},{key:"run",value:function(t){var n=t.getId(),r=e.stacks[n].length,o=e.stacks[n][r-1];if(!o)throw console.log(e.stacks),new Error("Impossible to run a undefined plugin");o.process(t)}}]),e}();f.stacks={},f.STACK_LIMIT=1e3,f.snapshots={},f.SNAPSHOT_LIMIT=1e3,f.defaultPlugin=new s,e.exports=f},function(e,t,n){"use strict";var r={EVERY:"every",ANY:"any",ONCE:"once"};e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,n,o){r(this,e),this.identifier=t,this.type=n,this.occurrence=o}return o(e,[{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:"start",value:function(e){return this.process(e)}}]),e}();e.exports=i},,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){r(this,e)}return o(e,null,[{key:"getPlugins",value:function(t){return e.values().filter(function(e){return e.type===t})}},{key:"store",value:function(t){e.isStored([t.identifier,t.type])&&console.warn('The key "'+[t.identifier,t.type]+'" is already registered, the content will be overwritten.'),e.map[[t.identifier,t.type]]=t}},{key:"unstore",value:function(t){e.isStored([t.identifier,t.type])?delete e.map[[t.identifier,t.type]]:console.warn('The key "'+[t.identifier,t.type]+'" not exists in this manager')}},{key:"print",value:function(){console.log(e.keys(),e.values())}},{key:"filterByOccurrence",value:function(e,t){return e.filter(function(e){return e.occurrence===t})}},{key:"filterByOccurrencies",value:function(e){var t={once:[],any:[],every:[]},n=!0,r=!1,o=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var a=i.value;t[a.occurrence]?t[a.occurrence].push(a):t[a.occurrence]=Array.of(a)}}catch(e){r=!0,o=e}finally{try{!n&&u.return&&u.return()}finally{if(r)throw o}}return t}},{key:"isStored",value:function(t){return!!e.get(t)}},{key:"get",value:function(t){return e.map[t]}},{key:"keys",value:function(){return Object.keys(e.map)}},{key:"values",value:function(){return e.keys().map(function(t){return e.get(t)})}},{key:"knows",value:function(t){var n=Object.keys(e.map),r=Object.keys(e.map).map(function(t){return e.map[t]});return n.some(function(e){var n={};return n[t]=null,e===Object.keys(n)[0]})||r.some(function(e){return e===t})}},{key:"like",value:function(t){return Object.keys(e.map).filter(function(n){var r={};return r[t]=null,n===Object.keys(r)[0]||e.map[n]===t}).map(function(t){var n={};return n[t]=e.map[t],n})}}]),e}();i.map={},e.exports=i},,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u={PluginExists:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Plugin with same "'+e.identifier+'" identifier found.'))}return i(t,e),t}(Error),TypeNotFound:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Media Tag could not find the content type of an instance.}."))}return i(t,e),t}(Error),FilterExists:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Filter with same "'+e.identifier+' identifier found."'))}return i(t,e),t}(Error),FetchFail:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,'Could not fetch "'+e.url+'", received "'+e.status+": "+e.statusText+'".'))}return i(t,e),t}(Error),InvalidCryptoKey:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Invalid cryptographic key."))}return i(t,e),t}(Error),InvalidCryptoLib:function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Invalid cryptographic algorithm name."))}return i(t,e),t}(Error),FailedCrypto:function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,"Failed to decrypt file"+(e&&e.message?" "+e.message:"")+"."))}return i(t,e),t}(Error)};e.exports=u},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),a=n(5),c=n(6),s=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.FILTER,a.ANY))}return i(t,e),t}(c);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3),c=n(0),s=function(e){function t(){r(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.DOWNLOAD));return e.message="<p>MediaTag hasn't found the best renderer for your source, please can download the content by clicking the button below</p>",e}return i(t,e),u(t,[{key:"process",value:function(e){var t=document.createElement("div"),n=document.createElement("button");t.innerHTML=this.message,n.innerHTML="Download",n.onclick=function(){var t=new XMLHttpRequest,n=e.getAttribute("src");t.open("GET",n,!0),t.responseType="blob",t.onload=function(){var e=t.response;e&&saveAs(e)},t.send()},t.appendChild(n),e.utilsSetAllDataAttributes(t),e.replaceContents([t])}}]),t}(a);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(43),u=function(){function e(){r(this,e)}return o(e,null,[{key:"createUri",value:function(t,n){return e.pluginsPathForTarget+"/"+n+"s/"+t}},{key:"store",value:function(t,n){var r=e.createUri(t,n);i.isStored(t)&&console.warn('The key "'+t+'" is already registered, the content will be overwritten.'),i.map[t]=r}},{key:"isStored",value:function(e){return!!i.get(e)}},{key:"unstore",value:function(e){i.isStored(e)?delete i.map[e]:console.warn('The key "'+e+'" not exists in this manager')}},{key:"get",value:function(e){return i.map[e]}},{key:"keys",value:function(){return Object.keys(i.map)}},{key:"values",value:function(){return i.keys().map(function(e){return i.get(e)})}},{key:"knows",value:function(e){var t=Object.keys(i.map),n=Object.keys(i.map).map(function(e){return i.map[e]});return t.some(function(t){var n={};return n[e]=null,t===Object.keys(n)[0]})||n.some(function(t){return t===e})}},{key:"like",value:function(e){return Object.keys(i.map).filter(function(t){var n={};return n[e]=null,t===Object.keys(n)[0]||i.map[t]===e}).map(function(e){var t={};return t[e]=i.map[e],t})}}]),e}();u.Store=new i,e.exports=u},function(e,t,n){"use strict";var r=n(19),o=n(21);r.setMap(o);var i=n(31),u=n(28),a=n(33),c=n(32),s=n(29),f=n(30),l=n(27),p=n(26),y=n(34),b=n(37),h=n(35),v=n(39),w=n(38),g=n(36),d=n(12),m=n(25),O=n(24),k=n(41),E=n(18),_=n(17);r.PluginStore.store(new i),r.PluginStore.store(new u),r.PluginStore.store(new a),r.PluginStore.store(new c),r.PluginStore.store(new s),r.PluginStore.store(new f),r.PluginStore.store(new l),r.PluginStore.store(new p),r.PluginStore.store(new y),r.PluginStore.store(new b),r.PluginStore.store(new h),r.PluginStore.store(new v),r.PluginStore.store(new w),r.PluginStore.store(new g),r.PluginStore.store(new d),r.PluginStore.store(new m),r.PluginStore.store(new O),r.PluginStore.store(new k),m.FunctionStore.store("salsa20poly1305",E),m.FunctionStore.store("cryptpad",_),e.exports=r},,,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=e.getAttribute("src"),n=e.getAttribute("data-crypto-key"),r=f.getKeyFromStr(n),o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="arraybuffer",o.onload=function(){var t=o.response;if(t){var n=new Uint8Array(t),i=f.decrypt(n,r),u=i.content,c=l.getBlobUrl(u,e.getMimeType()),s=new Event("decryption");s.blob=new Blob([u],{type:e.getMimeType()}),s.metadata=i.metadata,window.document.dispatchEvent(s),e.setAttribute("src",c),e.removeAttribute("data-crypto-key"),a.return(e)}},o.send(null)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(10),a=n(4),c=!0,s=131088,f=function(){function e(){r(this,e)}return i(e,null,[{key:"createNonce",value:function(){return new Uint8Array(new Array(24).fill(0))}},{key:"increment",value:function(e){for(var t=e.length;t-- >1;){if(c){if("number"!=typeof e[t])throw new Error("E_UNSAFE_TYPE");if(e[t]>255)throw new Error("E_OUT_OF_BOUNDS")}if(255!==e[t])return void e[t]++;if(e[t]=0,0===t)throw new Error("E_NONCE_TOO_LARGE")}}},{key:"encodePrefix",value:function(e){return[65280,255].map(function(t,n){return(e&t)>>8*(1-n)})}},{key:"decodePrefix",value:function(e){return e[0]<<8|e[1]}},{key:"joinChunks",value:function(t){return new Uint8Array(t.reduce(function(t,n){return e.slice(t).concat(e.slice(n))},[]))}},{key:"slice",value:function(e){return Array.prototype.slice.call(e)}},{key:"getRandomKeyStr",value:function(){var t=e.Nacl,n=t.randomBytes(18);return t.util.encodeBase64(n)}},{key:"getKeyFromStr",value:function(t){return e.Nacl.util.decodeBase64(t)}},{key:"encrypt",value:function(t,n){var r=t,o=e.Nacl.randomBytes(24),i=e.Nacl.secretbox(r,o,n);if(i)return new Uint8Array(e.slice(o).concat(e.slice(i)));throw new Error}},{key:"decrypt",value:function(t,n){var r=e.Nacl,o=function(e){throw new Error(e||"DECRYPTION_ERROR")},i=new Uint8Array(new Array(24).fill(0)),u=0,a=t.subarray(0,2),c=e.decodePrefix(a),f={metadata:void 0},l=new Uint8Array(t.subarray(2,2+c)),p=r.secretbox.open(l,i,n);e.increment(i);try{f.metadata=JSON.parse(r.util.encodeUTF8(p))}catch(e){return o("E_METADATA_DECRYPTION")}f.metadata||o("NO_METADATA");for(var y,b=function(){var o=u*s+2+c,a=o+s;u++;var f=new Uint8Array(t.subarray(o,a)),l=r.secretbox.open(f,i,n);return e.increment(i),l},h=[];u*s<t.length;){if(!(y=b()))return window.setTimeout(o);h.push(y)}return f.content=e.joinChunks(h),f}}]),e}();f.Nacl=window.nacl;var l=function(){function e(){r(this,e)}return i(e,null,[{key:"getArrayBuffer",value:function(e){return fetch(e).then(function(e){if(e.ok)return e.arrayBuffer();throw new u.FetchFails}).then(function(e){return e})}},{key:"createUrl",value:function(e){return window.URL.createObjectURL(e)}},{key:"getBlobUrl",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t}))}},{key:"getDataUrl",value:function(e,t){return"data:"+t+";base64,"+f.Nacl.util.encodeBase64(e)}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){var t=e.getAttribute("src"),n=e.getAttribute("data-crypto-key"),r=c.getKeyFromStr(n),o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType="arraybuffer",o.onload=function(){var t=o.response;if(t){var n=new Uint8Array(t),i=c.decrypt(n,r),u=s.getBlobUrl(i,e.getMimeType()),f=new Event("decryption");f.blob=new Blob([i],{type:e.getMimeType()}),window.document.dispatchEvent(f),e.setAttribute("src",u),e.removeAttribute("data-crypto-key"),a.return(e)}},o.send(null)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(10),a=n(4),c=function(){function e(){r(this,e)}return i(e,null,[{key:"slice",value:function(e){return Array.prototype.slice.call(e)}},{key:"getRandomKeyStr",value:function(){var t=e.Nacl,n=t.randomBytes(18);return t.util.encodeBase64(n)}},{key:"getKeyFromStr",value:function(t){var n=e.Nacl;return n.hash(n.util.decodeBase64(t)).subarray(32,64)}},{key:"encrypt",value:function(t,n){var r=t,o=e.Nacl.randomBytes(24),i=e.Nacl.secretbox(r,o,n);if(i)return new Uint8Array(e.slice(o).concat(e.slice(i)));throw new Error}},{key:"decrypt",value:function(t,n){if(t.length<24)throw new Error;var r=e.slice,o=e.Nacl,i=new Uint8Array(r(t).slice(0,24)),u=new Uint8Array(r(t).slice(24)),a=o.secretbox.open(u,i,n);if(a)return a;throw new Error("Decrypted file in undefined")}}]),e}();c.Nacl=window.nacl;var s=function(){function e(){r(this,e)}return i(e,null,[{key:"getArrayBuffer",value:function(e){return fetch(e).then(function(e){if(e.ok)return e.arrayBuffer();throw new u.FetchFails}).then(function(e){return e})}},{key:"createUrl",value:function(e){return window.URL.createObjectURL(e)}},{key:"getBlobUrl",value:function(e,t){return window.URL.createObjectURL(new Blob([e],{type:t}))}},{key:"getDataUrl",value:function(e,t){return"data:"+t+";base64,"+c.Nacl.util.encodeBase64(e)}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(e){if(e instanceof Array){var t=[];return e.forEach(function(e){e.mediaObject?t.push(e.mediaObject):t.push(r.start(e))}),t}var n=e;return r.start(n)}var o=n(23),i=n(22),u=n(20),a=n(4),c=n(8),s=n(13);r.createMediaObject=function(e){var t=new i(e),n=o.parse(t);return t.setProperties(n),t},r.start=function(e){var t=r.createMediaObject(e);a.start(t)},r.setMap=u.setMap,r.PluginStore=c,r.UriStore=s,e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(8),u=n(1),a=function(){function e(){r(this,e)}return o(e,null,[{key:"start",value:function(t){var n=i.getPlugins(u.MATCHER),r=n.filter(function(e){return e.process(t)}),o=r.map(function(e){return e.getIdentifier()}),a={};return o.forEach(function(t){if(!e.map)throw new Error("No map registrated for the matching engine");a[t]=e.map.get(t)}),a}},{key:"setMap",value:function(t){e.map=t}}]),e}();e.exports=a},function(e,t,n){"use strict";var r=n(1),o=n(0),i=n(13);i.pluginsPathForTarget="../plugins",i.store(o.IMAGE,r.RENDERER),i.store(o.AUDIO,r.RENDERER),i.store(o.VIDEO,r.RENDERER),i.store(o.PDF,r.RENDERER),i.store(o.DASH,r.RENDERER),i.store(o.CRYPTO,r.FILTER),i.store(o.CLEAR_KEY,r.FILTER),i.store(o.MEDIA_OBJECT,r.SANITIZER),e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){r(this,e),this.id=e.uid(),this.attributesObject=e.attributesObject(t),this.hookedFns={hasChildNodes:t.hasChildNodes.bind(t),removeChild:t.removeChild.bind(t),getLastChild:function(){return t.lastChild},appendChild:t.appendChild.bind(t)}}return o(e,[{key:"setProperties",value:function(e){for(var t in e){if(this[t])throw new Error("The property "+t+" already exists in this MediaObject !");this[t]=e[t]}}},{key:"getId",value:function(){return this.id}},{key:"getAttribute",value:function(e){return this.attributesObject[e]}},{key:"setAttribute",value:function(e,t){this.attributesObject[e]=t}},{key:"removeAttribute",value:function(e){delete this.attributesObject[e]}},{key:"getAllDataAttrKeys",value:function(){return Object.keys(this.attributesObject).filter(function(e){return e.startsWith("data-attr")})}},{key:"getExtension",value:function(){return this.extension}},{key:"getMimeType",value:function(){return this.mime}},{key:"hasAttribute",value:function(e){return e in this.attributesObject}},{key:"getType",value:function(){return this.type}},{key:"getSource",value:function(){return this.src}},{key:"clearContents",value:function(){for(;this.hookedFns.hasChildNodes();)this.hookedFns.removeChild(this.hookedFns.getLastChild())}},{key:"replaceContents",value:function(e){var t=this;this.clearContents(),e.forEach(function(e){return t.hookedFns.appendChild(e)})}},{key:"utilsSetAllDataAttributes",value:function(e){var t=this;this.getAllDataAttrKeys().forEach(function(n){return e.setAttribute(n.substr(10),t.getAttribute(n))})}},{key:"utilsPassAllDataAttributes",value:function(e){var t=this;this.getAllDataAttrKeys().forEach(function(n){return e.setAttribute(n,t.getAttribute(n))})}}]),e}();i.uid=function(e){return function(){return e++}}(0),i.attributesObject=function(e){var t={};if(e.hasAttributes()){var n=e.attributes;Object.keys(n).forEach(function(e){var r=n[e];t[r.name]=r.value})}return t.hasAttribute=function(e){return t[e]},t},e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){r(this,e)}return o(e,null,[{key:"extension",value:function(e){return e.getAttribute("data-type").split("/")[1]}},{key:"type",value:function(e){return e.getAttribute("data-type").split("/")[0]}},{key:"mime",value:function(e){return e.getAttribute("data-type")}},{key:"protocol",value:function(e){var t=e.getAttribute("src").split("://");return t.length>1?t[0]:window.location.protocol}},{key:"hostname",value:function(e){var t=e.getAttribute("src").split("://");return t.length>1?t[1].split("/")[0]:window.location.hostname}},{key:"source",value:function(e){return e.getAttribute("src")}},{key:"schemes",value:function(e){return/\w+:/.exec(e.getAttribute("src"))}},{key:"parse",value:function(t){return{protocol:e.protocol(t),hostname:e.hostname(t),src:e.source(t),type:e.type(t),extension:e.extension(t),mime:e.mime(t)}}}]),e}();e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),c=n(0),s=n(4),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.CLEAR_KEY))}return i(t,e),u(t,[{key:"process",value:function(e){var t=e.getAttribute("data-clear-key"),n=t.substring(0,32),r=t.substring(33,65);e.setAttribute("id",n),e.setAttribute("key",r),e.removeAttribute("data-clear-key"),s.return(e)}}]),t}(a);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),c=n(0),s=n(42),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.CRYPTO))}return i(t,e),u(t,[{key:"process",value:function(e){var n=e.getAttribute("data-crypto-key"),r=/\w+:/.exec(n);if(null===r)throw new Error("No algorithm scheme found in data-crypto-key");var o=r[0],i=o.replace(":",""),u=n.replace(o,"");if(e.setAttribute("data-crypto-key",u),!t.FunctionStore.hasFunction(i))throw new Error("Algorithm "+i+" is not registered");t.FunctionStore.get(i)(e)}}]),t}(a);f.FunctionStore=s,e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.CLEAR_KEY,c.FILTER))}return i(t,e),u(t,[{key:"process",value:function(e){return e.hasAttribute("data-clear-key")}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.CRYPTO,c.FILTER))}return i(t,e),u(t,[{key:"process",value:function(e){return e.hasAttribute("data-crypto-key")}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.AUDIO,c.RENDERER))}return i(t,e),u(t,[{key:"process",value:function(e){var t=new RegExp("^mp3|ogg|webm|wav$"),n=new RegExp("^audio/(mp3|ogg|webm|wav)$");return e.hasAttribute("src")&&"audio"===e.getType()&&null!==t.exec(e.getExtension())&&null!==n.exec(e.getMimeType())}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.DASH,c.RENDERER))}return i(t,e),u(t,[{key:"process",value:function(e){var t=new RegExp("^dash[+]xml$"),n=new RegExp("^application/dash[+]xml$");return e.hasAttribute("src")&&"application"===e.getType()&&null!==t.exec(e.getExtension())&&null!==n.exec(e.getMimeType())}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.DOWNLOAD,c.RENDERER))}return i(t,e),u(t,[{key:"process",value:function(e){return e.hasAttribute("src")&&"download"===e.getType()}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.IMAGE,c.RENDERER))}return i(t,e),u(t,[{key:"process",value:function(e){var t=new RegExp("^png|jpg|jpeg|gif$"),n=new RegExp("^image/(png|svg+xml|jpeg|gif)$");return e.hasAttribute("src")&&"image"===e.getType()&&null!==t.exec(e.getExtension())&&null!==n.exec(e.getMimeType())}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.PDF,c.RENDERER))}return i(t,e),u(t,[{key:"process",value:function(e){var t=new RegExp("^pdf$"),n=new RegExp("^application/pdf$");return e.hasAttribute("src")&&"application"===e.getType()&&null!==t.exec(e.getExtension())&&null!==n.exec(e.getMimeType())}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.VIDEO,c.RENDERER))}return i(t,e),u(t,[{key:"process",value:function(e){var t=new RegExp("^mp4|ogg|webm$"),n=new RegExp("^video/(mp4|ogg|webm)$");return e.hasAttribute("src")&&"video"===e.getType()&&null!==t.exec(e.getExtension())&&null!==n.exec(e.getMimeType())}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),c=n(1),s=n(2),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,a.MEDIA_OBJECT,c.SANITIZER))}return i(t,e),u(t,[{key:"process",value:function(e){return e.hasAttribute("src")&&e.hasAttribute("data-type")}}]),t}(s);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3),c=n(0),s=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.AUDIO))}return i(t,e),u(t,[{key:"process",value:function(e){var t=document.createElement("audio");t.setAttribute("src",e.getAttribute("src")),e.utilsSetAllDataAttributes(t),e.replaceContents([t])}}]),t}(a);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3),c=n(0),s=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.DASH))}return i(t,e),u(t,[{key:"process",value:function(e){var t=document.createElement("video"),n=new shaka.Player(t),r=e.getAttribute("id"),o=e.getAttribute("key");if(r&&o){var i='{"'+r+'": "'+o+'"}',u=JSON.parse(i);n.configure({drm:{clearKeys:u}})}e.utilsSetAllDataAttributes(t),e.replaceContents([t]),n.load(e.getAttribute("src")).then(function(){})}}]),t}(a);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3),c=n(0),s=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.IMAGE))}return i(t,e),u(t,[{key:"process",value:function(e){var t=document.createElement("img");t.setAttribute("src",e.getAttribute("src")),e.utilsSetAllDataAttributes(t),e.replaceContents([t])}}]),t}(a);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3),c=n(0),s=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.PDF))}return i(t,e),u(t,[{key:"process",value:function(e){var t=e.getAttribute("src"),n=document.createElement("canvas");e.utilsSetAllDataAttributes(n),e.replaceContents([n]),PDFJS.disableWorker=!0,PDFJS.getDocument(t).promise.then(function(e){function t(e){var t=1,r=e.getViewport(t),o=n.getContext("2d");n.height=r.height,n.width=r.width;var i={canvasContext:o,viewport:r};e.render(i).then(function(){})}function r(t){t||console.log("no event"),0===t.buttons?o===e.numPages?o=1:o++:4===t.buttons&&(1===o?o=e.numPages:o--)}var o=1;e.getPage(o).then(function(e){t(e)}),n.onclick=function(n){r(n),e.getPage(o).then(function(e){t(e)})}},function(e){console.error(e)})}}]),t}(a);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(3),c=n(0),s=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.VIDEO))}return i(t,e),u(t,[{key:"process",value:function(e){var t=document.createElement("video");t.setAttribute("src",e.getAttribute("src")),e.utilsSetAllDataAttributes(t),e.replaceContents([t])}}]),t}(a);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=n(1),a=n(5),c=n(6),s=function(e){function t(e){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.SANITIZER,a.EVERY))}return i(t,e),t}(c);e.exports=s},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(40),c=n(0),s=n(4),f=function(e){function t(){return r(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,c.MEDIA_OBJECT))}return i(t,e),u(t,[{key:"process",value:function(e){console.log("Some stuff to sanitize media object"),s.return(e)}}]),t}(a);e.exports=f},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){r(this,e)}return o(e,null,[{key:"hasFunction",value:function(t){return!!e.get(t)}},{key:"isStored",value:function(t){return!!e.get(t)}},{key:"store",value:function(t,n){e.isStored(t)&&console.warn('The key "'+t+'" is already registered, the content will be overwritten.'),e.map[t]=n}},{key:"unstore",value:function(t){e.isStored(t)?delete e.map[t]:console.warn('The key "'+t+'" not exists in this manager')}},{key:"get",value:function(t){return e.map[t]}},{key:"keys",value:function(){return Object.keys(e.map)}},{key:"values",value:function(){return e.keys().map(function(t){return e.get(t)})}},{key:"knows",value:function(t){var n=Object.keys(e.map),r=Object.keys(e.map).map(function(t){return e.map[t]});return n.some(function(e){var n={};return n[t]=null,e===Object.keys(n)[0]})||r.some(function(e){return e===t})}},{key:"like",value:function(t){return Object.keys(e.map).filter(function(n){var r={};return r[t]=null,n===Object.keys(r)[0]||e.map[n]===t}).map(function(t){var n={};return n[t]=e.map[t],n})}}]),e}();i.map={},e.exports=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){r(this,e)}return o(e,null,[{key:"isStored",value:function(t){return!!e.get(t)}},{key:"store",value:function(t,n){e.isStored(t)&&console.warn('The key "'+t+'" is already registered, the content will be overwritten.'),e.map[t]=n}},{key:"unstore",value:function(t){e.isStored(t)?delete e.map[t]:console.warn('The key "'+t+'" not exists in this manager')}},{key:"get",value:function(t){return e.map[t]}},{key:"keys",value:function(){return Object.keys(e.map)}},{key:"values",value:function(){return e.keys().map(function(t){return e.get(t)})}},{key:"knows",value:function(t){var n=Object.keys(e.map),r=Object.keys(e.map).map(function(t){return e.map[t]});return n.some(function(e){var n={};return n[t]=null,e===Object.keys(n)[0]})||r.some(function(e){return e===t})}},{key:"like",value:function(t){return Object.keys(e.map).filter(function(n){var r={};return r[t]=null,n===Object.keys(r)[0]||e.map[n]===t}).map(function(t){var n={};return n[t]=e.map[t],n})}}]),e}();i.map={},e.exports=i},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(14)}])});