"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[2185],{62185:function(e,t,r){r.r(t);var n=r(29439),a=r(1413),i=r(72791),o=r(57689),l=r(29945),s=r(56028),c=r(11135),u=r(23814),d=r(78687),f=r(45248),h=r(81551),m=r(87995),x=r(72455),j=r(80184),p=(0,x.Z)((function(e){return(0,c.Z)((0,a.Z)((0,a.Z)({},u.ID),u.DF))})),v=(0,d.$j)((function(e){return{simplePath:e.objectBrowser.simplePath}}));t.default=v((function(e){var t=e.modalOpen,r=(e.folderName,e.bucketName),a=e.onClose,c=e.simplePath,u=(0,h.TL)(),x=(0,o.s0)(),v=p(),b=(0,i.useState)(""),w=(0,n.Z)(b,2),Z=w[0],C=w[1],g=(0,i.useState)(!1),k=(0,n.Z)(g,2),P=k[0],F=k[1],N=(0,i.useState)(r),y=(0,n.Z)(N,2),z=y[0],E=y[1],S=(0,d.v9)((function(e){return e.objectBrowser.records}));(0,i.useEffect)((function(){if(c){var e="".concat(r).concat(r.endsWith("/")||c.startsWith("/")?"":"/").concat(c);E(e)}}),[c,r]);var B=function(){var e="/";c&&(e=c.endsWith("/")?c:"".concat(c,"/"));if(-1===S.findIndex((function(t){return t.name===e+Z}))){var t=Z.split("/").filter((function(e){return""!==e.trim()})).join("/");"/"===e.slice(0,1)&&(e=e.slice(1));var n="/browser/".concat(r,"/").concat((0,f.LL)("".concat(e).concat(t,"/")));x(n),a()}else u((0,m.zb)({errorMessage:"Folder cannot have the same name as an existing file",detailedError:""}))};(0,i.useEffect)((function(){var e=!0;0===Z.trim().length&&(e=!1),F(e)}),[Z]);return(0,j.jsx)(i.Fragment,{children:(0,j.jsx)(s.Z,{modalOpen:t,title:"Choose or create a new path",onClose:a,titleIcon:(0,j.jsx)(l.Z9m,{}),children:(0,j.jsxs)(l.rjZ,{container:!0,children:[(0,j.jsxs)(l.rjZ,{item:!0,xs:12,className:v.formFieldRow,children:[(0,j.jsx)("strong",{children:"Current Path:"})," ",(0,j.jsx)("br",{}),(0,j.jsx)("div",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:14,textAlign:"left"},dir:"rtl",children:z})]}),(0,j.jsx)(l.rjZ,{item:!0,xs:12,className:v.formFieldRow,children:(0,j.jsx)(l.Wzg,{value:Z,label:"New Folder Path",id:"folderPath",name:"folderPath",placeholder:"Enter the new Folder Path",onChange:function(e){C(e.target.value)},onKeyPress:function(e){"Enter"===e.code&&""!==Z&&B()},required:!0})}),(0,j.jsxs)(l.rjZ,{item:!0,xs:12,className:v.modalButtonBar,children:[(0,j.jsx)(l.zxk,{id:"clear",type:"button",color:"primary",variant:"regular",onClick:function(){C("")},label:"Clear"}),(0,j.jsx)(l.zxk,{id:"create",type:"submit",variant:"callAction",disabled:!P,onClick:B,label:"Create"})]})]})})})}))}}]);
//# sourceMappingURL=2185.1940263e.chunk.js.map