PageSourceSearch

https://espot.cat/wp-content/themes/Divi/includes/builder-5/visual…-library-script-group-carousel.js?ver=5.6.1

js espot.cat collected 2026-10-02 14:00:54 UTC 15,808 bytes, 1 lines download raw bytes

1!function(){"use strict";var e={80967:function(e){e.exports=window.divi.scriptLibrary}},t={};function o(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){o.r(r),o.d(r,{groupCarouselInit:function(){return x},groupCarouselReInit:function(){return $},groupCarouselReInitElement:function(){return B},groupCarouselUpdate:function(){return D}});var e=o(80967);const t="divi:groupCarousel:init",s="divi:groupCarousel:beforeSlide",n="divi:groupCarousel:afterSlide",i="divi:groupCarousel:destroy",a="divi:groupCarousel:update",l={auto:!1,speed:2e3,transitionSpeed:200,pauseOnHover:!0,centerMode:!1,slidesToShow:1,slidesToScroll:1,showArrows:!0,showDots:!0,arrowPosition:"center",dotAlignment:"center",dotPosition:"below"},u="et_pb_group_carousel_track",d="et_pb_group_carousel_slide",c="et_pb_group_carousel_slide_active",p="et_pb_group_carousel_slide_last_visible",_="et_pb_group_carousel_arrow_prev",f="et_pb_group_carousel_arrow_next",w="et_pb_group_carousel_dots",m="et_pb_group_carousel_dot",v="et_pb_group_carousel_dot_active",h="et_pb_group_carousel_initialized",b="et_pb_group_carousel_auto_rotate",g="et_pb_group_carousel_center_mode";function y(e){return e instanceof HTMLElement}function S(e){return void 0!==e.__groupCarouselInstance}function L(e){const t=document.querySelectorAll(e);return Array.from(t).filter(y)}function E(e){const t=e.querySelector(".et_pb_group_carousel_track");if(!t)return[];return Array.from(t.querySelectorAll(".et_pb_group_carousel_slide")).filter((e=>{let o=e.parentElement;for(;o&&o!==t;){if(o.classList.contains("et_pb_group_carousel_track"))return!1;o=o.parentElement}return o===t}))}function A(e,t,o=!1){e.classList.add(d,"et_pb_group_carousel_clone"),e.setAttribute("aria-hidden","true"),e.removeAttribute("id");const r=t.getAttribute("data-slide-id");r&&e.setAttribute("data-slide-id",r),o&&(e.setAttribute("data-clone-of",r||""),e.setAttribute("data-is-carousel-clone","true")),e.querySelectorAll("[id]").forEach((e=>e.removeAttribute("id"))),e.querySelectorAll("style").forEach((e=>e.remove()))}function M(e,t,o){return((e-t)%o+o)%o}function C(){const e=window.innerWidth,t=window.diviBreakpointData?.enabledBreakpoints;if(!t)return"desktop";const o=t.find((e=>e?.baseDevice))?.name??"desktop";let r=null,s=null,n=null;return t.forEach((t=>{if(t?.baseDevice)return;const o=t?.maxWidth?.value,i=t?.minWidth?.value;if(o&&i&&parseInt(o,10)>=e&&parseInt(i,10)<=e&&(r=t?.name),o&&!i){const n=parseInt(o,10);n>=e&&(null===s||n<s)&&(r=t?.name,s=n)}if(!o&&i){const o=parseInt(i,10);o<=e&&(null===n||o>n)&&(r=t?.name,n=o)}})),r??o}const T={auto:"data-carousel-auto",speed:"data-carousel-speed",transitionSpeed:"data-carousel-transition-speed",pauseOnHover:"data-carousel-pause-on-hover",centerMode:"data-carousel-center-mode",slidesToShow:"data-carousel-slides-to-show",slidesToScroll:"data-carousel-slides-to-scroll",showArrows:"data-carousel-show-arrows",showDots:"data-carousel-show-dots",arrowPosition:"data-carousel-arrow-position",dotAlignment:"data-carousel-dot-alignment",dotPosition:"data-carousel-dot-position"};function P(e,t,o,r,s){if(!e)return null;const n=function(e,t,o){const r=o.indexOf(e),s=o.indexOf(t);if(r<0||s<0)return[String(e)];const n=r<s,i=n?o.slice(r,s+1):o.slice(s,r+1);return n||i.reverse(),i}(o,r,s),i=n.find((o=>{const r=e[o];return r&&Object.prototype.hasOwnProperty.call(r,t)&&null!=r[t]&&""!==r[t]}));if(!i)return null;const a=e[i];return a?String(a[t]):null}function k(e){const t=Array.from(e.classList).find((e=>e.startsWith("et_pb_group_carousel_")));if(!t)return null;const o=`.${t}`,r=window.diviModuleGroupCarouselData?.find((e=>e.selector===o)),s=r?.data??{},n=function(e){const t=window.diviElementMultiViewData;return Array.isArray(t)?t.find((t=>{if("setAttrs"!==t.action||!t.data)return!1;const{selector:o}=t;if("string"!=typeof o||!o)return!1;try{return e===document.querySelector(o)}catch{return!1}}
1))?.data??null:null}(e),i=null!==n,a=C(),l=window.diviBreakpointData?.baseBreakpointName??"desktop",u=window.diviBreakpointData?.enabledBreakpointNames??["desktop","tablet","phone"],d=(t,o)=>{const r=e.getAttribute(o);return null!==r?r:String(t??"")},c=(e,t)=>{if("number"==typeof e)return e;if("string"==typeof e){const o=parseInt(e,10);return Number.isNaN(o)?t:o}return t},p=r?.responsive?.[a];if(p){const e=p,t=s;return{auto:!0===(e.auto??t.auto),speed:c(e.speed??t.speed,2e3),transitionSpeed:c(e.transitionSpeed??t.transitionSpeed,200),pauseOnHover:!0===(e.pauseOnHover??t.pauseOnHover),centerMode:!0===(e.centerMode??t.centerMode),slidesToShow:parseInt(String(e.slidesToShow??t.slidesToShow??"1"),10),slidesToScroll:parseInt(String(e.slidesToScroll??t.slidesToScroll??"1"),10),showArrows:!0===(e.showArrows??t.showArrows),showDots:!0===(e.showDots??t.showDots),arrowPosition:e.arrowPosition??t.arrowPosition??"center",dotAlignment:e.dotAlignment??t.dotAlignment??"center",dotPosition:e.dotPosition??t.dotPosition??"below"}}const _=e=>P(n,T[e],a,l,u),f=(e,t,o)=>{const r=_(e);return null!==r?r:i?String(t??""):d(t,o)},w=(e,t,o)=>{const r=_(e);return null!==r?"true"===r:i?t:"true"===d(t?"true":"false",o)};return{auto:w("auto",!0===s.auto,"data-carousel-auto"),speed:c(f("speed",s.speed,"data-carousel-speed"),2e3),transitionSpeed:c(f("transitionSpeed",s.transitionSpeed,"data-carousel-transition-speed"),200),pauseOnHover:w("pauseOnHover",!0===s.pauseOnHover,"data-carousel-pause-on-hover"),centerMode:w("centerMode",!0===s.centerMode,"data-carousel-center-mode"),slidesToShow:parseInt(f("slidesToShow",s.slidesToShow,"data-carousel-slides-to-show"),10),slidesToScroll:parseInt(f("slidesToScroll",s.slidesToScroll,"data-carousel-slides-to-scroll"),10),showArrows:w("showArrows",!0===s.showArrows,"data-carousel-show-arrows"),showDots:w("showDots",!0===s.showDots,"data-carousel-show-dots"),arrowPosition:f("arrowPosition",s.arrowPosition,"data-carousel-arrow-position"),dotAlignment:f("dotAlignment",s.dotAlignment,"data-carousel-dot-alignment"),dotPosition:f("dotPosition",s.dotPosition,"data-carousel-dot-position")}}const I="object"==typeof window.ET_Builder;function O(o,r,a){if(!o)return null;const y=o.__groupCarouselInstance;y?.destroy&&y.destroy();const S=o.querySelector(`.${u}`);if(!S)return null;S.querySelectorAll(".et_pb_group_carousel_clone").forEach((e=>e.remove()));const L={...l,...r,auto:!I&&(r?.auto??l.auto)},C=E(o);if(0===C.length)return null;const T=C.length,P=Math.min(L.slidesToShow,T),k=Math.min(L.slidesToScroll,T),O=Math.min(Math.max(P+k-1,P,k,1),T);let x=O;if(null!==a&&Number.isFinite(a)){const e=Math.max(0,Math.min(a,T-1));x=O+e}let D,N=null,q=!1,$=null,B=null;const H=o.getAttribute("data-id")||"carousel";C.forEach(((e,t)=>{e.classList.add(d),e.setAttribute("data-slide-id",`${H}-slide-${t}`)}));for(let e=0;e<O;e++){const t=C[(T-1-e%T+T)%T],o=t.cloneNode(!0);A(o,t,I),S.insertBefore(o,S.firstChild)}for(let e=0;e<O;e++){const t=C[e%T],o=t.cloneNode(!0);A(o,t,I),S.appendChild(o)}const j=E(o);S.style.transition=`transform ${L.transitionSpeed}ms ease-in-out`;for(let e=1;e<=10;e++)o.classList.remove(`et_pb_group_carousel_slides_${e}`);P>1&&P<=10&&o.classList.add(`et_pb_group_carousel_slides_${P}`),o.classList.toggle("et_pb_group_carousel_center_mode",L.centerMode);const F=e=>{if(e<0||e>=T||q)return;const t=M(x,O,T);e!==t&&(o.dispatchEvent(new CustomEvent(s,{detail:{currentSlide:t,nextSlide:e}})),x=O+e,q=!0,V())},G=()=>{if(q)return;x+=k,q=!0,V()},R=()=>{if(q)return;x-=k,q=!0,V()},z=()=>{if(!L.auto||N)return;const e=(e=!1)=>{!L.auto||!e&&q||(N=window.setTimeout((()=>{G(),N=null}),L.speed))};o.scheduleNextSlideCallback=e,e(!0)},W=()=>{N&&(clearTimeout(N),N=null),delete o.scheduleNextSlideCallback};function V(e=!1){const t=S,r=100/P;let s;if(L.centerMode){s=-(x-(P>1?(P-1)/2:0))*r}else s=-x*r;if(e)t.style.transition="none",t.style.transform=`translateX(${s}%)`,requestAnimationFrame((()=>{t.style.transition=`transform ${L.transitionSpeed}ms ease-in-out`,o.classList.contains("et_pb_group_carousel_no_transitions")||(q=!1)}));else if(t.style.transform=`translateX(${s}%)`,q){const e=r=>{r.target===t&&"transform"===r.propertyName&&(t.removeEventListener("transitionend",e),(()=>{const e=function(e,t,o){return e>=t+o||e<t?e>=t+o?t+(e-t-o):t+o+(e-t):null}(x,O,T);null!==e?(o.classList.add("et_pb_group_carousel_no_transitions"),x=e,V(!0),setTimeout((()=>{o.classList.remove("et_pb_group_carousel_no_transitions"),I&&V(!0),L.auto&&(W(),z()),q=!1}))):q=!1})(),requestAnimationFrame((()=>
1{if(L.auto&&!N){const e=o.scheduleNextSlideCallback;e&&e()}})))};t.addEventListener("transitionend",e)}j.forEach(((e,t)=>{if(e.classList.remove(c),e.classList.remove(p),L.centerMode){const o=x+(P>1?(P-1)/2:0);t===x&&e.classList.add(c),t===Math.floor(o)&&e.classList.add(p)}else t>=x&&t<x+P&&(e.classList.add(c),t===x+P-1&&e.classList.add(p))})),X(),U();const i=M(x,O,T);o.dispatchEvent(new CustomEvent(n,{detail:{currentSlide:i,totalSlides:T}}))}function X(){const e=w,t=Array.from(o.children).find((t=>t.classList.contains(e)));if(!t)return;if(!L.showDots)return void(t.style.display="none");let r,s;if(t.style.display="",t.innerHTML="",L.centerMode)r=T,s=M(x,O,T);else if(P>=T)r=1,s=0;else{r=Math.ceil((T-P)/k)+1;const e=M(x,O,T);s=Math.floor(e/k),s=Math.max(0,Math.min(s,r-1))}for(let e=0;e<r;e++){const o=document.createElement("button");o.className=m,o.type="button",o.setAttribute("aria-label",`Go to slide ${e+1}`),e===s&&o.classList.add(v),o.addEventListener("click",(t=>{if(t.stopPropagation(),L.centerMode)F(e);else{const t=e*k;F(Math.min(t,T-P))}})),t.appendChild(o)}}function U(){const e=_,t=f,r=Array.from(o.children),s=r.find((t=>t.classList.contains(e))),n=r.find((e=>e.classList.contains(t)));if(s&&n){if(!L.showArrows)return s.style.display="none",void(n.style.display="none");s.style.display="",n.style.display="",s.removeAttribute("disabled"),n.removeAttribute("disabled")}}const Y=e=>{e.stopPropagation(),R()},J=e=>{e.stopPropagation(),G()},K=e=>{if(q)return;const t=e.touches[0];$=t.clientX,B=t.clientY},Q=e=>{if(null===$||null===B)return;if(q)return $=null,void(B=null);const t=e.changedTouches[0],o=t.clientX,r=t.clientY,s=o-$,n=r-B;Math.abs(s)>Math.abs(n)&&Math.abs(s)>50&&(e.stopPropagation(),s<0?G():s>0&&R()),$=null,B=null},Z=_,ee=f,te=Array.from(o.children),oe=te.find((e=>e.classList.contains(Z))),re=te.find((e=>e.classList.contains(ee)));if(oe&&oe.addEventListener("click",Y),re&&re.addEventListener("click",J),o.addEventListener("touchstart",K,{passive:!0}),o.addEventListener("touchend",Q),L.auto&&L.pauseOnHover&&(o.addEventListener("mouseenter",W),o.addEventListener("mouseleave",z)),I&&P>=1&&P<=10){const e=`et_pb_group_carousel_slides_${P}`;let t=!1;D=new MutationObserver((o=>{o.forEach((o=>{if("attributes"===o.type&&"class"===o.attributeName){if(t)return;const r=o.target,s=r.getAttribute("data-original-slides-to-show"),n=s&&parseInt(s,10)>P;if(!r.classList.contains(e)&&n){t=!0;for(let e=1;e<=10;e++)e!==P&&r.classList.remove(`et_pb_group_carousel_slides_${e}`);r.classList.add(e),setTimeout((()=>{t=!1}),50)}}}))})),D.observe(o,{attributes:!0,attributeFilter:["class"]})}const se={element:o,slides:j,currentSlide:x,totalSlides:T,settings:L,autoplayTimer:N,goToSlide:F,nextSlide:G,prevSlide:R,startAutoplay:z,stopAutoplay:W,updateDots:X,updateArrows:U,destroy:()=>{W();const e=_,t=f,r=Array.from(o.children),s=r.find((t=>t.classList.contains(e))),n=r.find((e=>e.classList.contains(t)));s&&s.removeEventListener("click",Y),n&&n.removeEventListener("click",J),o.removeEventListener("touchstart",K),o.removeEventListener("touchend",Q);const a=S;a.querySelectorAll(".et_pb_group_carousel_clone").forEach((e=>e.remove())),a.style.transform="",a.style.transition="",C.forEach((e=>{e.classList.remove(c)})),o.classList.remove(h);for(let e=1;e<=10;e++)o.classList.remove(`et_pb_group_carousel_slides_${e}`);o.classList.remove(b),o.classList.remove(g),D&&(D.disconnect(),D=null),delete o.__groupCarouselInstance,o.dispatchEvent(new CustomEvent(i,{detail:{element:o}}))},getRealSlideIndex:()=>M(x,O,T),getSettings:()=>({...L,slidesToShow:P,slidesToScroll:k})};return o.__groupCarouselInstance=se,V(!0),!I&&"undefined"!=typeof window&&window.et_reinit_waypoint_modules&&requestAnimationFrame((()=>{window.et_reinit_waypoint_modules()})),L.auto&&z(),o.dispatchEvent(new CustomEvent(t,{detail:{instance:se}})),e.isBuilder||window.dispatchEvent(new CustomEvent(t,{detail:{instance:se}})),se}function x(e,t){if(!e)return null;const o=e;if(o.__groupCarouselInstance||e.classList.contains(h))return o.__groupCarouselInstance||null;const r=O(e,t||k(e)||{});return r&&e.classList.add(h),r}function D(e,t){const o=e.__groupCarouselInstance,r=(e=>{if(!e)return null;const t=e.getRealSlideIndex();return Number.isFinite(t)?t:null})(o);o?.destroy&&o.destroy(),e.classList.remove("et_pb_group_carousel_initialized");const s=O(e,t,r);return s&&(e.classList.add("et_pb_group_carousel_initialized"),e.dispatchEvent(new CustomEvent(a,{detail:{instance:s}}))),s}const N="object"==typeof window.ET_Builder;function q(){L(".et_pb_group_carousel:not(.et_pb_group_carousel_initialized)").forEach((e=>x(e)))}function $(){if("object"==typeof window.ET_Builder)return;L(".et_pb_group_carousel").forEach((e=>{const t=k(e);S(e)?t&&D(e,t):x(e,t)})),q()}function B(e,t){if(!e)return;const o=k(e);if(S(e)){const r=e.__groupCarouselInstance?.getSettings(),s=o||r,n=s?t?{...s,...t}:s:null;n&&D(e,n)}else{x(e,o||t)}}let H=!1;"undefined"!=typeof window&&(window.diviModuleGroupCarouselInit=x,window.diviModuleGroupCarouselUpdate=D,window.diviModuleGroupCarouselReinit=$,window.diviModuleGroupCarouselReinitElement=B),"undefined"==typeof document||H||(H=!0,function(){if(N)return;const e=()=>{q(),function(){const e=window.diviElementMultiViewData;if(!e)return;const t=e.filter((e=>"setAttrs"===e.action&&e.selector?.includes(".et_pb_group_carousel"))),o=e=>{const t=document.querySelector(e);
1if(!t)return;const o=k(t);o&&D(t,o)};let r;const s=()=>{clearTimeout(r),r=setTimeout((()=>{t.forEach((e=>{const t=e.selector.match(/(\.et_pb_group_carousel_[^\s.]+)/)?.[1];t&&o(t)}))}),400)};window.screen?.orientation?window.screen.orientation.addEventListener("change",s):window.addEventListener("orientationchange",s),window.addEventListener("resize",s),window.addEventListener("divi:setPaginatedContent",s),s(),t.forEach((e=>{const t=e.selector.match(/(\.et_pb_group_carousel_[^\s.]+)/)?.[1];if(!t)return;const r=document.querySelector(t);r&&new MutationObserver((s=>{let n=!1;s.forEach((t=>{if("attributes"!==t.type)return;const{attributeName:o}=t;if(o?.startsWith("data-carousel-"))n=!0;else if("class"===o){const o=t.target,s=t.oldValue?.includes("et_pb_sticky")||!1,i=o.classList.contains("et_pb_sticky");if(s!==i){const t=C(),o=i?e.data["desktop--sticky"]:e.data[t];o&&Object.entries(o).forEach((([e,t])=>{"string"==typeof t&&r&&r.setAttribute(e,t)})),n=!0}}})),n&&t&&o(t)})).observe(r,{attributes:!0,attributeOldValue:!0,attributeFilter:["class","data-carousel-auto","data-carousel-speed","data-carousel-transition-speed","data-carousel-pause-on-hover","data-carousel-center-mode","data-carousel-slides-to-show","data-carousel-slides-to-scroll","data-carousel-show-arrows","data-carousel-show-dots","data-carousel-arrow-position","data-carousel-dot-alignment"]})}))}()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}())}(),((window.divi=window.divi||{}).moduleLibrary=window.divi.moduleLibrary||{}).moduleLibraryScriptGroupCarousel=r}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.