PageSourceSearch

https://www.quarkexpeditions.com/wp-content/themes/quarkexpedition…/tpsliderelement.js?ver=2026.09.16.01

js quarkexpeditions.com collected 2026-09-24 18:28:19 UTC 13,131 bytes, 1 lines download raw bytes

1(()=>{var t={541:()=>{(()=>{"use strict";class t extends HTMLElement{constructor(){var t;super(),this.touchStartX=0,this.touchStartY=0,this.swipeThreshold=200,this.scrollSyncTimer=null,this.isSyncingFromScroll=!1,this.hasInitializedScroll=!1,this.allowedResponsiveKeys=["flexible-height","infinite","swipe","behaviour","auto-slide-interval","per-view","step","responsive"],this.getAttribute("current-slide")||this.setAttribute("current-slide","1"),this.swipeThreshold=Number(null!==(t=null==this?void 0:this.getAttribute("swipe-threshold"))&&void 0!==t?t:"200"),this.slide(),this.autoSlide(),this.setAttribute("initialized","yes");const e=this.getAttribute("responsive")||"";this.responsiveSettings=e?JSON.parse(e):[],"ResizeObserver"in window||(window.addEventListener("resize",this.handleResize.bind(this)),document.fonts.ready.then(()=>this.handleResize())),this.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.addEventListener("touchend",this.handleTouchEnd.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this))}handleKeyDown(t){"yes"===this.getAttribute("arrow-navigation")&&("ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),"ArrowLeft"===t.key?this.previous():"ArrowRight"===t.key&&this.next()))}connectedCallback(){this.update();const t=this.querySelector("tp-slider-slides");t&&t.addEventListener("scroll",this.handleScroll.bind(this),{passive:!0}),"scroll"===this.getAttribute("behaviour")&&(this.hasInitializedScroll||this.slide(),"complete"!==document.readyState&&window.addEventListener("load",()=>{"scroll"===this.getAttribute("behaviour")&&(this.hasInitializedScroll=!1,this.slide())},{once:!0}))}static get observedAttributes(){return["current-slide","flexible-height","infinite","swipe","per-view","step"]}attributeChangedCallback(t="",e="",i=""){"current-slide"===t&&e!==i&&(this.slide(),this.dispatchEvent(new CustomEvent("slide-complete",{bubbles:!0}))),this.update()}get currentSlideIndex(){var t;return parseInt(null!==(t=this.getAttribute("current-slide"))&&void 0!==t?t:"1")}set currentSlideIndex(t){this.setCurrentSlide(t)}get step(){var t;return parseInt(null!==(t=this.getAttribute("step"))&&void 0!==t?t:"1")}set step(t){this.setAttribute("step",t.toString())}get perView(){var t;return parseInt(null!==(t=this.getAttribute("per-view"))&&void 0!==t?t:"1")}set perView(t){this.setAttribute("per-view",t.toString())}getTotalSlides(){const t=this.getSlideElements();return t?t.length:0}getSlideElements(){const t=this.querySelector("tp-slider-slides");return null==t?void 0:t.querySelectorAll(":scope >
1 tp-slider-slide")}next(){const t=this.getTotalSlides();if(this.currentSlideIndex>=t-this.perView+1)return void("yes"===this.getAttribute("infinite")&&this.setCurrentSlide(1));const e=Math.min(this.currentSlideIndex+this.step,t-this.perView+1);e>t-this.perView+1||this.setCurrentSlide(e)}previous(){if(this.currentSlideIndex<=1)return void("yes"===this.getAttribute("infinite")&&this.setCurrentSlide(this.getTotalSlides()-this.perView+1));const t=this.getTotalSlides(),e=Math.ceil(t/this.step);let i=0;if(t/this.step!==Math.round(t/this.step)){let s;s=this.currentSlideIndex+this.step-1>=t?e:Math.ceil(this.currentSlideIndex/this.step),i=s===e?this.currentSlideIndex-this.step+1:this.currentSlideIndex-this.step}else i=this.currentSlideIndex-this.step;i>1?this.setCurrentSlide(i):this.setCurrentSlide(1)}getCurrentSlide(){return this.currentSlideIndex}setCurrentSlide(t){t>this.getTotalSlides()||t<=0||(this.dispatchEvent(new CustomEvent("slide-set",{bubbles:!0,detail:{slideIndex:t}})),this.setAttribute("current-slide",t.toString()))}slide(){if("yes"===this.getAttribute("disabled"))return;const t=this.querySelector("tp-slider-slides"),e=this.getSlideElements();if(!t||!e)return;setTimeout(()=>this.updateHeight(),0);const i=this.getAttribute("behaviour")||"";if("scroll"===i)return t.style.removeProperty("left"),void(this.isSyncingFromScroll||(this.scrollToCurrentSlide(this.hasInitializedScroll),this.hasInitializedScroll=!0));"fade"!==i&&e[this.currentSlideIndex-1]&&(t.style.left=`-${e[this.currentSlideIndex-1].offsetLeft}px`)}scrollToCurrentSlide(t=!0){const e=this.querySelector("tp-slider-slides"),i=this.getSlideElements();if(!e||!i)return;const s=i[this.currentSlideIndex-1];if(!s)return;const r=parseFloat(getComputedStyle(e).scrollPaddingInlineStart)||0;e.scrollTo({left:s.offsetLeft-r,behavior:t?"smooth":"auto"})}handleScroll(){"scroll"===this.getAttribute("behaviour")&&(null!==this.scrollSyncTimer&&clearTimeout(this.scrollSyncTimer),this.scrollSyncTimer=window.setTimeout(()=>{this.syncCurrentSlideFromScroll(),this.scrollSyncTimer=null},100))}syncCurrentSlideFromScroll(){const t=this.querySelector("tp-slider-slides"),e=this.getSlideElements();if(!t||!e||0===e.length)return;const i=t.scrollLeft,s=parseFloat(getComputedStyle(t).scrollPaddingInlineStart)||0;let r=0,l=1/0;e.forEach((t,e)=>{const n=Math.abs(t.offsetLeft-s-i);n<l&&(l=n,r=e)});const n=r+1;n!==this.currentSlideIndex&&(this.isSyncingFromScroll=!0,this.setCurrentSlide(n),this.isSyncingFromScroll=!1)}getArrow(t){const e=this.querySelectorAll(t),i=this;let s=this.querySelector(t);return e.forEach(t=>{i===t.closest("tp-slider")&&(s=t)}),s}update(){return t=this,i=function*(){const t=this.querySelector("tp-slider-nav"),e=this.querySelectorAll("tp-slider-count"),i=this.getArrow('tp-slider-arrow[direction="previous"]'),s=this.getArrow('tp-slider-arrow[direction="next"]');yield customElements.whenDefined("tp-slider-nav"),yield customElements.whenDefined("tp-slider-nav-item"),yield customElements.whenDefined("tp-slider-count"),yield customElements.whenDefined("tp-slider-arrow");const r=this.getTotalSlides(),l=Math.ceil(r/this.step),n=this.getSlideElements();if(n){const t="no"!==this.getAttribute("aria"),e=this.currentSlideIndex-1,i=e+this.perView-1;n.forEach((s,r)=>{this.currentSlideIndex-1===r?s.setAttribute("active","yes"):s.removeAttribute("active"),t&&(r>=e&&r<=i?(s.removeAttribute("aria-hidden"),s.removeAttribute("inert")):(s.setAttribute("aria-hidden","true"),s.setAttribute("inert","")))})}null==t||t.updateNavItems();const o=this.querySelectorAll("tp-slider-nav-item");o&&o.forEach((t,e,i)=>{var s;t.removeAttribute("current"),Math.round((this.currentSlideIndex-1)/this.step)===e?t.setAttribute("current","yes"):e===l-1&&this.currentSlideIndex+this.step-1>=r&&(t.setAttribute("current","yes"),null===(s=i[e-1])||void 0===s||s.removeAttribute("current"))}),e&&(this.setAttribute("total",this.getTotalSlides().toString()),e.forEach(t=>{"function"==typeof t.update&&t.update()})),"yes"!==this.getAttribute("infinite")?(this.getCurrentSlide()===this.getTotalSlides()-this.perView+1?null==s||s.setAttribute("disabled","yes"):null==s||s.removeAttribute("disabled"),1===this.getCurrentSlide()?null==i||i.setAttribute("disabled","yes"):null==i||i.removeAttribute("disabled")):(null==s||s.removeAttribute("disabled"),null==i||i.removeAttribute("disabled"))},new((e=void 0)||(e=Promise))(function(s,r){function l(t){try{o(i.next(t))}catch(t){r(t)}}function n(t){try{o(i.throw(t))}catch(t){r(t)}}function o(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e(function(t){t(i)})).then(l,n)}o((i=i.apply(t,[])).next())});var t,e,i}updateHeight(){const t=this.querySelector("tp-slider-slides");if(!t)return;if("yes"!==this.getAttribute("flexible-height")&&"fade"!==this.getAttribute("behaviour"))return void t.style.removeProperty("height");const e=this.getSlideElements();if(e)if("yes"===this.getAttribute("flexible-height"))if(this.perView>1){const i=this.currentSlideIndex-1,s=i+this.perView;let r=0;for(let t=i;t<s;t++)e[t].scrollHeight>r&&(r=e[t].scrollHeight);t.style.height=`${r}px`}else{const i=e[this.currentSlideIndex-1].scrollHeight;t.style.height=`${i}px`}else{let i=0;e.forEach(t=>{t.scrollHeight>i&&(i=t.scrollHeight)}),t.style.height=`${i}px`}}handleResize(){setTimeout(()=>{this.updateAttributesResponsively()},0),this.getAttribute("resizing")||(this.setAttribute("resizing","yes"),this.slide(),this.removeAttribute("resizing"))}updateAttributesResponsively(){this.responsiveSettings.length&&(this.allowedResponsiveKe
1ys.forEach(t=>{this.removeAttribute(t)}),this.responsiveSettings.every(t=>{if(window.matchMedia(t.media).matches){for(const e in t)"media"!==e&&this.allowedResponsiveKeys.includes(e)&&this.setAttribute(e,t[e]);return!1}return!0}))}handleTouchStart(t){"scroll"!==this.getAttribute("behaviour")&&"yes"===this.getAttribute("swipe")&&(this.touchStartX=t.touches[0].clientX,this.touchStartY=t.touches[0].clientY)}handleTouchEnd(t){if("scroll"===this.getAttribute("behaviour"))return;if("yes"!==this.getAttribute("swipe"))return;const e=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,s=e-this.touchStartX,r=i-this.touchStartY;Math.abs(s)>Math.abs(r)&&(s>0?s<this.swipeThreshold&&this.previous():s<0&&s>-this.swipeThreshold&&this.next())}autoSlide(){const t=this.getAttribute("auto-slide-interval");if(!t)return;const e=parseInt(t);e<=0||setTimeout(()=>{this.next(),this.autoSlide(),this.dispatchEvent(new CustomEvent("auto-slide-complete"))},e)}}class e extends HTMLElement{}class i extends HTMLElement{constructor(){super(),"ResizeObserver"in window&&new ResizeObserver(this.handleHeightChange.bind(this)).observe(this)}handleHeightChange(){const t=this.closest("tp-slider");t&&setTimeout(()=>{t.handleResize()},0)}}class s extends HTMLElement{}class r extends HTMLElement{constructor(){var t;super(),null===(t=this.querySelector("button"))||void 0===t||t.addEventListener("click",this.handleClick.bind(this))}handleClick(){if("yes"===this.getAttribute("disabled"))return;const t=this.closest("tp-slider");t&&("previous"===this.getAttribute("direction")?t.previous():"next"===this.getAttribute("direction")&&t.next())}}class l extends HTMLElement{constructor(){super(),this.template=null,this.slider=null,this.template=this.querySelector("template"),this.slider=this.closest("tp-slider")}updateNavItems(){var t,e,i;if(!this.template||!this.slider)return;const s=null===(t=this.slider)||void 0===t?void 0:t.getTotalSlides(),r=Math.ceil((s-(null===(e=this.slider)||void 0===e?void 0:e.perView))/(null===(i=this.slider)||void 0===i?void 0:i.step))+1;this.innerHTML="";for(let t=1;t<=r;t++){const e=this.template.content.cloneNode(!0),i=document.createElement("div");i.appendChild(e),this.innerHTML+=i.innerHTML.replace("$index",t.toString())}}}class n extends HTMLElement{constructor(){var t;super(),this.slider=this.closest("tp-slider"),null===(t=this.querySelector("button"))||void 0===t||t.addEventListener("click",this.handleClick.bind(this))}static get observedAttributes(){return["current"]}attributeChangedCallback(t,e,i){var s;if("current"===t&&"no"!==(null===(s=this.slider)||void 0===s?void 0:s.getAttribute("aria"))){const t=this.querySelector("button");t&&("yes"===i?t.setAttribute("aria-current","true"):t.removeAttribute("aria-current"))}}handleClick(){this.slider&&this.slider.setCurrentSlide(this.getIndex())}getIndex(){var t,e,i,s,r,l,n,o;if(this.getAttribute("index"))return parseInt(null!==(t=this.getAttribute("index"))&&void 0!==t?t:"0");const d=this.closest("tp-slider-nav"),h=null!==(i=null===(e=this.slider)||void 0===e?void 0:e.step)&&void 0!==i?i:1,u=null!==(r=null===(s=this.slider)||void 0===s?void 0:s.perView)&&void 0!==r?r:1,c=(null!==(n=null===(l=this.slider)||void 0===l?void 0:l.getTotalSlides())&&void 0!==n?n:1)-u+1,a=Array.from(null!==(o=null==d?void 0:d.children)&&void 0!==o?o:[]).indexOf(this)*h+1;return Math.min(c,a)}}class o extends HTMLElement{static get observedAttributes(){return["format"]}get format(){var t;return null!==(t=this.getAttribute("format"))&&void 0!==t?t:"$current / $total"}set format(t){this.setAttribute("format",t)}attributeChangedCallback(){this.update()}update(){var t;const e=this.closest("tp-slider");if(!e)return;const i=Math.min(e.currentSlideIndex-1+e.perView,e.getTotalSlides()),s=null!==(t=e.getAttribute("total"))&&void 0!==t?t:"";this.innerHTML=this.format.replace("$current",i.toString()).replace("$total",s||""),this.setAttribute("current",i.toString()),this.setAttribute("total",s||"")}}customElements.define("tp-slider-nav",l),customElements.define("tp-slider",t),customElements.define("tp-slider-count",o),customElements.define("tp-slider-track",e),customElements.define("tp-slider-slides",i),customElements.define("tp-slider-slide",s),customElements.define("tp-slider-arrow",r),customElements.define("tp-slider-nav-item",n)})()}};const e={};function i(s){const r=e[s];
1if(void 0!==r)return r.exports;const l=e[s]={exports:{}};return t[s](l,l.exports,i),l.exports}i.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{if(Array.isArray(e))for(var s=0;s<e.length;){var r=e[s++],l=e[s++];i.o(t,r)?0===l&&s++:0===l?Object.defineProperty(t,r,{enumerable:!0,value:e[s++]}):Object.defineProperty(t,r,{enumerable:!0,get:l})}else for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let s={};(()=>{"use strict";const t=i(541).TPSliderElement;i.d(s,["default",0,t])})(),window.TPSliderElement=s.default})();

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.