UNPKG

primereact

Version:

PrimeReact is an open source UI library for React featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with Prime

2 lines (1 loc) 33.8 kB
this.primereact=this.primereact||{},this.primereact.galleria=function(e,n,t,a,i,r,l,o,c,s,u,m,p,d){"use strict";function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function h(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var b=h(n),v=f(t);function g(){return g=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},g.apply(null,arguments)}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function x(e,n){if("object"!=I(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,n||"default");if("object"!=I(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}function y(e){var n=x(e,"string");return"symbol"==I(n)?n:n+""}function w(e,n,t){return(n=y(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){if(Array.isArray(e))return e}function S(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,r,l,o=[],c=!0,s=!1;try{if(r=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;c=!1}else for(;!(c=(a=r.call(t)).done)&&(o.push(a.value),o.length!==n);c=!0);}catch(e){s=!0,i=e}finally{try{if(!c&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(s)throw i}}return o}}function E(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=Array(n);t<n;t++)a[t]=e[t];return a}function N(e,n){if(e){if("string"==typeof e)return E(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?E(e,n):void 0}}function P(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function C(e,n){return O(e)||S(e,n)||N(e,n)||P()}var D=a.ComponentBase.extend({defaultProps:{__TYPE:"Galleria",activeIndex:0,autoPlay:!1,baseZIndex:0,caption:null,changeItemOnIndicatorHover:!1,children:void 0,circular:!1,className:null,closeIcon:null,footer:null,fullScreen:!1,header:null,id:null,indicator:null,indicatorsPosition:"bottom",item:null,itemNextIcon:null,itemPrevIcon:null,nextThumbnailIcon:null,numVisible:3,onHide:null,onItemChange:null,onShow:null,prevThumbnailIcon:null,responsiveOptions:null,showIndicators:!1,showIndicatorsOnItem:!1,showItemNavigators:!1,showItemNavigatorsOnHover:!1,showThumbnailNavigators:!0,showThumbnails:!0,style:null,thumbnail:null,thumbnailsPosition:"bottom",transitionInterval:4e3,transitionOptions:null,value:null,verticalThumbnailViewPortHeight:"300px"},css:{classes:{header:"p-galleria-header",footer:"p-galleria-footer",closeIcon:"p-galleria-close-icon",closeButton:"p-galleria-close p-link",root:function(e){var n=e.props,t=e.context;return s.classNames("p-galleria p-component",{"p-galleria-fullscreen":n.fullScreen,"p-galleria-indicator-onitem":n.showIndicatorsOnItem,"p-galleria-item-nav-onhover":n.showItemNavigatorsOnHover&&!n.fullScreen,"p-input-filled":t&&"filled"===t.inputStyle||"filled"===v.default.inputStyle,"p-ripple-disabled":t&&!1===t.ripple||!1===v.default.ripple},e.thumbnailsPosClassName,e.indicatorPosClassName)},content:"p-galleria-content",mask:function(e){return s.classNames("p-galleria-mask",{"p-galleria-visible":e.visibleState})},thumbnailItem:function(e){var n=e.subProps;return s.classNames("p-galleria-thumbnail-item",{"p-galleria-thumbnail-item-current":n.current,"p-galleria-thumbnail-item-active":n.active,"p-galleria-thumbnail-item-start":n.start,"p-galleria-thumbnail-item-end":n.end})},thumbnailItemContent:"p-galleria-thumbnail-item-content",previousThumbnailIcon:"p-galleria-thumbnail-prev-icon",previousThumbnailButton:function(e){return s.classNames("p-galleria-thumbnail-prev p-link",{"p-disabled":e.isDisabled})},nextThumbnailIcon:"p-galleria-thumbnail-next-icon",nextThumbnailButton:function(e){return s.classNames("p-galleria-thumbnail-next p-link",{"p-disabled":e.isDisabled})},thumbnailContainer:"p-galleria-thumbnail-container",thumbnailItemsContainer:"p-galleria-thumbnail-items-container",thumbnailItems:"p-galleria-thumbnail-items",thumbnailWrapper:"p-galleria-thumbnail-wrapper",previousItemIcon:"p-galleria-item-prev-icon",previousItemButton:function(e){return s.classNames("p-galleria-item-prev p-galleria-item-nav p-link",{"p-disabled":e.isDisabled})},nextItemIcon:"p-galleria-item-next-icon",nextItemButton:function(e){return s.classNames("p-galleria-item-next p-galleria-item-nav p-link",{"p-disabled":e.isDisabled})},caption:"p-galleria-caption",indicator:function(e){return s.classNames("p-galleria-indicator",{"p-highlight":e.isActive})},indicators:"p-galleria-indicators p-reset",itemWrapper:"p-galleria-item-wrapper",itemContainer:"p-galleria-item-container",item:"p-galleria-item",transition:"p-galleria"},styles:"\n@layer primereact {\n .p-galleria-content {\n display: flex;\n flex-direction: column;\n }\n \n .p-galleria-item-wrapper {\n display: flex;\n flex-direction: column;\n position: relative;\n }\n \n .p-galleria-item-container {\n position: relative;\n display: flex;\n height: 100%;\n }\n \n .p-galleria-item-nav {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n overflow: hidden;\n }\n \n .p-galleria-item-prev {\n left: 0;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n \n .p-galleria-item-next {\n right: 0;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n \n .p-galleria-item {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n }\n \n .p-galleria-item-nav-onhover .p-galleria-item-nav {\n pointer-events: none;\n opacity: 0;\n transition: opacity .2s ease-in-out;\n }\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 \n .p-galleria-item-nav-onhover .p-galleria-item-wrapper:hover .p-galleria-item-nav.p-disabled {\n pointer-events: none;\n }\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 \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 \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 \n .p-galleria-thumbnail-container {\n display: flex;\n flex-direction: row;\n }\n \n .p-galleria-thumbnail-items-container {\n overflow: hidden;\n width: 100%;\n }\n \n .p-galleria-thumbnail-items {\n display: flex;\n }\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: .5;\n }\n \n .p-galleria-thumbnail-item:hover {\n opacity: 1;\n transition: opacity .3s;\n }\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 \n .p-galleria-thumbnails-left .p-galleria-item-wrapper,\n .p-galleria-thumbnails-right .p-galleria-item-wrapper {\n flex-direction: row;\n }\n \n .p-galleria-thumbnails-left .p-galleria-item-wrapper,\n .p-galleria-thumbnails-top .p-galleria-item-wrapper {\n order: 2;\n }\n \n .p-galleria-thumbnails-left .p-galleria-thumbnail-wrapper,\n .p-galleria-thumbnails-top .p-galleria-thumbnail-wrapper {\n order: 1;\n }\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 \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 \n .p-galleria-indicator > button {\n display: inline-flex;\n align-items: center;\n }\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 \n .p-galleria-indicators-left .p-galleria-item-container,\n .p-galleria-indicators-top .p-galleria-item-container {\n order: 2;\n }\n \n .p-galleria-indicators-left .p-galleria-indicators,\n .p-galleria-indicators-top .p-galleria-indicators {\n order: 1;\n }\n \n .p-galleria-indicators-left .p-galleria-indicators,\n .p-galleria-indicators-right .p-galleria-indicators {\n flex-direction: column;\n }\n \n .p-galleria-indicator-onitem .p-galleria-indicators {\n position: absolute;\n display: flex;\n z-index: 1;\n }\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 \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 \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 \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 pointer-events: none;\n }\n \n .p-galleria-mask.p-component-overlay {\n pointer-events: auto;\n }\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 \n .p-galleria-mask .p-galleria-item-nav {\n position: fixed;\n top: 50%;\n margin-top: -.5rem;\n }\n \n /* Animation */\n .p-galleria-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-galleria-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-galleria-enter-done {\n transform: none;\n }\n \n .p-galleria-exit {\n opacity: 1;\n }\n \n .p-galleria-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0.0, 0.2, 1);\n }\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 \n .p-items-hidden .p-galleria-thumbnail-item.p-galleria-thumbnail-item-active {\n visibility: visible;\n }\n}\n",inlineStyles:{thumbnailItemsContainer:function(e){return{height:e.height}}}}});function j(e){if(Array.isArray(e))return E(e)}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(e){return j(e)||T(e)||N(e)||k()}function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function R(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?H(Object(t),!0).forEach((function(n){w(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):H(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var U=b.memo(b.forwardRef((function(e,n){var a=r.useMergeProps(),i=b.useRef(null),l=e.ptm,o=e.cx,p=function(n,t){return l(n,R({hostName:e.hostName},t))},d=function(){e.slideShowActive&&e.stopSlideShow&&e.stopSlideShow()},f=function(n){d(),e.onActiveItemChange({index:e.circular&&0===e.activeItemIndex?e.value.length-1:0!==e.activeItemIndex?e.activeItemIndex-1:0}),n&&n.cancelable&&n.preventDefault()},h=function(n){d(),e.onActiveItemChange({index:e.circular&&e.value.length-1===e.activeItemIndex?0:e.activeItemIndex+1}),n&&n.cancelable&&n.preventDefault()},v=function(n){d(),e.onActiveItemChange({index:n})},I=function(n){e.changeItemOnIndicatorHover&&(d(),e.onActiveItemChange({index:n}))},x=function(n,t){switch(n.code){case"Enter":case"NumpadEnter":case"Space":d(),e.onActiveItemChange({index:t}),n.preventDefault();break;case"ArrowRight":y();break;case"ArrowLeft":w();break;case"Home":O(),n.preventDefault();break;case"End":S(),n.preventDefault();break;case"Tab":E();break;case"ArrowDown":case"ArrowUp":case"PageUp":case"PageDown":n.preventDefault()}},y=function(){var e=A(s.DomHandler.find(i.current,'[data-pc-section="indicator"]')),n=N();P(n,n+1===e.length?e.length-1:n+1)},w=function(){var e=N();P(e,e-1<=0?0:e-1)},O=function(){var e=N();P(e,0)},S=function(){var e=A(s.DomHandler.find(i.current,'[data-pc-section="indicator"]')),n=N();P(n,e.length-1)},E=function(){var e=A(s.DomHandler.find(i.current,'[data-pc-section="indicator"]')),n=e.findIndex((function(e){return!0===s.DomHandler.getAttribute(e,"data-p-highlight")})),t=s.DomHandler.findSingle(i.current,'[data-pc-section="indicator"] > button[tabindex="0"]'),a=e.findIndex((function(e){return e===t.parentElement}));e[a].children[0].tabIndex="-1",e[n].children[0].tabIndex="0"},N=function(){var e=A(s.DomHandler.find(i.current,'[data-pc-section="indicator"]')),n=s.DomHandler.findSingle(i.current,'[data-pc-section="indicator"] > button[tabindex="0"]');return e.findIndex((function(e){return e===n.parentElement}))},P=function(e,n){var t=A(s.DomHandler.find(i.current,'[data-pc-section="indicator"]'));t[e].children[0].tabIndex="-1",t[n].children[0].tabIndex="0",t[n].children[0].focus()};r.useMountEffect((function(){e.autoPlay&&e.startSlideShow()}));var C,D=function(n){var i,r="p-galleria-indicator-"+n,l=e.activeItemIndex===n,s=e.indicator&&e.indicator(n),u=a({className:o("indicator",{isActive:l}),tabIndex:0,"aria-label":(i=n+1,t.ariaLabel("pageLabel",{page:i})),"aria-selected":e.activeIndex===n,"aria-controls":e.id+"_item_"+n,"data-p-highlight":l,onClick:function(){return v(n)},onMouseEnter:function(){return I(n)},onKeyDown:function(e){return x(e,n)}},p("indicator"));return s||(s=b.createElement("button",{tabIndex:e.activeIndex===n?"0":"-1",type:"button",className:"p-link"},b.createElement(c.Ripple,null))),b.createElement("li",g({},u,{key:r}),s)},j=e.itemTemplate&&e.itemTemplate(e.value[e.activeItemIndex]),T=function(){if(e.showItemNavigators){var n=!e.circular&&0===e.activeItemIndex,t=a({className:o("previousItemIcon")},p("previousItemIcon")),i=s.IconUtils.getJSXIcon(e.itemPrevIcon||b.createElement(u.ChevronLeftIcon,t),R({},t),{props:e}),r=a({type:"button",className:o("previousItemButton",{isDisabled:n}),onClick:f,disabled:n,"data-p-disabled":n,"data-pc-group-section":"itemnavigator"},p("previousItemButton"));return b.createElement("button",r,i,b.createElement(c.Ripple,null))}return null}(),k=function(){if(e.showItemNavigators){var n=!e.circular&&e.activeItemIndex===e.value.length-1,t=a({className:o("nextItemIcon")},p("nextItemIcon")),i=s.IconUtils.getJSXIcon(e.itemNextIcon||b.createElement(m.ChevronRightIcon,t),R({},t),{props:e}),r=a({type:"button",className:o("nextItemButton",{isDisabled:n}),onClick:h,disabled:n,"data-p-disabled":n,"data-pc-group-section":"itemnavigator"},p("nextItemButton"));return b.createElement("button",r,i,b.createElement(c.Ripple,null))}return null}(),H=function(){var n=a({className:o("caption")},p("caption"));if(e.caption){var t=e.caption(e.value[e.activeItemIndex]);return b.createElement("div",n,t)}return null}(),U=function(){if(e.showIndicators){for(var n=[],t=a({className:s.classNames(e.indicatorsContentClassName,o("indicators"))},p("indicators")),r=0;r<e.value.length;r++)n.push(D(r));return b.createElement("ul",g({ref:i},t),n)}return null}(),V=a({ref:n,className:o("itemWrapper")},p("itemWrapper")),B=a({className:o("itemContainer")},p("itemContainer")),M=a({className:o("item"),id:e.id+"_item_"+e.activeItemIndex,role:"group","aria-label":(C=e.activeItemIndex+1,t.ariaLabel("slideNumber",{slideNumber:C})),"aria-roledescription":t.localeOption("aria")?t.localeOption("aria").slide:void 0},p("item"));return b.createElement("div",V,b.createElement("div",B,T,b.createElement("div",M,j),k,H),U)})));function V(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function B(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?V(Object(t),!0).forEach((function(n){w(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):V(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}U.displayName="GalleriaItem";var M=b.memo((function(e){var n,a=r.useMergeProps(),i=e.ptm,l=e.cx,o=function(n,t){return i(n,B({hostName:e.hostName},t))},c=function(){var n=s.DomHandler.find(e.itemsContainerRef.current,'[data-pc-section="thumbnailitem"]'),t=f();h(t,t+1===n.length?n.length-1:t+1)},u=function(){var e=f();h(e,e-1<=0?0:e-1)},m=function(){var e=f();h(e,0)},p=function(){var n=s.DomHandler.find(e.itemsContainerRef.current,'[data-pc-section="thumbnailitem"]'),t=f();h(t,n.length-1)},d=function(){var n=A(s.DomHandler.find(e.itemsContainerRef.current,'[data-pc-section="thumbnailitem"]')),t=n.findIndex((function(e){return!0===s.DomHandler.getAttribute(e,"data-p-active")})),a=s.DomHandler.findSingle(e.itemsContainerRef.current,'[tabindex="0"]'),i=n.findIndex((function(e){return e===a.parentElement}));n[i].children[0].tabIndex="-1",n[t].children[0].tabIndex="0"},f=function(){var n=A(s.DomHandler.find(e.itemsContainerRef.current,'[data-pc-section="thumbnailitem"]')),t=s.DomHandler.findSingle(e.itemsContainerRef.current,'[data-pc-section="thumbnailitem"] > [tabindex="0"]');return n.findIndex((function(e){return e===t.parentElement}))},h=function(n,t){var a=s.DomHandler.find(e.itemsContainerRef.current,'[data-pc-section="thumbnailitem"]');a[n].children[0].tabIndex="-1",a[t].children[0].tabIndex="0",a[t].children[0].focus()},v=e.template&&e.template(e.item),I=a({className:s.classNames(e.className,l("thumbnailItem",{subProps:e})),role:"tab","data-p-active":e.current,"aria-selected":e.current,"aria-controls":e.containerId+"_item_"+e.index,onKeyDown:function(n){switch("Enter"!==n.code&&"NumpadEnter"!==n.code&&"Space"!==n.code||(e.onItemClick({originalEvent:n,index:e.index}),n.preventDefault()),n.code){case"ArrowRight":c();break;case"ArrowLeft":u();break;case"Home":m(),n.preventDefault();break;case"End":p(),n.preventDefault();break;case"ArrowUp":case"ArrowDown":n.preventDefault();break;case"Tab":d()}},"data-p-galleria-thumbnail-item-current":e.current,"data-p-galleria-thumbnail-item-active":e.active,"data-p-galleria-thumbnail-item-start":e.start,"data-p-galleria-thumbnail-item-end":e.end},o("thumbnailItem")),x=a({className:l("thumbnailItemContent"),tabIndex:e.current?"0":"-1","aria-label":(n=e.index+1,t.ariaLabel("pageLabel",{page:n})),"aria-current":e.current?"page":void 0,onClick:function(n){e.onItemClick({originalEvent:n,index:e.index})}},o("thumbnailItemContent"));return b.createElement("div",g({},I,{key:e.index+"_galleriathumbnailitem"}),b.createElement("div",x,v))})),_=b.memo(b.forwardRef((function(e,n){var a=r.useMergeProps(),i=C(b.useState(e.numVisible),2),l=i[0],o=i[1],f=C(b.useState(0),2),h=f[0],g=f[1],I=b.useRef(null),x=b.useRef(null),y=b.useRef(""),w=b.useRef(null),O=b.useRef(null),S=r.usePrevious(l),E=r.usePrevious(e.activeItemIndex),N=b.useContext(t.PrimeReactContext),P=e.ptm,D=e.cx,j=e.sx,T=function(n,t){return P(n,B({hostName:e.hostName},t))},k=C(r.useResizeListener({listener:function(){Y()},when:e.responsiveOptions}),1)[0],H=function(n){var t=h+n;n<0&&-1*t+l>e.value.length-1?t=l-e.value.length:n>0&&t>0&&(t=0),e.circular&&(n<0&&e.value.length-1===e.activeItemIndex?t=0:n>0&&0===e.activeItemIndex&&(t=l-e.value.length)),I.current&&(s.DomHandler.removeClass(I.current,"p-items-hidden"),I.current.style.transform=e.isVertical?"translate3d(0, ".concat(t*(100/l),"%, 0)"):"translate3d(".concat(t*(100/l),"%, 0, 0)"),I.current.style.transition="transform 500ms ease 0s"),g(t)},R=function(){e.slideShowActive&&e.stopSlideShow&&e.stopSlideShow()},U=function(){var e=Math.floor(l/2);return l%2?e:e-1},V=function(n){R();var t=0!==e.activeItemIndex?e.activeItemIndex-1:0;l-(t+h)-1>U()&&(-1*h!=0||e.circular)&&H(1),e.onActiveItemChange({index:e.circular&&0===e.activeItemIndex?e.value.length-1:t}),n.cancelable&&n.preventDefault()},_=function(n){R();var t=e.activeItemIndex+1;t+h>U()&&(-1*h<J()-1||e.circular)&&H(-1),e.onActiveItemChange({index:e.circular&&e.value.length-1===e.activeItemIndex?0:t}),n.cancelable&&n.preventDefault()},L=function(n){R();var t=n.index;if(t!==e.activeItemIndex){var a=t+h,i=0;t<e.activeItemIndex?(i=l-a-1-U())>0&&-1*h!=0&&H(i):(i=U()-a)<0&&-1*h<J()-1&&H(i),e.onActiveItemChange({index:t})}},G=function(n){I.current&&"transform"===n.propertyName&&(document.body.setAttribute("data-p-items-hidden","false"),!e.isUnstyled()&&s.DomHandler.addClass(I.current,"p-items-hidden"),I.current.style.transition="")},z=function(e){var n=e.changedTouches[0];x.current={x:n.pageX,y:n.pageY}},W=function(e){e.cancelable&&e.preventDefault()},X=function(n){var t=n.changedTouches[0];Z(n,e.isVertical?t.pageY-x.current.y:t.pageX-x.current.x)},Z=function(e,n){n<0?_(e):V(e)},J=function(){return e.value.length>l?e.value.length-l+1:0},K=function(){w.current||(w.current=s.DomHandler.createInlineStyle(N&&N.nonce||v.default.nonce,N&&N.styleContainer));var n='\n [data-pc-section="thumbnailitems"]['.concat(y.current,'] {\n [data-pc-section="thumbnailitem"] {\n flex: 1 0 ').concat(100/l,"%\n }\n } \n ");if(e.responsiveOptions){var t=s.ObjectUtils.localeComparator(N&&N.locale||v.default.locale);O.current=A(e.responsiveOptions),O.current.sort((function(e,n){return s.ObjectUtils.sort(e.breakpoint,n.breakpoint,-1,t,N&&N.nullSortOrder||v.default.nullSortOrder)}));for(var a=0;a<O.current.length;a++){var i=O.current[a];n+="\n @media screen and (max-width: ".concat(i.breakpoint,') {\n [data-pc-section="thumbnailitems"][').concat(y.current,'] {\n [data-pc-section="thumbnailitem"] {\n flex: 1 0 ').concat(100/i.numVisible,"%\n }\n } \n }\n ")}}w.current.innerHTML=n},Y=function(){if(I.current&&O.current){for(var n=window.innerWidth,t={numVisible:e.numVisible},a=0;a<O.current.length;a++){var i=O.current[a];parseInt(i.breakpoint,10)>=n&&(t=i)}l!==t.numVisible&&o(t.numVisible)}};r.useMountEffect((function(){I.current&&(y.current=s.UniqueComponentId(),I.current.setAttribute(y.current,"")),K(),Y(),k()})),r.useUpdateEffect((function(){var n=h;S===l&&E===e.activeItemIndex||((n=e.activeItemIndex<=U()?0:e.value.length-l+U()<e.activeItemIndex?l-e.value.length:e.value.length-l<e.activeItemIndex&&l%2==0?-1*e.activeItemIndex+U()+1:-1*e.activeItemIndex+U())!==h&&g(n),I.current.style.transform=e.isVertical?"translate3d(0, ".concat(n*(100/l),"%, 0)"):"translate3d(".concat(n*(100/l),"%, 0, 0)"),E!==e.activeItemIndex&&(document.body.setAttribute("data-p-items-hidden","false"),!e.isUnstyled()&&s.DomHandler.removeClass(I.current,"p-items-hidden"),I.current.style.transition="transform 500ms ease 0s"))}));var q,F,$,Q,ee,ne,te,ae=function(){if(e.showThumbnailNavigators){var n=!e.circular&&0===e.activeItemIndex||e.value.length<=l,i=a({className:D("previousThumbnailIcon")},T("previousThumbnailIcon")),r=s.IconUtils.getJSXIcon(e.isVertical?e.prevThumbnailIcon||b.createElement(d.ChevronUpIcon,i):e.prevThumbnailIcon||b.createElement(u.ChevronLeftIcon,i),B({},i),{props:e}),o=a({className:D("previousThumbnailButton",{isDisabled:n}),onClick:V,type:"button",disabled:n,"data-p-disabled":n,"aria-label":t.localeOption("aria")?t.localeOption("aria").prevPageLabel:void 0,"data-pc-group-section":"thumbnailnavigator"},T("previousThumbnailButton"));return b.createElement("button",o,r,b.createElement(c.Ripple,null))}return null},ie=function(){if(e.showThumbnailNavigators){var n=!e.circular&&e.activeItemIndex===e.value.length-1||e.value.length<=l,i=a({className:D("nextThumbnailIcon")},T("nextThumbnailIcon")),r=s.IconUtils.getJSXIcon(e.isVertical?e.nextThumbnailIcon||b.createElement(p.ChevronDownIcon,i):e.nextThumbnailIcon||b.createElement(m.ChevronRightIcon,i),B({},i),{props:e}),o=a({className:D("nextThumbnailButton",{isDisabled:n}),disabled:n,type:"button","aria-label":t.localeOption("aria")?t.localeOption("aria").nextPageLabel:void 0,onClick:_,"data-p-disabled":n,"data-pc-group-section":"thumbnailnavigator"},T("nextThumbnailButton"));return b.createElement("button",o,r,b.createElement(c.Ripple,null))}return null},re=(q=e.value.map((function(n,t){var a=-1*h,i=a+l-1;return b.createElement(M,{key:t,index:t,containerId:e.containerId,itemsContainerRef:I,template:e.itemTemplate,item:n,active:a<=t&&i>=t,start:a===t,end:i===t,onItemClick:L,current:e.activeItemIndex===t,ptm:P,cx:D,sx:j})})),F=e.isVertical?e.contentHeight:"",$=ae(),Q=ie(),ee=a({className:D("thumbnailContainer")},T("thumbnailContainer")),ne=a({className:D("thumbnailItemsContainer"),style:j("thumbnailItemsContainer",{height:F})},T("thumbnailItemsContainer")),te=a({ref:I,className:D("thumbnailItems"),role:"tablist",onTransitionEnd:G,onTouchStart:z,onTouchMove:W,onTouchEnd:X},T("thumbnailItems")),b.createElement("div",ee,$,b.createElement("div",ne,b.createElement("div",te,q)),Q)),le=a({className:D("thumbnailWrapper")},T("thumbnailWrapper"));return b.createElement("div",le,re)})));function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function G(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?L(Object(t),!0).forEach((function(n){w(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}M.displayName="GalleriaThumbnailItem",_.displayName="GalleriaThumbnails";var z=b.memo(b.forwardRef((function(e,n){var u=r.useMergeProps(),m=b.useContext(t.PrimeReactContext),p=D.getProps(e,m),d=C(b.useState(!1),2),f=d[0],h=d[1],I=C(b.useState(p.numVisible),2),x=I[0],y=I[1],w=C(b.useState(!1),2),O=w[0],S=w[1],E=C(b.useState(p.activeIndex),2),N=E[0],P=E[1],j=b.useRef(null),T=b.useRef(null),k=b.useRef(null),A=p.onItemChange?p.activeIndex:N,H="left"===p.thumbnailsPosition||"right"===p.thumbnailsPosition,R=p.id||s.UniqueComponentId(),V=D.setMetaData({props:p,state:{visible:f,numVisible:x,slideShowActive:O,activeIndex:N}}),B=V.ptm,M=V.cx,L=V.sx,z=V.isUnstyled;a.useHandleStyle(D.css.styles,z,{name:"galleria"}),r.useGlobalOnEscapeKey({callback:function(){Z()},when:p.closeOnEscape&&p.fullScreen,priority:[r.ESC_KEY_HANDLING_PRIORITIES.IMAGE,0]}),r.useInterval((function(){W({index:p.circular&&p.value.length-1===A?0:A+1})}),p.transitionInterval,O);var W=function(e){e.index>=p.value.length?ee():p.onItemChange?p.onItemChange(e):P(e.index)},X=function(){h(!0)},Z=function(){h(!1)},J=function(){s.DomHandler.blockBodyScroll()},K=function(){s.ZIndexUtils.set("modal",k.current,m&&m.autoZIndex||v.default.autoZIndex,p.baseZIndex||m&&m.zIndex.modal||v.default.zIndex.modal),!z()&&s.DomHandler.addMultipleClasses(k.current,"p-component-overlay p-component-overlay-enter")},Y=function(){p.onShow&&p.onShow()},q=function(){s.DomHandler.unblockBodyScroll(),!z()&&s.DomHandler.addClass(k.current,"p-component-overlay-leave")},F=function(){s.ZIndexUtils.clear(k.current),p.onHide&&p.onHide()},$=function(){return O},Q=function(){S(!0)},ee=function(){S(!1)},ne=function(e,n){var t=["top","left","bottom","right"].find((function(e){return e===n}));return t?"".concat(e,"-").concat(t):""};b.useEffect((function(){p.value&&p.value.length<x&&y(p.value.length)}),[p.value,x]),b.useEffect((function(){y(p.numVisible)}),[p.numVisible]),r.useUnmountEffect((function(){O&&ee(),s.ZIndexUtils.clear(k.current)})),b.useImperativeHandle(n,(function(){return{props:p,show:X,hide:Z,isAutoPlayActive:$,startSlideShow:Q,stopSlideShow:ee,getElement:function(){return j.current},getPreviewContent:function(){return T.current}}}));return s.ObjectUtils.isNotEmpty(p.value)&&function(){var e,n,a,r,d,h,v,I,y,w,S,E,N=(a=p.showThumbnails&&ne("p-galleria-thumbnails",p.thumbnailsPosition),r=p.showIndicators&&ne("p-galleria-indicators",p.indicatorsPosition),d=u({className:M("closeIcon"),"aria-hidden":!0},B("closeIcon")),h=s.IconUtils.getJSXIcon(p.closeIcon||b.createElement(l.TimesIcon,d),G({},d),{props:p}),v=u({type:"button",className:M("closeButton"),"aria-label":t.localeOption("aria")?t.localeOption("aria").close:void 0,onClick:Z},B("closeButton")),I=p.fullScreen&&b.createElement("button",v,h,b.createElement(c.Ripple,null)),e=u({className:M("header")},B("header")),y=p.header?b.createElement("div",e,p.header):null,n=u({className:M("footer")},B("footer")),w=p.footer?b.createElement("div",n,p.footer):null,S=u({ref:j,id:R,className:s.classNames(p.className,M("root",{context:m,thumbnailsPosClassName:a,indicatorPosClassName:r})),style:p.style,role:"region"},D.getOtherProps(p),B("root")),E=u({className:M("content"),"aria-live":p.autoPlay?"polite":"off"},B("content")),b.createElement("div",S,I,y,b.createElement("div",E,b.createElement(U,{hostName:"Galleria",ref:T,id:R,value:p.value,activeItemIndex:A,onActiveItemChange:W,itemTemplate:p.item,circular:p.circular,caption:p.caption,showIndicators:p.showIndicators,itemPrevIcon:p.itemPrevIcon,itemNextIcon:p.itemNextIcon,changeItemOnIndicatorHover:p.changeItemOnIndicatorHover,indicator:p.indicator,showItemNavigators:p.showItemNavigators,autoPlay:p.autoPlay,slideShowActive:O,startSlideShow:Q,stopSlideShow:ee,ptm:B,cx:M}),p.showThumbnails&&b.createElement(_,{hostName:"Galleria",value:p.value,containerId:R,activeItemIndex:A,onActiveItemChange:W,itemTemplate:p.thumbnail,numVisible:x,nextThumbnailIcon:p.nextThumbnailIcon,prevThumbnailIcon:p.prevThumbnailIcon,responsiveOptions:p.responsiveOptions,circular:p.circular,isVertical:H,contentHeight:p.verticalThumbnailViewPortHeight,showThumbnailNavigators:p.showThumbnailNavigators,autoPlay:p.autoPlay,slideShowActive:O,stopSlideShow:ee,isUnstyled:z,ptm:B,cx:M,sx:L})),w));if(p.fullScreen){var P=u({className:M("mask",{visibleState:f}),role:"dialog","aria-modal":"true"},B("mask")),C=u({classNames:M("transition"),in:f,timeout:{enter:150,exit:150},options:p.transitionOptions,unmountOnExit:!0,onEnter:J,onEntering:K,onEntered:Y,onExit:q,onExited:F},B("transition")),V=b.createElement("div",g({ref:k},P),b.createElement(i.CSSTransition,g({nodeRef:j},C),N));return b.createElement(o.Portal,{element:V})}return N}()})));return z.displayName="Galleria",e.Galleria=z,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.icons.times,primereact.portal,primereact.ripple,primereact.utils,primereact.icons.chevronleft,primereact.icons.chevronright,primereact.icons.chevrondown,primereact.icons.chevronup);