Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
20 KiB

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[941],{8283:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/file-manager",function(){return n(7241)}])},4427:function(e,t,n){"use strict";var r=n(5893),o=n(2429),i=n(9309),l=n(7169);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}t.Z=function(e){var t,n,u=e.children,s=e.sx,f=c((a(n={backgroundColor:l.lD,paddingRight:"3em"},"&.".concat(o.Z.selected),(a(t={backgroundColor:l.s7,fontWeight:400},"&.".concat(o.Z.focusVisible),{backgroundColor:l.s7}),a(t,"&:hover",{backgroundColor:l.s7}),t)),a(n,"&.".concat(o.Z.focusVisible),{backgroundColor:l.s7}),a(n,"&:hover",{backgroundColor:l.s7}),n),s);return(0,r.jsx)(i.Z,c({},e,{sx:f,children:u}))}},2879:function(e,t,n){"use strict";var r=n(5893),o=n(1057),i=n(4799),l=n(5603),a=n(9558),c=n(6239),u=n(7021),s=n(3213),f=n(5537),d=n(7169);function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){p(e,t,n[t])}))}return e}function h(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var m={onClearIndicatorClick:null},y=function(e){var t,n=e.onClearIndicatorClick,y=void 0===n?m.onClearIndicatorClick:n,x=h(e,["onClearIndicatorClick"]),g=x.children,b=x.sx,j=x.value,w=String(j).length>0&&y?(0,r.jsx)(o.Z,{position:"end",children:(0,r.jsx)(i.Z,{onClick:y,children:(0,r.jsx)(f.Z,{fontSize:"small"})})}):void 0,Z=v((p(t={},"& .".concat(l.Z.icon),{color:d.s7}),p(t,"& .".concat(a.Z.root),{marginRight:".8em"}),p(t,"& .".concat(c.Z.root),{color:d.s7,visibility:"hidden"}),p(t,"&:hover .".concat(a.Z.root," .").concat(c.Z.root,",\n &.").concat(u.Z.focused," .").concat(a.Z.root," .").concat(c.Z.root),{visibility:"visible"}),t),b);return(0,r.jsx)(s.Z,v({endAdornment:w},x,{sx:Z,children:g}))};y.defaultProps=m,t.Z=y},7241:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Ae}});var r=n(5893),o=n(9008),i=n(4051),l=n.n(i),a=n(7294),c=n(7357),u=n(2428),s=n(2026),f=n(1797),d=n(5293),p=n.n(d),v=n(2029),h=n(7169),m=n(8128),y=n(3631),x=n(4390),g=n(157),b=n(4825),j=n(1496),w=n(3457),Z=n(3640),S=n(480),O=n(267),C=n(1925),P=n(5934),k=[["iso",["application/x-cd-image","ISO (optical disc)"]],["other",["text/plain","Other file type"]],["script",["text/plain","Script (program)"]]],I=new Map(k),A=n(4427),U=n(9),D=n(192),F=n(2879);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T,N,_,M={isReadonly:void 0,onChange:void 0},R=(0,j.ZP)(m.Z)((T={color:h.hM},N="&.".concat(y.Z.checked),_={color:h.Ej},N in T?Object.defineProperty(T,N,{value:_,enumerable:!0,configurable:!0,writable:!0}):T[N]=_,T)),V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,t=e.fileName,n=e.fileType,o=e.fileLocations,i=e.isReadonly,l=e.onChange,a=(0,P.Z)(),c="file-name-".concat(a),u="File name",s="file-type-".concat(a),f="File type";return(0,r.jsxs)(w.Z,{sx:{"> :not(:first-child)":{marginTop:"1em"}},children:[(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(D.Z,{htmlFor:c,children:u}),(0,r.jsx)(U.Z,{defaultValue:t,disabled:i,id:c,label:u,onChange:function(e){var n=e.target.value;null===l||void 0===l||l.call(null,{fileName:n===t?void 0:n})}})]}),n&&(0,r.jsxs)(Z.Z,{children:[(0,r.jsx)(D.Z,{htmlFor:s,children:f}),(0,r.jsx)(F.Z,{defaultValue:n,disabled:i,id:s,input:(0,r.jsx)(U.Z,{label:f}),onChange:function(e){var t=e.target.value;null===l||void 0===l||l.call(null,{fileType:t===n?void 0:t})},children:k.map((function(e){var t=E(e,2),n=t[0],o=E(t[1],2)[1];return(0,r.jsx)(A.Z,{value:n,children:o},n)}))})]}),o.map((function(e,t){var n=e.anvilName,o=e.anvilDescription,a=e.anvilUUID,c=e.isFileLocationActive;return(0,r.jsx)(S.Z,{control:(0,r.jsx)(R,{checkedIcon:(0,r.jsx)(O.Z,{}),defaultChecked:c,disabled:i,icon:(0,r.jsx)(C.Z,{}),onChange:function(e){var n=e.target.checked;null===l||void 0===l||l.call(null,{isFileLocationActive:n===c?void 0:n},{fileLocationIndex:t})}}),label:"".concat(n,": ").concat(o),sx:{color:h.lD},value:"".concat(a,"-sync")},a)}))]})};V.defaultProps=M;var B=V,W=n(2152),z=n(1200);function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(r,o)}function X(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){$(i,r,o,l,a,"next",e)}function a(e){$(i,r,o,l,a,"throw",e)}l(void 0)}))}}function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Y(e,t,n[t])}))}return e}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var J={onEditFilesComplete:void 0,onPurgeFilesComplete:void 0},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=e.filesOverview,n=e.onEditFilesComplete,o=e.onPurgeFilesComplete,i=(0,a.useState)([]),u=i[0],s=i[1],f=(0,a.useState)([]),d=f[0],p=f[1],j=(0,a.useState)(!1),w=j[0],Z=j[1],S=(0,a.useState)(!1),O=S[0],C=S[1],P=(0,a.useState)(0),k=P[0],I=P[1],A={backgroundColor:h.hM,color:h.lD,"&:hover":{backgroundColor:h.hM}},U=function(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).fileLocationIndex;void 0!==n?u[e].fileLocations[n]=q({},u[e].fileLocations[n],t):u[e]=q({},u[e],t)}},D=function(e){e.preventDefault(),Z(!0);var t=u.reduce((function(e,t){var n=t.fileLocations,r=t.fileName,o=t.fileType,i=t.fileUUID,l={};void 0!==r&&(l.fileName=r),void 0!==o&&(l.fileType=o);var a=n.reduce((function(e,t){var n=t.fileLocationUUID,r=t.isFileLocationActive;return void 0!==r&&e.push({fileLocationUUID:n,isFileLocationActive:r}),e}),[]);return a.length>0&&(l.fileLocations=a),Object.keys(l).length>0&&e.push(x.Z.put("/file/".concat(i),l)),e}),[]);Promise.all(t).then((function(){Z(!1)})).then(n)},F=function(){C(!1),Z(!0);var e=d.filter((function(e){return e.isSelected})).map((function(e){var t=e.fileUUID;return x.Z.delete("/file/".concat(t))}));Promise.all(e).then((function(){Z(!1)})).then(o)},L=function(){C(!1)},E=function(){var e=d.filter((function(e){return e.isSelected})).length;I(e),e>0&&C(!0)};return(0,a.useEffect)((function(){Z(!0),Promise.all(t.map(function(){var e=X(l().mark((function e(t){var n,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=q({},t,{fileLocations:[]}),e.prev=1,e.next=4,(0,z.Z)("".concat(v.Z,"/file/").concat(t.fileUUID));case 4:r=e.sent,n.fileLocations=r.map((function(e){var t=H(e,10),n=t[5],r=t[6],o=t[7],i=t[8];return{anvilDescription:t[9],anvilName:i,anvilUUID:o,fileLocationUUID:n,isFileLocationActive:1===parseInt(r,10)}})),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),n.dataIncompleteError=e.t0;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}())).then((function(e){p(e);for(var t=[],n=0;n<e.length;n+=1){var r=e[n];t.push({fileUUID:r.fileUUID,fileLocations:r.fileLocations.map((function(e){return{fileLocationUUID:e.fileLocationUUID}}))})}s(t),Z(!1)}))}),[t]),(0,r.jsx)(r.Fragment,{children:w?(0,r.jsx)(W.Z,{}):(0,r.jsxs)("form",{onSubmit:D,children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column","& > :not(:first-child)":{marginTop:"1em"}},children:[d.map((function(e,t){var n=e.fileName,o=e.fileLocations,i=e.fileType,l=e.fileUUID;return(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"row","& > :last-child":{flexGrow:1}},children:[(0,r.jsx)(c.Z,{sx:{marginTop:".4em"},children:(0,r.jsx)(m.Z,{onChange:function(e){var n=e.target.checked;d[t].isSelected=n},sx:Y({color:h.s7},"&.".concat(y.Z.checked),{color:h.lD})})}),(0,r.jsx)(B,{fileName:n,fileType:i,fileLocations:o,onChange:U(t)})]},"file-edit-".concat(l))})),d.length>0&&(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end","& > :not(:last-child)":{marginRight:".5em"}},children:[(0,r.jsx)(b.Z,{onClick:E,sx:A,children:"Purge"}),(0,r.jsx)(b.Z,{type:"submit",children:"Update"})]})]}),(0,r.jsx)(g.Z,{actionProceedText:"Purge",content:"".concat(k," files will be removed from the system. You cannot undo this purge."),dialogProps:{open:O},onCancelAppend:L,onProceedAppend:F,proceedButtonProps:{sx:A},titleText:"Are you sure you want to purge ".concat(k," selected files? ")})]})})};K.defaultProps=J;var Q=K,ee=n(8462),te=n(891),ne=n(7720),re=n(8600),oe=n.n(re),ie=n(2416),le=function(e){var t=e.filesOverview;return(0,r.jsx)(ee.Z,{children:t.map((function(e){var t,n,o=e.fileChecksum,i=e.fileName,l=e.fileSizeInBytes,a=e.fileType,u=e.fileUUID,s=oe()(l,{binary:!0});return(0,r.jsx)(te.ZP,{sx:{padding:".6em 0"},children:(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},width:"100%"},children:[(0,r.jsxs)(c.Z,{sx:{flexGrow:1},children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"row"},children:[(0,r.jsx)(ie.Ac,{sx:{fontFamily:"Source Code Pro",fontWeight:400},text:i}),(0,r.jsx)(ne.Z,{flexItem:!0,orientation:"vertical",sx:{backgroundColor:h.d,marginLeft:".5em",marginRight:".5em"}}),(0,r.jsx)(ie.Ac,{text:null!==(n=null===(t=I.get(a))||void 0===t?void 0:t[1])&&void 0!==n?n:""})]}),(0,r.jsx)(ie.Ac,{text:s})]}),(0,r.jsx)(c.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row"},children:(0,r.jsx)(ie.Ac,{sx:{fontFamily:"Source Code Pro",fontWeight:400},text:o})})]})},u)}))})},ae=n(76),ce=n(9332),ue=n(9297),se=n(8187);function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function de(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){de(e,t,n[t])}))}return e}function ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||me(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e){return function(e){if(Array.isArray(e))return fe(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||me(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(e,t){if(e){if("string"===typeof e)return fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fe(e,t):void 0}}var ye={onFileUploadComplete:void 0,eventEmitter:void 0},xe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ye,t=e.onFileUploadComplete,n=e.eventEmitter,o=(0,a.useRef)(),i=(0,a.useState)([]),l=i[0],u=i[1],s=(0,a.useState)([]),f=s[0],d=s[1],p=function(e){var t,n=I.entries();do{var r=n.next();if(r.value){var o=ve(r.value,2),i=o[0];e===ve(o[1],1)[0]&&(t=i)}else t="other"}while(!t);return t},v=function(e){var t=e.target.files;t&&u(Array.from(t).map((function(e){return{file:e,fileName:e.name,fileLocations:[],fileType:p(e.type)}})))},h=function(e){return function(t){l[e]=pe({},l[e],t)}},m=function(e){for(e.preventDefault();l.length>0;){var n=l.shift();if(n){var r=n.file,o=n.fileName,i=new FormData;i.append("file",new File([r],o,pe({},r)));var a={fileName:o,progressValue:0};f.push(a),x.Z.post("/file",i,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(e){var t=e.loaded,n=e.total;a.progressValue=Math.round(t/n*100),d(he(f))}}).then((function(){null===t||void 0===t||t.call(null),f.splice(f.indexOf(a),1),d(he(f))}))}}u([]),d(he(f))};return(0,a.useEffect)((function(){null===n||void 0===n||n.addListener("openFilePicker",(function(){var e;null===(e=o.current)||void 0===e||e.click()})),null===n||void 0===n||n.addListener("clearSelectedFiles",(function(){u([])}))}),[n]),(0,r.jsxs)("form",{onSubmit:m,children:[(0,r.jsx)(ae.Z,{htmlFor:"select-file",children:(0,r.jsx)(ce.Z,{id:"select-file",inputProps:{multiple:!0},onChange:v,ref:o,sx:{display:"none"},type:"file"})}),(0,r.jsx)(c.Z,{sx:{display:"flex",flexDirection:"column"},children:f.map((function(e){var t=e.fileName,n=e.progressValue;return(0,r.jsxs)(c.Z,{sx:{alignItems:{md:"center"},display:"flex",flexDirection:{xs:"column",md:"row"},"& > :first-child":{minWidth:100,overflow:"hidden",overflowWrap:"normal",textOverflow:"ellipsis",whiteSpace:"nowrap",width:{xs:"100%",md:200},wordBreak:"keep-all"},"& > :last-child":{flexGrow:1}},children:[(0,r.jsx)(ie.Ac,{text:t}),(0,r.jsx)(ue.k,{progressPercentage:n})]},"in-upload-".concat(t))}))}),(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column","& > :not(:first-child)":{marginTop:"1em"}},children:[l.length>0&&(0,r.jsx)(se.Z,{text:"Uploaded files will be listed automatically, but it may take a while for larger files to appear.",type:"info"}),l.map((function(e,t){var n=e.file.name,r=e.fileName,o=e.fileLocations;return(0,a.createElement)(B,{fileName:r,fileLocations:o,key:"selected-".concat(n),onChange:h(t)})})),l.length>0&&(0,r.jsx)(c.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end"},children:(0,r.jsx)(b.Z,{type:"submit",children:"Upload"})})]})]})};xe.defaultProps=ye;var ge=xe,be=n(1706),je=n(3679),we=n(1905);function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Se(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(r,o)}function Oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);l=!0);}catch(c){a=!0,o=c}finally{try{l||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ce="".concat(v.Z,"/file"),Pe=function(){var e=(0,a.useState)([]),t=e[0],n=e[1],o=(0,a.useState)(),i=o[0],d=o[1],v=(0,a.useState)(!1),m=v[0],y=v[1],x=(0,a.useState)(!1),g=x[0],b=x[1],j=new(p()),w=function(){var e,t=(e=l().mark((function e(){var t;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.prev=1,e.next=4,(0,z.Z)(Ce);case 4:t=e.sent,n(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),d("Failed to get files due to a network issue.");case 11:y(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function l(e){Se(i,r,o,l,a,"next",e)}function a(e){Se(i,r,o,l,a,"throw",e)}l(void 0)}))});return function(){return t.apply(this,arguments)}}();return(0,we.Z)(Ce,{onSuccess:function(e){e.length!==t.length&&n(e)}}),(0,a.useEffect)((function(){g||w()}),[g]),(0,r.jsxs)(je.s_,{children:[(0,r.jsxs)(c.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row",marginBottom:"1em",width:"100%","& > :first-child":{flexGrow:1},"& > :not(:first-child, :last-child)":{marginRight:".3em"}},children:[(0,r.jsx)(ie.z,{text:"Files"}),!g&&(0,r.jsx)(be.Z,{onClick:function(){j.emit("openFilePicker")},children:(0,r.jsx)(u.Z,{})}),(0,r.jsx)(be.Z,{onClick:function(){j.emit("clearSelectedFiles"),b(!g)},children:g?(0,r.jsx)(s.Z,{sx:{color:h.Ej}}):(0,r.jsx)(f.Z,{})})]}),i&&(0,r.jsx)(se.Z,{text:i,type:"error"}),(0,r.jsx)(ge,{eventEmitter:j,onFileUploadComplete:w}),function(){var e;if(m)e=(0,r.jsx)(W.Z,{});else{var n=t.map((function(e){var t=Oe(e,5),n=t[0],r=t[1],o=t[2],i=t[3];return{fileChecksum:t[4],fileName:r,fileSizeInBytes:parseInt(o,10),fileType:i,fileUUID:n}}));e=g?(0,r.jsx)(Q,{filesOverview:n,onEditFilesComplete:w,onPurgeFilesComplete:w}):(0,r.jsx)(le,{filesOverview:n})}return e}()]})},ke=Pe,Ie=n(5716),Ae=function(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.default,{children:(0,r.jsx)("title",{children:"File Manager"})}),(0,r.jsx)(Ie.Z,{}),(0,r.jsx)(ke,{})]})}}},function(e){e.O(0,[738,688,7,643,716,315,818,141,774,888,179],(function(){return t=8283,e(e.s=t);var t}));var t=e.O();_N_E=t}]);