Liferay.Loader.define("item-selector-taglib@5.3.11/item_selector_preview/js/Carousel.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/tabs","liferay!frontend-js-react-web$react","./NoPreview.es","./PreviewImage.es","./PreviewVideo.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/tabs")),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),d=_interopRequireDefault(a("./NoPreview.es")),c=_interopRequireDefault(a("./PreviewImage.es")),u=_interopRequireDefault(a("./PreviewVideo.es"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const Arrow=({direction:e,handleClick:t})=>i.default.createElement("div",{className:"pull-".concat(e)},i.default.createElement(l.default,{borderless:!0,className:"icon-arrow",displayType:"secondary",onClick:t,size:"lg"},i.default.createElement(r.default,{symbol:"angle-".concat(e)}))),InfoPanel=({metadata:e})=>{const[t,a]=(0,i.useState)(0),l=JSON.parse(e),r=l.groups.map(((e,l)=>i.default.createElement(n.default.Item,{active:t===l,key:e.title,onClick:()=>a(l)},e.title))),d=l.groups.map(((e,t)=>{const a=e.data.map((e=>i.default.createElement(i.default.Fragment,{key:e.key},i.default.createElement("dt",{className:"sidebar-dt"},e.key),i.default.createElement("dd",{className:"sidebar-dd"},e.value))));return i.default.createElement(n.default.TabPane,{"aria-labelledby":"tab-".concat(t),key:"tabPane-".concat(t)},i.default.createElement("dl",{className:"sidebar-dl sidebar-section"},a))}));return i.default.createElement("div",{className:"info-panel sidenav-menu-slider"},i.default.createElement("div",{className:"sidebar sidenav-menu"},i.default.createElement("div",{className:"sidebar-header"},i.default.createElement(n.default,null,r)),i.default.createElement("div",{className:"sidebar-body"},i.default.createElement(n.default.Content,{activeIndex:t,fade:!0},d))))};var _default=({currentItem:e,handleClickNext:t,handleClickPrevious:a,isImage:l,showArrows:r=!0})=>{var n;const o="video"===e.type;let s=o&&(null==e||null===(n=e.value)||void 0===n?void 0:n.html);return o&&"string"==typeof e.value&&(s=JSON.parse(e.value).html),i.default.createElement("div",{className:"carousel closed sidenav-container"},i.default.createElement(InfoPanel,{metadata:e.metadata}),i.default.createElement("div",{className:"sidenav-content"},r&&i.default.createElement(Arrow,{direction:"left",handleClick:a}),o?i.default.createElement(u.default,{html:s}):l?i.default.createElement(c.default,{src:e.url||e.base64,title:e.title}):i.default.createElement(d.default,null),r&&i.default.createElement(Arrow,{direction:"right",handleClick:t})))};t.default=_default}}));
//# sourceMappingURL=Carousel.es.js.map