import{G as b}from"./iconBase.Blz05Vck.js";import{m as r,c as L}from"./swiper-react.BpyM6VYm.js";function B(d){return b({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"},child:[]}]})(d)}function O(d){return b({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"},child:[]}]})(d)}function P(d){let{swiper:a,extendParams:w,on:c,emit:f}=d;w({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),a.navigation={nextEl:null,prevEl:null};function h(n){let i;return n&&typeof n=="string"&&a.isElement&&(i=a.el.querySelector(n)||a.hostEl.querySelector(n),i)?i:(n&&(typeof n=="string"&&(i=[...document.querySelectorAll(n)]),a.params.uniqueNavElements&&typeof n=="string"&&i&&i.length>1&&a.el.querySelectorAll(n).length===1?i=a.el.querySelector(n):i&&i.length===1&&(i=i[0])),n&&!i?n:i)}function v(n,i){const e=a.params.navigation;n=r(n),n.forEach(t=>{t&&(t.classList[i?"add":"remove"](...e.disabledClass.split(" ")),t.tagName==="BUTTON"&&(t.disabled=i),a.params.watchOverflow&&a.enabled&&t.classList[a.isLocked?"add":"remove"](e.lockClass))})}function p(){const{nextEl:n,prevEl:i}=a.navigation;if(a.params.loop){v(i,!1),v(n,!1);return}v(i,a.isBeginning&&!a.params.rewind),v(n,a.isEnd&&!a.params.rewind)}function E(n){n.preventDefault(),!(a.isBeginning&&!a.params.loop&&!a.params.rewind)&&(a.slidePrev(),f("navigationPrev"))}function k(n){n.preventDefault(),!(a.isEnd&&!a.params.loop&&!a.params.rewind)&&(a.slideNext(),f("navigationNext"))}function u(){const n=a.params.navigation;if(a.params.navigation=L(a,a.originalParams.navigation,a.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(n.nextEl||n.prevEl))return;let i=h(n.nextEl),e=h(n.prevEl);Object.assign(a.navigation,{nextEl:i,prevEl:e}),i=r(i),e=r(e);const t=(s,g)=>{s&&s.addEventListener("click",g==="next"?k:E),!a.enabled&&s&&s.classList.add(...n.lockClass.split(" "))};i.forEach(s=>t(s,"next")),e.forEach(s=>t(s,"prev"))}function m(){let{nextEl:n,prevEl:i}=a.navigation;n=r(n),i=r(i);const e=(t,s)=>{t.removeEventListener("click",s==="next"?k:E),t.classList.remove(...a.params.navigation.disabledClass.split(" "))};n.forEach(t=>e(t,"next")),i.forEach(t=>e(t,"prev"))}c("init",()=>{a.params.navigation.enabled===!1?x():(u(),p())}),c("toEdge fromEdge lock unlock",()=>{p()}),c("destroy",()=>{m()}),c("enable disable",()=>{let{nextEl:n,prevEl:i}=a.navigation;if(n=r(n),i=r(i),a.enabled){p();return}[...n,...i].filter(e=>!!e).forEach(e=>e.classList.add(a.params.navigation.lockClass))}),c("click",(n,i)=>{let{nextEl:e,prevEl:t}=a.navigation;e=r(e),t=r(t);const s=i.target;let g=t.includes(s)||e.includes(s);if(a.isElement&&!g){const o=i.path||i.composedPath&&i.composedPath();o&&(g=o.find(l=>e.includes(l)||t.includes(l)))}if(a.params.navigation.hideOnClick&&!g){if(a.pagination&&a.params.pagination&&a.params.pagination.clickable&&(a.pagination.el===s||a.pagination.el.contains(s)))return;let o;e.length?o=e[0].classList.contains(a.params.navigation.hiddenClass):t.length&&(o=t[0].classList.contains(a.params.navigation.hiddenClass)),f(o===!0?"navigationShow":"navigationHide"),[...e,...t].filter(l=>!!l).forEach(l=>l.classList.toggle(a.params.navigation.hiddenClass))}});const C=()=>{a.el.classList.remove(...a.params.navigation.navigationDisabledClass.split(" ")),u(),p()},x=()=>{a.el.classList.add(...a.params.navigation.navigationDisabledClass.split(" ")),m()};Object.assign(a.navigation,{enable:C,disable:x,update:p,init:u,destroy:m})}export{B as H,P as N,O as a};
