primevue
Version:
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/primevue) [ • 32.6 kB
JavaScript
this.primevue=this.primevue||{},this.primevue.galleria=function(e,t,i,a,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(e),r=l(t),o=l(a),d={name:"GalleriaItem",emits:["start-slideshow","stop-slideshow","update:activeIndex"],props:{circular:{type:Boolean,default:!1},activeIndex:{type:Number,default:0},value:{type:Array,default:null},showItemNavigators:{type:Boolean,default:!0},showIndicators:{type:Boolean,default:!0},slideShowActive:{type:Boolean,default:!0},changeItemOnIndicatorHover:{type:Boolean,default:!0},autoPlay:{type:Boolean,default:!1},templates:{type:null,default:null},id:{type:String,default:null}},mounted(){this.autoPlay&&this.$emit("start-slideshow")},methods:{next(){let e=this.activeIndex+1,t=this.circular&&this.value.length-1===this.activeIndex?0:e;this.$emit("update:activeIndex",t)},prev(){let e=0!==this.activeIndex?this.activeIndex-1:0,t=this.circular&&0===this.activeIndex?this.value.length-1:e;this.$emit("update:activeIndex",t)},stopSlideShow(){this.slideShowActive&&this.stopSlideShow&&this.$emit("stop-slideshow")},navBackward(e){this.stopSlideShow(),this.prev(),e&&e.cancelable&&e.preventDefault()},navForward(e){this.stopSlideShow(),this.next(),e&&e.cancelable&&e.preventDefault()},onIndicatorClick(e){this.stopSlideShow(),this.$emit("update:activeIndex",e)},onIndicatorMouseEnter(e){this.changeItemOnIndicatorHover&&(this.stopSlideShow(),this.$emit("update:activeIndex",e))},onIndicatorKeyDown(e,t){switch(e.code){case"Enter":case"Space":this.stopSlideShow(),this.$emit("update:activeIndex",t),e.preventDefault();break;case"ArrowDown":case"ArrowUp":e.preventDefault()}},isIndicatorItemActive(e){return this.activeIndex===e},isNavBackwardDisabled(){return!this.circular&&0===this.activeIndex},isNavForwardDisabled(){return!this.circular&&this.activeIndex===this.value.length-1},ariaSlideNumber(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slideNumber.replace(/{slideNumber}/g,e):void 0},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{activeItem(){return this.value[this.activeIndex]},navBackwardClass(){return["p-galleria-item-prev p-galleria-item-nav p-link",{"p-disabled":this.isNavBackwardDisabled()}]},navForwardClass(){return["p-galleria-item-next p-galleria-item-nav p-link",{"p-disabled":this.isNavForwardDisabled()}]},ariaSlideLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.slide:void 0}},directives:{ripple:o.default}};const c={class:"p-galleria-item-wrapper"},h={class:"p-galleria-item-container"},p=["disabled"],m=[n.createElementVNode("span",{class:"p-galleria-item-prev-icon pi pi-chevron-left"},null,-1)],u=["id","aria-label","aria-roledescription"],v=["disabled"],g=[n.createElementVNode("span",{class:"p-galleria-item-next-icon pi pi-chevron-right"},null,-1)],b={key:2,class:"p-galleria-caption"},f={key:0,class:"p-galleria-indicators p-reset"},I=["aria-label","aria-selected","aria-controls","onClick","onMouseenter","onKeydown"],y={key:0,type:"button",tabindex:"-1",class:"p-link"};d.render=function(e,t,i,a,l,s){const r=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",c,[n.createElementVNode("div",h,[i.showItemNavigators?n.withDirectives((n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:n.normalizeClass(s.navBackwardClass),onClick:t[0]||(t[0]=e=>s.navBackward(e)),disabled:s.isNavBackwardDisabled()},m,10,p)),[[r]]):n.createCommentVNode("",!0),n.createElementVNode("div",{id:i.id+"_item_"+i.activeIndex,class:"p-galleria-item",role:"group","aria-label":s.ariaSlideNumber(i.activeIndex+1),"aria-roledescription":s.ariaSlideLabel},[i.templates.item?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.templates.item),{key:0,item:s.activeItem},null,8,["item"])):n.createCommentVNode("",!0)],8,u),i.showItemNavigators?n.withDirectives((n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:n.normalizeClass(s.navForwardClass),onClick:t[1]||(t[1]=e=>s.navForward(e)),disabled:s.isNavForwardDisabled()},g,10,v)),[[r]]):n.createCommentVNode("",!0),i.templates.caption?(n.openBlock(),n.createElementBlock("div",b,[i.templates.caption?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.templates.caption),{key:0,item:s.activeItem},null,8,["item"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),i.showIndicators?(n.openBlock(),n.createElementBlock("ul",f,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,((e,t)=>(n.openBlock(),n.createElementBlock("li",{key:`p-galleria-indicator-${t}`,class:n.normalizeClass(["p-galleria-indicator",{"p-highlight":s.isIndicatorItemActive(t)}]),tabindex:"0","aria-label":s.ariaPageLabel(t+1),"aria-selected":i.activeIndex===t,"aria-controls":i.id+"_item_"+t,onClick:e=>s.onIndicatorClick(t),onMouseenter:e=>s.onIndicatorMouseEnter(t),onKeydown:e=>s.onIndicatorKeyDown(e,t)},[i.templates.indicator?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",y)),i.templates.indicator?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.templates.indicator),{key:1,index:t},null,8,["index"])):n.createCommentVNode("",!0)],42,I)))),128))])):n.createCommentVNode("",!0)])};var x={name:"GalleriaThumbnails",emits:["stop-slideshow","update:activeIndex"],props:{containerId:{type:String,default:null},value:{type:Array,default:null},numVisible:{type:Number,default:3},activeIndex:{type:Number,default:0},isVertical:{type:Boolean,default:!1},slideShowActive:{type:Boolean,default:!1},circular:{type:Boolean,default:!1},responsiveOptions:{type:Array,default:null},contentHeight:{type:String,default:"300px"},showThumbnailNavigators:{type:Boolean,default:!0},templates:{type:null,default:null},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},startPos:null,thumbnailsStyle:null,sortedResponsiveOptions:null,data(){return{d_numVisible:this.numVisible,d_oldNumVisible:this.numVisible,d_activeIndex:this.activeIndex,d_oldActiveItemIndex:this.activeIndex,totalShiftedItems:0,page:0}},watch:{numVisible(e,t){this.d_numVisible=e,this.d_oldNumVisible=t},activeIndex(e,t){this.d_activeIndex=e,this.d_oldActiveItemIndex=t}},mounted(){this.createStyle(),this.calculatePosition(),this.responsiveOptions&&this.bindDocumentListeners()},updated(){let e=this.totalShiftedItems;this.d_oldNumVisible===this.d_numVisible&&this.d_oldActiveItemIndex===this.d_activeIndex||(e=this.d_activeIndex<=this.getMedianItemIndex()?0:this.value.length-this.d_numVisible+this.getMedianItemIndex()<this.d_activeIndex?this.d_numVisible-this.value.length:this.value.length-this.d_numVisible<this.d_activeIndex&&this.d_numVisible%2==0?-1*this.d_activeIndex+this.getMedianItemIndex()+1:-1*this.d_activeIndex+this.getMedianItemIndex(),e!==this.totalShiftedItems&&(this.totalShiftedItems=e),this.$refs.itemsContainer.style.transform=this.isVertical?`translate3d(0, ${e*(100/this.d_numVisible)}%, 0)`:`translate3d(${e*(100/this.d_numVisible)}%, 0, 0)`,this.d_oldActiveItemIndex!==this.d_activeIndex&&(i.DomHandler.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.d_oldActiveItemIndex=this.d_activeIndex,this.d_oldNumVisible=this.d_numVisible)},beforeUnmount(){this.responsiveOptions&&this.unbindDocumentListeners(),this.thumbnailsStyle&&this.thumbnailsStyle.parentNode.removeChild(this.thumbnailsStyle)},methods:{step(e){let t=this.totalShiftedItems+e;e<0&&-1*t+this.d_numVisible>this.value.length-1?t=this.d_numVisible-this.value.length:e>0&&t>0&&(t=0),this.circular&&(e<0&&this.value.length-1===this.d_activeIndex?t=0:e>0&&0===this.d_activeIndex&&(t=this.d_numVisible-this.value.length)),this.$refs.itemsContainer&&(i.DomHandler.removeClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transform=this.isVertical?`translate3d(0, ${t*(100/this.d_numVisible)}%, 0)`:`translate3d(${t*(100/this.d_numVisible)}%, 0, 0)`,this.$refs.itemsContainer.style.transition="transform 500ms ease 0s"),this.totalShiftedItems=t},stopSlideShow(){this.slideShowActive&&this.stopSlideShow&&this.$emit("stop-slideshow")},getMedianItemIndex(){let e=Math.floor(this.d_numVisible/2);return this.d_numVisible%2?e:e-1},navBackward(e){this.stopSlideShow();let t=0!==this.d_activeIndex?this.d_activeIndex-1:0,i=t+this.totalShiftedItems;this.d_numVisible-i-1>this.getMedianItemIndex()&&(-1*this.totalShiftedItems!=0||this.circular)&&this.step(1);let a=this.circular&&0===this.d_activeIndex?this.value.length-1:t;this.$emit("update:activeIndex",a),e.cancelable&&e.preventDefault()},navForward(e){this.stopSlideShow();let t=this.d_activeIndex===this.value.length-1?this.value.length-1:this.d_activeIndex+1;t+this.totalShiftedItems>this.getMedianItemIndex()&&(-1*this.totalShiftedItems<this.getTotalPageNumber()-1||this.circular)&&this.step(-1);let i=this.circular&&this.value.length-1===this.d_activeIndex?0:t;this.$emit("update:activeIndex",i),e.cancelable&&e.preventDefault()},onItemClick(e){this.stopSlideShow();let t=e;if(t!==this.d_activeIndex){const e=t+this.totalShiftedItems;let i=0;t<this.d_activeIndex?(i=this.d_numVisible-e-1-this.getMedianItemIndex(),i>0&&-1*this.totalShiftedItems!=0&&this.step(i)):(i=this.getMedianItemIndex()-e,i<0&&-1*this.totalShiftedItems<this.getTotalPageNumber()-1&&this.step(i)),this.$emit("update:activeIndex",t)}},onThumbnailKeydown(e,t){switch("Enter"!==e.code&&"Space"!==e.code||(this.onItemClick(t),e.preventDefault()),e.code){case"ArrowRight":this.onRightKey();break;case"ArrowLeft":this.onLeftKey();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"ArrowUp":case"ArrowDown":e.preventDefault();break;case"Tab":this.onTabKey()}},onRightKey(){const e=i.DomHandler.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item"),t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,t+1===e.length?e.length-1:t+1)},onLeftKey(){const e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,e-1<=0?0:e-1)},onHomeKey(){const e=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(e,0)},onEndKey(){const e=i.DomHandler.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item"),t=this.findFocusedIndicatorIndex();this.changedFocusedIndicator(t,e.length-1)},onTabKey(){const e=[...i.DomHandler.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item")],t=e.findIndex((e=>i.DomHandler.hasClass(e,"p-galleria-thumbnail-item-current"))),a=i.DomHandler.findSingle(this.$refs.itemsContainer,'.p-galleria-thumbnail-item > [tabindex="0"'),n=e.findIndex((e=>e===a.parentElement));e[n].children[0].tabIndex="-1",e[t].children[0].tabIndex="0"},findFocusedIndicatorIndex(){const e=[...i.DomHandler.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item")],t=i.DomHandler.findSingle(this.$refs.itemsContainer,'.p-galleria-thumbnail-item > [tabindex="0"]');return e.findIndex((e=>e===t.parentElement))},changedFocusedIndicator(e,t){const a=i.DomHandler.find(this.$refs.itemsContainer,".p-galleria-thumbnail-item");a[e].children[0].tabIndex="-1",a[t].children[0].tabIndex="0",a[t].children[0].focus()},onTransitionEnd(){this.$refs.itemsContainer&&(i.DomHandler.addClass(this.$refs.itemsContainer,"p-items-hidden"),this.$refs.itemsContainer.style.transition="")},onTouchStart(e){let t=e.changedTouches[0];this.startPos={x:t.pageX,y:t.pageY}},onTouchMove(e){e.cancelable&&e.preventDefault()},onTouchEnd(e){let t=e.changedTouches[0];this.isVertical?this.changePageOnTouch(e,t.pageY-this.startPos.y):this.changePageOnTouch(e,t.pageX-this.startPos.x)},changePageOnTouch(e,t){t<0?this.navForward(e):this.navBackward(e)},getTotalPageNumber(){return this.value.length>this.d_numVisible?this.value.length-this.d_numVisible+1:0},createStyle(){this.thumbnailsStyle||(this.thumbnailsStyle=document.createElement("style"),this.thumbnailsStyle.type="text/css",document.body.appendChild(this.thumbnailsStyle));let e=`\n #${this.containerId} .p-galleria-thumbnail-item {\n flex: 1 0 ${100/this.d_numVisible}%\n }\n `;if(this.responsiveOptions){this.sortedResponsiveOptions=[...this.responsiveOptions],this.sortedResponsiveOptions.sort(((e,t)=>{const i=e.breakpoint,a=t.breakpoint;let n=null;return n=null==i&&null!=a?-1:null!=i&&null==a?1:null==i&&null==a?0:"string"==typeof i&&"string"==typeof a?i.localeCompare(a,void 0,{numeric:!0}):i<a?-1:i>a?1:0,-1*n}));for(let t=0;t<this.sortedResponsiveOptions.length;t++){let i=this.sortedResponsiveOptions[t];e+=`\n screen and (max-width: ${i.breakpoint}) {\n #${this.containerId} .p-galleria-thumbnail-item {\n flex: 1 0 ${100/i.numVisible}%\n }\n }\n `}}this.thumbnailsStyle.innerHTML=e},calculatePosition(){if(this.$refs.itemsContainer&&this.sortedResponsiveOptions){let e=window.innerWidth,t={numVisible:this.numVisible};for(let i=0;i<this.sortedResponsiveOptions.length;i++){let a=this.sortedResponsiveOptions[i];parseInt(a.breakpoint,10)>=e&&(t=a)}this.d_numVisible!==t.numVisible&&(this.d_numVisible=t.numVisible)}},bindDocumentListeners(){this.documentResizeListener||(this.documentResizeListener=()=>{this.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))},unbindDocumentListeners(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)},isNavBackwardDisabled(){return!this.circular&&0===this.d_activeIndex||this.value.length<=this.d_numVisible},isNavForwardDisabled(){return!this.circular&&this.d_activeIndex===this.value.length-1||this.value.length<=this.d_numVisible},firstItemAciveIndex(){return-1*this.totalShiftedItems},lastItemActiveIndex(){return this.firstItemAciveIndex()+this.d_numVisible-1},isItemActive(e){return this.firstItemAciveIndex()<=e&&this.lastItemActiveIndex()>=e},ariaPageLabel(e){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,e):void 0}},computed:{navBackwardClass(){return["p-galleria-thumbnail-prev p-link",{"p-disabled":this.isNavBackwardDisabled()}]},navForwardClass(){return["p-galleria-thumbnail-next p-link",{"p-disabled":this.isNavForwardDisabled()}]},navBackwardIconClass(){return["p-galleria-thumbnail-prev-icon pi",{"pi-chevron-left":!this.isVertical,"pi-chevron-up":this.isVertical}]},navForwardIconClass(){return["p-galleria-thumbnail-next-icon pi",{"pi-chevron-right":!this.isVertical,"pi-chevron-down":this.isVertical}]},ariaPrevButtonLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.prevPageLabel:void 0},ariaNextButtonLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.nextPageLabel:void 0}},directives:{ripple:o.default}};const w={class:"p-galleria-thumbnail-wrapper"},k={class:"p-galleria-thumbnail-container"},S=["disabled","aria-label"],C=["aria-selected","aria-controls","onKeydown"],B=["tabindex","aria-label","aria-current","onClick"],$=["disabled","aria-label"];x.render=function(e,t,i,a,l,s){const r=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("div",w,[n.createElementVNode("div",k,[i.showThumbnailNavigators?n.withDirectives((n.openBlock(),n.createElementBlock("button",n.mergeProps({key:0,class:s.navBackwardClass,disabled:s.isNavBackwardDisabled(),type:"button","aria-label":s.ariaPrevButtonLabel,onClick:t[0]||(t[0]=e=>s.navBackward(e))},i.prevButtonProps),[n.createElementVNode("span",{class:n.normalizeClass(s.navBackwardIconClass)},null,2)],16,S)),[[r]]):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"p-galleria-thumbnail-items-container",style:n.normalizeStyle({height:i.isVertical?i.contentHeight:""})},[n.createElementVNode("div",{ref:"itemsContainer",class:"p-galleria-thumbnail-items",role:"tablist",onTransitionend:t[1]||(t[1]=(...e)=>s.onTransitionEnd&&s.onTransitionEnd(...e)),onTouchstart:t[2]||(t[2]=e=>s.onTouchStart(e)),onTouchmove:t[3]||(t[3]=e=>s.onTouchMove(e)),onTouchend:t[4]||(t[4]=e=>s.onTouchEnd(e))},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,((e,t)=>(n.openBlock(),n.createElementBlock("div",{key:`p-galleria-thumbnail-item-${t}`,class:n.normalizeClass(["p-galleria-thumbnail-item",{"p-galleria-thumbnail-item-current":i.activeIndex===t,"p-galleria-thumbnail-item-active":s.isItemActive(t),"p-galleria-thumbnail-item-start":s.firstItemAciveIndex()===t,"p-galleria-thumbnail-item-end":s.lastItemActiveIndex()===t}]),role:"tab","aria-selected":i.activeIndex===t,"aria-controls":i.containerId+"_item_"+t,onKeydown:e=>s.onThumbnailKeydown(e,t)},[n.createElementVNode("div",{class:"p-galleria-thumbnail-item-content",tabindex:i.activeIndex===t?"0":"-1","aria-label":s.ariaPageLabel(t+1),"aria-current":i.activeIndex===t?"page":void 0,onClick:e=>s.onItemClick(t)},[i.templates.thumbnail?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(i.templates.thumbnail),{key:0,item:e},null,8,["item"])):n.createCommentVNode("",!0)],8,B)],42,C)))),128))],544)],4),i.showThumbnailNavigators?n.withDirectives((n.openBlock(),n.createElementBlock("button",n.mergeProps({key:1,class:s.navForwardClass,disabled:s.isNavForwardDisabled(),type:"button","aria-label":s.ariaNextButtonLabel,onClick:t[5]||(t[5]=e=>s.navForward(e))},i.nextButtonProps),[n.createElementVNode("span",{class:n.normalizeClass(s.navForwardIconClass)},null,2)],16,$)),[[r]]):n.createCommentVNode("",!0)])])};var V={name:"GalleriaContent",inheritAttrs:!1,interval:null,emits:["activeitem-change","mask-hide"],data(){return{id:this.$attrs.id||i.UniqueComponentId(),activeIndex:this.$attrs.activeIndex,numVisible:this.$attrs.numVisible,slideShowActive:!1}},watch:{"$attrs.value":function(e){e&&e.length<this.numVisible&&(this.numVisible=e.length)},"$attrs.activeIndex":function(e){this.activeIndex=e},"$attrs.numVisible":function(e){this.numVisible=e}},updated(){this.$emit("activeitem-change",this.activeIndex)},beforeUnmount(){this.slideShowActive&&this.stopSlideShow()},methods:{isAutoPlayActive(){return this.slideShowActive},startSlideShow(){this.interval=setInterval((()=>{let e=this.$attrs.circular&&this.$attrs.value.length-1===this.activeIndex?0:this.activeIndex+1;this.activeIndex=e}),this.$attrs.transitionInterval),this.slideShowActive=!0},stopSlideShow(){this.interval&&clearInterval(this.interval),this.slideShowActive=!1},getPositionClass(e,t){const i=["top","left","bottom","right"].find((e=>e===t));return i?`${e}-${i}`:""},isVertical(){return"left"===this.$attrs.thumbnailsPosition||"right"===this.$attrs.thumbnailsPosition}},computed:{galleriaClass(){const e=this.$attrs.showThumbnails&&this.getPositionClass("p-galleria-thumbnails",this.$attrs.thumbnailsPosition),t=this.$attrs.showIndicators&&this.getPositionClass("p-galleria-indicators",this.$attrs.indicatorsPosition);return["p-galleria p-component",{"p-galleria-fullscreen":this.$attrs.fullScreen,"p-galleria-indicator-onitem":this.$attrs.showIndicatorsOnItem,"p-galleria-item-nav-onhover":this.$attrs.showItemNavigatorsOnHover&&!this.$attrs.fullScreen},e,t,this.$attrs.containerClass]},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},components:{GalleriaItem:d,GalleriaThumbnails:x},directives:{ripple:o.default}};const N=["id"],_=["aria-label"],A=[n.createElementVNode("span",{class:"p-galleria-close-icon pi pi-times"},null,-1)],D={key:1,class:"p-galleria-header"},P=["aria-live"],E={key:2,class:"p-galleria-footer"};V.render=function(e,t,i,a,l,s){const r=n.resolveComponent("GalleriaItem"),o=n.resolveComponent("GalleriaThumbnails"),d=n.resolveDirective("ripple");return e.$attrs.value&&e.$attrs.value.length>0?(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:0,id:l.id,class:s.galleriaClass,style:e.$attrs.containerStyle},e.$attrs.containerProps),[e.$attrs.fullScreen?n.withDirectives((n.openBlock(),n.createElementBlock("button",{key:0,autofocus:"",type:"button",class:"p-galleria-close p-link","aria-label":s.closeAriaLabel,onClick:t[0]||(t[0]=t=>e.$emit("mask-hide"))},A,8,_)),[[d]]):n.createCommentVNode("",!0),e.$attrs.templates&&e.$attrs.templates.header?(n.openBlock(),n.createElementBlock("div",D,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.$attrs.templates.header)))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"p-galleria-content","aria-live":e.$attrs.autoPlay?"polite":"off"},[n.createVNode(r,{id:l.id,activeIndex:l.activeIndex,"onUpdate:activeIndex":t[1]||(t[1]=e=>l.activeIndex=e),slideShowActive:l.slideShowActive,"onUpdate:slideShowActive":t[2]||(t[2]=e=>l.slideShowActive=e),value:e.$attrs.value,circular:e.$attrs.circular,templates:e.$attrs.templates,showIndicators:e.$attrs.showIndicators,changeItemOnIndicatorHover:e.$attrs.changeItemOnIndicatorHover,showItemNavigators:e.$attrs.showItemNavigators,autoPlay:e.$attrs.autoPlay,onStartSlideshow:s.startSlideShow,onStopSlideshow:s.stopSlideShow},null,8,["id","activeIndex","slideShowActive","value","circular","templates","showIndicators","changeItemOnIndicatorHover","showItemNavigators","autoPlay","onStartSlideshow","onStopSlideshow"]),e.$attrs.showThumbnails?(n.openBlock(),n.createBlock(o,{key:0,activeIndex:l.activeIndex,"onUpdate:activeIndex":t[3]||(t[3]=e=>l.activeIndex=e),slideShowActive:l.slideShowActive,"onUpdate:slideShowActive":t[4]||(t[4]=e=>l.slideShowActive=e),containerId:l.id,value:e.$attrs.value,templates:e.$attrs.templates,numVisible:l.numVisible,responsiveOptions:e.$attrs.responsiveOptions,circular:e.$attrs.circular,isVertical:s.isVertical(),contentHeight:e.$attrs.verticalThumbnailViewPortHeight,showThumbnailNavigators:e.$attrs.showThumbnailNavigators,prevButtonProps:e.$attrs.prevButtonProps,nextButtonProps:e.$attrs.nextButtonProps,onStopSlideshow:s.stopSlideShow},null,8,["activeIndex","slideShowActive","containerId","value","templates","numVisible","responsiveOptions","circular","isVertical","contentHeight","showThumbnailNavigators","prevButtonProps","nextButtonProps","onStopSlideshow"])):n.createCommentVNode("",!0)],8,P),e.$attrs.templates&&e.$attrs.templates.footer?(n.openBlock(),n.createElementBlock("div",E,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.$attrs.templates.footer)))])):n.createCommentVNode("",!0)],16,N)):n.createCommentVNode("",!0)};var T={name:"Galleria",inheritAttrs:!1,emits:["update:activeIndex","update:visible"],props:{id:{type:String,default:null},value:{type:Array,default:null},activeIndex:{type:Number,default:0},fullScreen:{type:Boolean,default:!1},visible:{type:Boolean,default:!1},numVisible:{type:Number,default:3},responsiveOptions:{type:Array,default:null},showItemNavigators:{type:Boolean,default:!1},showThumbnailNavigators:{type:Boolean,default:!0},showItemNavigatorsOnHover:{type:Boolean,default:!1},changeItemOnIndicatorHover:{type:Boolean,default:!1},circular:{type:Boolean,default:!1},autoPlay:{type:Boolean,default:!1},transitionInterval:{type:Number,default:4e3},showThumbnails:{type:Boolean,default:!0},thumbnailsPosition:{type:String,default:"bottom"},verticalThumbnailViewPortHeight:{type:String,default:"300px"},showIndicators:{type:Boolean,default:!1},showIndicatorsOnItem:{type:Boolean,default:!1},indicatorsPosition:{type:String,default:"bottom"},baseZIndex:{type:Number,default:0},maskClass:{type:String,default:null},containerStyle:{type:null,default:null},containerClass:{type:null,default:null},containerProps:{type:null,default:null},prevButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},container:null,mask:null,data(){return{containerVisible:this.visible}},updated(){this.fullScreen&&this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.fullScreen&&i.DomHandler.removeClass(document.body,"p-overflow-hidden"),this.mask=null,this.container&&(i.ZIndexUtils.clear(this.container),this.container=null)},methods:{onBeforeEnter(e){i.ZIndexUtils.set("modal",e,this.baseZIndex||this.$primevue.config.zIndex.modal)},onEnter(e){this.mask.style.zIndex=String(parseInt(e.style.zIndex,10)-1),i.DomHandler.addClass(document.body,"p-overflow-hidden"),this.focus()},onBeforeLeave(){i.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onAfterLeave(e){i.ZIndexUtils.clear(e),this.containerVisible=!1,i.DomHandler.removeClass(document.body,"p-overflow-hidden")},onActiveItemChange(e){this.activeIndex!==e&&this.$emit("update:activeIndex",e)},maskHide(){this.$emit("update:visible",!1)},containerRef(e){this.container=e},maskRef(e){this.mask=e},focus(){let e=this.container.$el.querySelector("[autofocus]");e&&e.focus()}},computed:{maskContentClass(){return["p-galleria-mask p-component-overlay p-component-overlay-enter",this.maskClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]}},components:{GalleriaContent:V,Portal:r.default},directives:{focustrap:s.default}};const L=["role","aria-modal"];return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&a.firstChild?a.insertBefore(n,a.firstChild):a.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("\n.p-galleria-content {\n display: flex;\n flex-direction: column;\n}\n.p-galleria-item-wrapper {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n.p-galleria-item-container {\n position: relative;\n display: flex;\n height: 100%;\n}\n.p-galleria-item-nav {\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n}\n.p-galleria-item-prev {\n left: 0;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.p-galleria-item-next {\n right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n.p-galleria-item {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n}\n.p-galleria-item-nav-onhover .p-galleria-item-nav {\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.2s ease-in-out;\n}\n.p-galleria-item-nav-onhover .p-galleria-item-wrapper:hover .p-galleria-item-nav {\n pointer-events: all;\n opacity: 1;\n}\n.p-galleria-item-nav-onhover .p-galleria-item-wrapper:hover .p-galleria-item-nav.p-disabled {\n pointer-events: none;\n}\n.p-galleria-caption {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n}\n\n/* Thumbnails */\n.p-galleria-thumbnail-wrapper {\n display: flex;\n flex-direction: column;\n overflow: auto;\n flex-shrink: 0;\n}\n.p-galleria-thumbnail-prev,\n.p-galleria-thumbnail-next {\n align-self: center;\n flex: 0 0 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-galleria-thumbnail-prev span,\n.p-galleria-thumbnail-next span {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.p-galleria-thumbnail-container {\n display: flex;\n flex-direction: row;\n}\n.p-galleria-thumbnail-items-container {\n overflow: hidden;\n width: 100%;\n}\n.p-galleria-thumbnail-items {\n display: flex;\n}\n.p-galleria-thumbnail-item {\n overflow: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n opacity: 0.5;\n}\n.p-galleria-thumbnail-item:hover {\n opacity: 1;\n transition: opacity 0.3s;\n}\n.p-galleria-thumbnail-item-current {\n opacity: 1;\n}\n\n/* Positions */\n/* Thumbnails */\n.p-galleria-thumbnails-left .p-galleria-content,\n.p-galleria-thumbnails-right .p-galleria-content {\n flex-direction: row;\n}\n.p-galleria-thumbnails-left .p-galleria-item-wrapper,\n.p-galleria-thumbnails-right .p-galleria-item-wrapper {\n flex-direction: row;\n}\n.p-galleria-thumbnails-left .p-galleria-item-wrapper,\n.p-galleria-thumbnails-top .p-galleria-item-wrapper {\n order: 2;\n}\n.p-galleria-thumbnails-left .p-galleria-thumbnail-wrapper,\n.p-galleria-thumbnails-top .p-galleria-thumbnail-wrapper {\n order: 1;\n}\n.p-galleria-thumbnails-left .p-galleria-thumbnail-container,\n.p-galleria-thumbnails-right .p-galleria-thumbnail-container {\n flex-direction: column;\n flex-grow: 1;\n}\n.p-galleria-thumbnails-left .p-galleria-thumbnail-items,\n.p-galleria-thumbnails-right .p-galleria-thumbnail-items {\n flex-direction: column;\n height: 100%;\n}\n\n/* Indicators */\n.p-galleria-indicators {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-galleria-indicator > button {\n display: inline-flex;\n align-items: center;\n}\n.p-galleria-indicators-left .p-galleria-item-wrapper,\n.p-galleria-indicators-right .p-galleria-item-wrapper {\n flex-direction: row;\n align-items: center;\n}\n.p-galleria-indicators-left .p-galleria-item-container,\n.p-galleria-indicators-top .p-galleria-item-container {\n order: 2;\n}\n.p-galleria-indicators-left .p-galleria-indicators,\n.p-galleria-indicators-top .p-galleria-indicators {\n order: 1;\n}\n.p-galleria-indicators-left .p-galleria-indicators,\n.p-galleria-indicators-right .p-galleria-indicators {\n flex-direction: column;\n}\n.p-galleria-indicator-onitem .p-galleria-indicators {\n position: absolute;\n display: flex;\n}\n.p-galleria-indicator-onitem.p-galleria-indicators-top .p-galleria-indicators {\n top: 0;\n left: 0;\n width: 100%;\n align-items: flex-start;\n}\n.p-galleria-indicator-onitem.p-galleria-indicators-right .p-galleria-indicators {\n right: 0;\n top: 0;\n height: 100%;\n align-items: flex-end;\n}\n.p-galleria-indicator-onitem.p-galleria-indicators-bottom .p-galleria-indicators {\n bottom: 0;\n left: 0;\n width: 100%;\n align-items: flex-end;\n}\n.p-galleria-indicator-onitem.p-galleria-indicators-left .p-galleria-indicators {\n left: 0;\n top: 0;\n height: 100%;\n align-items: flex-start;\n}\n\n/* FullScreen */\n.p-galleria-mask {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.p-galleria-close {\n position: absolute;\n top: 0;\n right: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n}\n.p-galleria-mask .p-galleria-item-nav {\n position: fixed;\n top: 50%;\n margin-top: -0.5rem;\n}\n\n/* Animation */\n.p-galleria-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-galleria-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-galleria-enter-from,\n.p-galleria-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n.p-galleria-enter-active .p-galleria-item-nav {\n opacity: 0;\n}\n\n/* Keyboard Support */\n.p-items-hidden .p-galleria-thumbnail-item {\n visibility: hidden;\n}\n.p-items-hidden .p-galleria-thumbnail-item.p-galleria-thumbnail-item-active {\n visibility: visible;\n}\n"),T.render=function(e,t,i,a,l,s){const r=n.resolveComponent("GalleriaContent"),o=n.resolveComponent("Portal"),d=n.resolveDirective("focustrap");return i.fullScreen?(n.openBlock(),n.createBlock(o,{key:0},{default:n.withCtx((()=>[l.containerVisible?(n.openBlock(),n.createElementBlock("div",{key:0,ref:s.maskRef,class:n.normalizeClass(s.maskContentClass),role:i.fullScreen?"dialog":"region","aria-modal":i.fullScreen?"true":void 0},[n.createVNode(n.Transition,{name:"p-galleria",onBeforeEnter:s.onBeforeEnter,onEnter:s.onEnter,onBeforeLeave:s.onBeforeLeave,onAfterLeave:s.onAfterLeave,appear:""},{default:n.withCtx((()=>[i.visible?n.withDirectives((n.openBlock(),n.createBlock(r,n.mergeProps({key:0,ref:s.containerRef},e.$props,{onMaskHide:s.maskHide,templates:e.$slots,onActiveitemChange:s.onActiveItemChange}),null,16,["onMaskHide","templates","onActiveitemChange"])),[[d]]):n.createCommentVNode("",!0)])),_:1},8,["onBeforeEnter","onEnter","onBeforeLeave","onAfterLeave"])],10,L)):n.createCommentVNode("",!0)])),_:1})):(n.openBlock(),n.createBlock(r,n.mergeProps({key:1},e.$props,{templates:e.$slots,onActiveitemChange:s.onActiveItemChange}),null,16,["templates","onActiveitemChange"]))},T}(primevue.focustrap,primevue.portal,primevue.utils,primevue.ripple,Vue);