Loading
function(e,t,i){i.d(t,{Ay:()=>d,JF:()=>p,gA:()=>o});var a=i(627968),n=i(64700),s=i(780777),l=i(693591),r=i(375708);function o(){return[{name:r.intl.string(r.t["Sp2NF+"]),extensions:["jpg","jpeg","jfif","png","gif","webp","avif"]}]}function p(e,t,i){if(null!=e){let a=new FileReader;a.onload=a=>{"string"==typeof a.target?.result&&(a=>{if(e.type===l.a.MP4)return t(a,e);let n=new Image;n.src=a,n.onload=()=>{t(a,e)},n.onerror=()=>{i()}})(a.target.result)},a.readAsDataURL(e)}}class h extends n.PureComponent{_ref=n.createRef();_isMounted=!1;static defaultProps={multiple:!0,tabIndex:-1,maxFileSizeBytes:1/0};componentDidMount(){this._isMounted=!0}handleFileChange=e=>{let{onFileSizeError:t,maxFileSizeBytes:i}=this.props;if(e.stopPropagation(),e.preventDefault(),null!=e.currentTarget.files)for(let a=0;a<e.currentTarget.files.length;a++){let n=e.currentTarget.files[a];if(n.size>i){t?.(i,n.size);continue}p(n,this.handleFileRead,this.handleFileError)}};activateUploadDialogue(){this._ref.current?.activateUploadDialogue()}handleFileRead=(e,t)=>{let{onChange:i}=this.props;this._isMounted&&i(e,t)};handleFileError=async()=>{let{openUploadError:e}=await Promise.all([i.e("54048"),i.e("99666")]).then(i.bind(i,494921));e({title:r.intl.string(r.t["0egKg3"]),help:r.intl.string(r.t["7PnXqu"])})};render(){let{multiple:e,disabled:t,className:i,tabIndex:n,"aria-label":l,"aria-hidden":r,filters:p}=this.props;return(0,a.jsx)(s.A,{ref:this._ref,onClick:this.props.onClick,onChange:this.handleFileChange,filters:p??o(),multiple:e,disabled:t,className:i,tabIndex:n,"aria-label":l,"aria-hidden":r})}}let d=h}