!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.mediaTag=t():e.mediaTag=t()}(this,function(){returnfunction(e){functiont(r){if(n[r])returnn[r].exports;vari=n[r]={i:r,l:!1,exports:{}};returne[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}varn={};returnt.m=e,t.c=n,t.i=function(e){returne},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){varn=e&&e.__esModule?function(){returne.default}:function(){returne};returnt.d(n,"a",n),n},t.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=68)}([function(e,t,n){"use strict";functionr(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}vari=function(){functione(e,t){for(varn=0;n<t.length;n++){varr=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}returnfunction(t,n,r){returnn&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(5),u=n(3),a=n(4),c=function(){functione(){r(this,e)}returni(e,null,[{key:"findRequiredModuleIdentifiers",value:function(t){returno.logics().filter(function(n){returnn.apply(t)&&!e.forbiddenIdentifiers.includes(n.identifier)}).map(function(e){returne.identifier})}},{key:"findFilterIdentifiersToRegister",value:function(t){returno.logics().filter(function(n){returnn.apply(t)&&!e.forbiddenIdentifiers.includes(n.identifier)}).filter(function(e){return"filter"===e.type}).map(function(e){returne.identifier})}},{key:"findPluginIdentifiersToRegister",value:function(t){returno.logics().filter(function(n){returnn.apply(t)&&!e.forbiddenIdentifiers.includes(n.identifier)}).filter(function(e){return"plugin"===e.type}).map(function(e){returne.identifier})}},{key:"searchLogicCollision",value:function(e){vart=e.filter(function(e){returna.plugins().find(function(t){returne.identifier===t.identifier})});returnt.length>1?{modules:t}:null}},{key:"findModuleChain",value:function(t){varn=e.findRequiredModuleIdentifiers(t),r=n.map(function(e){vart=u.getFilter(e)||a.getPlugin(e);if(t)returnt;thrownewError("Module "+e+" not found")}),i=e.searchLogicCollision(r);if(i){varo=i.modules.map(function(e){returne.identifier});thrownewError("Has collision between ["+o+"]'s logics")}returnr}},{key:"startup",value:function(t){if(o.hasLogics()===!1)returnvoidconsole.warn("Guidelines havn't logics ... The orchestrator cannot do anything !");varn=t.getId();e.chains[n]=e.findModuleChain(t),e.history[n]={identifiers:[e.findRequiredModuleIdentifiers(t)],cycles:{}},e.chains[n].length>0&&e.run(t)}},{key:"coherence",value:function(t){varn=t.getId(),r=e.history[n].identifiers.length-1;if(Object.keys(e.history[n].cycles).some(function(t){returne.history[n].cycles[t]>e.allowedCycles}))throwconsole.log(e.history[n]),newError("Maximum cycles exceed "+e.history[n].cycles);vari=e.history[n].identifiers[r-1].every(function(t){returne.history[n].identifiers[r].includes(t)})||e.history[n].identifiers[r-1][0]===e.history[n].identifiers[r][0],o=e.history[n].identifiers[r][0];i&&(console.info('Chain has not evolved since the last module execution, the module "%s" is skipped',o),e.chains[n].shift())}},{key:"run",value:function(t){varn=t.getId();e.chains[n][0]?e.chains[n][0].startup(t):console.warn("Attempts to run a empty chain ...","History : ",e.history[n])}},{key:"chain",value:function(t){e.update(t),e.coherence(t),e.run(t)}},{key:"update",value:function(t){varn=t.getId(),r=e.chains[n].shift();e.findModuleChain(t).filter(function(t){return!e.chains[n].includes(t)}).forEach(function(t){e.chains[n].unshift(t)});vari=e.history[n].cycles[r.identifier];e.history[n].cycles[r.identifier]="number"==typeofi?i+1:1;varo=e.chains[n].map(function(e){returne.identifier});e.history[n].identifiers.push(o)}}]),e}();c.chains={},c.history={},c.allowedCycles=1,c.forbiddenIdentifiers=[],e.exports=c},,,function(e,t,n){"use strict";functionr(e,t){if(!(einstanceoft))thrownewTypeError("C