Liferay.Loader.define("@liferay/document-library-web@6.0.104/document_library/js/FileEntryPicker",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$classnames","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=a("@frontend-taglib-clay$clayui/button"),r=d(a("@frontend-taglib-clay$clayui/form")),n=o(a("@frontend-taglib-clay$clayui/icon")),f=o(a("liferay!frontend-js-react-web$classnames")),i=a("frontend-js-web"),c=(o(a("liferay!frontend-js-react-web$prop-types")),d(a("liferay!frontend-js-react-web$react")));function o(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();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]}return a.default=e,t&&t.set(e,a),a}var s=({maxFileSize:e,namespace:t,validExtensions:a})=>{const o=Number(e),u="".concat(t,"file"),[d,s]=(0,c.useState)(""),[y,m]=(0,c.useState)(""),[b,p]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{m(d?d.replace(/^.*[\\]/,""):"")}),[d]),c.default.createElement(r.default.Group,{className:(0,f.default)({"has-error":b})},c.default.createElement("label",{className:"btn btn-secondary",htmlFor:u},Liferay.Language.get("select-file")),y&&c.default.createElement(c.default.Fragment,null,c.default.createElement("small",{className:"inline-item inline-item-after"},c.default.createElement("strong",null,y)),c.default.createElement(l.ClayButtonWithIcon,{borderless:!0,displayType:"secondary",monospaced:!0,onClick:()=>s(""),symbol:"times-circle-full"})),c.default.createElement(r.ClayInput,{accept:a,className:"d-none",id:u,name:u,onChange:({target:e})=>{e.files[0].size>o?(p(!0),s("")):(p(!1),s(e.value),window["".concat(t,"updateFileNameAndTitle")]())},type:"file",value:d}),b&&c.default.createElement(r.default.FeedbackGroup,null,c.default.createElement(r.default.FeedbackItem,null,c.default.createElement(n.default,{className:"mr-1",symbol:"exclamation-full"}),(0,i.sub)(Liferay.Language.get("please-enter-a-file-with-a-valid-file-size-no-larger-than-x"),Liferay.Util.formatStorage(o,{addSpaceBeforeSuffix:!0})))))};t.default=s}}));
//# sourceMappingURL=FileEntryPicker.js.map