Programmes
Références
À propos
Blog
Contact
Dénonciation
Mes favoris
Se connecter
Formulaire de dénonciation
Utilisez ce formulaire afin de dénoncer un prospect
Prescripteur
Programme rattaché
Le 116
Les Terrasses Saint Gervais
Nom du client
Prénom du client
Email du client
Téléphone du client
Message optionnel
Envoyer
Ok
var App=function(){this.start(),this.user()};App.prototype.start=function(){var t,e=this;e.housingsList=document.querySelector("#housings"),e.programResume=document.querySelector('[data-l-model="subprograms"]'),e.housingsList?(t=document.querySelector("[data-sp-id]").getAttribute("data-sp-id"),e.fetchHousings(t).then(t=>{e.housingsList.outerHTML=t,e.housingsList=document.querySelector("#housings"),e.init()}).catch(t=>{})):e.programResume?(t=document.querySelector("[data-p-id]").getAttribute("data-p-id"),e.fetchResume(t).then(t=>{e.programResume.outerHTML=t,e.programResume=document.querySelector('[data-l-model="subprograms"]'),e.init()}).catch(t=>{})):e.init()},App.prototype.init=function(){var t=this;t.housingPopin=document.querySelector(".housing-popin-ctn"),t.housingNav=document.querySelector(".housing-nav"),t.housings,t.programInfos=document.getElementById("program-infos"),t.programMap=document.querySelector(".b-map"),t.actions=document.querySelector(".d-actions"),t.filter=document.querySelector(".filter-popin"),t.dialog=document.querySelector(".dialog-alert"),t.filterDispo,t.filterIcons,t.filterTypos,t.scrollTo,t.scrollDec=220,t.sheet=document.querySelector(".housing-sheet-header"),document.body.classList.contains("mob-m-p")&&(t.scrollDec=78),document.body.classList.contains("is-admin")&&(t.scrollDec=295),t.housingsList&&trig.events("#housings"),t.events(),t.initAlias(),t.hash()},App.prototype.events=function(){var s=this;document.querySelector(".btn-sheet").addEventListener("click",function(t){var e=document.querySelector(".d").dataset.spId;analytics.analytic({context:"housing",action:"sheet",programId:e})});var t=document.querySelector(".housing-popin");t&&t.addEventListener(mob.clickType,function(t){t.target.classList.contains("housing-action")&&(t.preventDefault(),document.body.classList.add("dialog-on"))}),document.querySelectorAll("#housings>.housing>.housing-status").forEach(function(t){t.addEventListener("click",function(){t.closest(".housing").querySelector(".a-more").click()})}),document.querySelectorAll("a[data-housing-link]").forEach(function(t){t.addEventListener("click",function(){window.open(t.dataset.housingLink,"_blank").focus()})}),document.querySelectorAll("a[data-action]").forEach(function(o){o.addEventListener(mob.clickType,function(t){t.preventDefault(),t.stopImmediatePropagation();var e=o.getAttribute("data-action");try{s[e](t)}catch(t){console.log(t+" : "+e)}})}),s.dialog&&s.dialog.addEventListener(mob.clickType,function(t){"body,class,has-alert"==t.target.getAttribute("data-tgl")&&document.body.classList.add("dialog-on")}),document.querySelectorAll('a[data-action="wait"]').forEach(function(t){t.addEventListener(mob.clickType,function(t){t.preventDefault(),t.stopImmediatePropagation(),alert("Action en cours de développement")})}),document.querySelectorAll("a").forEach(function(e){e.addEventListener(mob.clickType,function(t){"touchend"==mob.clickType&&t.cancelable&&(t.preventDefault(),t.stopImmediatePropagation(),"#"!==(t=e.getAttribute("href"))&&(window.location=t))})}),window.addEventListener("hashchange",function(){"subprogram"==document.body.getAttribute("data-body-model")&&s.hash()}),window.addEventListener("scroll",function(t){s.onScroll()}),s.housingNav&&s.housingNav.addEventListener(mob.clickType,function(t){var e,o;t.preventDefault(),t.stopImmediatePropagation(),t.target.classList.contains("housing-nav-filter")?s.resetFilter():(e=s.programInfos,o=0,t.target.classList.contains("housing-nav-list")&&(e=s.housingsList),t.target.classList.contains("housing-nav-map")&&(e=s.programMap,o=20),o=e.offsetTop-o,window.scrollTo({top:o-s.scrollDec,behavior:"smooth"}))}),s.filterDispo=document.querySelector(".filter-popin .filter-dispo"),s.filterDispo&&s.filterDispo.addEventListener("click",function(t){s.filterDispo.classList.toggle("active"),s.updateFilter()}),s.filterIcons=document.querySelectorAll(".filter-popin .housing-icons>*"),s.filterIcons.forEach(function(e){e.addEventListener("click",function(t){e.classList.toggle("active"),s.updateFilter()})}),s.filterTypos=document.querySelectorAll(".filter-popin .housing-typos>*"),s.filterTypos.forEach(function(e){e.addEventListener("click",function(t){e.classList.toggle("active"),s.updateFilter()})}),s.housings=document.querySelectorAll(".housings .housing"),s.anchors=document.querySelectorAll(".anchor-a"),s.anchors.forEach(function(t){t.addEventListener(mob.clickType,function(t){t.preventDefault();t=t.target.getAttribute("data-id"),t=document.querySelector("#"+t).offsetTop;window.scrollTo({top:t-s.scrollDec-40,behavior:"smooth"})})});t=document.querySelectorAll(".li-diapo>.li,.l.xl>.li");t&&t.forEach(function(t){t.addEventListener("touchend",function(t){var e=t.currentTarget.closest("[data-slider]");e.classList.contains("touched")||slider.clearLoop(e);t=t.currentTarget.offsetLeft
{t=t.querySelector(o).textContent,e=e.querySelector(o).textContent;return"number"==n&&(t=parseInt(t),e=parseInt(e)),"asc"==i.getAttribute("data-housing-sort")?"number"==n?t-e:t.localeCompare(e):"number"==n?e-t:e.localeCompare(t)}),t.forEach(function(t){s.housingsList.prepend(t)}),s.housingsList.scrollTo(0,0)})}))},App.prototype.onScroll=function(t){var e=this;window.clearTimeout(e.scrollTo),e.scrollTo=window.setTimeout(function(){e.housingNav&&(130
e.housingsList.offsetTop&&e.housingNav.setAttribute("data-active","list"),e.programInfos&&window.scrollY+e.scrollDec+40>e.programInfos.offsetTop&&e.housingNav.setAttribute("data-active","program"))},200)},App.prototype.housingFilter=function(t){document.body.classList.add("filter-on")},App.prototype.updateFilter=function(t){var e=this,i=[],o=!1,s=!1,r=!1,c=!1;e.filterIcons.forEach(function(t){t.classList.contains("active")&&(s=o=!0,i.push(t.getAttribute("class").split(" ")[0]))}),e.filterDispo.classList.contains("active")&&(o=c=!0);var a=[];e.filterTypos.forEach(function(t){t.classList.contains("active")&&(r=o=!0,a.push(t.textContent))}),o?document.body.classList.add("has-filters"):document.body.classList.remove("has-filters"),e.housings.forEach(function(o){var n=!0,e=!0,t=!0;s&&(n=!1,i.forEach(function(e){o.querySelectorAll(".housing-icons>*").forEach(function(t){t.classList.contains(e)&&t.classList.contains("on")&&(n=!0)})})),r&&(e=!1,a.forEach(function(t){o.getAttribute("data-typo")==t&&(e=!0)})),c&&"free"!==o.getAttribute("data-status")&&(t=!1),n&&e&&t?o.classList.add("active"):o.classList.remove("active")}),o||e.housings.forEach(function(t){t.classList.remove("active")}),s||e.filterIcons.forEach(function(t){t.classList.remove("active")}),e.numActiveFilter=document.querySelectorAll(".housings>.housing.active").length,document.querySelector(".filter-num").textContent=e.numActiveFilter,document.querySelector(".filter-footer").setAttribute("data-num",e.numActiveFilter)},App.prototype.closeFilter=function(t){document.body.classList.remove("filter-on"),t.preventDefault(),t.stopImmediatePropagation(),scroll.to("housings"),0==this.numActiveFilter&&this.resetFilter()},App.prototype.resetFilter=function(){this.filter.querySelectorAll(".active").forEach(function(t){t.classList.remove("active")}),document.body.classList.remove("has-filters")},App.prototype.hash=function(){var e=this;if(window.location.hash){document.body.classList.add("has-hash");try{var t=document.querySelector("[data-sp-id]").getAttribute("data-sp-id")}catch(t){}var o=window.location.hash.split("#")[1],n=document.querySelector(".housing-popin-ctn");n&&t&&e.fetchHousing(t,o).then(t=>{n.innerHTML=t,e.updaters=document.querySelectorAll(".housing-popin .housing-updater .left a,.housing-popin .housing-updater button"),e.updaters.forEach(function(t){t.addEventListener("click",function(t){document.body.classList.add("has-loader")})})}).catch(t=>{console.log("ERREUR FETCH HOUSING "+t)})}else document.body.classList.remove("has-hash")},App.prototype.fetchHousings=function(o){return document.body.classList.add("has-loader"),new Promise((e,t)=>{fetch("/a/h/"+o+"/list").then(t=>t.text()).then(t=>{document.body.classList.remove("has-loader"),e(t)}).catch(t=>{console.log("err : "+t)})})},App.prototype.fetchResume=function(o){return new Promise((e,t)=>{fetch("/a/h/"+o+"/resume").then(t=>t.text()).then(t=>{e(t)}).catch(t=>{console.log("err : "+t)})})},App.prototype.fetchHousing=function(o,n){return document.body.classList.add("has-loader"),new Promise((e,t)=>{fetch("/a/h/"+o+"/"+n).then(t=>t.text()).then(t=>{e(t),document.body.classList.remove("has-loader")}).catch(t=>{console.log("err : "+t)})})},App.prototype.removeHash=function(){var t,e=window.location.toString();e.includes("#")&&(t=e.split("#")[0],e=e.split("#")[1],e=document.getElementById("h-"+e),window.history.replaceState({},document.title,t),document.body.classList.remove("has-hash"),e=e.offsetTop,window.scrollTo({top:e-this.scrollDec,behavior:"smooth"}))},App.prototype.onSliderUpdate=function(t){if(t.classList.contains("zoom")&&(o=document.querySelector(".l.zoom").getAttribute("data-slider-current"),n=document.querySelector(".l.zoom").getAttribute("data-slider-num"),document.querySelector(".diapo-increm").textContent=o,document.querySelector(".diapo-max").textContent=n),t.classList.contains("li-diapo")||t.classList.contains("xl")){var e=t.getAttribute("data-slider-current"),o=t.parentNode,n=o.parentNode;const s=Array.prototype.slice.call(n.childNodes);var o=s.indexOf(o),i=t.querySelector(".li:nth-child("+e+")").offsetLeft,o=100*o;window.setTimeout(function(){t.scrollTo({left:i,behavior:"smooth"})},o)}},App.prototype.user=function(){},App.prototype.initAlias=function(){var s=this;window.setTimeout(function(){if(console.log("init alias"),s.alias=document.querySelector(".alias"),console.log("ALIAS = "+s.alias),s.alias){try{var t=document.querySelector(".li-plaquette").cloneNode(!0);s.alias.append(t)}catch(t){}try{var e=document.querySelector('.li[data-kit-type*="Contrat"]').cloneNode(!0);s.alias.append(e)}catch(t){}try{var o=document.querySelector('.li[data-kit-type*="masse"]').cloneNode(!0);s.alias.append(o)}catch(t){}try{var n=document.querySelector('.li[data-kit-type*="vente"]').cloneNode(!0);s.alias.append(n)}catch(t){}try{var i=document.querySelector('.li[data-kit-type*="parkings"]').cloneNode(!0);s.alias.append(i)}catch(t){}}},1e3)};var app=new App;