1import{aq as d,ar as s,as as a,at as h,v as u,N as S,C as m}from"./storefrontApp.5Jl33SLO.min.js";import{S as _}from"./chunk-storefront_base_lit_element.BngXaMu.js";import{e as p}from"./chunk-vendor-lit.NvY0u02.js";import{A as g}from"./chunk-aria_live_controller.kpJQIIJ.js";import"./chunk-vendor-di.Bh23gdA.js";import"./chunk-storefront_settings_constants.DIF02Gz.js";import"./chunk-vendor-rxjs.Dp7kflo.js";import"./chunk-vendor-lodash.CWHFt7Z.js";import"./chunk-vendor-phoenix.cdKS79L.js";import"./chunk-storefront_event_handler.D1TSrvL.js";var f=Object.defineProperty,E=(n,e,t,r)=>{for(var i=void 0,o=n.length-1,l;o>=0;o--)(l=n[o])&&(i=l(e,t,i)||i);return i&&f(e,t,i),i};class c extends _{constructor(){super(...arguments),this.name="",this.$slider=null}static{this.moduleName=d.component}connectedCallback(){super.connectedCallback(),this._ariaLiveController||(this._ariaLiveController=new g(this))}firstUpdated(e){super.firstUpdated(e),this.$slider=this._getSlider(this.name),this._renderSlidingProgress(this.$slider),this._renderPagination(this.$slider),this._handleSlideChangeEvent(this.$slider)}disconnectedCallback(){super.disconnectedCallback(),this.$slider&&this._removeSlideChangeEvent(this.$slider)}_getSlider(e){const t=this.querySelector(`#${e}`);if(!t)throw new Error("No HTML slider element found");const r=t.getSlider();if(!r)throw new Error("No ISlider element found");return r}_renderSlidingProgress(e){const t=e.root.querySelector(`.${s.progressBar}`);if(!t)return;const r=e.Components.Controller.getEnd()+1,i=Math.min((e.index+1)/r,1);t.style.width=String(100*i)+"%"}_renderPagination(e){const t=e.root.querySelector(`.${s.paginationCurrent}`),r=e.root.querySelector(`.${s.paginationLength}`);!t||!r||(t.innerText=`${e.index+1}`,r.innerText=`${e.length}`)}_handleSlideChangeEvent(e){e.on(a.mountedMove,()=>{this._renderSlidingProgress(e),this._renderPagination(e)}),e.on(a.moved,(t,r)=>{this._updateSlideTabIndex(r,!1),this._updateSlideTabIndex(t,!0),this._announceNewSlide(t)})}_updateSlideTabIndex(e,t){const r=this.$slider?.Components.Slides.getAt(e)?.slide,i=r?.querySelector("img");if(!r||!i)return;t&&!r.querySelector("a")?i.setAttribute("tabindex","0"):i.removeAttribute("tabindex")}_announceNewSlide(e){const t=this.$slider?.Components.Slides.getAt(e)?.slide;if(!t)return;const r=t.getAttribute(h);this._ariaLiveController.handleNotifications([{id:u(),value:r}],!1)}_removeSlideChangeEvent(e){e.off(a.mountedMove)}}E([p()],c.prototype,"name");class x extends S{static{this.featureName=d.feature}async init(){return{cores:[{type:m,instance:[c]}]}}}export{x as PhotoSliderInitializer};
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.