1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[690],{4112:function(e,t,o){var n=o(5893),r=o(7294),s=o(3967),a=o.n(s),i=o(6536),l=o(2356),c=o(1803);let m=e=>e.replace(/(<([^>]+)>)/gi,"").toString().toLowerCase().normalize("NFD").trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-");t.Z=e=>{let{Tag:t="div",className:o="",children:s,offset:d=0,freeMode:u}=e,p=r.useRef(),{lang:h,cmsMode:_,path:v}=(0,l.W9)(),[f,g]=r.useState(),j=f?Object.keys(f):[],x=u?"data-tags":"data-anchor",b=r.useCallback(e=>{e.forEach(e=>{if(!e)return;let t=e.getAttribute(x);if(!t||t.includes("contain")||t.includes("noheight"))return;Array.from(e.querySelectorAll(".scroller__section-anchor")).forEach(e=>e.remove());let o=document.createElement("div");o.className="scroller__section-anchor";let n=u?t:(0,c.yw)(h,t),r=m(n);o.setAttribute("id",r),e.appendChild(o),g(e=>({...e,[r]:{title:n}}))}),document.documentElement.style.setProperty("scroll-behavior","smooth")},[u,h,x]),N=r.useCallback(e=>{e.forEach(e=>{Array.from(e.querySelectorAll(".scroller__section-anchor")).forEach(e=>e.remove())}),document.documentElement.style.removeProperty("scroll-behavior"),window.location.href.substring(0,window.location.href.indexOf("#")),g(void 0)},[]);r.useEffect(()=>{if(p.current){let e=Array.from(p.current.querySelectorAll("[".concat(x,"]")));return b(e),()=>N(e)}},[_,b,N,x,h,v]);let w=e=>t=>{t.preventDefault(),document.getElementById(e).scrollIntoView({behavior:"smooth",block:"start",inline:"center"})},y=a()("scroller",{[o]:o});return(0,n.jsxs)(t,{ref:p,className:y,children:[(0,n.jsx)("div",{className:"scroller__menu",children:(0,n.jsx)(i.Z,{items:j,componentTag:"nav",className:"scroller__menu-inner",currentClassName:"scroller__item--current",onUpdate:e=>{e&&(window.requestAnimationFrame(()=>{let e=document.querySelector(".scroller__item--current");e&&e.parentElement.scrollTo({left:e.offsetLeft-75,behavior:"smooth"})}),window.history.replaceState("",document.title,void 0===e?window.location.href.substr(0,window.location.href.indexOf("#")):"#".concat(e.id)))},offset:d,children:j.map(e=>{let t=f[e];if(!t)return null;let{title:o}=t;return(0,n.jsx)("a",{className:"scroller__item",href:"#".concat(e),onClick:w(e),dangerouslySetInnerHTML:{__html:o}},e)})},j.length)}),s]})}},7690:function(e,t,o){o.r(t),o.d(t,{default:function(){return D},getProps:function(){return E}});var n=o(5893),r=o(7294),s=o(4428),a=o(2356),i=o(1505),l=o(4112),c=o(4559),m=o(3134),d=o(5675),u=o.n(d),p=o(6124),h=o(9669),_=o(7019),v=o(3534),f=o(7079),g=o(1803);function j(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,[n,r]=t.split("-"),s=Number(n),a=Number(r)+o,i=(a>12?1:a<1?12:a).toString().padStart(2,"0");return new Date("".concat(a>12?s+1:a<1?s-1:s,"-").concat(i,"-01")).toLocaleString(e,{month:"long",year:"numeric"})}var x=o(6921),b=o(8579);function N(e){var t,o,s;let{promotions:i={},loading:l,onPromotionClick:c,children:m,withHeader:d}=e,{lang:N,config:y}=(0,a.W9)(),{seasonInterval:Z}=y,{userStayDates:k,setUserStay:S,setPax:C}=(0,p.A)(),{merchant:A={},promotions:E=[]}=i,D=E.length?Object.keys(s=E.reduce((e,t)=>{let{startDate:o,endDate:n,price:r,publicPrice:s}=t,a=Math.round((1-r/s)*100),i="".concat(o,"-").concat(n);if(!e[i])return{...e,[i]:{...t,percentage:a}};let{percentage:l}=e[i];return a>l?{...e,[i]:{...t,percentage:a}}:e},{})).reduce((e,t)=>{let{startDate:o,endDate:n}=s[t],r=new Date(n).getFullYear(),a=new Date(o).getMonth()+1,i="".concat(r,"-").concat(a);return e[i]?{...e,[i]:[...e[i],s[t]]}:{...e,[i]:[s[t]]}},{}):{},F=Object.keys(D),[P,L]=r.useState(null),[M,O]=r.useState(0),z=F[M],q=F[M-1],I=F[M+1],T=D[z],W=r.useCallback(()=>{let{start:e,end:t}=Z,[o]=k;return x._b(new Date(o),e,t)?0:1},[Z,k]),B=e=>{O(t=>t+e)},R=!E.length;return(r.useEffect(()=>{!R&&d&&(async()=>{let e=W();L(await b.sU(A.slug,A.resort,e,N))})()},[W,R,N,null==A?void 0:A.resort,null==A?void 0:A.slug,d]),!l&&R)?null:(0,n.jsx)("div",{className:"promotions","data-anchor":m?void 0:"lodging-promotions",children:(0,n.jsxs)("div",{className:"promotions__inner",children:[d&&P&&(0,n.jsxs)("div",{className:"promotions__top-header",children:[(0,n.jsx)("div",{className:"promotions__top-title",children:P.title}),(0,n.jsx)("div",{className:"promotions__top-stars",children:[...Array(P.stars)].map((e,t)=>(0,n.jsx)(_.Star,{className:"promotions__top-star"},t))}),(null==P?void 0:null===(t=P.images[0])||void 0===t?void 0:t.src)&&(0,n.jsx)(u(),{className:"promotions__top-image",src:null===(o=P.images[0])||void 0===o?void 0:o.src,width:300,height:200,alt:"",unoptimized:!0})]}),(0,n.jsxs)("div",{className:"promotions__header",children:[(0,n.jsxs)(h.Z,{type:"button",className:"promotions__back-button",variant:"transparent",onClick:()=>B(-1),disabled:!q,children:[(0,n.jsx)(_.ArrowLeft,{}),j(N,z,-1)]}),(0,n.jsxs)("div",{className:"promotions__title",children:[!d&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.ZP,{id:"lodging-promotions-short"})," -"," "]}),(0,n.jsx)("span",{className:"promotions__title-month",children:j(N,z)})]}),(0,n.jsxs)(h.Z,{type:"button",className:"promotions__back-button",variant:"transparent",onClick:()=>B(1),disabled:!I,children:[j(N,z,1),(0,n.jsx)(_.ArrowRight,{})]})]}),(0,n.jsxs)("div",{className:"promotions__items",children:[T.map((e,t)=>{let{iresaRoomId:o,startDate:r,endDate:s,price:a,publicPrice:i}=e;return(0,n.jsxs)("div",{className:"promotions__promotion",children:[(0,n.jsxs)("div",{className:"promotions__promotion-info",children:[(0,n.jsxs)("div",{className:"promotions__promotion-dates",children:[(0,n.jsx)(g.ZP,{id:"from-date"})," ",w(r)," ",(0,n.jsx)(g.ZP,{id:"to-date"})," ",w(s)]}),(0,n.jsxs)("div",{className:"promotions__promotion-percentage",children:["-",Math.round((1-a/i)*100),"%"]})]}),(0,n.jsxs)("div",{className:"promotions__promotion-price-wrapper",children:[(0,n.jsxs)("div",{className:"promotions__promotion-public-price",children:[i,"â¬"]}),(0,n.jsxs)("div",{className:"promotions__promotion-price",children:[Number(a).toFixed(2),"â¬"]}),(0,n.jsx)(f.Z,{content:(0,g.yw)(N,"price-from-for-two-people"),children:(0,n.jsxs)(h.Z,{className:"promotions__promotion-button",onClick:()=>{let e={from:r,to:s};S(e),C({adults:2,children:0,agesChildren:[]}),"function"==typeof c&&c(A.slug,e)},children:[(0,n.jsx)(g.ZP,{id:"lodging-show"})," ",(0,n.jsx)(_.ShoppingCart,{})]})})]})]},"".concat(o,"-").concat(t))}),l&&[void 0,void 0,void 0,void 0].map((e,t)=>(0,n.jsx)(v.Z,{variant:"overlay",className:"promotions__loader"},t))]})]})})}function w(e){return new Date(e).toLocaleDateString("fr-FR",{month:"numeric",day:"numeric"})}var y=o(2360);function Z(e){let{destination:t}=e,{facet:o}=(0,p.A)(),{lang:i}=(0,a.W9)(),[l,c]=r.useState([]);r.useEffect(()=>{(async()=>{let e=(await b.cO(t.resort)).filter(e=>"LBM"===e.gateway);c(await Promise.all(e.map(async e=>{let o=await b.uK({merchant:e.merchant,start:m.cQ.formatDate(new Date),numberDays:360});return{...o,merchant:{...o.merchant,resort:t.resort,slug:e.slug}}})))})()},[o,i,t.resort]);let d=l.some(e=>{var t;return(null==e?void 0:null===(t=e.promotions)||void 0===t?void 0:t.length)>0});return(0,n.jsxs)(n.Fragment,{children:[d&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.Z,{id:"all-promotion-before-".concat(t.resort),className:"resort-promotions__zone gs-container",tooltip:"Zone d'\xe9dition : Contenu ".concat(t.label)}),(0,n.jsx)("div",{className:"resort-promotions__label",children:t.label}),(0,n.jsx)(s.Z,{id:"all-promotion-after-".concat(t.resort),className:"resort-promotions__zone gs-container",tooltip:"Zone d'\xe9dition : Contenu ".concat(t.label)})]}),l.map((e,o)=>(0,n.jsx)(k,{promotions:e,destination:t},o))]})}function k(e){let{promotions:t,destination:o}=e,{userStayDates:s}=(0,p.A)(),{lang:i,config:l}=(0,a.W9)(),{seasonInterval:c}=l,{lodgingsUrls:m}=o,[d,u]=r.useState(4),h=()=>{let{start:e,end:t}=c,[o]=s;return x._b(new Date(o),e,t)?"winter":"summer"};return(0,n.jsx)(N,{promotions:t,visibleNumber:d,setVisibleNumber:u,onPromotionClick:(e,t)=>
1{let o=h(),n={from:t.from,to:t.to,pax:{adults:2,children:0,agesChildren:[]}},r=y.J_(n),s="".concat(m[o][i],"/").concat(e).concat(r,"#disponibilites");window.open(s,"_blank")},withHeader:!0})}var S=o(4967);function C(){return(0,n.jsx)("div",{className:"all-promotions",children:S.B.map(e=>(0,n.jsx)(Z,{destination:e},e.resort))})}var A=o(1171);async function E(e){let{ubloApi:t,site:o,lang:n}=e,[r,s]=await Promise.all([A.Ti(t,o,n),A.gg(t,o,n)]);return{navigation:r,shortcuts:s}}var D=e=>{let{navigation:t,shortcuts:o}=e,{lang:r,config:m,menuPath:d}=(0,a.W9)(),{channel:u,integration:p}=m,h="/hebergements"===d.menu,_="/cse-et-collectivites"===d.menu,v="/montagne-hiver/carte-blanche"===d.menu;return(0,n.jsx)(i.Z,{pageName:"page-avec-ancres",navigation:t,shortcuts:o,children:(0,n.jsx)("main",{className:"main",children:(0,n.jsxs)(l.Z,{className:"anchor-content",offset:-70,freeMode:!0,children:[(0,n.jsx)(s.Z,{id:"content",className:"main__zone gs-container",tooltip:"Zone d'\xe9dition : Mises en avant \xe0 placer sur 12 colonnes",tagsLabel:"Intitul\xe9 de navigation"}),h&&(0,n.jsx)(C,{}),(0,n.jsx)(s.Z,{id:"bottom-content",className:"main__zone gs-container",tooltip:"Zone d'\xe9dition : Mises en avant \xe0 placer sur 12 colonnes",tagsLabel:"Intitul\xe9 de navigation"}),(_||v)&&(0,n.jsx)("div",{id:"formulaire",className:"main__contact-form",children:(0,n.jsx)(c.Z,{host:p?"https://admin-integration.mon-sejour-en-montagne.com":"https://admin.mon-sejour-en-montagne.com",lang:r,channel:u,subject:_?5600:5601,hiddenFields:["country","stayFrom","stayTo"],hideOptionalStayFields:!0})})]})})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.