@20minutes/hela 2.9.21 → 2.9.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,7 +101,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), Tt = typeof window < "u"
101
101
  h.childElementCount > 0 && h.classList.remove("u-hidden");
102
102
  });
103
103
  }, Zt = () => {
104
- const s = document.querySelector("header"), t = document.querySelector(".js-limit-scroll-close-article-btn"), e = document.querySelector(".js-close-article-btn"), i = document.querySelector(".c-header-mobile"), n = i instanceof HTMLElement ? i.offsetHeight : 0;
104
+ const s = document.querySelector(".js-content-header"), t = document.querySelector(".js-limit-scroll-close-article-btn"), e = document.querySelector(".js-close-article-btn"), i = document.querySelector(".c-header-mobile"), n = i instanceof HTMLElement ? i.offsetHeight : 0;
105
105
  if (s && t && e) {
106
106
  const o = new IntersectionObserver(
107
107
  () => {
@@ -1,4 +1,4 @@
1
- (function(b,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(b=typeof globalThis<"u"?globalThis:b||self,w(b.scripts={}))})(this,function(b){"use strict";var Gi=Object.defineProperty;var Ui=(b,w,z)=>w in b?Gi(b,w,{enumerable:!0,configurable:!0,writable:!0,value:z}):b[w]=z;var W=(b,w,z)=>Ui(b,typeof w!="symbol"?w+"":w,z);const w=()=>/Android/i.test(navigator.userAgent),z=typeof window<"u"&&navigator.userAgent.toLowerCase().includes("firefox"),Tt=()=>{const s=document.getElementById("js-download-band");s&&w()&&s.setAttribute("href","https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome")},zt=()=>{const s=document.querySelector("#js-election-selector");s&&s.addEventListener("change",t=>{window.location.replace(t.target.value)})},Ot=()=>{const s=document.querySelector(".c-search-banner");if(s){const t=document.querySelector("#js-search-banner-to-hide"),e=s.querySelector("#js-search-banner-dropdown-btn");e==null||e.addEventListener("click",()=>{const i=e.querySelector("svg"),n=i==null?void 0:i.querySelector("use");switch(n==null?void 0:n.getAttribute("xlink:href")){case"#chevron-up":n==null||n.setAttribute("xlink:href","#chevron-down"),t==null||t.classList.add("u-hidden");break;case"#chevron-down":n==null||n.setAttribute("xlink:href","#chevron-up"),t==null||t.classList.remove("u-hidden");break}})}},Dt=[{text:"Paris",_index:"town_1717424751904",_id:"75056",_score:1,_source:{output:"Paris (75000)",url:"/elections/resultats/paris/paris-75000"}},{text:"Paris 10ème Arrondissement",_index:"town_1717424751904",_id:"75056AR10",_score:1,_source:{output:"Paris 10ème Arrondissement (75010)",url:"/elections/resultats/paris/paris-75010"}},{text:"Paris 11ème Arrondissement",_index:"town_1717424751904",_id:"75056AR11",_score:1,_source:{output:"Paris 11ème Arrondissement (75011)",url:"/elections/resultats/paris/paris-75011"}}],Mt=(s,t,e,i,n,o)=>{const r=document.getElementById(s);if(!r)return;const a=r.dataset.storybook,l=r.querySelector(`#${s}-search`),c=l==null?void 0:l.getAttribute("data-api-url"),h=r.querySelector(".c-autocomplete__menu");if(!l||!h||!c)return;const d=r.querySelector(".c-autocomplete__input-spinner"),u=l.getAttribute("data-trigger-message"),m=async P=>{try{let y;return a&&t.includes("20minutes.fr")?y=Dt:y=await(await fetch(`${c}${e}${encodeURIComponent(P)}`)).json(),o?y[o]:y}catch(y){return console.error("Error fetching autocomplete results:",y),[]}},p=(P,y)=>{const x=document.createElement("li");x.id=`/${P}`,x.textContent=y,x.addEventListener("click",()=>{l instanceof HTMLInputElement&&(l.value=y,h.classList.add("u-hidden"))}),h.appendChild(x)},g=()=>{d==null||d.classList.toggle("u-hidden")},v=()=>{const P=document.createElement("li");P.textContent=u,h.appendChild(P)},A=async P=>{g(),h.classList.remove("u-hidden");const y=await m(P);h.innerHTML="",y.length===0&&h.classList.add("u-hidden"),y.forEach(x=>{p(x[i],x[n])}),g()},I=P=>{if(!(P.target instanceof HTMLInputElement))return;const y=P.target.value;h.classList.remove("u-hidden"),y.length>=3?A(y):(h.innerHTML="",v())};l.addEventListener("input",I),l.addEventListener("focusout",()=>{setTimeout(()=>h.classList.add("u-hidden"),300)}),l.addEventListener("focusin",()=>{h.childElementCount>0&&h.classList.remove("u-hidden")})},$t=()=>{const s=document.querySelector("header"),t=document.querySelector(".js-limit-scroll-close-article-btn"),e=document.querySelector(".js-close-article-btn"),i=document.querySelector(".c-header-mobile"),n=i instanceof HTMLElement?i.offsetHeight:0;if(s&&t&&e){const o=new IntersectionObserver(()=>{const r=e.classList,a=r.contains("u-hidden"),l=s.getBoundingClientRect().bottom-n,c=t.getBoundingClientRect().bottom-n;a&&l<=0&&c>=0&&r.remove("u-hidden"),!a&&(l>=0||c<=0)&&r.add("u-hidden")},{root:document,rootMargin:`-${n}px 0px 0px 0px`});o.observe(s),o.observe(t)}},Zt=s=>{s.stopImmediatePropagation(),s.preventDefault();const t=s.currentTarget;if(t instanceof HTMLButtonElement){const e=t.parentElement,i=e==null?void 0:e.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),i==null||i.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),i==null||i.setAttribute("aria-hidden","false"))}},Rt=(s=document.querySelector(".js-collapse__button"))=>{s&&document.querySelectorAll(".c-collapse__button").forEach(e=>{e.addEventListener("click",i=>{Zt(i)})})},Ft=(s,t)=>{const e=document.querySelector(`#${t}`);if(e){const i=e.querySelector(".js-countdown-days"),n=e.querySelector(".js-countdown-hours"),o=e.querySelector(".js-countdown-minutes"),r=e.querySelector(".js-countdown-seconds");if(!i||!n||!o||!r)return;window.counters={paralympicsGames:"2024-08-28 20:00:00"};const a=window.counters[s],l=new Date(a).getTime(),c=setInterval(()=>{const h=new Date().getTime(),d=l-h;if(d<=0)clearInterval(c);else{const u=Math.floor(d/864e5),m=Math.floor(d%(1e3*60*60*24)/(1e3*60*60)),p=Math.floor(d%(1e3*60*60)/(1e3*60)),g=Math.floor(d%(1e3*60)/1e3);i.innerHTML=u.toString(),n.innerHTML=m.toString(),o.innerHTML=p.toString(),r.innerHTML=g.toString()}},1e3)}},kt=s=>{const t=s.getBBox(),e=t.width/20;return[t.x-e,t.y-e,t.width+e*2,t.height+e*2].join(" ")},qt=()=>{const s=document.querySelector(".c-map-districts-container"),t=document.querySelector(".c-map-districts");if(!s||!t)return;const e=document.querySelector(".c-map-districts-container__description"),i=document.querySelector(".c-map-districts-container__department"),n=document.querySelector(".c-map-districts-container__unzoom-button");let o=t;const r=t.getAttribute("viewBox"),a=(p,g)=>{var v;return(v=p.matches)==null?void 0:v.call(p,g)},l=(p,g,v=".c-map-districts__zoomable:not(.js-selected-area)")=>{if(!p)return;let A,I=p.parentElement;for(;I instanceof SVGGraphicsElement&&I!==g;)a(I,v)&&(A=I),I=I.parentElement;return A},c=(p,g,v)=>{if(!p)return;let A=p.parentElement;for(;A instanceof SVGGraphicsElement&&A!==v;){if(g===A)return!0;A=A.parentElement}return v===g},h=(p,g)=>{if(g&&n&&e){s.classList.remove("c-map-districts-container--department-view"),e.classList.remove("u-hidden"),i==null||i.classList.add("u-hidden"),n.classList.add("u-hidden"),g!==r&&(e.classList.add("u-hidden"),n.classList.remove("u-hidden")),o.classList.remove("js-selected-area"),o=p;const v=o.getAttribute("data-info");i&&v&&(s.classList.add("c-map-districts-container--department-view"),i.classList.remove("u-hidden"),i.innerHTML=v),o.classList.add("js-selected-area"),t.setAttribute("viewBox",g)}},d=p=>{p.stopPropagation();const g=p.currentTarget;if(o&&t&&g instanceof SVGGraphicsElement){if(g===o)return;if(p.preventDefault(),o!==t&&!c(g,o,t)){h(t,r);return}const v=l(g,o);h(v||g,kt(v||g))}},u=()=>{t&&o!==t&&h(t,r)};t.addEventListener("click",u),n&&n.addEventListener("click",u),document.querySelectorAll(".c-map-districts__zoomable").forEach(p=>{p.addEventListener("click",g=>d(g))})},Nt=()=>{const s=document.getElementById("elections-form-search"),t=document.querySelector(".c-search-form__autocomplete");if(!s||!t)return;const e=o=>{t.classList.remove("u-hidden");const r=t.querySelectorAll("li"),a=[];return r.forEach(l=>{const c=l.querySelector("a");c&&c.innerHTML.toLowerCase().includes(o.toLowerCase())&&a.push(l.innerHTML)}),a},i=o=>{t.innerHTML+=`<li>${o}</li>`},n=({target:o})=>{if(!(o instanceof HTMLInputElement))return;const r=o.value;if(t.classList.add("u-hidden"),r.length>=3){const a=e(r);t.innerHTML="",a.length===0&&t.classList.add("u-hidden"),a.forEach(l=>{i(l)})}};s.addEventListener("input",n),s.addEventListener("focusout",()=>{setTimeout(()=>t.classList.add("u-hidden"),300)}),s.addEventListener("focusin",()=>{t.childElementCount>0&&t.classList.remove("u-hidden")})},Ht=(s,t)=>{var n;s.setAttribute("aria-expanded","true");const e=(n=s.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");e==null||e.forEach(o=>o.classList.remove(t));const i=s.querySelector(".js-ellipsis-button__label");i instanceof HTMLSpanElement&&(i.innerHTML="Voir moins")},Bt=(s,t)=>{var n;const e=(n=s.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");e==null||e.forEach(o=>o.classList.add(t)),s.setAttribute("aria-expanded","false");const i=s.querySelector(".js-ellipsis-button__label");i instanceof HTMLSpanElement&&(i.innerHTML="Voir plus")},Wt=(s,t)=>{const e=s.currentTarget;if(s.preventDefault(),e instanceof HTMLButtonElement){const i=t?"u-ellipsis-multiline":"u-ellipsis";return e.getAttribute("aria-expanded")==="true"?Bt(e,i):Ht(e,i)}return null},Vt=(s=document.querySelector(".js-ellipsis-button"))=>{s&&document.querySelectorAll(".js-ellipsis-button").forEach(e=>{const i=e.getAttribute("data-multiple")==="true";e.addEventListener("click",n=>Wt(n,i))})},jt=s=>{var i;s.setAttribute("aria-expanded","true");const t=(i=s.parentNode)==null?void 0:i.querySelectorAll(".js-expand-target");t==null||t.forEach(n=>n.setAttribute("aria-hidden","false"));const e=s.querySelector(".js-expand-button__label");e instanceof HTMLSpanElement&&(e.innerHTML="Voir moins")},Gt=s=>{var i;const t=(i=s.parentNode)==null?void 0:i.querySelectorAll(".js-expand-target");t==null||t.forEach(n=>n.setAttribute("aria-hidden","true")),s.setAttribute("aria-expanded","false");const e=s.querySelector(".js-expand-button__label");e instanceof HTMLSpanElement&&(e.innerHTML="Voir plus")},Ut=s=>{const t=s.currentTarget;return s.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?Gt(t):jt(t):null},Kt=(s=document.querySelector(".js-expand-button"))=>{s&&document.querySelectorAll(".js-expand-button").forEach(e=>e.addEventListener("click",Ut))},Xt=()=>{const s=document.querySelector(".js-game-alert");z&&s&&s.classList.remove("u-hidden")},Yt=()=>{const s=document.querySelectorAll(".js-half-donut-result");for(const t of Array.from(s)){const e=t.querySelector(".c-half-donut"),i=t.querySelector(".c-legend");if(!e||!i)return;i.querySelectorAll("[data-color]").forEach(n=>{const o=n.getAttribute("data-color"),r=e.querySelector(`.c-half-donut__zone--${o}`);r==null||r.addEventListener("mouseenter",()=>{n.classList.add("c-legend__item--is-hovered"),e.classList.add("c-half-donut--is-hovered"),i.classList.add("c-legend--is-hovered")}),r==null||r.addEventListener("mouseleave",()=>{n.classList.remove("c-legend__item--is-hovered"),e.classList.remove("c-half-donut--is-hovered"),i.classList.remove("c-legend--is-hovered")}),n.addEventListener("mouseenter",()=>{r==null||r.classList.add("c-half-donut__zone--is-hovered"),i.classList.add("c-legend--is-hovered"),e.classList.add("c-half-donut--is-hovered")}),n.addEventListener("mouseleave",()=>{r==null||r.classList.remove("c-half-donut__zone--is-hovered"),i.classList.remove("c-legend--is-hovered"),e.classList.remove("c-half-donut--is-hovered")})})}},Qt=()=>{const s=document.querySelector(".c-image-slider__container");if(!s)return;const t=document.querySelectorAll(".c-image-slider__slide"),e=document.querySelector(".c-image-slider__button-container--previous"),i=document.querySelector(".c-image-slider__button-container--next"),n=document.querySelectorAll(".c-image-slider__indicator");let o=0;const r=()=>{n.forEach((u,m)=>{u.classList.toggle("c-image-slider__indicator--is-active",m===o)})},a=(u=!0)=>{if(!(s instanceof HTMLElement))return;s.style.transition=u?"transform 0.3s ease":"none";const m=-o*100;s.style.transform=`translateX(${m}%)`,r()},l=u=>{o=u,a(!0)};e==null||e.addEventListener("click",()=>{const u=(o-1+t.length)%t.length;l(u)}),i==null||i.addEventListener("click",()=>{const u=(o+1)%t.length;l(u)}),n.forEach((u,m)=>{u.addEventListener("click",()=>{l(m)})});let c=0,h=0,d=!1;s.addEventListener("touchstart",u=>{s instanceof HTMLElement&&(c=u.touches[0].clientX,h=c,d=!0,s.style.transition="none")}),s.addEventListener("touchmove",u=>{if(!(s instanceof HTMLElement))return;h=u.touches[0].clientX;const m=h-c,p=-o*window.innerWidth+m;s.style.transform=`translateX(${p}px)`}),s.addEventListener("touchend",()=>{if(!d)return;d=!1;const u=h-c;Math.abs(u)>75&&(u<0?o=Math.min(o+1,t.length-1):u>0&&(o=Math.max(o-1,0))),a(!0)}),a(!0)},f={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var Jt=[`a[href]${f.inert}${f.negTabIndex}`,`area[href]${f.inert}${f.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${f.inert}${f.negTabIndex}${f.disabled}`,`input[type="radio"]${f.inert}${f.negTabIndex}${f.disabled}`,`select${f.inert}${f.negTabIndex}${f.disabled}`,`textarea${f.inert}${f.negTabIndex}${f.disabled}`,`button${f.inert}${f.negTabIndex}${f.disabled}`,`details${f.inert} > summary:first-of-type${f.negTabIndex}`,`iframe${f.inert}${f.negTabIndex}`,`audio[controls]${f.inert}${f.negTabIndex}`,`video[controls]${f.inert}${f.negTabIndex}`,`[contenteditable]${f.inert}${f.negTabIndex}`,`[tabindex]${f.inert}${f.negTabIndex}`];function et(s){(s.querySelector("[autofocus]")||s).focus()}function te(s){const t=D(s,!0),e=t?D(s,!1)||t:null;return[t,e]}function D(s,t){if(t&&nt(s))return s;if(ie(s))if(s.shadowRoot){let e=it(s.shadowRoot,t);for(;e;){const i=D(e,t);if(i)return i;e=st(e,t)}}else if(s.localName==="slot"){const e=s.assignedElements({flatten:!0});t||e.reverse();for(const i of e){const n=D(i,t);if(n)return n}}else{let e=it(s,t);for(;e;){const i=D(e,t);if(i)return i;e=st(e,t)}}return!t&&nt(s)?s:null}function it(s,t){return t?s.firstElementChild:s.lastElementChild}function st(s,t){return t?s.nextElementSibling:s.previousElementSibling}const ee=s=>s.matches("details:not([open]) *")&&!s.matches("details>summary:first-of-type")?!0:!(s.offsetWidth||s.offsetHeight||s.getClientRects().length),nt=s=>{var t;return(t=s.shadowRoot)!=null&&t.delegatesFocus?!1:s.matches(Jt.join(","))&&!ee(s)};function ie(s){return s.shadowRoot&&s.getAttribute("tabindex")==="-1"?!1:!s.matches(":disabled,[hidden],[inert]")}function M(s=document){const t=s.activeElement;return t?t.shadowRoot?M(t.shadowRoot)||document.activeElement:t:null}function se(s,t){const[e,i]=te(s);if(!e)return t.preventDefault();const n=M();t.shiftKey&&n===e?(i.focus(),t.preventDefault()):!t.shiftKey&&n===i&&(e.focus(),t.preventDefault())}function O(s,t){function e(i){if(!i||i===document||i===window)return null;const n=ot(i);return n&&(i=n),i.closest(s)||e(i.getRootNode().host)}return e(t)}function ot(s){return s.assignedSlot||(s.parentNode?ot(s.parentNode):null)}const $="data-a11y-dialog";class rt{constructor(t){W(this,"$el");W(this,"id");W(this,"previouslyFocused");W(this,"shown");this.$el=t,this.id=this.$el.getAttribute($)||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.fire("destroy").defaultPrevented?this:(this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0)),this)}show(t){var i;return this.shown?this:this.fire("show",t).defaultPrevented?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=M(),((i=this.previouslyFocused)==null?void 0:i.tagName)==="BODY"&&(t!=null&&t.target)&&(this.previouslyFocused=t.target),(t==null?void 0:t.type)==="focus"?this.maintainFocus():et(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this)}hide(t){var i,n;return this.shown?this.fire("hide",t).defaultPrevented?this:(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(n=(i=this.previouslyFocused)==null?void 0:i.focus)==null||n.call(i),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0),this):this}on(t,e,i){return this.$el.addEventListener(t,e,i),this}off(t,e,i){return this.$el.removeEventListener(t,e,i),this}fire(t,e){const i=new CustomEvent(t,{detail:e,cancelable:!0});return this.$el.dispatchEvent(i),i}handleTriggerClicks(t){const e=t.composedPath()[0],i=O(`[${$}-show="${this.id}"]`,e),n=O(`[${$}-hide="${this.id}"]`,e),o=O(`[${$}-hide]`,e)&&O('[aria-modal="true"]',e)===this.$el;i&&this.show(t),(n||o)&&this.hide(t)}bindKeypress(t){if(O('[aria-modal="true"]',M())!==this.$el)return;let e=!1;try{e=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}t.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!e&&(t.preventDefault(),this.hide(t)),t.key==="Tab"&&se(this.$el,t)}maintainFocus(){const t=M();O(`[aria-modal="true"], [${$}-ignore-focus-trap]`,t)||et(this.$el)}}function at(){for(const s of document.querySelectorAll("[data-a11y-dialog]"))new rt(s)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",at):at());const ne=()=>document.querySelectorAll(".js-modal").forEach(s=>{if(!(s instanceof HTMLElement))return;const t=new rt(s);if(s.id==="dialog-menu"){const e=document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"),i=document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");e.length>0&&i.length>0&&(t.on("show",()=>{e.forEach(n=>n.classList.add("u-hidden")),i.forEach(n=>n.classList.remove("u-hidden"))}),t.on("hide",()=>{e.forEach(n=>n.classList.remove("u-hidden")),i.forEach(n=>n.classList.add("u-hidden"))}))}t.on("show",()=>{document.body.classList.add("noscroll")}).on("hide",()=>{document.body.classList.remove("noscroll")})}),Z="68px",U=({navigatedList:s,nextBtn:t,prevBtn:e})=>{t.classList.contains("o-nav-button--visible")&&!e.classList.contains("o-nav-button--visible")&&(s.style.width=`calc(100% - ${Z})`,s.style.position="",s.style.right=""),e.classList.contains("o-nav-button--visible")&&(s.style.position="absolute",t.classList.contains("o-nav-button--visible")&&(s.style.width=`calc(100% - ${Z} * 2)`,s.style.right=Z),t.classList.contains("o-nav-button--visible")||(s.style.width=`calc(100% - ${Z})`,s.style.right="0")),!t.classList.contains("o-nav-button--visible")&&!e.classList.contains("o-nav-button--visible")&&(s.style.width="",s.style.position="",s.style.right="")},oe=({navigatedList:s,nextBtn:t,prevBtn:e})=>{var o,r,a,l,c,h,d,u;const i=s.scrollLeft>0,n=s.scrollLeft+(s.clientWidth+.5)<s.scrollWidth;i&&n?((o=t.classList)==null||o.add("o-nav-button--visible"),(r=e.classList)==null||r.add("o-nav-button--visible")):i?((a=t.classList)==null||a.remove("o-nav-button--visible"),(l=e.classList)==null||l.add("o-nav-button--visible")):n?((c=t.classList)==null||c.add("o-nav-button--visible"),(h=e.classList)==null||h.remove("o-nav-button--visible")):((d=t.classList)==null||d.remove("o-nav-button--visible"),(u=e.classList)==null||u.remove("o-nav-button--visible")),t.classList.contains("c-slider__button-container--has-space-around")&&e.classList.contains("c-slider__button-container--has-space-around")&&U({navigatedList:s,nextBtn:t,prevBtn:e})},re=({navigatedList:s,nextBtn:t,prevBtn:e,sliderVariant:i})=>{if(s){const n=s.closest(".js-overview-bar-container"),o=n==null?void 0:n.querySelector(".c-stepper"),r=o==null?void 0:o.querySelectorAll(".c-stepper__item");if(r){const a=Array.from(r).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(a<0)r[0].classList.add("c-stepper__item--loading");else{r[a].classList.remove("c-stepper__item--loading"),r[a].classList.add("c-stepper__item--loaded");const l=r[a].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),a+1<r.length&&r[a+1].classList.add("c-stepper__item--loading")}}if(s.scrollWidth-s.clientWidth>s.clientWidth){let a=s.scrollLeft;switch(i){case"three-columns-articles":a+=s.clientWidth+32;break;case"rubrics":a+=s.clientWidth-36;break;default:a+=Math.ceil(s.clientWidth*.6);break}s.scrollTo({left:a,behavior:"smooth"}),e.classList.add("o-nav-button--visible"),a+s.clientWidth>=s.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const a=s.scrollWidth-s.clientWidth;s.scrollTo({left:a,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),e.classList.add("o-nav-button--visible")}t.classList.contains("c-slider__button-container--has-space-around")&&e.classList.contains("c-slider__button-container--has-space-around")&&U({navigatedList:s,nextBtn:t,prevBtn:e})}},ae=({navigatedList:s,nextBtn:t,prevBtn:e,sliderVariant:i,delay:n})=>{if(s){const o=s.closest(".js-overview-bar-container"),r=o==null?void 0:o.querySelector(".c-stepper"),a=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(a){const l=Array.from(a).findIndex(c=>c.classList.contains("c-stepper__item--loading"));l<0?a[0].classList.add("c-stepper__item--loading"):(a[l].classList.remove("c-stepper__item--loading"),a[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(a[l-1].classList.remove("c-stepper__item--loading"),a[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const c=a[l-1].querySelector(".c-stepper__loader");a[l-1].classList.add("c-stepper__item--loading"),c&&c instanceof HTMLElement&&(c.style.transition=`width ${n/1e3}s linear`)},0)))}if(s.clientWidth<s.scrollLeft){let l=s.scrollLeft;switch(i){case"three-columns-articles":l-=s.clientWidth+32;break;case"rubrics":l-=s.clientWidth-36;break;default:l-=Math.ceil(s.clientWidth*.6);break}s.scrollTo({left:l,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),l===0&&e.classList.remove("o-nav-button--visible")}else s.scrollTo({left:0,behavior:"smooth"}),e.classList.remove("o-nav-button--visible"),s.clientWidth<s.scrollWidth&&t.classList.add("o-nav-button--visible");t.classList.contains("c-slider__button-container--has-space-around")&&e.classList.contains("c-slider__button-container--has-space-around")&&U({navigatedList:s,nextBtn:t,prevBtn:e})}},le=({navigatedList:s,nextBtn:t,prevBtn:e})=>{oe({navigatedList:s,nextBtn:t,prevBtn:e})},ce=()=>{const s=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(s)){const{sliderVariant:e}=t.dataset,{sliderAuto:i}=t.dataset,{sliderDelay:n}=t.dataset,o=n?parseInt(n,10):3e3,r=t.closest(".js-overview-bar-container"),a=r==null?void 0:r.querySelector(".c-stepper"),l=a==null?void 0:a.querySelectorAll(".c-stepper__item");if(t){const c=t.querySelector(".js-navigation-container__list"),h=t.querySelector(".o-nav-button--next-button"),d=t.querySelector(".o-nav-button--previous-button");if(c&&c.clientWidth<c.scrollWidth&&(h==null||h.classList.add("o-nav-button--visible"),h!=null&&h.classList.contains("c-slider__button-container--has-space-around")&&(c.style.width=`calc(100% - ${Z})`)),c&&h&&d&&(h==null||h.addEventListener("click",re.bind(!1,{navigatedList:c,nextBtn:h,prevBtn:d,sliderVariant:e})),d==null||d.addEventListener("click",ae.bind(!1,{navigatedList:c,nextBtn:h,prevBtn:d,sliderVariant:e,delay:o}))),i==="true"&&h){const u=a?a.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(m=>{const p=m.querySelector(".c-stepper__loader");p&&p instanceof HTMLElement&&(p.style.transition=`width ${o/1e3}s linear`)}),u||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{h.classList.contains("o-nav-button--visible")?h.click():c&&d&&(c.scrollLeft=0,l&&(l.forEach(m=>{const p=m.querySelector(".c-stepper__loader");p&&p instanceof HTMLElement&&(p.style.transition="width 0s linear"),m.classList.remove("c-stepper__item--loading"),m.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{p&&p instanceof HTMLElement&&(p.style.transition=`width ${o/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),d.click())},o)}}}},he=()=>{const s=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(s))if(t){const e=t.querySelector(".js-navigation-container__list"),i=t.querySelector(".o-nav-button--next-button"),n=t.querySelector(".o-nav-button--previous-button");e&&i&&n&&window.addEventListener("resize",le.bind(!1,{navigatedList:e,nextBtn:i,prevBtn:n}))}};/*!
1
+ (function(b,w){typeof exports=="object"&&typeof module<"u"?w(exports):typeof define=="function"&&define.amd?define(["exports"],w):(b=typeof globalThis<"u"?globalThis:b||self,w(b.scripts={}))})(this,function(b){"use strict";var Gi=Object.defineProperty;var Ui=(b,w,z)=>w in b?Gi(b,w,{enumerable:!0,configurable:!0,writable:!0,value:z}):b[w]=z;var W=(b,w,z)=>Ui(b,typeof w!="symbol"?w+"":w,z);const w=()=>/Android/i.test(navigator.userAgent),z=typeof window<"u"&&navigator.userAgent.toLowerCase().includes("firefox"),Tt=()=>{const s=document.getElementById("js-download-band");s&&w()&&s.setAttribute("href","https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome")},zt=()=>{const s=document.querySelector("#js-election-selector");s&&s.addEventListener("change",t=>{window.location.replace(t.target.value)})},Ot=()=>{const s=document.querySelector(".c-search-banner");if(s){const t=document.querySelector("#js-search-banner-to-hide"),e=s.querySelector("#js-search-banner-dropdown-btn");e==null||e.addEventListener("click",()=>{const i=e.querySelector("svg"),n=i==null?void 0:i.querySelector("use");switch(n==null?void 0:n.getAttribute("xlink:href")){case"#chevron-up":n==null||n.setAttribute("xlink:href","#chevron-down"),t==null||t.classList.add("u-hidden");break;case"#chevron-down":n==null||n.setAttribute("xlink:href","#chevron-up"),t==null||t.classList.remove("u-hidden");break}})}},Dt=[{text:"Paris",_index:"town_1717424751904",_id:"75056",_score:1,_source:{output:"Paris (75000)",url:"/elections/resultats/paris/paris-75000"}},{text:"Paris 10ème Arrondissement",_index:"town_1717424751904",_id:"75056AR10",_score:1,_source:{output:"Paris 10ème Arrondissement (75010)",url:"/elections/resultats/paris/paris-75010"}},{text:"Paris 11ème Arrondissement",_index:"town_1717424751904",_id:"75056AR11",_score:1,_source:{output:"Paris 11ème Arrondissement (75011)",url:"/elections/resultats/paris/paris-75011"}}],Mt=(s,t,e,i,n,o)=>{const r=document.getElementById(s);if(!r)return;const a=r.dataset.storybook,l=r.querySelector(`#${s}-search`),c=l==null?void 0:l.getAttribute("data-api-url"),h=r.querySelector(".c-autocomplete__menu");if(!l||!h||!c)return;const d=r.querySelector(".c-autocomplete__input-spinner"),u=l.getAttribute("data-trigger-message"),m=async P=>{try{let y;return a&&t.includes("20minutes.fr")?y=Dt:y=await(await fetch(`${c}${e}${encodeURIComponent(P)}`)).json(),o?y[o]:y}catch(y){return console.error("Error fetching autocomplete results:",y),[]}},p=(P,y)=>{const x=document.createElement("li");x.id=`/${P}`,x.textContent=y,x.addEventListener("click",()=>{l instanceof HTMLInputElement&&(l.value=y,h.classList.add("u-hidden"))}),h.appendChild(x)},g=()=>{d==null||d.classList.toggle("u-hidden")},v=()=>{const P=document.createElement("li");P.textContent=u,h.appendChild(P)},A=async P=>{g(),h.classList.remove("u-hidden");const y=await m(P);h.innerHTML="",y.length===0&&h.classList.add("u-hidden"),y.forEach(x=>{p(x[i],x[n])}),g()},I=P=>{if(!(P.target instanceof HTMLInputElement))return;const y=P.target.value;h.classList.remove("u-hidden"),y.length>=3?A(y):(h.innerHTML="",v())};l.addEventListener("input",I),l.addEventListener("focusout",()=>{setTimeout(()=>h.classList.add("u-hidden"),300)}),l.addEventListener("focusin",()=>{h.childElementCount>0&&h.classList.remove("u-hidden")})},$t=()=>{const s=document.querySelector(".js-content-header"),t=document.querySelector(".js-limit-scroll-close-article-btn"),e=document.querySelector(".js-close-article-btn"),i=document.querySelector(".c-header-mobile"),n=i instanceof HTMLElement?i.offsetHeight:0;if(s&&t&&e){const o=new IntersectionObserver(()=>{const r=e.classList,a=r.contains("u-hidden"),l=s.getBoundingClientRect().bottom-n,c=t.getBoundingClientRect().bottom-n;a&&l<=0&&c>=0&&r.remove("u-hidden"),!a&&(l>=0||c<=0)&&r.add("u-hidden")},{root:document,rootMargin:`-${n}px 0px 0px 0px`});o.observe(s),o.observe(t)}},Zt=s=>{s.stopImmediatePropagation(),s.preventDefault();const t=s.currentTarget;if(t instanceof HTMLButtonElement){const e=t.parentElement,i=e==null?void 0:e.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),i==null||i.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),i==null||i.setAttribute("aria-hidden","false"))}},Rt=(s=document.querySelector(".js-collapse__button"))=>{s&&document.querySelectorAll(".c-collapse__button").forEach(e=>{e.addEventListener("click",i=>{Zt(i)})})},Ft=(s,t)=>{const e=document.querySelector(`#${t}`);if(e){const i=e.querySelector(".js-countdown-days"),n=e.querySelector(".js-countdown-hours"),o=e.querySelector(".js-countdown-minutes"),r=e.querySelector(".js-countdown-seconds");if(!i||!n||!o||!r)return;window.counters={paralympicsGames:"2024-08-28 20:00:00"};const a=window.counters[s],l=new Date(a).getTime(),c=setInterval(()=>{const h=new Date().getTime(),d=l-h;if(d<=0)clearInterval(c);else{const u=Math.floor(d/864e5),m=Math.floor(d%(1e3*60*60*24)/(1e3*60*60)),p=Math.floor(d%(1e3*60*60)/(1e3*60)),g=Math.floor(d%(1e3*60)/1e3);i.innerHTML=u.toString(),n.innerHTML=m.toString(),o.innerHTML=p.toString(),r.innerHTML=g.toString()}},1e3)}},kt=s=>{const t=s.getBBox(),e=t.width/20;return[t.x-e,t.y-e,t.width+e*2,t.height+e*2].join(" ")},qt=()=>{const s=document.querySelector(".c-map-districts-container"),t=document.querySelector(".c-map-districts");if(!s||!t)return;const e=document.querySelector(".c-map-districts-container__description"),i=document.querySelector(".c-map-districts-container__department"),n=document.querySelector(".c-map-districts-container__unzoom-button");let o=t;const r=t.getAttribute("viewBox"),a=(p,g)=>{var v;return(v=p.matches)==null?void 0:v.call(p,g)},l=(p,g,v=".c-map-districts__zoomable:not(.js-selected-area)")=>{if(!p)return;let A,I=p.parentElement;for(;I instanceof SVGGraphicsElement&&I!==g;)a(I,v)&&(A=I),I=I.parentElement;return A},c=(p,g,v)=>{if(!p)return;let A=p.parentElement;for(;A instanceof SVGGraphicsElement&&A!==v;){if(g===A)return!0;A=A.parentElement}return v===g},h=(p,g)=>{if(g&&n&&e){s.classList.remove("c-map-districts-container--department-view"),e.classList.remove("u-hidden"),i==null||i.classList.add("u-hidden"),n.classList.add("u-hidden"),g!==r&&(e.classList.add("u-hidden"),n.classList.remove("u-hidden")),o.classList.remove("js-selected-area"),o=p;const v=o.getAttribute("data-info");i&&v&&(s.classList.add("c-map-districts-container--department-view"),i.classList.remove("u-hidden"),i.innerHTML=v),o.classList.add("js-selected-area"),t.setAttribute("viewBox",g)}},d=p=>{p.stopPropagation();const g=p.currentTarget;if(o&&t&&g instanceof SVGGraphicsElement){if(g===o)return;if(p.preventDefault(),o!==t&&!c(g,o,t)){h(t,r);return}const v=l(g,o);h(v||g,kt(v||g))}},u=()=>{t&&o!==t&&h(t,r)};t.addEventListener("click",u),n&&n.addEventListener("click",u),document.querySelectorAll(".c-map-districts__zoomable").forEach(p=>{p.addEventListener("click",g=>d(g))})},Nt=()=>{const s=document.getElementById("elections-form-search"),t=document.querySelector(".c-search-form__autocomplete");if(!s||!t)return;const e=o=>{t.classList.remove("u-hidden");const r=t.querySelectorAll("li"),a=[];return r.forEach(l=>{const c=l.querySelector("a");c&&c.innerHTML.toLowerCase().includes(o.toLowerCase())&&a.push(l.innerHTML)}),a},i=o=>{t.innerHTML+=`<li>${o}</li>`},n=({target:o})=>{if(!(o instanceof HTMLInputElement))return;const r=o.value;if(t.classList.add("u-hidden"),r.length>=3){const a=e(r);t.innerHTML="",a.length===0&&t.classList.add("u-hidden"),a.forEach(l=>{i(l)})}};s.addEventListener("input",n),s.addEventListener("focusout",()=>{setTimeout(()=>t.classList.add("u-hidden"),300)}),s.addEventListener("focusin",()=>{t.childElementCount>0&&t.classList.remove("u-hidden")})},Ht=(s,t)=>{var n;s.setAttribute("aria-expanded","true");const e=(n=s.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");e==null||e.forEach(o=>o.classList.remove(t));const i=s.querySelector(".js-ellipsis-button__label");i instanceof HTMLSpanElement&&(i.innerHTML="Voir moins")},Bt=(s,t)=>{var n;const e=(n=s.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");e==null||e.forEach(o=>o.classList.add(t)),s.setAttribute("aria-expanded","false");const i=s.querySelector(".js-ellipsis-button__label");i instanceof HTMLSpanElement&&(i.innerHTML="Voir plus")},Wt=(s,t)=>{const e=s.currentTarget;if(s.preventDefault(),e instanceof HTMLButtonElement){const i=t?"u-ellipsis-multiline":"u-ellipsis";return e.getAttribute("aria-expanded")==="true"?Bt(e,i):Ht(e,i)}return null},Vt=(s=document.querySelector(".js-ellipsis-button"))=>{s&&document.querySelectorAll(".js-ellipsis-button").forEach(e=>{const i=e.getAttribute("data-multiple")==="true";e.addEventListener("click",n=>Wt(n,i))})},jt=s=>{var i;s.setAttribute("aria-expanded","true");const t=(i=s.parentNode)==null?void 0:i.querySelectorAll(".js-expand-target");t==null||t.forEach(n=>n.setAttribute("aria-hidden","false"));const e=s.querySelector(".js-expand-button__label");e instanceof HTMLSpanElement&&(e.innerHTML="Voir moins")},Gt=s=>{var i;const t=(i=s.parentNode)==null?void 0:i.querySelectorAll(".js-expand-target");t==null||t.forEach(n=>n.setAttribute("aria-hidden","true")),s.setAttribute("aria-expanded","false");const e=s.querySelector(".js-expand-button__label");e instanceof HTMLSpanElement&&(e.innerHTML="Voir plus")},Ut=s=>{const t=s.currentTarget;return s.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?Gt(t):jt(t):null},Kt=(s=document.querySelector(".js-expand-button"))=>{s&&document.querySelectorAll(".js-expand-button").forEach(e=>e.addEventListener("click",Ut))},Xt=()=>{const s=document.querySelector(".js-game-alert");z&&s&&s.classList.remove("u-hidden")},Yt=()=>{const s=document.querySelectorAll(".js-half-donut-result");for(const t of Array.from(s)){const e=t.querySelector(".c-half-donut"),i=t.querySelector(".c-legend");if(!e||!i)return;i.querySelectorAll("[data-color]").forEach(n=>{const o=n.getAttribute("data-color"),r=e.querySelector(`.c-half-donut__zone--${o}`);r==null||r.addEventListener("mouseenter",()=>{n.classList.add("c-legend__item--is-hovered"),e.classList.add("c-half-donut--is-hovered"),i.classList.add("c-legend--is-hovered")}),r==null||r.addEventListener("mouseleave",()=>{n.classList.remove("c-legend__item--is-hovered"),e.classList.remove("c-half-donut--is-hovered"),i.classList.remove("c-legend--is-hovered")}),n.addEventListener("mouseenter",()=>{r==null||r.classList.add("c-half-donut__zone--is-hovered"),i.classList.add("c-legend--is-hovered"),e.classList.add("c-half-donut--is-hovered")}),n.addEventListener("mouseleave",()=>{r==null||r.classList.remove("c-half-donut__zone--is-hovered"),i.classList.remove("c-legend--is-hovered"),e.classList.remove("c-half-donut--is-hovered")})})}},Qt=()=>{const s=document.querySelector(".c-image-slider__container");if(!s)return;const t=document.querySelectorAll(".c-image-slider__slide"),e=document.querySelector(".c-image-slider__button-container--previous"),i=document.querySelector(".c-image-slider__button-container--next"),n=document.querySelectorAll(".c-image-slider__indicator");let o=0;const r=()=>{n.forEach((u,m)=>{u.classList.toggle("c-image-slider__indicator--is-active",m===o)})},a=(u=!0)=>{if(!(s instanceof HTMLElement))return;s.style.transition=u?"transform 0.3s ease":"none";const m=-o*100;s.style.transform=`translateX(${m}%)`,r()},l=u=>{o=u,a(!0)};e==null||e.addEventListener("click",()=>{const u=(o-1+t.length)%t.length;l(u)}),i==null||i.addEventListener("click",()=>{const u=(o+1)%t.length;l(u)}),n.forEach((u,m)=>{u.addEventListener("click",()=>{l(m)})});let c=0,h=0,d=!1;s.addEventListener("touchstart",u=>{s instanceof HTMLElement&&(c=u.touches[0].clientX,h=c,d=!0,s.style.transition="none")}),s.addEventListener("touchmove",u=>{if(!(s instanceof HTMLElement))return;h=u.touches[0].clientX;const m=h-c,p=-o*window.innerWidth+m;s.style.transform=`translateX(${p}px)`}),s.addEventListener("touchend",()=>{if(!d)return;d=!1;const u=h-c;Math.abs(u)>75&&(u<0?o=Math.min(o+1,t.length-1):u>0&&(o=Math.max(o-1,0))),a(!0)}),a(!0)},f={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var Jt=[`a[href]${f.inert}${f.negTabIndex}`,`area[href]${f.inert}${f.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${f.inert}${f.negTabIndex}${f.disabled}`,`input[type="radio"]${f.inert}${f.negTabIndex}${f.disabled}`,`select${f.inert}${f.negTabIndex}${f.disabled}`,`textarea${f.inert}${f.negTabIndex}${f.disabled}`,`button${f.inert}${f.negTabIndex}${f.disabled}`,`details${f.inert} > summary:first-of-type${f.negTabIndex}`,`iframe${f.inert}${f.negTabIndex}`,`audio[controls]${f.inert}${f.negTabIndex}`,`video[controls]${f.inert}${f.negTabIndex}`,`[contenteditable]${f.inert}${f.negTabIndex}`,`[tabindex]${f.inert}${f.negTabIndex}`];function et(s){(s.querySelector("[autofocus]")||s).focus()}function te(s){const t=D(s,!0),e=t?D(s,!1)||t:null;return[t,e]}function D(s,t){if(t&&nt(s))return s;if(ie(s))if(s.shadowRoot){let e=it(s.shadowRoot,t);for(;e;){const i=D(e,t);if(i)return i;e=st(e,t)}}else if(s.localName==="slot"){const e=s.assignedElements({flatten:!0});t||e.reverse();for(const i of e){const n=D(i,t);if(n)return n}}else{let e=it(s,t);for(;e;){const i=D(e,t);if(i)return i;e=st(e,t)}}return!t&&nt(s)?s:null}function it(s,t){return t?s.firstElementChild:s.lastElementChild}function st(s,t){return t?s.nextElementSibling:s.previousElementSibling}const ee=s=>s.matches("details:not([open]) *")&&!s.matches("details>summary:first-of-type")?!0:!(s.offsetWidth||s.offsetHeight||s.getClientRects().length),nt=s=>{var t;return(t=s.shadowRoot)!=null&&t.delegatesFocus?!1:s.matches(Jt.join(","))&&!ee(s)};function ie(s){return s.shadowRoot&&s.getAttribute("tabindex")==="-1"?!1:!s.matches(":disabled,[hidden],[inert]")}function M(s=document){const t=s.activeElement;return t?t.shadowRoot?M(t.shadowRoot)||document.activeElement:t:null}function se(s,t){const[e,i]=te(s);if(!e)return t.preventDefault();const n=M();t.shiftKey&&n===e?(i.focus(),t.preventDefault()):!t.shiftKey&&n===i&&(e.focus(),t.preventDefault())}function O(s,t){function e(i){if(!i||i===document||i===window)return null;const n=ot(i);return n&&(i=n),i.closest(s)||e(i.getRootNode().host)}return e(t)}function ot(s){return s.assignedSlot||(s.parentNode?ot(s.parentNode):null)}const $="data-a11y-dialog";class rt{constructor(t){W(this,"$el");W(this,"id");W(this,"previouslyFocused");W(this,"shown");this.$el=t,this.id=this.$el.getAttribute($)||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.fire("destroy").defaultPrevented?this:(this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0)),this)}show(t){var i;return this.shown?this:this.fire("show",t).defaultPrevented?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=M(),((i=this.previouslyFocused)==null?void 0:i.tagName)==="BODY"&&(t!=null&&t.target)&&(this.previouslyFocused=t.target),(t==null?void 0:t.type)==="focus"?this.maintainFocus():et(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this)}hide(t){var i,n;return this.shown?this.fire("hide",t).defaultPrevented?this:(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(n=(i=this.previouslyFocused)==null?void 0:i.focus)==null||n.call(i),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0),this):this}on(t,e,i){return this.$el.addEventListener(t,e,i),this}off(t,e,i){return this.$el.removeEventListener(t,e,i),this}fire(t,e){const i=new CustomEvent(t,{detail:e,cancelable:!0});return this.$el.dispatchEvent(i),i}handleTriggerClicks(t){const e=t.composedPath()[0],i=O(`[${$}-show="${this.id}"]`,e),n=O(`[${$}-hide="${this.id}"]`,e),o=O(`[${$}-hide]`,e)&&O('[aria-modal="true"]',e)===this.$el;i&&this.show(t),(n||o)&&this.hide(t)}bindKeypress(t){if(O('[aria-modal="true"]',M())!==this.$el)return;let e=!1;try{e=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}t.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!e&&(t.preventDefault(),this.hide(t)),t.key==="Tab"&&se(this.$el,t)}maintainFocus(){const t=M();O(`[aria-modal="true"], [${$}-ignore-focus-trap]`,t)||et(this.$el)}}function at(){for(const s of document.querySelectorAll("[data-a11y-dialog]"))new rt(s)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",at):at());const ne=()=>document.querySelectorAll(".js-modal").forEach(s=>{if(!(s instanceof HTMLElement))return;const t=new rt(s);if(s.id==="dialog-menu"){const e=document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"),i=document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");e.length>0&&i.length>0&&(t.on("show",()=>{e.forEach(n=>n.classList.add("u-hidden")),i.forEach(n=>n.classList.remove("u-hidden"))}),t.on("hide",()=>{e.forEach(n=>n.classList.remove("u-hidden")),i.forEach(n=>n.classList.add("u-hidden"))}))}t.on("show",()=>{document.body.classList.add("noscroll")}).on("hide",()=>{document.body.classList.remove("noscroll")})}),Z="68px",U=({navigatedList:s,nextBtn:t,prevBtn:e})=>{t.classList.contains("o-nav-button--visible")&&!e.classList.contains("o-nav-button--visible")&&(s.style.width=`calc(100% - ${Z})`,s.style.position="",s.style.right=""),e.classList.contains("o-nav-button--visible")&&(s.style.position="absolute",t.classList.contains("o-nav-button--visible")&&(s.style.width=`calc(100% - ${Z} * 2)`,s.style.right=Z),t.classList.contains("o-nav-button--visible")||(s.style.width=`calc(100% - ${Z})`,s.style.right="0")),!t.classList.contains("o-nav-button--visible")&&!e.classList.contains("o-nav-button--visible")&&(s.style.width="",s.style.position="",s.style.right="")},oe=({navigatedList:s,nextBtn:t,prevBtn:e})=>{var o,r,a,l,c,h,d,u;const i=s.scrollLeft>0,n=s.scrollLeft+(s.clientWidth+.5)<s.scrollWidth;i&&n?((o=t.classList)==null||o.add("o-nav-button--visible"),(r=e.classList)==null||r.add("o-nav-button--visible")):i?((a=t.classList)==null||a.remove("o-nav-button--visible"),(l=e.classList)==null||l.add("o-nav-button--visible")):n?((c=t.classList)==null||c.add("o-nav-button--visible"),(h=e.classList)==null||h.remove("o-nav-button--visible")):((d=t.classList)==null||d.remove("o-nav-button--visible"),(u=e.classList)==null||u.remove("o-nav-button--visible")),t.classList.contains("c-slider__button-container--has-space-around")&&e.classList.contains("c-slider__button-container--has-space-around")&&U({navigatedList:s,nextBtn:t,prevBtn:e})},re=({navigatedList:s,nextBtn:t,prevBtn:e,sliderVariant:i})=>{if(s){const n=s.closest(".js-overview-bar-container"),o=n==null?void 0:n.querySelector(".c-stepper"),r=o==null?void 0:o.querySelectorAll(".c-stepper__item");if(r){const a=Array.from(r).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(a<0)r[0].classList.add("c-stepper__item--loading");else{r[a].classList.remove("c-stepper__item--loading"),r[a].classList.add("c-stepper__item--loaded");const l=r[a].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),a+1<r.length&&r[a+1].classList.add("c-stepper__item--loading")}}if(s.scrollWidth-s.clientWidth>s.clientWidth){let a=s.scrollLeft;switch(i){case"three-columns-articles":a+=s.clientWidth+32;break;case"rubrics":a+=s.clientWidth-36;break;default:a+=Math.ceil(s.clientWidth*.6);break}s.scrollTo({left:a,behavior:"smooth"}),e.classList.add("o-nav-button--visible"),a+s.clientWidth>=s.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const a=s.scrollWidth-s.clientWidth;s.scrollTo({left:a,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),e.classList.add("o-nav-button--visible")}t.classList.contains("c-slider__button-container--has-space-around")&&e.classList.contains("c-slider__button-container--has-space-around")&&U({navigatedList:s,nextBtn:t,prevBtn:e})}},ae=({navigatedList:s,nextBtn:t,prevBtn:e,sliderVariant:i,delay:n})=>{if(s){const o=s.closest(".js-overview-bar-container"),r=o==null?void 0:o.querySelector(".c-stepper"),a=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(a){const l=Array.from(a).findIndex(c=>c.classList.contains("c-stepper__item--loading"));l<0?a[0].classList.add("c-stepper__item--loading"):(a[l].classList.remove("c-stepper__item--loading"),a[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(a[l-1].classList.remove("c-stepper__item--loading"),a[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const c=a[l-1].querySelector(".c-stepper__loader");a[l-1].classList.add("c-stepper__item--loading"),c&&c instanceof HTMLElement&&(c.style.transition=`width ${n/1e3}s linear`)},0)))}if(s.clientWidth<s.scrollLeft){let l=s.scrollLeft;switch(i){case"three-columns-articles":l-=s.clientWidth+32;break;case"rubrics":l-=s.clientWidth-36;break;default:l-=Math.ceil(s.clientWidth*.6);break}s.scrollTo({left:l,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),l===0&&e.classList.remove("o-nav-button--visible")}else s.scrollTo({left:0,behavior:"smooth"}),e.classList.remove("o-nav-button--visible"),s.clientWidth<s.scrollWidth&&t.classList.add("o-nav-button--visible");t.classList.contains("c-slider__button-container--has-space-around")&&e.classList.contains("c-slider__button-container--has-space-around")&&U({navigatedList:s,nextBtn:t,prevBtn:e})}},le=({navigatedList:s,nextBtn:t,prevBtn:e})=>{oe({navigatedList:s,nextBtn:t,prevBtn:e})},ce=()=>{const s=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(s)){const{sliderVariant:e}=t.dataset,{sliderAuto:i}=t.dataset,{sliderDelay:n}=t.dataset,o=n?parseInt(n,10):3e3,r=t.closest(".js-overview-bar-container"),a=r==null?void 0:r.querySelector(".c-stepper"),l=a==null?void 0:a.querySelectorAll(".c-stepper__item");if(t){const c=t.querySelector(".js-navigation-container__list"),h=t.querySelector(".o-nav-button--next-button"),d=t.querySelector(".o-nav-button--previous-button");if(c&&c.clientWidth<c.scrollWidth&&(h==null||h.classList.add("o-nav-button--visible"),h!=null&&h.classList.contains("c-slider__button-container--has-space-around")&&(c.style.width=`calc(100% - ${Z})`)),c&&h&&d&&(h==null||h.addEventListener("click",re.bind(!1,{navigatedList:c,nextBtn:h,prevBtn:d,sliderVariant:e})),d==null||d.addEventListener("click",ae.bind(!1,{navigatedList:c,nextBtn:h,prevBtn:d,sliderVariant:e,delay:o}))),i==="true"&&h){const u=a?a.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(m=>{const p=m.querySelector(".c-stepper__loader");p&&p instanceof HTMLElement&&(p.style.transition=`width ${o/1e3}s linear`)}),u||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{h.classList.contains("o-nav-button--visible")?h.click():c&&d&&(c.scrollLeft=0,l&&(l.forEach(m=>{const p=m.querySelector(".c-stepper__loader");p&&p instanceof HTMLElement&&(p.style.transition="width 0s linear"),m.classList.remove("c-stepper__item--loading"),m.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{p&&p instanceof HTMLElement&&(p.style.transition=`width ${o/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),d.click())},o)}}}},he=()=>{const s=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(s))if(t){const e=t.querySelector(".js-navigation-container__list"),i=t.querySelector(".o-nav-button--next-button"),n=t.querySelector(".o-nav-button--previous-button");e&&i&&n&&window.addEventListener("resize",le.bind(!1,{navigatedList:e,nextBtn:i,prevBtn:n}))}};/*!
2
2
  * PhotoSwipe 5.4.4 - https://photoswipe.com
3
3
  * (c) 2024 Dmytro Semenov
4
4
  */function S(s,t,e){const i=document.createElement(t);return s&&(i.className=s),e&&e.appendChild(i),i}function _(s,t){return s.x=t.x,s.y=t.y,t.id!==void 0&&(s.id=t.id),s}function lt(s){s.x=Math.round(s.x),s.y=Math.round(s.y)}function K(s,t){const e=Math.abs(s.x-t.x),i=Math.abs(s.y-t.y);return Math.sqrt(e*e+i*i)}function R(s,t){return s.x===t.x&&s.y===t.y}function F(s,t,e){return Math.min(Math.max(s,t),e)}function k(s,t,e){let i=`translate3d(${s}px,${t||0}px,0)`;return e!==void 0&&(i+=` scale3d(${e},${e},1)`),i}function C(s,t,e,i){s.style.transform=k(t,e,i)}const de="cubic-bezier(.4,0,.22,1)";function ct(s,t,e,i){s.style.transition=t?`${t} ${e}ms ${i||de}`:"none"}function X(s,t,e){s.style.width=typeof t=="number"?`${t}px`:t,s.style.height=typeof e=="number"?`${e}px`:e}function ue(s){ct(s)}function pe(s){return"decode"in s?s.decode().catch(()=>{}):s.complete?Promise.resolve(s):new Promise((t,e)=>{s.onload=()=>t(s),s.onerror=e})}const L={IDLE:"idle",LOADING:"loading",LOADED:"loaded",ERROR:"error"};function me(s){return"button"in s&&s.button===1||s.ctrlKey||s.metaKey||s.altKey||s.shiftKey}function fe(s,t,e=document){let i=[];if(s instanceof Element)i=[s];else if(s instanceof NodeList||Array.isArray(s))i=Array.from(s);else{const n=typeof s=="string"?s:t;n&&(i=Array.from(e.querySelectorAll(n)))}return i}function ht(){return!!(navigator.vendor&&navigator.vendor.match(/apple/i))}let dt=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{dt=!0}}))}catch{}class ge{constructor(){this._pool=[]}add(t,e,i,n){this._toggleListener(t,e,i,n)}remove(t,e,i,n){this._toggleListener(t,e,i,n,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,e,i,n,o,r){if(!t)return;const a=o?"removeEventListener":"addEventListener";e.split(" ").forEach(c=>{if(c){r||(o?this._pool=this._pool.filter(d=>d.type!==c||d.listener!==i||d.target!==t):this._pool.push({target:t,type:c,listener:i,passive:n}));const h=dt?{passive:n||!1}:!1;t[a](c,i,h)}})}}function ut(s,t){if(s.getViewportSizeFn){const e=s.getViewportSizeFn(s,t);if(e)return e}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function q(s,t,e,i,n){let o=0;if(t.paddingFn)o=t.paddingFn(e,i,n)[s];else if(t.padding)o=t.padding[s];else{const r="padding"+s[0].toUpperCase()+s.slice(1);t[r]&&(o=t[r])}return Number(o)||0}function pt(s,t,e,i){return{x:t.x-q("left",s,t,e,i)-q("right",s,t,e,i),y:t.y-q("top",s,t,e,i)-q("bottom",s,t,e,i)}}class _e{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:e}=this.slide,i=this.slide[t==="x"?"width":"height"]*this.currZoomLevel,o=q(t==="x"?"left":"top",e.options,e.viewportSize,this.slide.data,this.slide.index),r=this.slide.panAreaSize[t];this.center[t]=Math.round((r-i)/2)+o,this.max[t]=i>r?Math.round(r-i)+o:this.center[t],this.min[t]=i>r?o:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,e){return F(e,this.max[t],this.min[t])}}const mt=4e3;let ft=class{constructor(t,e,i,n){this.pswp=n,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){const n={x:t,y:e};this.elementSize=n,this.panAreaSize=i;const o=i.x/n.x,r=i.y/n.y;this.fit=Math.min(1,o<r?o:r),this.fill=Math.min(1,o>r?o:r),this.vFill=Math.min(1,r),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const e=t+"ZoomLevel",i=this.options[e];if(i)return typeof i=="function"?i(this):i==="fill"?this.fill:i==="fit"?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,this.fit*3),this.elementSize&&t*this.elementSize.x>mt&&(t=mt/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,this.fit*4)}};class ve{constructor(t,e,i){this.data=t,this.index=e,this.pswp=i,this.isActive=e===i.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!i.opener.isOpen,this.zoomLevels=new ft(i.options,t,e,i),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:e}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=S("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new _e(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||!this.isActive&&!1||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel===this.zoomLevels.initial||!this.isActive?(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize()):(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y))}updateContentSize(t){const e=this.currentResolution||this.zoomLevels.initial;if(!e)return;const i=Math.round(this.width*e)||this.pswp.viewportSize.x,n=Math.round(this.height*e)||this.pswp.viewportSize.y;!this.sizeChanged(i,n)&&!t||this.content.setDisplayedSize(i,n)}sizeChanged(t,e){return t!==this.prevDisplayedWidth||e!==this.prevDisplayedHeight?(this.prevDisplayedWidth=t,this.prevDisplayedHeight=e,!0):!1}getPlaceholderElement(){var t;return(t=this.content.placeholder)===null||t===void 0?void 0:t.element}zoomTo(t,e,i,n){const{pswp:o}=this;if(!this.isZoomable()||o.mainScroll.isShifted())return;o.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:i}),o.animations.stopAllPan();const r=this.currZoomLevel;n||(t=F(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),lt(this.pan);const a=()=>{this._setResolution(t),this.applyCurrentZoomPan()};i?o.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:a,duration:i,easing:o.options.easing}):a()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,e,i){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];e||(e=this.pswp.getViewportCenterPoint()),i||(i=this.zoomLevels.initial);const o=this.currZoomLevel/i;return this.bounds.correctPan(t,(this.pan[t]-e[t])*o+e[t])}panTo(t,e){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",e),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),_(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,e,i){i/=this.currentResolution||this.zoomLevels.initial,C(this.container,t,e,i)}calculateSize(){const{pswp:t}=this;_(this.panAreaSize,pt(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return k(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}const ye=.35,we=.6,Se=.4,be=.5;function Le(s,t){return s*t/(1-t)}class Ee{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&_(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:e,dragAxis:i}=this.gestures,{currSlide:n}=this.pswp;if(i==="y"&&this.pswp.options.closeOnVerticalDrag&&n&&n.currZoomLevel<=n.zoomLevels.fit&&!this.gestures.isMultitouch){const o=n.pan.y+(t.y-e.y);if(!this.pswp.dispatch("verticalDrag",{panY:o}).defaultPrevented){this._setPanWithFriction("y",o,we);const r=1-Math.abs(this._getVerticalDragRatio(n.pan.y));this.pswp.applyBgOpacity(r),n.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),n&&(lt(n.pan),n.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:e,currSlide:i}=this.pswp;let n=0;if(this.pswp.animations.stopAll(),e.isShifted()){const r=(e.x-e.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&r<0||t.x<.1&&r<-.5?(n=1,t.x=Math.min(t.x,0)):(t.x>be&&r>0||t.x>-.1&&r>.5)&&(n=-1,t.x=Math.max(t.x,0)),e.moveIndexBy(n,!0,t.x)}i&&i.currZoomLevel>i.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:e}=this.gestures,{currSlide:i}=this.pswp;if(!i)return;const{pan:n,bounds:o}=i,r=n[t],a=this.pswp.bgOpacity<1&&t==="y",c=r+Le(e[t],.995);if(a){const p=this._getVerticalDragRatio(r),g=this._getVerticalDragRatio(c);if(p<0&&g<-.4||p>0&&g>Se){this.pswp.close();return}}const h=o.correctPan(t,c);if(r===h)return;const d=h===c?1:.82,u=this.pswp.bgOpacity,m=h-r;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:r,end:h,velocity:e[t],dampingRatio:d,onUpdate:p=>{if(a&&this.pswp.bgOpacity<1){const g=1-(h-p)/m;this.pswp.applyBgOpacity(F(u+(1-u)*g,0,1))}n[t]=Math.floor(p),i.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:e,dragAxis:i,prevP1:n,isMultitouch:o}=this.gestures,{currSlide:r,mainScroll:a}=this.pswp,l=e[t]-n[t],c=a.x+l;if(!l||!r)return!1;if(t==="x"&&!r.isPannable()&&!o)return a.moveTo(c,!0),!0;const{bounds:h}=r,d=r.pan[t]+l;if(this.pswp.options.allowPanToNext&&i==="x"&&t==="x"&&!o){const u=a.getCurrSlideX(),m=a.x-u,p=l>0,g=!p;if(d>h.min[t]&&p){if(h.min[t]<=this.startPan[t])return a.moveTo(c,!0),!0;this._setPanWithFriction(t,d)}else if(d<h.max[t]&&g){if(this.startPan[t]<=h.max[t])return a.moveTo(c,!0),!0;this._setPanWithFriction(t,d)}else if(m!==0){if(m>0)return a.moveTo(Math.max(c,u),!0),!0;if(m<0)return a.moveTo(Math.min(c,u),!0),!0}else this._setPanWithFriction(t,d)}else t==="y"?!a.isShifted()&&h.min.y!==h.max.y&&this._setPanWithFriction(t,d):this._setPanWithFriction(t,d);return!1}_getVerticalDragRatio(t){var e,i;return(t-((e=(i=this.pswp.currSlide)===null||i===void 0?void 0:i.bounds.center.y)!==null&&e!==void 0?e:0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,e,i){const{currSlide:n}=this.pswp;if(!n)return;const{pan:o,bounds:r}=n;if(r.correctPan(t,e)!==e||i){const l=Math.round(e-o[t]);o[t]+=l*(i||ye)}else o[t]=e}}const Pe=.05,Ae=.15;function gt(s,t,e){return s.x=(t.x+e.x)/2,s.y=(t.y+e.y)/2,s}class Ie{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,_(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:e,p2:i,startP2:n,pswp:o}=this.gestures,{currSlide:r}=o;if(!r)return;const a=r.zoomLevels.min,l=r.zoomLevels.max;if(!r.isZoomable()||o.mainScroll.isShifted())return;gt(this._startZoomPoint,e,n),gt(this._zoomPoint,t,i);let c=1/K(e,n)*K(t,i)*this._startZoomLevel;if(c>r.zoomLevels.initial+r.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),c<a)if(o.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=r.zoomLevels.initial){const h=1-(a-c)/(a/1.2);o.dispatch("pinchClose",{bgOpacity:h}).defaultPrevented||o.applyBgOpacity(h)}else c=a-(a-c)*Ae;else c>l&&(c=l+(c-l)*Pe);r.pan.x=this._calculatePanForZoomLevel("x",c),r.pan.y=this._calculatePanForZoomLevel("y",c),r.setZoomLevel(c),r.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:e}=t;(!e||e.currZoomLevel<e.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,e){const i=e/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*i}correctZoomPan(t){const{pswp:e}=this.gestures,{currSlide:i}=e;if(!(i!=null&&i.isZoomable()))return;this._zoomPoint.x===0&&(t=!0);const n=i.currZoomLevel;let o,r=!0;n<i.zoomLevels.initial?o=i.zoomLevels.initial:n>i.zoomLevels.max?o=i.zoomLevels.max:(r=!1,o=n);const a=e.bgOpacity,l=e.bgOpacity<1,c=_({x:0,y:0},i.pan);let h=_({x:0,y:0},c);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=n,_(this._startPan,c)),r&&(h={x:this._calculatePanForZoomLevel("x",o),y:this._calculatePanForZoomLevel("y",o)}),i.setZoomLevel(o),h={x:i.bounds.correctPan("x",h.x),y:i.bounds.correctPan("y",h.y)},i.setZoomLevel(n);const d=!R(h,c);if(!d&&!r&&!l){i._setResolution(o),i.applyCurrentZoomPan();return}e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:u=>{if(u/=1e3,d||r){if(d&&(i.pan.x=c.x+(h.x-c.x)*u,i.pan.y=c.y+(h.y-c.y)*u),r){const m=n+(o-n)*u;i.setZoomLevel(m)}i.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(F(a+(1-a)*u,0,1))},onComplete:()=>{i._setResolution(o),i.applyCurrentZoomPan()}})}}function _t(s){return!!s.target.closest(".pswp__container")}class xe{constructor(t){this.gestures=t}click(t,e){const i=e.target.classList,n=i.contains("pswp__img"),o=i.contains("pswp__item")||i.contains("pswp__zoom-wrap");n?this._doClickOrTapAction("imageClick",t,e):o&&this._doClickOrTapAction("bgClick",t,e)}tap(t,e){_t(e)&&this._doClickOrTapAction("tap",t,e)}doubleTap(t,e){_t(e)&&this._doClickOrTapAction("doubleTap",t,e)}_doClickOrTapAction(t,e,i){var n;const{pswp:o}=this.gestures,{currSlide:r}=o,a=t+"Action",l=o.options[a];if(!o.dispatch(a,{point:e,originalEvent:i}).defaultPrevented){if(typeof l=="function"){l.call(o,e,i);return}switch(l){case"close":case"next":o[l]();break;case"zoom":r==null||r.toggleZoom(e);break;case"zoom-or-close":r!=null&&r.isZoomable()&&r.zoomLevels.secondary!==r.zoomLevels.initial?r.toggleZoom(e):o.options.clickToCloseNonZoomable&&o.close();break;case"toggle-controls":(n=this.gestures.pswp.element)===null||n===void 0||n.classList.toggle("pswp--ui-visible");break}}}}const Ce=10,Te=300,ze=25;class Oe{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new Ee(this),this.zoomLevels=new Ie(this),this.tapHandler=new xe(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,e,i,n){const{pswp:o}=this,{events:r}=o,a=n?t+n:"";r.add(o.scrollWrap,t+e,this.onPointerDown.bind(this)),r.add(window,t+"move",this.onPointerMove.bind(this)),r.add(window,t+i,this.onPointerUp.bind(this)),a&&r.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const e=t.type==="mousedown"||t.pointerType==="mouse";if(e&&t.button>0)return;const{pswp:i}=this;if(!i.opener.isOpen){t.preventDefault();return}i.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(e&&(i.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),i.animations.stopAll(),this._updatePoints(t,"down"),this._numActivePoints===1&&(this.dragAxis=null,_(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1)}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===1&&!this.isDragging?(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,_(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop())):this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop())))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(this._numActivePoints===0&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this._numActivePoints===1&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?R(this.p1,this.prevP1)||this.drag.change():(!R(this.p1,this.prevP1)||!R(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const e=Date.now(),i=e-this._intervalTime;i<50&&!t||(this.velocity.x=this._getVelocity("x",i),this.velocity.y=this._getVelocity("y",i),this._intervalTime=e,_(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:e}=this.pswp;if(e.isShifted()){e.moveIndexBy(0,!0);return}if(t.type.indexOf("cancel")>0)return;if(t.type==="mouseup"||t.pointerType==="mouse"){this.tapHandler.click(this.startP1,t);return}const i=this.pswp.options.doubleTapAction?Te:0;this._tapTimer?(this._clearTapTimer(),K(this._lastStartP1,this.startP1)<ze&&this.tapHandler.doubleTap(this.startP1,t)):(_(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},i))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,e){const i=this.p1[t]-this._intervalP1[t];return Math.abs(i)>1&&e>5?i/e:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,e){this.pswp.applyFilters("preventPointerEvent",!0,t,e)&&t.preventDefault()}_updatePoints(t,e){if(this._pointerEventEnabled){const i=t,n=this._ongoingPointers.findIndex(o=>o.id===i.pointerId);e==="up"&&n>-1?this._ongoingPointers.splice(n,1):e==="down"&&n===-1?this._ongoingPointers.push(this._convertEventPosToPoint(i,{x:0,y:0})):n>-1&&this._convertEventPosToPoint(i,this._ongoingPointers[n]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&_(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&_(this.p2,this._ongoingPointers[1])}else{const i=t;this._numActivePoints=0,i.type.indexOf("touch")>-1?i.touches&&i.touches.length>0&&(this._convertEventPosToPoint(i.touches[0],this.p1),this._numActivePoints++,i.touches.length>1&&(this._convertEventPosToPoint(i.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),e==="up"?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){_(this.prevP1,this.p1),_(this.prevP2,this.p2)}_updateStartPoints(){_(this.startP1,this.p1),_(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(t!==0){const e=t>0?"x":"y";Math.abs(this.p1[e]-this.startP1[e])>=Ce&&(this.dragAxis=e)}}}_convertEventPosToPoint(t,e){return e.x=t.pageX-this.pswp.offset.x,e.y=t.pageY-this.pswp.offset.y,"pointerId"in t?e.id=t.pointerId:t.identifier!==void 0&&(e.id=t.identifier),e}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const De=.35;class Me{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:e}=this,i=Math.round(e.viewportSize.x+e.viewportSize.x*e.options.spacing),n=i!==this.slideWidth;n&&(this.slideWidth=i,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((o,r)=>{n&&C(o.el,(r+this._containerShiftIndex)*this.slideWidth),t&&o.slide&&o.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const e=S("pswp__item","div",this.pswp.container);e.setAttribute("role","group"),e.setAttribute("aria-roledescription","slide"),e.setAttribute("aria-hidden","true"),e.style.display=t===1?"block":"none",this.itemHolders.push({el:e})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,e,i){const{pswp:n}=this;let o=n.potentialIndex+t;const r=n.getNumItems();if(n.canLoop()){o=n.getLoopedIndex(o);const l=(t+r)%r;l<=r/2?t=l:t=l-r}else o<0?o=0:o>=r&&(o=r-1),t=o-n.potentialIndex;n.potentialIndex=o,this._currPositionIndex-=t,n.animations.stopMainScroll();const a=this.getCurrSlideX();if(!e)this.moveTo(a),this.updateCurrItem();else{n.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:i||0,naturalFrequency:30,dampingRatio:1,onUpdate:c=>{this.moveTo(c)},onComplete:()=>{this.updateCurrItem(),n.appendHeavy()}});let l=n.potentialIndex-n.currIndex;if(n.canLoop()){const c=(l+r)%r;c<=r/2?l=c:l=c-r}Math.abs(l)>1&&this.updateCurrItem()}return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){var t;const{pswp:e}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,e.currIndex=e.potentialIndex;let n=Math.abs(i),o;n>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),n=3,this.itemHolders.forEach(r=>{var a;(a=r.slide)===null||a===void 0||a.destroy(),r.slide=void 0}));for(let r=0;r<n;r++)i>0?(o=this.itemHolders.shift(),o&&(this.itemHolders[2]=o,this._containerShiftIndex++,C(o.el,(this._containerShiftIndex+2)*this.slideWidth),e.setContent(o,e.currIndex-n+r+2))):(o=this.itemHolders.pop(),o&&(this.itemHolders.unshift(o),this._containerShiftIndex--,C(o.el,this._containerShiftIndex*this.slideWidth),e.setContent(o,e.currIndex+n-r-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),e.animations.stopAllPan(),this.itemHolders.forEach((r,a)=>{r.slide&&r.slide.setIsActive(a===1)}),e.currSlide=(t=this.itemHolders[1])===null||t===void 0?void 0:t.slide,e.contentLoader.updateLazy(i),e.currSlide&&e.currSlide.applyCurrentZoomPan(),e.dispatch("change")}moveTo(t,e){if(!this.pswp.canLoop()&&e){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const n=Math.round(t-this.x);(i<0&&n>0||i>=this.pswp.getNumItems()-1&&n<0)&&(t=this.x+n*De)}this.x=t,this.pswp.container&&C(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:e??!1})}}const $e={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(s,t)=>t?s:$e[s];class Ze{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const e=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&e&&this._wasFocused&&e.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:e}=this;if(e.dispatch("keydown",{originalEvent:t}).defaultPrevented||me(t))return;let i,n,o=!1;const r="key"in t;switch(r?t.key:t.keyCode){case T("Escape",r):e.options.escKey&&(i="close");break;case T("z",r):i="toggleZoom";break;case T("ArrowLeft",r):n="x";break;case T("ArrowUp",r):n="y";break;case T("ArrowRight",r):n="x",o=!0;break;case T("ArrowDown",r):o=!0,n="y";break;case T("Tab",r):this._focusRoot();break}if(n){t.preventDefault();const{currSlide:a}=e;e.options.arrowKeys&&n==="x"&&e.getNumItems()>1?i=o?"next":"prev":a&&a.currZoomLevel>a.zoomLevels.fit&&(a.pan[n]+=o?-80:80,a.panTo(a.pan.x,a.pan.y))}i&&(t.preventDefault(),e[i]())}_onFocusIn(t){const{template:e}=this.pswp;e&&document!==t.target&&e!==t.target&&!e.contains(t.target)&&e.focus()}}const Re="cubic-bezier(.4,0,.22,1)";class Fe{constructor(t){var e;this.props=t;const{target:i,onComplete:n,transform:o,onFinish:r=()=>{},duration:a=333,easing:l=Re}=t;this.onFinish=r;const c=o?"transform":"opacity",h=(e=t[c])!==null&&e!==void 0?e:"";this._target=i,this._onComplete=n,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{ct(i,c,a,l),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},a+500),i.style[c]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&clearTimeout(this._helperTimeout),ue(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}const ke=12,qe=.75;class Ne{constructor(t,e,i){this.velocity=t*1e3,this._dampingRatio=e||qe,this._naturalFrequency=i||ke,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,e){let i=0,n;e/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*e);if(this._dampingRatio===1)n=this.velocity+this._naturalFrequency*t,i=(t+n*e)*o,this.velocity=i*-this._naturalFrequency+n*o;else if(this._dampingRatio<1){n=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const r=Math.cos(this._dampedFrequency*e),a=Math.sin(this._dampedFrequency*e);i=o*(t*r+n*a),this.velocity=i*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*n*r)}return i}}class He{constructor(t){this.props=t,this._raf=0;const{start:e,end:i,velocity:n,onUpdate:o,onComplete:r,onFinish:a=()=>{},dampingRatio:l,naturalFrequency:c}=t;this.onFinish=a;const h=new Ne(n,l,c);let d=Date.now(),u=e-i;const m=()=>{this._raf&&(u=h.easeFrame(u,Date.now()-d),Math.abs(u)<1&&Math.abs(h.velocity)<50?(o(i),r&&r(),this.onFinish()):(d=Date.now(),o(u+i),this._raf=requestAnimationFrame(m)))};this._raf=requestAnimationFrame(m)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class Be{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,e){const i=e?new He(t):new Fe(t);return this.activeAnimations.push(i),i.onFinish=()=>this.stop(i),i}stop(t){t.destroy();const e=this.activeAnimations.indexOf(t);e>-1&&this.activeAnimations.splice(e,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isPan?(t.destroy(),!1):!0)}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>t.props.isMainScroll?(t.destroy(),!1):!0)}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}class We{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:e}=this.pswp;let{deltaX:i,deltaY:n}=t;if(e&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(e.isZoomable()){let o=-n;t.deltaMode===1?o*=.05:o*=t.deltaMode?1:.002,o=2**o;const r=e.currZoomLevel*o;e.zoomTo(r,{x:t.clientX,y:t.clientY})}}else e.isPannable()&&(t.deltaMode===1&&(i*=18,n*=18),e.panTo(e.pan.x-i,e.pan.y-n))}}function Ve(s){if(typeof s=="string")return s;if(!s||!s.isCustomSVG)return"";const t=s;let e='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return e=e.split("%d").join(t.size||32),t.outlineID&&(e+='<use class="pswp__icn-shadow" xlink:href="#'+t.outlineID+'"/>'),e+=t.inner,e+="</svg>",e}class je{constructor(t,e){var i;const n=e.name||e.className;let o=e.html;if(t.options[n]===!1)return;typeof t.options[n+"SVG"]=="string"&&(o=t.options[n+"SVG"]),t.dispatch("uiElementCreate",{data:e});let r="";e.isButton?(r+="pswp__button ",r+=e.className||`pswp__button--${e.name}`):r+=e.className||`pswp__${e.name}`;let a=e.isButton?e.tagName||"button":e.tagName||"div";a=a.toLowerCase();const l=S(r,a);if(e.isButton){a==="button"&&(l.type="button");let{title:d}=e;const{ariaLabel:u}=e;typeof t.options[n+"Title"]=="string"&&(d=t.options[n+"Title"]),d&&(l.title=d);const m=u||d;m&&l.setAttribute("aria-label",m)}l.innerHTML=Ve(o),e.onInit&&e.onInit(l,t),e.onClick&&(l.onclick=d=>{typeof e.onClick=="string"?t[e.onClick]():typeof e.onClick=="function"&&e.onClick(d,l,t)});const c=e.appendTo||"bar";let h=t.element;c==="bar"?(t.topBar||(t.topBar=S("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),h=t.topBar):(l.classList.add("pswp__hide-on-close"),c==="wrapper"&&(h=t.scrollWrap)),(i=h)===null||i===void 0||i.appendChild(t.applyFilters("uiElement",l,e))}}function vt(s,t,e){s.classList.add("pswp__button--arrow"),s.setAttribute("aria-controls","pswp__items"),t.on("change",()=>{t.options.loop||(e?s.disabled=!(t.currIndex<t.getNumItems()-1):s.disabled=!(t.currIndex>0))})}const Ge={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:vt},Ue={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(s,t)=>{vt(s,t,!0)}},Ke={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},Xe={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},Ye={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(s,t)=>{let e,i=null;const n=(a,l)=>{s.classList.toggle("pswp__preloader--"+a,l)},o=a=>{e!==a&&(e=a,n("active",a))},r=()=>{var a;if(!((a=t.currSlide)!==null&&a!==void 0&&a.content.isLoading())){o(!1),i&&(clearTimeout(i),i=null);return}i||(i=setTimeout(()=>{var l;o(!!(!((l=t.currSlide)===null||l===void 0)&&l.content.isLoading())),i=null},t.options.preloaderDelay))};t.on("change",r),t.on("loadComplete",a=>{t.currSlide===a.slide&&r()}),t.ui&&(t.ui.updatePreloaderVisibility=r)}},Qe={name:"counter",order:5,onInit:(s,t)=>{t.on("change",()=>{s.innerText=t.currIndex+1+t.options.indexIndicatorSep+t.getNumItems()})}};function yt(s,t){s.classList.toggle("pswp--zoomed-in",t)}class Je{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[Ke,Ge,Ue,Xe,Ye,Qe],t.dispatch("uiRegister"),this.uiElementsData.sort((e,i)=>(e.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(e=>{this.registerElement(e)}),t.on("change",()=>{var e;(e=t.element)===null||e===void 0||e.classList.toggle("pswp--one-slide",t.getNumItems()===1)}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new je(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:e,options:i}=this.pswp;if(this.pswp.opener.isClosing||!t||!e)return;let{currZoomLevel:n}=e;if(this.pswp.opener.isOpen||(n=e.zoomLevels.initial),n===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=n;const o=e.zoomLevels.initial-e.zoomLevels.secondary;if(Math.abs(o)<.01||!e.isZoomable()){yt(t,!1),t.classList.remove("pswp--zoom-allowed");return}t.classList.add("pswp--zoom-allowed");const r=n===e.zoomLevels.initial?e.zoomLevels.secondary:e.zoomLevels.initial;yt(t,r<=n),(i.imageClickAction==="zoom"||i.imageClickAction==="zoom-or-close")&&t.classList.add("pswp--click-to-zoom")}}function ti(s){const t=s.getBoundingClientRect();return{x:t.left,y:t.top,w:t.width}}function ei(s,t,e){const i=s.getBoundingClientRect(),n=i.width/t,o=i.height/e,r=n>o?n:o,a=(i.width-t*r)/2,l=(i.height-e*r)/2,c={x:i.left+a,y:i.top+l,w:t*r};return c.innerRect={w:i.width,h:i.height,x:a,y:l},c}function ii(s,t,e){const i=e.dispatch("thumbBounds",{index:s,itemData:t,instance:e});if(i.thumbBounds)return i.thumbBounds;const{element:n}=t;let o,r;if(n&&e.options.thumbSelector!==!1){const a=e.options.thumbSelector||"img";r=n.matches(a)?n:n.querySelector(a)}return r=e.applyFilters("thumbEl",r,t,s),r&&(t.thumbCropped?o=ei(r,t.width||t.w||0,t.height||t.h||0):o=ti(r)),e.applyFilters("thumbBounds",o,t,s)}let si=class{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}},ni=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){var n,o,r;this._filters[t]||(this._filters[t]=[]),(n=this._filters[t])===null||n===void 0||n.push({fn:e,priority:i}),(o=this._filters[t])===null||o===void 0||o.sort((a,l)=>a.priority-l.priority),(r=this.pswp)===null||r===void 0||r.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter(i=>i.fn!==e)),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){var i;return(i=this._filters[t])===null||i===void 0||i.forEach(n=>{e[0]=n.fn.apply(this,e)}),e[0]}on(t,e){var i,n;this._listeners[t]||(this._listeners[t]=[]),(i=this._listeners[t])===null||i===void 0||i.push(e),(n=this.pswp)===null||n===void 0||n.on(t,e)}off(t,e){var i;this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(n=>e!==n)),(i=this.pswp)===null||i===void 0||i.off(t,e)}dispatch(t,e){var i;if(this.pswp)return this.pswp.dispatch(t,e);const n=new si(t,e);return(i=this._listeners[t])===null||i===void 0||i.forEach(o=>{o.call(this,n)}),n}},oi=class{constructor(t,e){if(this.element=S("pswp__img pswp__img--placeholder",t?"img":"div",e),t){const i=this.element;i.decoding="async",i.alt="",i.src=t,i.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&(this.element.tagName==="IMG"?(X(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=k(0,0,t/250)):X(this.element,t,e))}destroy(){var t;(t=this.element)!==null&&t!==void 0&&t.parentNode&&this.element.remove(),this.element=null}},ri=class{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=L.IDLE,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(t,e){if(this.slide&&this.usePlaceholder())if(this.placeholder){const i=this.placeholder.element;i&&!i.parentElement&&this.slide.container.prepend(i)}else{const i=this.instance.applyFilters("placeholderSrc",this.data.msrc&&this.slide.isFirstSlide?this.data.msrc:!1,this);this.placeholder=new oi(i,this.slide.container)}this.element&&!e||this.instance.dispatch("contentLoad",{content:this,isLazy:t}).defaultPrevented||(this.isImageContent()?(this.element=S("pswp__img","img"),this.displayedImageWidth&&this.loadImage(t)):(this.element=S("pswp__content","div"),this.element.innerHTML=this.data.html||""),e&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){var e,i;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const n=this.element;this.updateSrcsetSizes(),this.data.srcset&&(n.srcset=this.data.srcset),n.src=(e=this.data.src)!==null&&e!==void 0?e:"",n.alt=(i=this.data.alt)!==null&&i!==void 0?i:"",this.state=L.LOADING,n.complete?this.onLoaded():(n.onload=()=>{this.onLoaded()},n.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=L.LOADED,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),(this.state===L.LOADED||this.state===L.ERROR)&&this.removePlaceholder())}onError(){this.state=L.ERROR,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===L.LOADING,this)}isError(){return this.state===L.ERROR}isImageContent(){return this.type==="image"}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(X(this.element,t,e),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==L.ERROR,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=e+"px",t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,!this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented&&(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var t,e;let i=S("pswp__error-msg","div");i.innerText=(t=(e=this.instance.options)===null||e===void 0?void 0:e.errorMsg)!==null&&t!==void 0?t:"",i=this.instance.applyFilters("contentErrorElement",i,this),this.element=S("pswp__content pswp__error-msg-container","div"),this.element.appendChild(i),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===L.ERROR){this.displayError();return}if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||ht())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){this.instance.dispatch("contentActivate",{content:this}).defaultPrevented||!this.slide||(this.isImageContent()&&this.isDecoding&&!ht()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,!this.instance.dispatch("contentRemove",{content:this}).defaultPrevented&&(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),(this.state===L.LOADED||this.state===L.ERROR)&&this.removePlaceholder()))}};const ai=5;function wt(s,t,e){const i=t.createContentFromData(s,e);let n;const{options:o}=t;if(o){n=new ft(o,s,-1);let r;t.pswp?r=t.pswp.viewportSize:r=ut(o,t);const a=pt(o,r,s,e);n.update(i.width,i.height,a)}return i.lazyLoad(),n&&i.setDisplayedSize(Math.ceil(i.width*n.initial),Math.ceil(i.height*n.initial)),i}function li(s,t){const e=t.getItemData(s);if(!t.dispatch("lazyLoadSlide",{index:s,itemData:e}).defaultPrevented)return wt(e,t,s)}class ci{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,ai),this._cachedItems=[]}updateLazy(t){const{pswp:e}=this;if(e.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=e.options,n=t===void 0?!0:t>=0;let o;for(o=0;o<=i[1];o++)this.loadSlideByIndex(e.currIndex+(n?o:-o));for(o=1;o<=i[0];o++)this.loadSlideByIndex(e.currIndex+(n?-o:o))}loadSlideByIndex(t){const e=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(e);i||(i=li(e,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let e=this.getContentByIndex(t.index);return e||(e=this.pswp.createContentFromData(t.data,t.index),this.addToCache(e)),e.setSlide(t),e}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const e=this._cachedItems.findIndex(i=>!i.isAttached&&!i.hasSlide);e!==-1&&this._cachedItems.splice(e,1)[0].destroy()}}removeByIndex(t){const e=this._cachedItems.findIndex(i=>i.index===t);e!==-1&&this._cachedItems.splice(e,1)}getContentByIndex(t){return this._cachedItems.find(e=>e.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}}let hi=class extends ni{getNumItems(){var t;let e=0;const i=(t=this.options)===null||t===void 0?void 0:t.dataSource;i&&"length"in i?e=i.length:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),i.items&&(e=i.items.length));const n=this.dispatch("numItems",{dataSource:i,numItems:e});return this.applyFilters("numItems",n.numItems,i)}createContentFromData(t,e){return new ri(t,this,e)}getItemData(t){var e;const i=(e=this.options)===null||e===void 0?void 0:e.dataSource;let n={};Array.isArray(i)?n=i[t]:i&&"gallery"in i&&(i.items||(i.items=this._getGalleryDOMElements(i.gallery)),n=i.items[t]);let o=n;o instanceof Element&&(o=this._domElementToItemData(o));const r=this.dispatch("itemData",{itemData:o||{},index:t});return this.applyFilters("itemData",r.itemData,t)}_getGalleryDOMElements(t){var e,i;return(e=this.options)!==null&&e!==void 0&&e.children||(i=this.options)!==null&&i!==void 0&&i.childSelector?fe(this.options.children,this.options.childSelector,t)||[]:[t]}_domElementToItemData(t){const e={element:t},i=t.tagName==="A"?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,e.w=e.width,e.h=e.height,i.dataset.pswpType&&(e.type=i.dataset.pswpType);const o=t.querySelector("img");if(o){var n;e.msrc=o.currentSrc||o.src,e.alt=(n=o.getAttribute("alt"))!==null&&n!==void 0?n:""}(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0)}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return wt(t,this,e)}};const N=.003;class di{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,e=this.pswp.currSlide,{options:i}=t;if(i.showHideAnimationType==="fade"?(i.showHideOpacity=!0,this._thumbBounds=void 0):i.showHideAnimationType==="none"?(i.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=e==null?void 0:e.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&(e==null?void 0:e.content.usePlaceholder())&&(!this.isClosing||!t.mainScroll.isShifted()),!this._animateZoom)this._animateRootOpacity=!0,this.isOpening&&e&&(e.zoomAndPanToInitial(),e.applyCurrentZoomPan());else{var n;this._animateRootOpacity=(n=i.showHideOpacity)!==null&&n!==void 0?n:!1}if(this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>N,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation){this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,this.isOpening&&(t.element&&(t.element.style.opacity=String(N)),t.applyBgOpacity(1));return}if(this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect){var o;this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=(o=this.pswp.currSlide)===null||o===void 0?void 0:o.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")}else this._croppedZoom=!1;this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(N)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(N)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(N)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&t.mainScroll.x!==0&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&this._placeholder.tagName==="IMG"?new Promise(t=>{let e=!1,i=!0;pe(this._placeholder).finally(()=>{e=!0,i||t(!0)}),setTimeout(()=>{i=!1,e&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){var t,e;(t=this.pswp.element)===null||t===void 0||t.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),(e=this.pswp.element)===null||e===void 0||e.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;if(this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed)t.destroy();else if(this.isOpen){var e;this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),(e=t.currSlide)===null||e===void 0||e.applyCurrentZoomPan()}}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:e}=this,{innerRect:i}=this._thumbBounds,{currSlide:n,viewportSize:o}=e;if(this._croppedZoom&&i&&this._cropContainer1&&this._cropContainer2){const r=-o.x+(this._thumbBounds.x-i.x)+i.w,a=-o.y+(this._thumbBounds.y-i.y)+i.h,l=o.x-i.w,c=o.y-i.h;t?(this._animateTo(this._cropContainer1,"transform",k(r,a)),this._animateTo(this._cropContainer2,"transform",k(l,c))):(C(this._cropContainer1,r,a),C(this._cropContainer2,l,c))}n&&(_(n.pan,i||this._thumbBounds),n.currZoomLevel=this._thumbBounds.w/n.width,t?this._animateTo(n.container,"transform",n.getCurrentTransform()):n.applyCurrentZoomPan())}_animateTo(t,e,i){if(!this._duration){t.style[e]=i;return}const{animations:n}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{n.activeAnimations.length||this._onAnimationComplete()},target:t};o[e]=i,n.startTransition(o)}}const ui={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class pi extends hi{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new ge,this.animations=new Be,this.mainScroll=new Me(this),this.gestures=new Oe(this),this.opener=new di(this),this.keyboard=new Ze(this),this.contentLoader=new ci(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new We(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:e}=this.mainScroll;e[0]&&(e[0].el.style.display="block",this.setContent(e[0],this.currIndex-1)),e[2]&&(e[2].el.style.display="block",this.setContent(e[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const e=this.getNumItems();return this.options.loop&&(t>e-1&&(t-=e),t<0&&(t+=e)),F(t,0,e-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{var e;(e=t.slide)===null||e===void 0||e.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){var e;(e=this.currSlide)===null||e===void 0||e.zoomTo(...t)}toggleZoom(){var t;(t=this.currSlide)===null||t===void 0||t.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){var t;if(!this.isDestroying){this.options.showHideAnimationType="none",this.close();return}this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),(t=this.element)===null||t===void 0||t.remove(),this.mainScroll.itemHolders.forEach(e=>{var i;(i=e.slide)===null||i===void 0||i.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((e,i)=>{var n,o;let r=((n=(o=this.currSlide)===null||o===void 0?void 0:o.index)!==null&&n!==void 0?n:0)-1+i;if(this.canLoop()&&(r=this.getLoopedIndex(r)),r===t&&(this.setContent(e,t,!0),i===1)){var a;this.currSlide=e.slide,(a=e.slide)===null||a===void 0||a.setIsActive(!0)}}),this.dispatch("change")}setContent(t,e,i){if(this.canLoop()&&(e=this.getLoopedIndex(e)),t.slide){if(t.slide.index===e&&!i)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(e<0||e>=this.getNumItems()))return;const n=this.getItemData(e);t.slide=new ve(n,e,this),e===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const e=ut(this.options,this);!t&&R(e,this._prevViewportSize)||(_(this._prevViewportSize,e),this.dispatch("beforeResize"),_(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){if(!this.hasMouse){var t;this.hasMouse=!0,(t=this.element)===null||t===void 0||t.classList.add("pswp--has_mouse")}}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,e){this.offset.x=t,this.offset.y=e,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=S("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=S("pswp__bg","div",this.element),this.scrollWrap=S("pswp__scroll-wrap","section",this.element),this.container=S("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new Je(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return ii(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...ui,...t}}}/*!
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 04 Sep 2025 08:32:25 GMT
3
+ * Generated on Thu, 04 Sep 2025 13:17:47 GMT
4
4
  */
5
5
 
6
6
  $token-variables: (
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Thu, 04 Sep 2025 08:32:25 GMT
4
+ * Generated on Thu, 04 Sep 2025 13:17:47 GMT
5
5
  */
6
6
 
7
7
  $jeux: #4742ff !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@20minutes/hela",
3
- "version": "2.9.21",
3
+ "version": "2.9.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/20minutes/hela.git"