import e,{Component as t}from"react";import{CSSTransition as i}from"primereact/csstransition";import{DomHandler as n,ZIndexUtils as o,classNames as r,ObjectUtils as a}from"primereact/utils";import{Portal as s}from"primereact/portal";import l from"primereact/api";function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var i=0;i=1.5;return e.createElement("div",{ref:function(e){return t.mask=e},className:"p-image-mask p-component-overlay p-component-overlay-enter",onClick:this.onMaskClick},e.createElement("div",{className:"p-image-toolbar"},this.props.downloadable&&e.createElement("button",{className:"p-image-action p-link",onClick:this.onDownload,type:"button"},e.createElement("i",{className:"pi pi-download"})),e.createElement("button",{className:"p-image-action p-link",onClick:this.rotateRight,type:"button"},e.createElement("i",{className:"pi pi-refresh"})),e.createElement("button",{className:"p-image-action p-link",onClick:this.rotateLeft,type:"button"},e.createElement("i",{className:"pi pi-undo"})),e.createElement("button",{className:"p-image-action p-link",onClick:this.zoomOut,type:"button",disabled:o},e.createElement("i",{className:"pi pi-search-minus"})),e.createElement("button",{className:"p-image-action p-link",onClick:this.zoomIn,type:"button",disabled:o},e.createElement("i",{className:"pi pi-search-plus"})),e.createElement("button",{className:"p-image-action p-link",type:"button",onClick:this.hidePreview},e.createElement("i",{className:"pi pi-times"}))),e.createElement(i,{nodeRef:this.previewRef,classNames:"p-image-preview",in:this.state.previewVisible,timeout:{enter:150,exit:150},unmountOnExit:!0,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited},e.createElement("div",{ref:this.previewRef},e.createElement("img",{src:this.props.src,className:"p-image-preview",style:n,onClick:this.onPreviewImageClick,alt:this.props.alt}))))}},{key:"render",value:function(){var t=this,i=r("p-image p-component",this.props.className,{"p-image-preview-container":this.props.preview}),n=this.renderElement(),o=this.props.template?a.getJSXElement(this.props.template,this.props):e.createElement("i",{className:"p-image-preview-icon pi pi-eye"}),l=this.props;return e.createElement("span",{ref:function(e){return t.container=e},className:i,style:this.props.style},e.createElement("img",{src:l.src,className:this.props.imageClassName,width:l.width,height:l.height,style:this.props.imageStyle,alt:l.alt}),this.props.preview&&e.createElement("div",{className:"p-image-preview-indicator",onClick:this.onImageClick},o),this.state.maskVisible&&e.createElement(s,{element:n,appendTo:document.body}))}}])&&p(k.prototype,E),w&&p(k,w),Object.defineProperty(k,"prototype",{writable:!1}),C}();E={preview:!1,className:null,downloadable:!1,style:null,imageStyle:null,imageClassName:null,template:null,src:null,alt:null,width:null,height:null},(k="defaultProps")in(b=w)?Object.defineProperty(b,k,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[k]=E;export{w as Image};