(function(aggregator, $) {    aggregator.component("adminchecker", { template: "
", controller: function(elt) { var href = document.location.href, pos = href.indexOf("?default="), prop, obj, deleteList = function(obj) { for (prop in obj) { if (obj.hasOwnProperty(prop)) { delete obj[prop]; } } }; if(!$(elt).attr("admin-checked")) { if (pos > -1) { /* dans le cas où on demande d'utiliser l'url "default" */ /* reinitialisation des listes selector ou composant d'origine */ obj = window.aggregator.debug().listSelector; for (prop in obj) { if (obj.hasOwnProperty(prop)) { $(prop).removeAttr("aggregator-name"); } } deleteList(window.aggregator.debug().listComposants); deleteList(window.aggregator.debug().listSelector); /* ensuite on charge le module complet d'administration */ $(elt).attr("aggregator-name", "admin"); } }} });}(aggregator, jQuery));(function(aggregator) { aggregator.replaceTo("link[rel='aggregator']", "adminchecker");}(aggregator));(function(aggregator) {    aggregator.component("header", { template: "
", controller: function(elt) { var onDesactivePastille = false; if ('false' == 'true') { onDesactivePastille = true; } /** * Met en surbrillance l'onglet et le lien courants dans la barre de navigation en aggrégation * @param str l'objet json indiquant le nom de l'onglet et du lien ex :'{"onglet":"mes-sinistres","lien":"declarer-un-sinistre-habitation"}' */ function changeCurrentTabAgg(str) { if(str != null && str != '') { var jsonContextBase = JSON.parse(str); /*suppression de la class is-current sur tous les onglets*/ var $onglets = $("body").find('.mars-menu__link'); if ($onglets != undefined && $onglets != null) { $onglets.removeClass('is-current'); } if(jsonContextBase.onglet != null && jsonContextBase.onglet != '' && jsonContextBase.onglet != 'null') { /*ajout de la class is-current sur l'onglet dont le nom correspond au paramétre*/ var $onglet = $('body').find('.mars-menu__link[data-nav-name="' + jsonContextBase.onglet + '"]'); if ($onglet != undefined && $onglet != null) { $onglet.addClass('is-current'); /* $('body').find(".mars-navigation__name").html(($onglet.html()).trim());*/ } } /*suppression de la class is-current sur tous les liens de la barre de navigation*/ var $liens = $('body').find('.mars-megamenu__link'); if ($liens != undefined && $liens != null) { $liens.removeClass('is-current'); } if(jsonContextBase.lien != null && jsonContextBase.lien != '' && jsonContextBase.lien != 'null') { /*ajout de la class is-current sur le lien dont le nom correspond au paramètre*/ var $lien = $('body').find('.mars-megamenu__link[data-nav-name="' + jsonContextBase.lien + '"]'); if ($lien != undefined && $lien != null) { $lien.addClass('is-current'); } } } } function changePastille(str) { if(str != null && str != '') { var jsonContextBase = JSON.parse(str); /* mise à jour de la pastille devis*/ var nbDevis = jsonContextBase.nbDevis; if (nbDevis > 0) { $('.mars-header__item-basket-bubble').text(nbDevis).removeClass("empty-bubble"); } else { $('.mars-header__item-basket-bubble').text(nbDevis).addClass("empty-bubble"); } } } /* A l'init du header : */ changeCurrentTabAgg(elt.attr('data-context')); /* Puis on place un écouteur pour intercepter les changements*/ /* Select the node that will be observed for mutations */ var targetNode = document.getElementById('agg-portal-header'); /* Options for the observer (which mutations to observe) */ var config = { attributes: true }; /* Callback function to execute when mutations are observed */ var callback = function(mutationsList) { var i; for (i in mutationsList) { if(mutationsList[i].type === 'attributes') { if (mutationsList[i].attributeName === 'data-context') { changeCurrentTabAgg(elt.attr('data-context')); } } } }; if(targetNode!=null && targetNode!="undefined") { /* Create an observer instance linked to the callback function */ var observer = new MutationObserver(callback); /* Start observing the target node for configured mutations */ observer.observe(targetNode, config); } /* écouteur pour intercepter les changements sur le header synthèse devis*/ /* Select the node that will be observed for mutations */ if (!onDesactivePastille) { var targetNodeHSD = document.getElementById('agg-portal-header-pri'); /* Options for the observer (which mutations to observe) */ var configHSD = { attributes: true }; /* Callback function to execute when mutations are observed */ var callbackHSD = function(mutationsList) { var i; for (i in mutationsList) { if(mutationsList[i].type === 'attributes') { if (mutationsList[i].attributeName === 'data-context') { changePastille(elt.attr('data-context')); } } } }; if(targetNodeHSD!=null && targetNodeHSD!="undefined") { /* Create an observer instance linked to the callback function */ var observerHSD = new MutationObserver(callbackHSD); /* Start observing the target node for configured mutations */ observerHSD.observe(targetNodeHSD, configHSD); } } function whenAvailable(name, callback) { var interval = 10; window.setTimeout(function() { if (window[name]) { callback(window[name]); } else { whenAvailable(name, callback); } }, interval); } /* init header et footer agg */ whenAvailable("init_agg", function(t) { init_agg(); }); /* alimentation panier */ var onAffiche = false; if ('true' == 'true') { onAffiche = true; } var onAfficheLogs = false; if ('false' == 'true') { onAfficheLogs = true; } whenAvailable("activateSasAuthentification", function(t) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller PRI - Appel activation sas authent'); } activateSasAuthentification("https://www.maaf.fr", "/fr", "https://www.maaf.fr/accesespaceperso/identifiant?contexte=iframe"); }); if (onAffiche) { whenAvailable("majURLPanier", function(t) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller PRI - Appel maj URL Panier aggHeaderPri'); } majURLPanier('https://www.maaf.fr/espaceclient/devis-enregistres', '/mes-devis?uuid=', 'coveuse.maaf.panier', 'uuid', false, 'ControllerPri', onAfficheLogs); }); if (!onDesactivePastille) { var dataContextHDS = ""; var fromDataContext = false; if (targetNodeHSD!=null && targetNodeHSD!="undefined" && targetNodeHSD.hasAttribute('data-context')) { dataContextHDS = targetNodeHSD.getAttribute('data-context'); dataContextHDSParsed = JSON.parse(targetNodeHSD.getAttribute('data-context')); if(!isNaN(dataContextHDSParsed.nbDevis) && dataContextHDSParsed.nbDevis != null) { fromDataContext = true; } } if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller PRI - Alimentation pastille depuis le data context ou non : ' + fromDataContext); } if (fromDataContext) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller PRI - Alimentation pastille panier depuis le datacontext'); } changePastille(dataContextHDS); } else { whenAvailable("addCountBasket", function(t) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller PRI - Appel count pour alimentation pastille panier aggHeaderPri - jeton CSRF = '); } addCountBasket('https://www.maaf.fr/espaceclient/devis-enregistres', '/mes-devis?uuid=', 'coveuse.maaf.panier', 'uuid', 'https://www.maaf.fr/espaceclient/CAP-US_espaceclient/api/devis/internet/count/', false, 'ControllerPri', onAfficheLogs, ''); }); } } }} });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-header", "header");}(aggregator));(function(aggregator) {    aggregator.component("footer", { template: "
", controller: function(elt) { function whenAvailable(name, callback) { var interval = 10; window.setTimeout(function() { if (window[name]) { callback(window[name]); } else { whenAvailable(name, callback); } }, interval); } whenAvailable("init_agg_menu_footer", function(t) { init_agg_menu_footer(); });} });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-footer", "footer");}(aggregator));(function(aggregator) {    aggregator.component("reference-vers-un-composant-aggregable-covea", { template: "

Mon espace MAAF Vie

", });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-contenu-pedagogique-haut", "reference-vers-un-composant-aggregable-covea");}(aggregator));(function(aggregator) {    aggregator.component("reference-vers-un-composant-aggregable-covea-1", { template: "
", });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-contenu-pedagogique-bas", "reference-vers-un-composant-aggregable-covea-1");}(aggregator));