this.primereact=this.primereact||{},this.primereact.galleria=function(e,t,i,n,s,r,a){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(t),p=o(s);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);ithis.props.value.length-1?t=this.state.numVisible-this.props.value.length:e>0&&t>0&&(t=0),this.props.circular&&(e<0&&this.props.value.length-1===this.props.activeItemIndex?t=0:e>0&&0===this.props.activeItemIndex&&(t=this.state.numVisible-this.props.value.length)),this.itemsContainer&&(i.DomHandler.removeClass(this.itemsContainer,"p-items-hidden"),this.itemsContainer.style.transform=this.props.isVertical?"translate3d(0, ".concat(t*(100/this.state.numVisible),"%, 0)"):"translate3d(".concat(t*(100/this.state.numVisible),"%, 0, 0)"),this.itemsContainer.style.transition="transform 500ms ease 0s"),this.setState({totalShiftedItems:t})}},{key:"stopSlideShow",value:function(){this.props.slideShowActive&&this.props.stopSlideShow&&this.props.stopSlideShow()}},{key:"getMedianItemIndex",value:function(){var e=Math.floor(this.state.numVisible/2);return this.state.numVisible%2?e:e-1}},{key:"navBackward",value:function(e){this.stopSlideShow();var t=0!==this.props.activeItemIndex?this.props.activeItemIndex-1:0;this.state.numVisible-(t+this.state.totalShiftedItems)-1>this.getMedianItemIndex()&&(-1*this.state.totalShiftedItems!=0||this.props.circular)&&this.step(1),this.props.onActiveItemChange({index:this.props.circular&&0===this.props.activeItemIndex?this.props.value.length-1:t}),e.cancelable&&e.preventDefault()}},{key:"navForward",value:function(e){this.stopSlideShow();var t=this.props.activeItemIndex+1;t+this.state.totalShiftedItems>this.getMedianItemIndex()&&(-1*this.state.totalShiftedItems0&&-1*this.state.totalShiftedItems!=0&&this.step(n):(n=this.getMedianItemIndex()-i)<0&&-1*this.state.totalShiftedItemsthis.state.numVisible?this.props.value.length-this.state.numVisible+1:0}},{key:"createStyle",value:function(){this.thumbnailsStyle||(this.thumbnailsStyle=i.DomHandler.createInlineStyle(p.default.nonce));var e,t="\n .p-galleria-thumbnail-items[".concat(this.attributeSelector,"] .p-galleria-thumbnail-item {\n flex: 1 0 ").concat(100/this.state.numVisible,"%\n }\n ");if(this.props.responsiveOptions){this.responsiveOptions=E(e=this.props.responsiveOptions)||C(e)||N(e)||O(),this.responsiveOptions.sort((function(e,t){var i=e.breakpoint,n=t.breakpoint;return-1*(null==i&&null!=n?-1:null!=i&&null==n?1:null==i&&null==n?0:"string"==typeof i&&"string"==typeof n?i.localeCompare(n,void 0,{numeric:!0}):in?1:0)}));for(var n=0;n=e&&(t=n)}this.state.numVisible!==t.numVisible&&this.setState({numVisible:t.numVisible})}}},{key:"bindDocumentListeners",value:function(){var e=this;this.documentResizeListener||(this.documentResizeListener=function(){e.calculatePosition()},window.addEventListener("resize",this.documentResizeListener))}},{key:"unbindDocumentListeners",value:function(){this.documentResizeListener&&(window.removeEventListener("resize",this.documentResizeListener),this.documentResizeListener=null)}},{key:"componentDidMount",value:function(){this.itemsContainer&&this.itemsContainer.setAttribute(this.attributeSelector,""),this.createStyle(),this.calculatePosition(),this.props.responsiveOptions&&this.bindDocumentListeners()}},{key:"componentDidUpdate",value:function(e,t){var n=this.state.totalShiftedItems;t.numVisible===this.state.numVisible&&e.activeItemIndex===this.props.activeItemIndex||((n=this.props.activeItemIndex<=this.getMedianItemIndex()?0:this.props.value.length-this.state.numVisible+this.getMedianItemIndex()=i,start:n===i,end:s===i,onItemClick:e.onItemClick,current:e.props.activeItemIndex===i})}))}},{key:"renderBackwardNavigator",value:function(){if(this.props.showThumbnailNavigators){var e=!this.props.circular&&0===this.props.activeItemIndex||this.props.value.length<=this.state.numVisible,t=i.classNames("p-galleria-thumbnail-prev p-link",{"p-disabled":e}),s=i.classNames("p-galleria-thumbnail-prev-icon pi",{"pi-chevron-left":!this.props.isVertical,"pi-chevron-up":this.props.isVertical});return l.default.createElement("button",{className:t,onClick:this.navBackward,disabled:e},l.default.createElement("span",{className:s}),l.default.createElement(n.Ripple,null))}return null}},{key:"renderForwardNavigator",value:function(){if(this.props.showThumbnailNavigators){var e=!this.props.circular&&this.props.activeItemIndex===this.props.value.length-1||this.props.value.length<=this.state.numVisible,t=i.classNames("p-galleria-thumbnail-next p-link",{"p-disabled":e}),s=i.classNames("p-galleria-thumbnail-next-icon pi",{"pi-chevron-right":!this.props.isVertical,"pi-chevron-down":this.props.isVertical});return l.default.createElement("button",{className:t,onClick:this.navForward,disabled:e},l.default.createElement("span",{className:s}),l.default.createElement(n.Ripple,null))}return null}},{key:"renderContent",value:function(){var e=this,t=this.renderItems(),i=this.props.isVertical?this.props.contentHeight:"",n=this.renderBackwardNavigator(),s=this.renderForwardNavigator();return l.default.createElement("div",{className:"p-galleria-thumbnail-container"},n,l.default.createElement("div",{className:"p-galleria-thumbnail-items-container",style:{height:i}},l.default.createElement("div",{ref:function(t){return e.itemsContainer=t},className:"p-galleria-thumbnail-items",onTransitionEnd:this.onTransitionEnd,onTouchStart:this.onTouchStart,onTouchMove:this.onTouchMove,onTouchEnd:this.onTouchEnd},t)),s)}},{key:"render",value:function(){var e=this.renderContent();return l.default.createElement("div",{className:"p-galleria-thumbnail-wrapper"},e)}}]),s}(t.Component);function R(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function D(e){for(var t=1;t0&&this.renderGalleria()}}]),u}(t.Component);return y(M,"defaultProps",{id:null,value:null,activeIndex:0,fullScreen:!1,item:null,thumbnail:null,indicator:null,caption:null,className:null,style:null,header:null,footer:null,numVisible:3,responsiveOptions:null,showItemNavigators:!1,showThumbnailNavigators:!0,showItemNavigatorsOnHover:!1,changeItemOnIndicatorHover:!1,circular:!1,autoPlay:!1,transitionInterval:4e3,showThumbnails:!0,thumbnailsPosition:"bottom",verticalThumbnailViewPortHeight:"300px",showIndicators:!1,showIndicatorsOnItem:!1,indicatorsPosition:"bottom",baseZIndex:0,transitionOptions:null,onItemChange:null}),e.Galleria=M,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.ripple,primereact.api,primereact.csstransition,primereact.portal);