From 4490ce2e25b7596ab5cc0b01db69e89513cd932c Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Jan 2023 16:27:57 -0500 Subject: [PATCH] Plugin updated... --- dist/react-keyed-file-browser.js | 2 +- src/browser.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/react-keyed-file-browser.js b/dist/react-keyed-file-browser.js index 81ba32c1c..13cb43acd 100644 --- a/dist/react-keyed-file-browser.js +++ b/dist/react-keyed-file-browser.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-keyed-file-browser"]=t():e["react-keyed-file-browser"]=t()}(self,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BaseFile:()=>I,BaseFileConnectors:()=>x,BaseFolder:()=>pe,BaseFolderConnectors:()=>de,Details:()=>r,FileRenderers:()=>i,Filters:()=>n,FolderRenderers:()=>l,Groupers:()=>a,Headers:()=>s,Icons:()=>d,RawFileBrowser:()=>ft,Sorters:()=>c,Utils:()=>o,default:()=>wt});var r={};e.r(r),e.d(r,{DefaultDetail:()=>y});var n={};e.r(n),e.d(n,{DefaultFilter:()=>S});var o={};e.r(o),e.d(o,{isFolder:()=>R,moveFilesAndFolders:()=>k});var s={};e.r(s),e.d(s,{TableHeader:()=>L});var i={};e.r(i),e.d(i,{ListThumbnailFile:()=>U,RawListThumbnailFile:()=>Y,RawTableFile:()=>se,SimpleListThumbnailFile:()=>oe,TableFile:()=>ie});var l={};e.r(l),e.d(l,{ListThumbnailFolder:()=>De,RawListThumbnailFolder:()=>ve,RawTableFolder:()=>Ee,TableFolder:()=>Se});var a={};e.r(a),e.d(a,{GroupByFolder:()=>Be,GroupByModifiedRelative:()=>Ve});var c={};e.r(c),e.d(c,{SortByModified:()=>et,SortByName:()=>Xe});var d={};e.r(d),e.d(d,{FontAwesome:()=>bt});const p=require("prop-types");var h=e.n(p);const m=require("react");var u=e.n(m);const f=require("react-dnd"),g=require("react-dnd-html5-backend");var F=Object.defineProperty,b=(e,t,r)=>(((e,t,r)=>{t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class w extends u().Component{constructor(){super(...arguments),b(this,"handleCloseClick",(e=>{e&&e.preventDefault(),this.props.close()}))}render(){let e=this.props.file.key.split("/");return e=e.length?e[e.length-1]:"",u().createElement("div",null,u().createElement("h2",null,"Sensor Details"),u().createElement("div",null,"Sensor meta data goes here..."),u().createElement("a",{href:"#",onClick:this.handleCloseClick},"Close"))}}b(w,"propTypes",{file:h().shape({key:h().string.isRequired,name:h().string.isRequired,extension:h().string.isRequired,url:h().string}).isRequired,close:h().func});const y=w;var v=Object.defineProperty,D=(e,t,r)=>(((e,t,r)=>{t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class E extends u().Component{constructor(){super(...arguments),D(this,"handleFilterChange",(e=>{const t=e.target.value;this.props.updateFilter(t)}))}render(){return u().createElement("input",{type:"search",placeholder:"Search Sensors",value:this.props.value,onChange:this.handleFilterChange})}}D(E,"propTypes",{value:h().string.isRequired,updateFilter:h().func});const S=E,C=require("classnames");var P=e.n(C);function R(e){return e.key.endsWith("/")}function k(e,t,r){if(!t.didDrop())return;const n=t.getDropResult(),o=[],s=[];e.browserProps.selection.forEach((e=>{"/"===e[e.length-1]?o.push(e):s.push(e)})),e.browserProps.openFolder(n.path),o.forEach((t=>{const r=t,o=r.split("/"),s=o[o.length-2],i=`${n.path}${s}/`;i.substr(0,r.length)!==r&&i!==r&&e.browserProps.moveFolder&&e.browserProps.moveFolder(r,i)})),s.forEach((t=>{const r=t,o=r.split("/"),s=o[o.length-1],i=`${n.path}${s}`;i!==r&&e.browserProps.moveFile&&e.browserProps.moveFile(r,i)}))}const N={Archive:["zip","rar","7z"],Audio:["mp3","ogg","wav","aac"],Excel:["xls","xlsx"],Image:["jpg","jpeg","png","bmp"],PDF:["pdf"],PowerPoint:["ppt","pptx"],Text:["txt"],Video:["mp4","flv","avi","wmv","mov"],Word:["doc","docx"],Code:["js"]},O={};for(const[e,t]of Object.entries(N))for(const r of t)O[r]=e;var A=Object.defineProperty,T=(e,t,r)=>(((e,t,r)=>{t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class j extends u().Component{constructor(){super(...arguments),T(this,"state",{newName:this.getName()}),T(this,"handleFileClick",(e=>{e&&e.preventDefault(),this.props.browserProps.preview({url:this.props.url,name:this.getName(),key:this.props.fileKey,extension:this.getExtension()})})),T(this,"handleItemClick",(e=>{e.stopPropagation(),this.props.browserProps.select(this.props.fileKey,"file",e.ctrlKey||e.metaKey,e.shiftKey)})),T(this,"handleItemDoubleClick",(e=>{e.stopPropagation(),this.handleFileClick()})),T(this,"handleRenameClick",(e=>{this.props.browserProps.renameFile&&this.props.browserProps.beginAction("rename",this.props.fileKey)})),T(this,"handleNewNameChange",(e=>{const t=e.target.value;this.setState({newName:t})})),T(this,"handleRenameSubmit",(e=>{if(e&&e.preventDefault(),!this.props.browserProps.renameFile)return;const t=this.state.newName.trim();if(0===t.length)return;if(["/","\\"].some((e=>-1!==t.indexOf(e))))return;let r=t;const n=this.props.fileKey.lastIndexOf("/");-1!==n&&(r=`${this.props.fileKey.substr(0,n)}/${t}`),this.props.browserProps.renameFile(this.props.fileKey,r)})),T(this,"handleDeleteClick",(e=>{this.props.browserProps.deleteFile&&this.props.browserProps.beginAction("delete",this.props.fileKey)})),T(this,"handleDeleteSubmit",(e=>{e.preventDefault(),this.props.browserProps.deleteFile&&this.props.browserProps.deleteFile(this.props.browserProps.actionTargets)})),T(this,"handleCancelEdit",(e=>{this.props.browserProps.endAction()}))}selectFileNameFromRef(e){if(e){const t=e.value,r=t.lastIndexOf(".");e.setSelectionRange(0,r||t.length),e.focus()}}getName(){let e=this.props.newKey||this.props.fileKey;const t=e.lastIndexOf("/");return-1!==t&&(e=e.substr(t+1)),e}getExtension(){const e=this.props.fileKey.split(".");return e[e.length-1].toLowerCase().trim()}getFileType(){return O[this.getExtension()]||"File"}connectDND(e){const t=this.props.isDragging||this.props.action;return"function"!=typeof this.props.browserProps.moveFile||t||this.props.isRenaming||(e=this.props.connectDragSource(e)),"function"!=typeof this.props.browserProps.createFiles&&"function"!=typeof this.props.browserProps.moveFile&&"function"!=typeof this.props.browserProps.moveFolder||(e=this.props.connectDropTarget(e)),e}}T(j,"propTypes",{fileKey:h().string,url:h().string,newKey:h().string,isRenaming:h().bool,connectDragSource:h().func,connectDropTarget:h().func,isDragging:h().bool,action:h().string,browserProps:h().shape({icons:h().object,select:h().func,beginAction:h().func,endAction:h().func,preview:h().func,createFiles:h().func,moveFile:h().func,moveFolder:h().func,renameFile:h().func,deleteFile:h().func})});const M={drop(e,t){if(t.didDrop())return;const r=e.newKey||e.fileKey,n=r.lastIndexOf("/"),o=-1!==n?r.substr(0,n+1):"",s=t.getItem();return s.files&&e.browserProps.createFiles&&e.browserProps.createFiles(s.files,o),{path:o}}},x={dragSource:{beginDrag:e=>(e.browserProps.selection.length&&e.browserProps.selection.includes(e.fileKey)||e.browserProps.select(e.fileKey,"file"),{key:e.fileKey}),endDrag(e,t,r){k(e,t)}},dragCollect:function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},targetSource:M,targetCollect:function(e,t){return{connectDropTarget:e.dropTarget(),isOver:t.isOver({shallow:!0})}}},I=j;var K=Object.defineProperty;class B extends u().Component{handleHeaderClick(e){this.props.select(this.props.fileKey)}render(){const e=u().createElement("div",{className:P()("file-browser-header",{dragover:this.props.isOver,selected:this.props.isSelected})},"Devices");return"function"==typeof this.props.browserProps.createFiles||"function"==typeof this.props.browserProps.moveFile||"function"==typeof this.props.browserProps.moveFolder?this.props.connectDropTarget(e):e}}((e,t,r)=>{t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(B,"propTypes"+"",{select:h().func,fileKey:h().string,connectDropTarget:h().func,isOver:h().bool,isSelected:h().func,browserProps:h().shape({createFiles:h().func,moveFolder:h().func,moveFile:h().func})});const L=(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect)(B),G=require("date-fns"),q=require("lodash/flow");var _=e.n(q);var W=Object.defineProperty,$=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,V=(e,t,r)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Y extends I{render(){const{thumbnail_url:e,action:t,url:r,isDragging:n,isRenaming:o,isSelected:s,isSelectable:i,isOver:l,isDeleting:a,showName:c,showSize:d,showModified:p,browserProps:h,connectDragPreview:m}=this.props;let f;f=e?u().createElement("div",{className:"image",style:{backgroundImage:"url("+e+")"}}):h.icons[this.getFileType()]||h.icons.File;const g=n||t,F=h.confirmDeletionRenderer;let b,w,y;c&&(b=!g&&a&&1===h.selection.length?u().createElement(F,{handleDeleteSubmit:this.handleDeleteSubmit,handleFileClick:this.handleFileClick,url:r},this.getName()):!g&&o?u().createElement("form",{className:"renaming",onSubmit:this.handleRenameSubmit},u().createElement("input",{ref:this.selectFileNameFromRef,type:"text",value:this.state.newName,onChange:this.handleNewNameChange,onBlur:this.handleCancelEdit,autoFocus:!0})):u().createElement("a",null,this.getName())),d&&(o||a||(w=u().createElement("span",{className:"size"},u().createElement("small",null,function(e){if(e>1024){const t=e/1024;return t>1024?`${function(e,t){if(e=parseFloat(e),isNaN(e))return parseFloat("0").toFixed(2);{const t=Math.pow(10,2);return(e=(Math.round(e*t)/t).toFixed(2)).toString()}}(t/1024)} MB`:`${Math.round(t)} kB`}return`${e} B`}(this.props.size))))),p&&(o||a||(y=u().createElement("span",{className:"modified"},"Last modified: ",(0,G.formatDistanceToNow)(this.props.modified,{addSuffix:!0}))));let v={};i&&(v={onClick:this.handleItemClick});let D=u().createElement("li",((e,t)=>{for(var r in t||(t={}))z.call(t,r)&&V(e,r,t[r]);if($)for(var r of $(t))H.call(t,r)&&V(e,r,t[r]);return e})({className:P()("file",{pending:t,dragging:n,dragover:l,selected:s}),onDoubleClick:this.handleItemDoubleClick},v),u().createElement("div",{className:"item"},u().createElement("span",{className:"thumb"},f),u().createElement("span",{className:"name"},b),w,y));return"function"==typeof h.moveFile&&(D=m(D)),this.connectDND(D)}}((e,t,r)=>{V(e,t+"",{showName:!0,showSize:!0,showModified:!0,isSelectable:!0})})(Y,"defaultProps");const U=_()((0,f.DragSource)("file",x.dragSource,x.dragCollect),(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect))(Y);var J=Object.defineProperty,Q=Object.defineProperties,X=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,re=(e,t,r)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class ne extends u().Component{render(){return u().createElement(U,(e=((e,t)=>{for(var r in t||(t={}))ee.call(t,r)&&re(e,r,t[r]);if(Z)for(var r of Z(t))te.call(t,r)&&re(e,r,t[r]);return e})({},this.props),Q(e,X({showName:!1,showSize:!1,showModified:!1,isSelectable:!1}))));var e}}const oe=ne;class se extends I{render(){const{isDragging:e,isDeleting:t,isRenaming:r,isOver:n,isSelected:o,action:s,url:i,browserProps:l,connectDragPreview:a,depth:c,size:d,modified:p,analysisFunc:h,dataLogFunc:m,isSensor:f,sensorId:g,sensorSettings:F}=this.props,b=l.icons[f?"Sensor":this.getFileType()]||l.icons.File,w=e||s,y=l.confirmDeletionRenderer;let v;v=!w&&t&&1===l.selection.length?u().createElement(y,{handleDeleteSubmit:this.handleDeleteSubmit,handleFileClick:this.handleFileClick,url:i},b,this.getName()):!w&&r?u().createElement("form",{className:"renaming",onSubmit:this.handleRenameSubmit},b,u().createElement("input",{ref:this.selectFileNameFromRef,type:"text",value:this.state.newName,onChange:this.handleNewNameChange,onBlur:this.handleCancelEdit,autoFocus:!0})):u().createElement("a",null,b,this.getName);let D=u().createElement("div",{className:"nameLbl"},v);"function"==typeof l.moveFile&&(D=a(D));const E=u().createElement("tr",{className:P()("file",{pending:s,dragging:e,dragover:n,selected:o}),onClick:this.handleItemClick,onDoubleClick:this.handleItemDoubleClick},u().createElement("td",{className:"name"},u().createElement("div",{className:"nameBox",style:{paddingLeft:16*c+"px"}},D,f&&u().createElement(u().Fragment,null,u().createElement("div",{className:"rowBtn",onClick:()=>{h()}},u().createElement("i",{className:"fa fa-chart-simple","aria-hidden":"true"}),window.innerWidth>550&&u().createElement(u().Fragment,null,"Analysis")),u().createElement("div",{className:"rowBtn",onClick:()=>{m()}},u().createElement("i",{className:"fa fa-list","aria-hidden":"true"}),window.innerWidth>550&&u().createElement(u().Fragment,null,"Data Log")),u().createElement("div",{className:"device-settings",onClick:()=>{F(this.getName())}},u().createElement("i",{className:"fa fa-gear","aria-hidden":"true"}))))));return this.connectDND(E)}}const ie=_()((0,f.DragSource)("file",x.dragSource,x.dragCollect),(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect))(se);var le=Object.defineProperty,ae=(e,t,r)=>(((e,t,r)=>{t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class ce extends u().Component{constructor(){super(...arguments),ae(this,"state",{newName:this.props.isDraft?"New folder":this.getName()}),ae(this,"handleFolderClick",(e=>{e.stopPropagation(),this.props.browserProps.select(this.props.fileKey,"folder",e.ctrlKey||e.metaKey,e.shiftKey)})),ae(this,"handleFolderDoubleClick",(e=>{e.stopPropagation(),this.toggleFolder()})),ae(this,"handleRenameClick",(e=>{this.props.browserProps.renameFolder&&this.props.browserProps.beginAction("rename",this.props.fileKey)})),ae(this,"handleNewNameChange",(e=>{const t=e.target.value;this.setState({newName:t})})),ae(this,"handleRenameSubmit",(e=>{if(e.preventDefault(),e.stopPropagation(),!this.props.browserProps.renameFolder&&!this.props.isDraft)return;const t=this.state.newName.trim();if(0===t.length)return;if(["/","\\"].some((e=>-1!==t.indexOf(e))))return;let r=this.props.fileKey.substr(0,this.props.fileKey.substr(0,this.props.fileKey.length-1).lastIndexOf("/"));r.length&&(r+="/"),r+=t,r+="/",this.props.isDraft?this.props.browserProps.createFolder(r):this.props.browserProps.renameFolder(this.props.fileKey,r)})),ae(this,"handleDeleteClick",(e=>{this.props.browserProps.deleteFolder&&this.props.browserProps.beginAction("delete",this.props.fileKey)})),ae(this,"handleDeleteSubmit",(e=>{e.preventDefault(),e.stopPropagation(),this.props.browserProps.deleteFolder&&this.props.browserProps.deleteFolder(this.props.browserProps.actionTargets)})),ae(this,"handleCancelEdit",(e=>{this.props.browserProps.endAction()})),ae(this,"toggleFolder",(()=>{this.props.browserProps.toggleFolder(this.props.fileKey)}))}selectFolderNameFromRef(e){if(e){const t=e.value;e.setSelectionRange(0,t.length),e.focus()}}getName(){if(this.props.name)return this.props.name;const e=this.props.fileKey.split("/");return this.props.newName||e[e.length-2]}connectDND(e){const t=this.props.isDragging||this.props.action;return this.props.keyDerived&&("function"!=typeof this.props.browserProps.moveFolder||t||this.props.isRenaming||this.props.isDeleting||(e=this.props.connectDragSource(e)),"function"!=typeof this.props.browserProps.createFiles&&"function"!=typeof this.props.browserProps.moveFolder&&"function"!=typeof this.props.browserProps.moveFile||(e=this.props.connectDropTarget(e))),e}}ae(ce,"propTypes",{name:h().string,fileKey:h().string,isGateway:h().bool,statusIcon:h().element,newName:h().string,keyDerived:h().bool,isDraft:h().bool,isRenaming:h().bool,isDeleting:h().bool,connectDragSource:h().func,connectDropTarget:h().func,isDragging:h().bool,action:h().string,browserProps:h().shape({select:h().func,toggleFolder:h().func,beginAction:h().func,endAction:h().func,preview:h().func,createFiles:h().func,createFolder:h().func,moveFile:h().func,moveFolder:h().func,renameFolder:h().func,deleteFolder:h().func})});const de={dragSource:{beginDrag:e=>(e.browserProps.selection.length||e.browserProps.select(e.fileKey,"folder"),{key:e.fileKey}),endDrag(e,t,r){k(e,t)}},dragCollect:function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}}},pe=ce;var he=Object.defineProperty,me=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,be=(e,t,r)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,we=(e,t)=>{for(var r in t||(t={}))ge.call(t,r)&&be(e,r,t[r]);if(fe)for(var r of fe(t))Fe.call(t,r)&&be(e,r,t[r]);return e},ye=(e,t)=>me(e,ue(t));class ve extends pe{render(){const{isOpen:e,isDragging:t,isDeleting:r,isRenaming:n,isDraft:o,isOver:s,isSelected:i,url:l,action:a,browserProps:c,depth:d,keyDerived:p,connectDragPreview:h}=this.props,m=c.icons[e?"FolderOpen":"Folder"],f=t||a,g=c.confirmDeletionRenderer;let F,b;if(F=!f&&r&&1===c.selection.length?u().createElement(g,{handleDeleteSubmit:this.handleDeleteSubmit,handleFileClick:this.handleFileClick,url:l},this.getName()):!f&&n||o?u().createElement("div",null,u().createElement("form",{className:"renaming",onSubmit:this.handleRenameSubmit},u().createElement("input",{type:"text",ref:this.selectFolderNameFromRef,value:this.state.newName,onChange:this.handleNewNameChange,onBlur:this.handleCancelEdit,autoFocus:!0}))):u().createElement("div",null,u().createElement("a",{onClick:this.toggleFolder},this.getName())),e&&c.nestChildren){b=[];for(let e=0;e{m({name:f,id:g,password:F,description:b})}},u().createElement("i",{className:"fa fa-gear","aria-hidden":"true"}))))));return this.connectDND(C)}}const Se=_()((0,f.DragSource)("folder",de.dragSource,de.dragCollect),(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect))(Ee),Ce=e=>{const{children:t,handleDeleteSubmit:r,handleFileClick:n,url:o}=e;return u().createElement("form",{className:"deleting",onSubmit:r},u().createElement("a",{onClick:n},t),u().createElement("div",null,u().createElement("button",{type:"submit"},"Confirm Deletion")))};Ce.propTypes={children:h().node,handleDeleteSubmit:h().func,handleFileClick:h().func,url:h().string},Ce.defaultProps={url:"#"};const Pe=Ce,Re=e=>{const{handleDeleteSubmit:t}=e;return u().createElement("button",{className:"deleting",onClick:t},"Confirm Deletion")};Re.propTypes={handleDeleteSubmit:h().func};const ke=Re;var Ne=Object.defineProperty,Oe=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,xe=(e,t,r)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))je.call(t,r)&&xe(e,r,t[r]);if(Te)for(var r of Te(t))Me.call(t,r)&&xe(e,r,t[r]);return e},Ke=(e,t)=>Oe(e,Ae(t));function Be(e,t){const r={contents:[],children:{}};return e.map((e=>{e.relativeKey=(e.newKey||e.key).substr(t.length);let n=r;const o=e.relativeKey.split("/");o.map(((t,r)=>{if(r===o.length-1&&R(e))for(const t in e)n[t]=e[t];""!==t&&(R(e)||r!==o.length-1?(t in n.children==0&&(n.children[t]={contents:[],children:{}}),n=n.children[t]):n.contents.push(Ke(Ie({},e),{keyDerived:!0})))}))})),e=function e(r,n){""!==n&&(n+="/");let o=[];for(const s in r.children)o.push(Ke(Ie({},r.children[s]),{contents:void 0,keyDerived:!0,key:t+n+s+"/",relativeKey:n+s+"/",children:e(r.children[s],n+s),size:0}));return o=o.concat(r.contents),o}(r,"")}var Le=Object.defineProperty,Ge=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,ze=(e,t,r)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,He=(e,t)=>{for(var r in t||(t={}))We.call(t,r)&&ze(e,r,t[r]);if(_e)for(var r of _e(t))$e.call(t,r)&&ze(e,r,t[r]);return e};function Ve(e,t){const r=function(){const e=[],t=new Date;return e.push({name:"Today",begins:(0,G.startOfToday)(),ends:(0,G.endOfToday)(),items:[]}),e.push({name:"Yesterday",begins:(0,G.startOfYesterday)(),ends:(0,G.endOfYesterday)(),items:[]}),e.push({name:"Earlier this Week",begins:(0,G.startOfWeek)(t),ends:(0,G.endOfWeek)(t),items:[]}),e.push({name:"Last Week",begins:(0,G.startOfWeek)((0,G.addWeeks)(t,-1)),ends:(0,G.endOfWeek)((0,G.addWeeks)(t,-1)),items:[]}),(0,G.getMonth)(e[e.length-1].begins)===(0,G.getMonth)(t)&&e.push({name:"Earlier this Month",begins:(0,G.startOfMonth)(t),ends:(0,G.endOfMonth)(t),items:[]}),e}();for(let t=0;t+t.begins&&l<=+t.ends){t.items.push(s),i=!0;break}}if(!i){const e={name:(0,G.format)(s.modified,"MMMM yyyy"),begins:(0,G.startOfMonth)(s.modified),ends:(0,G.endOfMonth)(s.modified),items:[]};e.items.push(s),r.push(e)}}var n;const o=[];for(let e=0;eo)return 1}return 0}function Je(e,t){return e.draft&&!t.draft?1:t.draft&&!e.draft?-1:Ue(e,t)}function Qe(e){let t=[],r=[];for(let n=0;n{const{selectedItems:t,isFolder:r,icons:n,nameFilter:o,canCreateFolder:s,onCreateFolder:i,canRenameFile:l,onRenameFile:a,canRenameFolder:c,onRenameFolder:d,canDeleteFile:p,onDeleteFile:h,canDeleteFolder:m,onDeleteFolder:f,canDownloadFile:g,onDownloadFile:F,canDownloadFolder:b,onDownloadFolder:w,addGateway:y,share:v}=e;let D=[u().createElement(u().Fragment,null,u().createElement("li",{key:"action-share"},u().createElement("a",{onClick:()=>{v(t.length?t[0]:"root")},href:"#",role:"button"},n.Share,"Share")))];if(t.length){const e=t.filter((e=>e.action));if(e.length===t.length&&1===[...new Set(e)].length){let t;switch(e[0].action){case"delete":t="Deleting ...";break;case"rename":t="Renaming ...";break;default:t="Moving ..."}D=u().createElement("div",{className:"item-actions"},n.Loading," ",t)}else{r&&s&&!o&&!t[0].isGateway&&(D.push(u().createElement("li",{key:"action-add-gateway"},u().createElement("a",{onClick:()=>{y(t[0])},href:"#",role:"button"},n.GatewayAdd,"Add Gateway"))),D.push(u().createElement("li",{key:"action-add-folder"},u().createElement("a",{onClick:i,href:"#",role:"button"},n.FolderAdd,"Add Subfolder"))));const e=t.find((e=>!e.keyDerived));e||r||!l||1!==t.length?!e&&r&&c&&D.push(u().createElement("li",{key:"action-rename"},u().createElement("a",{onClick:d,href:"#",role:"button"},n.Rename,"Rename"))):D.push(u().createElement("li",{key:"action-rename"},u().createElement("a",{onClick:a,href:"#",role:"button"},n.Rename,"Rename"))),e||r||!p?!e&&r&&m&&D.push(u().createElement("li",{key:"action-delete"},u().createElement("a",{onClick:f,href:"#",role:"button"},n.Delete,"Delete"))):D.push(u().createElement("li",{key:"action-delete"},u().createElement("a",{onClick:h,href:"#",role:"button"},n.Delete,"Delete"))),(!r&&g||r&&b)&&D.push(u().createElement("li",{key:"action-download"},u().createElement("a",{onClick:r?w:F,href:"#",role:"button"},n.Download,"Download"))),D=D.length?u().createElement("ul",{className:"item-actions"},D):u().createElement("div",{className:"item-actions"}," ")}}else s&&!o&&(D.push(u().createElement("li",{key:"action-add-gateway"},u().createElement("a",{onClick:()=>{y("root")},href:"#",role:"button"},n.GatewayAdd,"Add Gateway"))),D.push(u().createElement("li",{key:"action-add-folder"},u().createElement("a",{onClick:i,href:"#",role:"button"},n.FolderAdd,"Add Folder")))),D=D.length?u().createElement("ul",{className:"item-actions"},D):u().createElement("div",{className:"item-actions"}," ");return D};tt.propTypes={selectedItems:h().arrayOf(h().object),isFolder:h().bool,icons:h().object,nameFilter:h().string,canCreateFolder:h().bool,onCreateFolder:h().func,canRenameFile:h().bool,onRenameFile:h().func,canRenameFolder:h().bool,onRenameFolder:h().func,canDeleteFile:h().bool,onDeleteFile:h().func,canDeleteFolder:h().bool,onDeleteFolder:h().func,canDownloadFile:h().bool,onDownloadFile:h().func,canDownloadFolder:h().bool,onDownloadFolder:h().func,addGateway:h().func,share:h().func},tt.defaultProps={selectedItems:[],isFolder:!1,icons:{},nameFilter:"",canCreateFolder:!1,onCreateFolder:null,canRenameFile:!1,onRenameFile:null,canRenameFolder:!1,onRenameFolder:null,canDeleteFile:!1,onDeleteFile:null,canDeleteFolder:!1,onDeleteFolder:null,canDownloadFile:!1,onDownloadFile:null,canDownloadFolder:!1,onDownloadFolder:null,share:null,addGateway:null};const rt=tt;var nt=Object.defineProperty,ot=Object.defineProperties,st=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,ct=(e,t,r)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&ct(e,r,t[r]);if(it)for(var r of it(t))at.call(t,r)&&ct(e,r,t[r]);return e},pt=(e,t)=>ot(e,st(t)),ht=(e,t,r)=>(ct(e,"symbol"!=typeof t?t+"":t,r),r);const mt=/.*\/__new__[/]?$/gm;function ut(e,t){return{key:`file-${e.key}`,fileKey:e.key,isSelected:t.selection.includes(e.key),isOpen:e.key in t.openFolders||t.nameFilter,isRenaming:"rename"===t.activeAction&&t.actionTargets.includes(e.key),isDeleting:"delete"===t.activeAction&&t.actionTargets.includes(e.key),isDraft:!!e.draft}}class ft extends u().Component{constructor(){super(...arguments),ht(this,"state",{openFolders:{},selection:[],activeAction:null,actionTargets:[],nameFilter:"",searchResultsShown:20,previewFile:null,addFolder:null}),ht(this,"getFile",(e=>{let t=!1;return this.props.files.find((r=>(r.key.startsWith(e)&&(t=!0),r.key===e)))||(t?{key:e,modified:0,size:0,relativeKey:e}:void 0)})),ht(this,"createFiles",((e,t)=>{this.setState((e=>{const r={selection:[]};return t&&(r.openFolders=pt(dt({},e.openFolders),{[t]:!0})),r}),(()=>{this.props.onCreateFiles(e,t)}))})),ht(this,"createFolder",(e=>{this.setState({activeAction:null,actionTargets:[],selection:[e]},(()=>{this.props.onCreateFolder(e)}))})),ht(this,"moveFile",((e,t)=>{this.setState({activeAction:null,actionTargets:[],selection:[t]},(()=>{this.props.onMoveFile(e,t)}))})),ht(this,"moveFolder",((e,t)=>{this.setState((r=>{const n={activeAction:null,actionTargets:[],selection:[t]};return e in r.openFolders&&(n.openFolders=pt(dt({},r.openFolders),{[t]:!0})),n}),(()=>{this.props.onMoveFolder(e,t)}))})),ht(this,"renameFile",((e,t)=>{this.setState({activeAction:null,actionTargets:[],selection:[t]},(()=>{this.props.onRenameFile(e,t)}))})),ht(this,"renameFolder",((e,t)=>{this.setState((r=>{const n={activeAction:null,actionTargets:[]};return r.selection[0].substr(0,e.length)===e&&(n.selection=[r.selection[0].replace(e,t)]),e in r.openFolders&&(n.openFolders=pt(dt({},r.openFolders),{[t]:!0})),n}),(()=>{this.props.onRenameFolder(e,t)}))})),ht(this,"deleteFile",(e=>{this.setState({activeAction:null,actionTargets:[],selection:[]},(()=>{this.props.onDeleteFile(e)}))})),ht(this,"deleteFolder",(e=>{this.setState((t=>{const r={activeAction:null,actionTargets:[],selection:[]};return e in t.openFolders&&(r.openFolders=dt({},t.openFolders),delete r.openFolders[e]),r}),(()=>{this.props.onDeleteFolder(e)}))})),ht(this,"downloadFile",(e=>{this.setState({activeAction:null,actionTargets:[]},(()=>{this.props.onDownloadFile(e)}))})),ht(this,"downloadFolder",(e=>{this.setState({activeAction:null,actionTargets:[]},(()=>{this.props.onDownloadFolder(e)}))})),ht(this,"beginAction",((e,t)=>{this.setState({activeAction:e,actionTargets:t||[]})})),ht(this,"endAction",(()=>{this.state.selection&&this.state.selection.length>0&&this.state.selection.filter((e=>e.match(mt))).length>0&&this.setState({selection:[]}),this.beginAction(null,null)})),ht(this,"select",((e,t,r,n)=>{const{actionTargets:o}=this.state,s=o.length&&!o.includes(e),i=this.getFile(e);let l=[e];if(r||n){const t=this.state.selection.indexOf(e);l=-1!==t?[...this.state.selection.slice(0,t),...this.state.selection.slice(t+1)]:[...this.state.selection,e]}this.setState((e=>({selection:l,actionTargets:s?[]:o,activeAction:s?null:e.activeAction})),(()=>{this.props.onSelect(i),"file"===t&&this.props.onSelectFile(i),"folder"===t&&this.props.onSelectFolder(i)}))})),ht(this,"preview",(e=>{this.state.previewFile&&this.state.previewFile.key!==e.key&&this.closeDetail(),this.setState({previewFile:e},(()=>{this.props.onPreviewOpen(e)}))})),ht(this,"closeDetail",(()=>{this.setState({previewFile:null},(()=>{this.props.onPreviewClose(this.state.previewFile)}))})),ht(this,"handleShowMoreClick",(e=>{e.preventDefault(),this.setState((e=>({searchResultsShown:e.searchResultsShown+20})))})),ht(this,"toggleFolder",(e=>{const t=e in this.state.openFolders;this.setState((r=>{const n={openFolders:dt({},r.openFolders)};return t?delete n.openFolders[e]:n.openFolders[e]=!0,n}),(()=>{const r=t?"onFolderClose":"onFolderOpen";this.props[r](this.getFile(e),this.getBrowserProps())}))})),ht(this,"openFolder",(e=>{this.setState((t=>({openFolders:pt(dt({},t.openFolders),{[e]:!0})})),(()=>{this.props.onFolderOpen(this.getFile(e),this.getBrowserProps())}))})),ht(this,"handleGlobalClick",(e=>{this.browserRef&&this.browserRef.contains(e.target)||this.setState({selection:[],actionTargets:[],activeAction:null})})),ht(this,"handleActionBarRenameClick",(e=>{e.preventDefault(),this.beginAction("rename",this.state.selection)})),ht(this,"handleActionBarDeleteClick",(e=>{e.preventDefault(),this.beginAction("delete",this.state.selection)})),ht(this,"handleActionBarAddFolderClick",(e=>{e.preventDefault(),"createFolder"!==this.state.activeAction&&this.setState((e=>{let t="";e.selection&&e.selection.length>0&&(t+=e.selection,"/"!==t.substr(t.length-1,t.length)&&(t+="/")),"__new__/"===t||t.endsWith("/__new__/")||(t+="__new__/");const r={actionTargets:[t],activeAction:"createFolder",selection:[t]};return e.selection&&e.selection.length>0&&(r.openFolders=pt(dt({},e.openFolders),{[this.state.selection]:!0})),r}))})),ht(this,"handleActionBarDownloadClick",(e=>{e.preventDefault();const t=this.getFiles(),r=this.getSelectedItems(t);1===r.length&&R(r[0])?this.downloadFolder(this.state.selection):this.downloadFile(this.state.selection)})),ht(this,"updateFilter",(e=>{this.setState({nameFilter:e,searchResultsShown:20})})),ht(this,"sensorSettings",(e=>{this.props.sensorSettings(e)})),ht(this,"gatewaySettings",(e=>{this.props.gatewaySettings(e)})),ht(this,"addGateway",(e=>{this.props.addGateway(e)})),ht(this,"share",(e=>{this.props.share(e)})),ht(this,"handleMultipleDeleteSubmit",(()=>{this.deleteFolder(this.state.selection.filter((e=>"/"===e[e.length-1]))),this.deleteFile(this.state.selection.filter((e=>"/"!==e[e.length-1])))}))}componentDidMount(){"table"===this.props.renderStyle&&this.props.nestChildren&&console.warn("Invalid settings: Cannot nest table children in file browser"),window.addEventListener("click",this.handleGlobalClick)}componentWillUnmount(){window.removeEventListener("click",this.handleGlobalClick)}getBrowserProps(){return{nestChildren:this.props.nestChildren,fileRenderer:this.props.fileRenderer,fileRendererProps:this.props.fileRendererProps,folderRenderer:this.props.folderRenderer,folderRendererProps:this.props.folderRendererProps,confirmDeletionRenderer:this.props.confirmDeletionRenderer,confirmMultipleDeletionRenderer:this.props.confirmMultipleDeletionRenderer,icons:this.props.icons,openFolders:this.state.openFolders,nameFilter:this.state.nameFilter,selection:this.state.selection,activeAction:this.state.activeAction,actionTargets:this.state.actionTargets,select:this.select,openFolder:this.openFolder,toggleFolder:this.toggleFolder,beginAction:this.beginAction,endAction:this.endAction,preview:this.preview,createFiles:this.props.onCreateFiles?this.createFiles:void 0,createFolder:this.props.onCreateFolder?this.createFolder:void 0,renameFile:this.props.onRenameFile?this.renameFile:void 0,renameFolder:this.props.onRenameFolder?this.renameFolder:void 0,moveFile:this.props.onMoveFile?this.moveFile:void 0,moveFolder:this.props.onMoveFolder?this.moveFolder:void 0,deleteFile:this.props.onDeleteFile?this.deleteFile:void 0,deleteFolder:this.props.onDeleteFolder?this.deleteFolder:void 0,getItemProps:ut,sensorSettings:this.props.sensorSettings?this.sensorSettings:void 0,gatewaySettings:this.props.gatewaySettings?this.gatewaySettings:void 0,addGateway:this.props.addGateway?this.addGateway:void 0,share:this.props.share?this.share:void 0,statusIcon:this.props.statusIcon}}renderActionBar(e){const{icons:t,canFilter:r,filterRendererProps:n,filterRenderer:o,actionRenderer:s,onCreateFolder:i,onRenameFile:l,onRenameFolder:a,onDeleteFile:c,onDeleteFolder:d,onDownloadFile:p,onDownloadFolder:h}=this.props,m=this.getBrowserProps(),f=1===e.length&&R(e[0]);let g;r&&(g=u().createElement(o,dt({value:this.state.nameFilter,updateFilter:this.updateFilter},n)));const F=u().createElement(s,{browserProps:m,selectedItems:e,isFolder:f,icons:t,nameFilter:this.state.nameFilter,canCreateFolder:"function"==typeof i,onCreateFolder:this.handleActionBarAddFolderClick,canRenameFile:"function"==typeof l,onRenameFile:this.handleActionBarRenameClick,canRenameFolder:"function"==typeof a,onRenameFolder:this.handleActionBarRenameClick,canDeleteFile:"function"==typeof c,onDeleteFile:this.handleActionBarDeleteClick,canDeleteFolder:"function"==typeof d,onDeleteFolder:this.handleActionBarDeleteClick,canDownloadFile:"function"==typeof p,onDownloadFile:this.handleActionBarDownloadClick,canDownloadFolder:"function"==typeof h,onDownloadFolder:this.handleActionBarDownloadClick,addGateway:this.addGateway,share:this.share});return u().createElement("div",{className:"action-bar"},g,F)}renderFiles(e,t){const{fileRenderer:r,fileRendererProps:n,folderRenderer:o,folderRendererProps:s}=this.props,i=this.getBrowserProps();let l=[];return e.map((e=>{const a=pt(dt({},i.getItemProps(e,i)),{depth:this.state.nameFilter?0:t});R(e)?(!this.props.showFoldersOnFilter&&this.state.nameFilter||l.push(u().createElement(o,pt(dt(pt(dt(dt({},e),a),{browserProps:i}),s),{gatewaySettings:this.gatewaySettings,statusIcon:this.statusIcon}))),(this.state.nameFilter||a.isOpen&&!i.nestChildren)&&(l=l.concat(this.renderFiles(e.children,t+1)))):l.push(u().createElement(r,pt(dt(pt(dt(dt({},e),a),{browserProps:i}),n),{sensorSettings:this.sensorSettings})))})),l}getFiles(){let e=this.props.files.concat([]);if("createFolder"===this.state.activeAction&&e.push({key:this.state.actionTargets[0],size:0,draft:!0}),this.state.nameFilter){const t=[],r=this.state.nameFilter.toLowerCase().split(" ");e.map((e=>{let n=!1;r.map((t=>{-1===e.key.toLowerCase().trim().indexOf(t)&&(n=!0)})),n||t.push(e)})),e=t}if("function"==typeof this.props.group)e=this.props.group(e,"");else{const t=[];e.map((e=>{R(e)||t.push(e)})),e=t}return"function"==typeof this.props.sort&&(e=this.props.sort(e)),e}getSelectedItems(e){const{selection:t}=this.state,r=[],n=e=>{t.includes(e.key)&&r.push(e),e.children&&e.children.map(n)};return e.map(n),r}render(){const e={browserProps:this.getBrowserProps(),fileKey:"",fileCount:this.props.files.length};let t;const r=this.getFiles(),n=this.getSelectedItems(r);let o,s=this.renderFiles(r,0);switch(this.props.renderStyle){case"table":if(s.length){if(this.state.nameFilter){const e=s.length;s=s.slice(0,this.state.searchResultsShown),e>s.length&&s.push(u().createElement("tr",{key:"show-more"},u().createElement("td",{colSpan:100},u().createElement("a",{onClick:this.handleShowMoreClick,href:"#"},this.props.showMoreResults))))}}else s=this.state.nameFilter?u().createElement("tr",null,u().createElement("td",{colSpan:100},this.props.noMatchingFilesMessage(this.state.nameFilter))):u().createElement("tr",null,u().createElement("td",{colSpan:100},this.props.noFilesMessage));this.props.headerRenderer&&(o=u().createElement(this.props.headerRenderer,dt(dt({},e),this.props.headerRendererProps))),t=u().createElement(u().Fragment,null,u().createElement("table",{cellSpacing:"0",cellPadding:"0"},u().createElement("tbody",null,s)));break;case"list":if(s.length){let e;if(this.state.nameFilter){const t=s.length;s=s.slice(0,this.state.searchResultsShown),t>s.length&&(e=u().createElement("a",{onClick:this.handleShowMoreClick,href:"#"},this.props.showMoreResults))}s=u().createElement("div",null,u().createElement("ul",null,s),e)}else s=this.state.nameFilter?u().createElement("p",{className:"empty"},this.props.noMatchingFilesMessage(this.state.nameFilter)):u().createElement("p",{className:"empty"},this.props.noFilesMessage);this.props.headerRenderer&&(o=u().createElement(this.props.headerRenderer,dt(dt({},e),this.props.headerRendererProps))),t=u().createElement("div",null,s)}const i=this.props.confirmMultipleDeletionRenderer;return u().createElement("div",{className:"rendered-react-keyed-file-browser"},this.props.actions,u().createElement("div",{className:"rendered-file-browser",ref:e=>{this.browserRef=e}},this.props.showActionBar&&this.renderActionBar(n),"delete"===this.state.activeAction&&this.state.selection.length>1&&u().createElement(i,{handleDeleteSubmit:this.handleMultipleDeleteSubmit}),o,u().createElement("div",{className:"files"},t)))}}ht(ft,"propTypes",{files:h().arrayOf(h().shape({key:h().string.isRequired,modified:h().number,size:h().number})).isRequired,actions:h().node,showActionBar:h().bool.isRequired,canFilter:h().bool.isRequired,showFoldersOnFilter:h().bool,noFilesMessage:h().oneOfType([h().string,h().object]),noMatchingFilesMessage:h().func,showMoreResults:h().oneOfType([h().string,h().object]),group:h().func.isRequired,sort:h().func.isRequired,icons:h().shape({Folder:h().element,FolderOpen:h().element,File:h().element,PDF:h().element,Image:h().element,Delete:h().element,Rename:h().element,Loading:h().element,Download:h().element}),nestChildren:h().bool.isRequired,renderStyle:h().oneOf(["list","table"]).isRequired,startOpen:h().bool.isRequired,headerRenderer:h().func,headerRendererProps:h().object,filterRenderer:h().func,filterRendererProps:h().object,fileRenderer:h().func,fileRendererProps:h().object,folderRenderer:h().func,folderRendererProps:h().object,detailRenderer:h().func,detailRendererProps:h().object,actionRenderer:h().func,confirmDeletionRenderer:h().func,confirmMultipleDeletionRenderer:h().func,onCreateFiles:h().oneOfType([h().func,h().bool]),onCreateFolder:h().oneOfType([h().func,h().bool]),onMoveFile:h().oneOfType([h().func,h().bool]),onMoveFolder:h().oneOfType([h().func,h().bool]),onRenameFile:h().oneOfType([h().func,h().bool]),onRenameFolder:h().oneOfType([h().func,h().bool]),onDeleteFile:h().oneOfType([h().func,h().bool]),onDeleteFolder:h().oneOfType([h().func,h().bool]),onDownloadFile:h().oneOfType([h().func,h().bool]),onDownloadFolder:h().oneOfType([h().func,h().bool]),onSelect:h().func,onSelectFile:h().func,onSelectFolder:h().func,onPreviewOpen:h().func,onPreviewClose:h().func,onFolderOpen:h().func,onFolderClose:h().func,sensorSettings:h().func,gatewaySettings:h().func,addGateway:h().func,share:h().func,statusIcon:h().element}),ht(ft,"defaultProps",{showActionBar:!0,canFilter:!0,showFoldersOnFilter:!1,noFilesMessage:"No files.",noMatchingFilesMessage:e=>`No files matching "${e}".`,showMoreResults:"Show more results",group:Be,sort:Xe,nestChildren:!1,renderStyle:"table",startOpen:!1,headerRenderer:L,headerRendererProps:{},filterRenderer:S,filterRendererProps:{},fileRenderer:ie,fileRendererProps:{},folderRenderer:Se,folderRendererProps:{},detailRenderer:y,detailRendererProps:{},actionRenderer:rt,confirmDeletionRenderer:Pe,confirmMultipleDeletionRenderer:ke,icons:{},onSelect:e=>{},onSelectFile:e=>{},onSelectFolder:e=>{},onPreviewOpen:e=>{},onPreviewClose:e=>{},onFolderOpen:e=>{},onFolderClose:e=>{}});class gt extends m.Component{render(){return u().createElement(f.DndProvider,{backend:g.HTML5Backend},u().createElement(ft,dt({},this.props)))}}const Ft=e=>{const t=4===e?"fa":"fas",r=4===e?["FontAwesome",'"FontAwesome"']:['"Font Awesome 5 Free"','"Font Awesome 5 Pro"'];let n=!1;const o=document.createElement("span");var s;return o.className=t,o.style.display="none",document.body.insertBefore(o,document.body.firstChild),r.includes((s=o,"font-family",window.getComputedStyle(s,null).getPropertyValue("font-family")))?n=!0:console.warn(`Font Awesome ${e} was not detected but Font Awesome ${e} icons have been requested for \`react-object-list\``),document.body.removeChild(o),n},bt=(e=4)=>{switch(e){case 4:return Ft(4),{Gateway:u().createElement("i",{className:"gatewayFileIcon","aria-hidden":"true"}),Sensor:u().createElement("i",{className:"sensorFileIcon","aria-hidden":"true"}),Folder:u().createElement("i",{className:"folderFileIcon","aria-hidden":"true"}),FolderOpen:u().createElement("i",{className:"folderOpenFileIcon","aria-hidden":"true"}),FolderAdd:u().createElement("i",{className:"folderAddFileIcon","aria-hidden":"true"}),Rename:u().createElement("i",{className:"renameFileIcon","aria-hidden":"true"}),Delete:u().createElement("i",{className:"deleteFileIcon","aria-hidden":"true"}),GatewayAdd:u().createElement("i",{className:"gatewayAddFileIcon","aria-hidden":"true"}),Share:u().createElement("i",{className:"shareFileIcon","aria-hidden":"true"}),Loading:u().createElement("i",{className:"fa fa-circle-o-notch fa-spin","aria-hidden":"true"}),Download:u().createElement("i",{className:"fa fa-download","aria-hidden":"true"})};case 5:return Ft(5),{File:u().createElement("i",{className:"far fa-file","aria-hidden":"true"}),Image:u().createElement("i",{className:"far fa-file-image","aria-hidden":"true"}),Video:u().createElement("i",{className:"far fa-file-video","aria-hidden":"true"}),Audio:u().createElement("i",{className:"far fa-file-audio","aria-hidden":"true"}),Archive:u().createElement("i",{className:"far fa-file-archive","aria-hidden":"true"}),Word:u().createElement("i",{className:"far fa-file-word","aria-hidden":"true"}),Excel:u().createElement("i",{className:"far fa-file-excel","aria-hidden":"true"}),PowerPoint:u().createElement("i",{className:"far fa-file-powerpoint","aria-hidden":"true"}),Text:u().createElement("i",{className:"far fa-file-alt","aria-hidden":"true"}),PDF:u().createElement("i",{className:"far fa-file-pdf","aria-hidden":"true"}),Rename:u().createElement("i",{className:"fas fa-i-cursor","aria-hidden":"true"}),Folder:u().createElement("i",{className:"far fa-folder","aria-hidden":"true"}),FolderOpen:u().createElement("i",{className:"far fa-folder-open","aria-hidden":"true"}),Delete:u().createElement("i",{className:"far fa-trash-alt","aria-hidden":"true"}),Loading:u().createElement("i",{className:"fas fa-circle-notch fa-spin","aria-hidden":"true"}),Download:u().createElement("i",{className:"fas fa-download","aria-hidden":"true"})};default:console.warn(`Could not find config for version ${e}`,"Accepted versions are: 4, 5","Please make an issue in `react-object-list` to fix this.")}},wt=gt;return t})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-keyed-file-browser"]=t():e["react-keyed-file-browser"]=t()}(self,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{BaseFile:()=>I,BaseFileConnectors:()=>x,BaseFolder:()=>pe,BaseFolderConnectors:()=>de,Details:()=>r,FileRenderers:()=>i,Filters:()=>n,FolderRenderers:()=>l,Groupers:()=>a,Headers:()=>s,Icons:()=>d,RawFileBrowser:()=>ft,Sorters:()=>c,Utils:()=>o,default:()=>wt});var r={};e.r(r),e.d(r,{DefaultDetail:()=>y});var n={};e.r(n),e.d(n,{DefaultFilter:()=>S});var o={};e.r(o),e.d(o,{isFolder:()=>R,moveFilesAndFolders:()=>k});var s={};e.r(s),e.d(s,{TableHeader:()=>L});var i={};e.r(i),e.d(i,{ListThumbnailFile:()=>U,RawListThumbnailFile:()=>Y,RawTableFile:()=>se,SimpleListThumbnailFile:()=>oe,TableFile:()=>ie});var l={};e.r(l),e.d(l,{ListThumbnailFolder:()=>De,RawListThumbnailFolder:()=>ve,RawTableFolder:()=>Ee,TableFolder:()=>Se});var a={};e.r(a),e.d(a,{GroupByFolder:()=>Be,GroupByModifiedRelative:()=>Ve});var c={};e.r(c),e.d(c,{SortByModified:()=>et,SortByName:()=>Xe});var d={};e.r(d),e.d(d,{FontAwesome:()=>bt});const p=require("prop-types");var h=e.n(p);const m=require("react");var u=e.n(m);const f=require("react-dnd"),g=require("react-dnd-html5-backend");var F=Object.defineProperty,b=(e,t,r)=>(((e,t,r)=>{t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class w extends u().Component{constructor(){super(...arguments),b(this,"handleCloseClick",(e=>{e&&e.preventDefault(),this.props.close()}))}render(){let e=this.props.file.key.split("/");return e=e.length?e[e.length-1]:"",u().createElement("div",null,u().createElement("h2",null,"Sensor Details"),u().createElement("div",null,"Sensor meta data goes here..."),u().createElement("a",{href:"#",onClick:this.handleCloseClick},"Close"))}}b(w,"propTypes",{file:h().shape({key:h().string.isRequired,name:h().string.isRequired,extension:h().string.isRequired,url:h().string}).isRequired,close:h().func});const y=w;var v=Object.defineProperty,D=(e,t,r)=>(((e,t,r)=>{t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class E extends u().Component{constructor(){super(...arguments),D(this,"handleFilterChange",(e=>{const t=e.target.value;this.props.updateFilter(t)}))}render(){return u().createElement("input",{type:"search",placeholder:"Search Sensors",value:this.props.value,onChange:this.handleFilterChange})}}D(E,"propTypes",{value:h().string.isRequired,updateFilter:h().func});const S=E,C=require("classnames");var P=e.n(C);function R(e){return e.key.endsWith("/")}function k(e,t,r){if(!t.didDrop())return;const n=t.getDropResult(),o=[],s=[];e.browserProps.selection.forEach((e=>{"/"===e[e.length-1]?o.push(e):s.push(e)})),e.browserProps.openFolder(n.path),o.forEach((t=>{const r=t,o=r.split("/"),s=o[o.length-2],i=`${n.path}${s}/`;i.substr(0,r.length)!==r&&i!==r&&e.browserProps.moveFolder&&e.browserProps.moveFolder(r,i)})),s.forEach((t=>{const r=t,o=r.split("/"),s=o[o.length-1],i=`${n.path}${s}`;i!==r&&e.browserProps.moveFile&&e.browserProps.moveFile(r,i)}))}const N={Archive:["zip","rar","7z"],Audio:["mp3","ogg","wav","aac"],Excel:["xls","xlsx"],Image:["jpg","jpeg","png","bmp"],PDF:["pdf"],PowerPoint:["ppt","pptx"],Text:["txt"],Video:["mp4","flv","avi","wmv","mov"],Word:["doc","docx"],Code:["js"]},O={};for(const[e,t]of Object.entries(N))for(const r of t)O[r]=e;var A=Object.defineProperty,T=(e,t,r)=>(((e,t,r)=>{t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class j extends u().Component{constructor(){super(...arguments),T(this,"state",{newName:this.getName()}),T(this,"handleFileClick",(e=>{e&&e.preventDefault(),this.props.browserProps.preview({url:this.props.url,name:this.getName(),key:this.props.fileKey,extension:this.getExtension()})})),T(this,"handleItemClick",(e=>{e.stopPropagation(),this.props.browserProps.select(this.props.fileKey,"file",e.ctrlKey||e.metaKey,e.shiftKey)})),T(this,"handleItemDoubleClick",(e=>{e.stopPropagation(),this.handleFileClick()})),T(this,"handleRenameClick",(e=>{this.props.browserProps.renameFile&&this.props.browserProps.beginAction("rename",this.props.fileKey)})),T(this,"handleNewNameChange",(e=>{const t=e.target.value;this.setState({newName:t})})),T(this,"handleRenameSubmit",(e=>{if(e&&e.preventDefault(),!this.props.browserProps.renameFile)return;const t=this.state.newName.trim();if(0===t.length)return;if(["/","\\"].some((e=>-1!==t.indexOf(e))))return;let r=t;const n=this.props.fileKey.lastIndexOf("/");-1!==n&&(r=`${this.props.fileKey.substr(0,n)}/${t}`),this.props.browserProps.renameFile(this.props.fileKey,r)})),T(this,"handleDeleteClick",(e=>{this.props.browserProps.deleteFile&&this.props.browserProps.beginAction("delete",this.props.fileKey)})),T(this,"handleDeleteSubmit",(e=>{e.preventDefault(),this.props.browserProps.deleteFile&&this.props.browserProps.deleteFile(this.props.browserProps.actionTargets)})),T(this,"handleCancelEdit",(e=>{this.props.browserProps.endAction()}))}selectFileNameFromRef(e){if(e){const t=e.value,r=t.lastIndexOf(".");e.setSelectionRange(0,r||t.length),e.focus()}}getName(){let e=this.props.newKey||this.props.fileKey;const t=e.lastIndexOf("/");return-1!==t&&(e=e.substr(t+1)),e}getExtension(){const e=this.props.fileKey.split(".");return e[e.length-1].toLowerCase().trim()}getFileType(){return O[this.getExtension()]||"File"}connectDND(e){const t=this.props.isDragging||this.props.action;return"function"!=typeof this.props.browserProps.moveFile||t||this.props.isRenaming||(e=this.props.connectDragSource(e)),"function"!=typeof this.props.browserProps.createFiles&&"function"!=typeof this.props.browserProps.moveFile&&"function"!=typeof this.props.browserProps.moveFolder||(e=this.props.connectDropTarget(e)),e}}T(j,"propTypes",{fileKey:h().string,url:h().string,newKey:h().string,isRenaming:h().bool,connectDragSource:h().func,connectDropTarget:h().func,isDragging:h().bool,action:h().string,browserProps:h().shape({icons:h().object,select:h().func,beginAction:h().func,endAction:h().func,preview:h().func,createFiles:h().func,moveFile:h().func,moveFolder:h().func,renameFile:h().func,deleteFile:h().func})});const M={drop(e,t){if(t.didDrop())return;const r=e.newKey||e.fileKey,n=r.lastIndexOf("/"),o=-1!==n?r.substr(0,n+1):"",s=t.getItem();return s.files&&e.browserProps.createFiles&&e.browserProps.createFiles(s.files,o),{path:o}}},x={dragSource:{beginDrag:e=>(e.browserProps.selection.length&&e.browserProps.selection.includes(e.fileKey)||e.browserProps.select(e.fileKey,"file"),{key:e.fileKey}),endDrag(e,t,r){k(e,t)}},dragCollect:function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},targetSource:M,targetCollect:function(e,t){return{connectDropTarget:e.dropTarget(),isOver:t.isOver({shallow:!0})}}},I=j;var K=Object.defineProperty;class B extends u().Component{handleHeaderClick(e){this.props.select(this.props.fileKey)}render(){const e=u().createElement("div",{className:P()("file-browser-header",{dragover:this.props.isOver,selected:this.props.isSelected})},"Devices");return"function"==typeof this.props.browserProps.createFiles||"function"==typeof this.props.browserProps.moveFile||"function"==typeof this.props.browserProps.moveFolder?this.props.connectDropTarget(e):e}}((e,t,r)=>{t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(B,"propTypes"+"",{select:h().func,fileKey:h().string,connectDropTarget:h().func,isOver:h().bool,isSelected:h().func,browserProps:h().shape({createFiles:h().func,moveFolder:h().func,moveFile:h().func})});const L=(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect)(B),G=require("date-fns"),q=require("lodash/flow");var _=e.n(q);var W=Object.defineProperty,$=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,V=(e,t,r)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Y extends I{render(){const{thumbnail_url:e,action:t,url:r,isDragging:n,isRenaming:o,isSelected:s,isSelectable:i,isOver:l,isDeleting:a,showName:c,showSize:d,showModified:p,browserProps:h,connectDragPreview:m}=this.props;let f;f=e?u().createElement("div",{className:"image",style:{backgroundImage:"url("+e+")"}}):h.icons[this.getFileType()]||h.icons.File;const g=n||t,F=h.confirmDeletionRenderer;let b,w,y;c&&(b=!g&&a&&1===h.selection.length?u().createElement(F,{handleDeleteSubmit:this.handleDeleteSubmit,handleFileClick:this.handleFileClick,url:r},this.getName()):!g&&o?u().createElement("form",{className:"renaming",onSubmit:this.handleRenameSubmit},u().createElement("input",{ref:this.selectFileNameFromRef,type:"text",value:this.state.newName,onChange:this.handleNewNameChange,onBlur:this.handleCancelEdit,autoFocus:!0})):u().createElement("a",null,this.getName())),d&&(o||a||(w=u().createElement("span",{className:"size"},u().createElement("small",null,function(e){if(e>1024){const t=e/1024;return t>1024?`${function(e,t){if(e=parseFloat(e),isNaN(e))return parseFloat("0").toFixed(2);{const t=Math.pow(10,2);return(e=(Math.round(e*t)/t).toFixed(2)).toString()}}(t/1024)} MB`:`${Math.round(t)} kB`}return`${e} B`}(this.props.size))))),p&&(o||a||(y=u().createElement("span",{className:"modified"},"Last modified: ",(0,G.formatDistanceToNow)(this.props.modified,{addSuffix:!0}))));let v={};i&&(v={onClick:this.handleItemClick});let D=u().createElement("li",((e,t)=>{for(var r in t||(t={}))z.call(t,r)&&V(e,r,t[r]);if($)for(var r of $(t))H.call(t,r)&&V(e,r,t[r]);return e})({className:P()("file",{pending:t,dragging:n,dragover:l,selected:s}),onDoubleClick:this.handleItemDoubleClick},v),u().createElement("div",{className:"item"},u().createElement("span",{className:"thumb"},f),u().createElement("span",{className:"name"},b),w,y));return"function"==typeof h.moveFile&&(D=m(D)),this.connectDND(D)}}((e,t,r)=>{V(e,t+"",{showName:!0,showSize:!0,showModified:!0,isSelectable:!0})})(Y,"defaultProps");const U=_()((0,f.DragSource)("file",x.dragSource,x.dragCollect),(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect))(Y);var J=Object.defineProperty,Q=Object.defineProperties,X=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,re=(e,t,r)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class ne extends u().Component{render(){return u().createElement(U,(e=((e,t)=>{for(var r in t||(t={}))ee.call(t,r)&&re(e,r,t[r]);if(Z)for(var r of Z(t))te.call(t,r)&&re(e,r,t[r]);return e})({},this.props),Q(e,X({showName:!1,showSize:!1,showModified:!1,isSelectable:!1}))));var e}}const oe=ne;class se extends I{render(){const{isDragging:e,isDeleting:t,isRenaming:r,isOver:n,isSelected:o,action:s,url:i,browserProps:l,connectDragPreview:a,depth:c,size:d,modified:p,analysisFunc:h,dataLogFunc:m,isSensor:f,sensorId:g,sensorSettings:F}=this.props,b=l.icons[f?"Sensor":this.getFileType()]||l.icons.File,w=e||s,y=l.confirmDeletionRenderer;let v;v=!w&&t&&1===l.selection.length?u().createElement(y,{handleDeleteSubmit:this.handleDeleteSubmit,handleFileClick:this.handleFileClick,url:i},b,this.getName()):!w&&r?u().createElement("form",{className:"renaming",onSubmit:this.handleRenameSubmit},b,u().createElement("input",{ref:this.selectFileNameFromRef,type:"text",value:this.state.newName,onChange:this.handleNewNameChange,onBlur:this.handleCancelEdit,autoFocus:!0})):u().createElement("a",null,b,this.getName);let D=u().createElement("div",{className:"nameLbl"},v);"function"==typeof l.moveFile&&(D=a(D));const E=u().createElement("tr",{className:P()("file",{pending:s,dragging:e,dragover:n,selected:o}),onClick:this.handleItemClick,onDoubleClick:this.handleItemDoubleClick},u().createElement("td",{className:"name"},u().createElement("div",{className:"nameBox",style:{paddingLeft:16*c+"px"}},D,f&&u().createElement(u().Fragment,null,u().createElement("div",{className:"rowBtn",onClick:()=>{h()}},u().createElement("i",{className:"fa fa-chart-simple","aria-hidden":"true"}),window.innerWidth>550&&u().createElement(u().Fragment,null,"Analysis")),u().createElement("div",{className:"rowBtn",onClick:()=>{m()}},u().createElement("i",{className:"fa fa-list","aria-hidden":"true"}),window.innerWidth>550&&u().createElement(u().Fragment,null,"Data Log")),u().createElement("div",{className:"device-settings",onClick:()=>{F(this.getName())}},u().createElement("i",{className:"fa fa-gear","aria-hidden":"true"}))))));return this.connectDND(E)}}const ie=_()((0,f.DragSource)("file",x.dragSource,x.dragCollect),(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect))(se);var le=Object.defineProperty,ae=(e,t,r)=>(((e,t,r)=>{t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);class ce extends u().Component{constructor(){super(...arguments),ae(this,"state",{newName:this.props.isDraft?"New folder":this.getName()}),ae(this,"handleFolderClick",(e=>{e.stopPropagation(),this.props.browserProps.select(this.props.fileKey,"folder",e.ctrlKey||e.metaKey,e.shiftKey)})),ae(this,"handleFolderDoubleClick",(e=>{e.stopPropagation(),this.toggleFolder()})),ae(this,"handleRenameClick",(e=>{this.props.browserProps.renameFolder&&this.props.browserProps.beginAction("rename",this.props.fileKey)})),ae(this,"handleNewNameChange",(e=>{const t=e.target.value;this.setState({newName:t})})),ae(this,"handleRenameSubmit",(e=>{if(e.preventDefault(),e.stopPropagation(),!this.props.browserProps.renameFolder&&!this.props.isDraft)return;const t=this.state.newName.trim();if(0===t.length)return;if(["/","\\"].some((e=>-1!==t.indexOf(e))))return;let r=this.props.fileKey.substr(0,this.props.fileKey.substr(0,this.props.fileKey.length-1).lastIndexOf("/"));r.length&&(r+="/"),r+=t,r+="/",this.props.isDraft?this.props.browserProps.createFolder(r):this.props.browserProps.renameFolder(this.props.fileKey,r)})),ae(this,"handleDeleteClick",(e=>{this.props.browserProps.deleteFolder&&this.props.browserProps.beginAction("delete",this.props.fileKey)})),ae(this,"handleDeleteSubmit",(e=>{e.preventDefault(),e.stopPropagation(),this.props.browserProps.deleteFolder&&this.props.browserProps.deleteFolder(this.props.browserProps.actionTargets)})),ae(this,"handleCancelEdit",(e=>{this.props.browserProps.endAction()})),ae(this,"toggleFolder",(()=>{this.props.browserProps.toggleFolder(this.props.fileKey)}))}selectFolderNameFromRef(e){if(e){const t=e.value;e.setSelectionRange(0,t.length),e.focus()}}getName(){if(this.props.name)return this.props.name;const e=this.props.fileKey.split("/");return this.props.newName||e[e.length-2]}connectDND(e){const t=this.props.isDragging||this.props.action;return this.props.keyDerived&&("function"!=typeof this.props.browserProps.moveFolder||t||this.props.isRenaming||this.props.isDeleting||(e=this.props.connectDragSource(e)),"function"!=typeof this.props.browserProps.createFiles&&"function"!=typeof this.props.browserProps.moveFolder&&"function"!=typeof this.props.browserProps.moveFile||(e=this.props.connectDropTarget(e))),e}}ae(ce,"propTypes",{name:h().string,fileKey:h().string,isGateway:h().bool,statusIcon:h().element,newName:h().string,keyDerived:h().bool,isDraft:h().bool,isRenaming:h().bool,isDeleting:h().bool,connectDragSource:h().func,connectDropTarget:h().func,isDragging:h().bool,action:h().string,browserProps:h().shape({select:h().func,toggleFolder:h().func,beginAction:h().func,endAction:h().func,preview:h().func,createFiles:h().func,createFolder:h().func,moveFile:h().func,moveFolder:h().func,renameFolder:h().func,deleteFolder:h().func})});const de={dragSource:{beginDrag:e=>(e.browserProps.selection.length||e.browserProps.select(e.fileKey,"folder"),{key:e.fileKey}),endDrag(e,t,r){k(e,t)}},dragCollect:function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}}},pe=ce;var he=Object.defineProperty,me=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,be=(e,t,r)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,we=(e,t)=>{for(var r in t||(t={}))ge.call(t,r)&&be(e,r,t[r]);if(fe)for(var r of fe(t))Fe.call(t,r)&&be(e,r,t[r]);return e},ye=(e,t)=>me(e,ue(t));class ve extends pe{render(){const{isOpen:e,isDragging:t,isDeleting:r,isRenaming:n,isDraft:o,isOver:s,isSelected:i,url:l,action:a,browserProps:c,depth:d,keyDerived:p,connectDragPreview:h}=this.props,m=c.icons[e?"FolderOpen":"Folder"],f=t||a,g=c.confirmDeletionRenderer;let F,b;if(F=!f&&r&&1===c.selection.length?u().createElement(g,{handleDeleteSubmit:this.handleDeleteSubmit,handleFileClick:this.handleFileClick,url:l},this.getName()):!f&&n||o?u().createElement("div",null,u().createElement("form",{className:"renaming",onSubmit:this.handleRenameSubmit},u().createElement("input",{type:"text",ref:this.selectFolderNameFromRef,value:this.state.newName,onChange:this.handleNewNameChange,onBlur:this.handleCancelEdit,autoFocus:!0}))):u().createElement("div",null,u().createElement("a",{onClick:this.toggleFolder},this.getName())),e&&c.nestChildren){b=[];for(let e=0;e{m({name:f,id:g,password:F,description:b})}},u().createElement("i",{className:"fa fa-gear","aria-hidden":"true"}))))));return this.connectDND(C)}}const Se=_()((0,f.DragSource)("folder",de.dragSource,de.dragCollect),(0,f.DropTarget)(["file","folder",g.NativeTypes.FILE],x.targetSource,x.targetCollect))(Ee),Ce=e=>{const{children:t,handleDeleteSubmit:r,handleFileClick:n,url:o}=e;return u().createElement("form",{className:"deleting",onSubmit:r},u().createElement("a",{onClick:n},t),u().createElement("div",null,u().createElement("button",{type:"submit"},"Confirm Deletion")))};Ce.propTypes={children:h().node,handleDeleteSubmit:h().func,handleFileClick:h().func,url:h().string},Ce.defaultProps={url:"#"};const Pe=Ce,Re=e=>{const{handleDeleteSubmit:t}=e;return u().createElement("button",{className:"deleting",onClick:t},"Confirm Deletion")};Re.propTypes={handleDeleteSubmit:h().func};const ke=Re;var Ne=Object.defineProperty,Oe=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,xe=(e,t,r)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))je.call(t,r)&&xe(e,r,t[r]);if(Te)for(var r of Te(t))Me.call(t,r)&&xe(e,r,t[r]);return e},Ke=(e,t)=>Oe(e,Ae(t));function Be(e,t){const r={contents:[],children:{}};return e.map((e=>{e.relativeKey=(e.newKey||e.key).substr(t.length);let n=r;const o=e.relativeKey.split("/");o.map(((t,r)=>{if(r===o.length-1&&R(e))for(const t in e)n[t]=e[t];""!==t&&(R(e)||r!==o.length-1?(t in n.children==0&&(n.children[t]={contents:[],children:{}}),n=n.children[t]):n.contents.push(Ke(Ie({},e),{keyDerived:!0})))}))})),e=function e(r,n){""!==n&&(n+="/");let o=[];for(const s in r.children)o.push(Ke(Ie({},r.children[s]),{contents:void 0,keyDerived:!0,key:t+n+s+"/",relativeKey:n+s+"/",children:e(r.children[s],n+s),size:0}));return o=o.concat(r.contents),o}(r,"")}var Le=Object.defineProperty,Ge=Object.defineProperties,qe=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,ze=(e,t,r)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,He=(e,t)=>{for(var r in t||(t={}))We.call(t,r)&&ze(e,r,t[r]);if(_e)for(var r of _e(t))$e.call(t,r)&&ze(e,r,t[r]);return e};function Ve(e,t){const r=function(){const e=[],t=new Date;return e.push({name:"Today",begins:(0,G.startOfToday)(),ends:(0,G.endOfToday)(),items:[]}),e.push({name:"Yesterday",begins:(0,G.startOfYesterday)(),ends:(0,G.endOfYesterday)(),items:[]}),e.push({name:"Earlier this Week",begins:(0,G.startOfWeek)(t),ends:(0,G.endOfWeek)(t),items:[]}),e.push({name:"Last Week",begins:(0,G.startOfWeek)((0,G.addWeeks)(t,-1)),ends:(0,G.endOfWeek)((0,G.addWeeks)(t,-1)),items:[]}),(0,G.getMonth)(e[e.length-1].begins)===(0,G.getMonth)(t)&&e.push({name:"Earlier this Month",begins:(0,G.startOfMonth)(t),ends:(0,G.endOfMonth)(t),items:[]}),e}();for(let t=0;t+t.begins&&l<=+t.ends){t.items.push(s),i=!0;break}}if(!i){const e={name:(0,G.format)(s.modified,"MMMM yyyy"),begins:(0,G.startOfMonth)(s.modified),ends:(0,G.endOfMonth)(s.modified),items:[]};e.items.push(s),r.push(e)}}var n;const o=[];for(let e=0;eo)return 1}return 0}function Je(e,t){return e.draft&&!t.draft?1:t.draft&&!e.draft?-1:Ue(e,t)}function Qe(e){let t=[],r=[];for(let n=0;n{const{selectedItems:t,isFolder:r,icons:n,nameFilter:o,canCreateFolder:s,onCreateFolder:i,canRenameFile:l,onRenameFile:a,canRenameFolder:c,onRenameFolder:d,canDeleteFile:p,onDeleteFile:h,canDeleteFolder:m,onDeleteFolder:f,canDownloadFile:g,onDownloadFile:F,canDownloadFolder:b,onDownloadFolder:w,addGateway:y,share:v}=e;let D=[u().createElement(u().Fragment,null,u().createElement("li",{key:"action-share"},u().createElement("a",{onClick:()=>{v(t.length?t[0]:"root")},href:"#",role:"button"},n.Share,"Share")))];if(t.length){const e=t.filter((e=>e.action));if(e.length===t.length&&1===[...new Set(e)].length){let t;switch(e[0].action){case"delete":t="Deleting ...";break;case"rename":t="Renaming ...";break;default:t="Moving ..."}D=u().createElement("div",{className:"item-actions"},n.Loading," ",t)}else{r&&s&&!o&&!t[0].isGateway&&(D.push(u().createElement("li",{key:"action-add-gateway"},u().createElement("a",{onClick:()=>{y(t[0])},href:"#",role:"button"},n.GatewayAdd,"Add Gateway"))),D.push(u().createElement("li",{key:"action-add-folder"},u().createElement("a",{onClick:i,href:"#",role:"button"},n.FolderAdd,"Add Subfolder"))));const e=t.find((e=>!e.keyDerived));e||r||!l||1!==t.length?!e&&r&&c&&D.push(u().createElement("li",{key:"action-rename"},u().createElement("a",{onClick:d,href:"#",role:"button"},n.Rename,"Rename"))):D.push(u().createElement("li",{key:"action-rename"},u().createElement("a",{onClick:a,href:"#",role:"button"},n.Rename,"Rename"))),e||r||!p?!e&&r&&m&&D.push(u().createElement("li",{key:"action-delete"},u().createElement("a",{onClick:f,href:"#",role:"button"},n.Delete,"Delete"))):D.push(u().createElement("li",{key:"action-delete"},u().createElement("a",{onClick:h,href:"#",role:"button"},n.Delete,"Delete"))),(!r&&g||r&&b)&&D.push(u().createElement("li",{key:"action-download"},u().createElement("a",{onClick:r?w:F,href:"#",role:"button"},n.Download,"Download"))),D=D.length?u().createElement("ul",{className:"item-actions"},D):u().createElement("div",{className:"item-actions"}," ")}}else s&&!o&&(D.push(u().createElement("li",{key:"action-add-gateway"},u().createElement("a",{onClick:()=>{y("root")},href:"#",role:"button"},n.GatewayAdd,"Add Gateway"))),D.push(u().createElement("li",{key:"action-add-folder"},u().createElement("a",{onClick:i,href:"#",role:"button"},n.FolderAdd,"Add Folder")))),D=D.length?u().createElement("ul",{className:"item-actions"},D):u().createElement("div",{className:"item-actions"}," ");return D};tt.propTypes={selectedItems:h().arrayOf(h().object),isFolder:h().bool,icons:h().object,nameFilter:h().string,canCreateFolder:h().bool,onCreateFolder:h().func,canRenameFile:h().bool,onRenameFile:h().func,canRenameFolder:h().bool,onRenameFolder:h().func,canDeleteFile:h().bool,onDeleteFile:h().func,canDeleteFolder:h().bool,onDeleteFolder:h().func,canDownloadFile:h().bool,onDownloadFile:h().func,canDownloadFolder:h().bool,onDownloadFolder:h().func,addGateway:h().func,share:h().func},tt.defaultProps={selectedItems:[],isFolder:!1,icons:{},nameFilter:"",canCreateFolder:!1,onCreateFolder:null,canRenameFile:!1,onRenameFile:null,canRenameFolder:!1,onRenameFolder:null,canDeleteFile:!1,onDeleteFile:null,canDeleteFolder:!1,onDeleteFolder:null,canDownloadFile:!1,onDownloadFile:null,canDownloadFolder:!1,onDownloadFolder:null,share:null,addGateway:null};const rt=tt;var nt=Object.defineProperty,ot=Object.defineProperties,st=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,ct=(e,t,r)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&ct(e,r,t[r]);if(it)for(var r of it(t))at.call(t,r)&&ct(e,r,t[r]);return e},pt=(e,t)=>ot(e,st(t)),ht=(e,t,r)=>(ct(e,"symbol"!=typeof t?t+"":t,r),r);const mt=/.*\/__new__[/]?$/gm;function ut(e,t){return{key:`file-${e.key}`,fileKey:e.key,isSelected:t.selection.includes(e.key),isOpen:e.key in t.openFolders||t.nameFilter,isRenaming:"rename"===t.activeAction&&t.actionTargets.includes(e.key),isDeleting:"delete"===t.activeAction&&t.actionTargets.includes(e.key),isDraft:!!e.draft}}class ft extends u().Component{constructor(){super(...arguments),ht(this,"state",{openFolders:{},selection:[],activeAction:null,actionTargets:[],nameFilter:"",searchResultsShown:20,previewFile:null,addFolder:null}),ht(this,"getFile",(e=>{let t=!1;return this.props.files.find((r=>(r.key.startsWith(e)&&(t=!0),r.key===e)))||(t?{key:e,modified:0,size:0,relativeKey:e}:void 0)})),ht(this,"createFiles",((e,t)=>{this.setState((e=>{const r={selection:[]};return t&&(r.openFolders=pt(dt({},e.openFolders),{[t]:!0})),r}),(()=>{this.props.onCreateFiles(e,t)}))})),ht(this,"createFolder",(e=>{this.setState({activeAction:null,actionTargets:[],selection:[e]},(()=>{this.props.onCreateFolder(e)}))})),ht(this,"moveFile",((e,t)=>{this.setState({activeAction:null,actionTargets:[],selection:[t]},(()=>{this.props.onMoveFile(e,t)}))})),ht(this,"moveFolder",((e,t)=>{this.setState((r=>{const n={activeAction:null,actionTargets:[],selection:[t]};return e in r.openFolders&&(n.openFolders=pt(dt({},r.openFolders),{[t]:!0})),n}),(()=>{this.props.onMoveFolder(e,t)}))})),ht(this,"renameFile",((e,t)=>{this.setState({activeAction:null,actionTargets:[],selection:[t]},(()=>{this.props.onRenameFile(e,t)}))})),ht(this,"renameFolder",((e,t)=>{this.setState((r=>{const n={activeAction:null,actionTargets:[]};return r.selection[0].substr(0,e.length)===e&&(n.selection=[r.selection[0].replace(e,t)]),e in r.openFolders&&(n.openFolders=pt(dt({},r.openFolders),{[t]:!0})),n}),(()=>{this.props.onRenameFolder(e,t)}))})),ht(this,"deleteFile",(e=>{this.setState({activeAction:null,actionTargets:[],selection:[]},(()=>{this.props.onDeleteFile(e)}))})),ht(this,"deleteFolder",(e=>{this.setState((t=>{const r={activeAction:null,actionTargets:[],selection:[]};return e in t.openFolders&&(r.openFolders=dt({},t.openFolders),delete r.openFolders[e]),r}),(()=>{this.props.onDeleteFolder(e)}))})),ht(this,"downloadFile",(e=>{this.setState({activeAction:null,actionTargets:[]},(()=>{this.props.onDownloadFile(e)}))})),ht(this,"downloadFolder",(e=>{this.setState({activeAction:null,actionTargets:[]},(()=>{this.props.onDownloadFolder(e)}))})),ht(this,"beginAction",((e,t)=>{this.setState({activeAction:e,actionTargets:t||[]})})),ht(this,"endAction",(()=>{this.state.selection&&this.state.selection.length>0&&this.state.selection.filter((e=>e.match(mt))).length>0&&this.setState({selection:[]}),this.beginAction(null,null)})),ht(this,"select",((e,t,r,n)=>{const{actionTargets:o}=this.state,s=o.length&&!o.includes(e),i=this.getFile(e);let l=[e];if(r||n){const t=this.state.selection.indexOf(e);l=-1!==t?[...this.state.selection.slice(0,t),...this.state.selection.slice(t+1)]:[...this.state.selection,e]}this.setState((e=>({selection:l,actionTargets:s?[]:o,activeAction:s?null:e.activeAction})),(()=>{this.props.onSelect(i),"file"===t&&this.props.onSelectFile(i),"folder"===t&&this.props.onSelectFolder(i)}))})),ht(this,"preview",(e=>{this.state.previewFile&&this.state.previewFile.key!==e.key&&this.closeDetail(),this.setState({previewFile:e},(()=>{this.props.onPreviewOpen(e)}))})),ht(this,"closeDetail",(()=>{this.setState({previewFile:null},(()=>{this.props.onPreviewClose(this.state.previewFile)}))})),ht(this,"handleShowMoreClick",(e=>{e.preventDefault(),this.setState((e=>({searchResultsShown:e.searchResultsShown+20})))})),ht(this,"toggleFolder",(e=>{const t=e in this.state.openFolders;this.setState((r=>{const n={openFolders:dt({},r.openFolders)};return t?delete n.openFolders[e]:n.openFolders[e]=!0,n}),(()=>{const r=t?"onFolderClose":"onFolderOpen";this.props[r](this.getFile(e),this.getBrowserProps())}))})),ht(this,"openFolder",(e=>{this.setState((t=>({openFolders:pt(dt({},t.openFolders),{[e]:!0})})),(()=>{this.props.onFolderOpen(this.getFile(e),this.getBrowserProps())}))})),ht(this,"handleGlobalClick",(e=>{this.browserRef&&this.browserRef.contains(e.target)||this.setState({selection:[],actionTargets:[],activeAction:null})})),ht(this,"handleActionBarRenameClick",(e=>{e.preventDefault(),this.beginAction("rename",this.state.selection)})),ht(this,"handleActionBarDeleteClick",(e=>{e.preventDefault(),this.beginAction("delete",this.state.selection)})),ht(this,"handleActionBarAddFolderClick",(e=>{e.preventDefault(),"createFolder"!==this.state.activeAction&&this.setState((e=>{let t="";e.selection&&e.selection.length>0&&(t+=e.selection,"/"!==t.substr(t.length-1,t.length)&&(t+="/")),"__new__/"===t||t.endsWith("/__new__/")||(t+="__new__/");const r={actionTargets:[t],activeAction:"createFolder",selection:[t]};return e.selection&&e.selection.length>0&&(r.openFolders=pt(dt({},e.openFolders),{[this.state.selection]:!0})),r}))})),ht(this,"handleActionBarDownloadClick",(e=>{e.preventDefault();const t=this.getFiles(),r=this.getSelectedItems(t);1===r.length&&R(r[0])?this.downloadFolder(this.state.selection):this.downloadFile(this.state.selection)})),ht(this,"updateFilter",(e=>{this.setState({nameFilter:e,searchResultsShown:20})})),ht(this,"sensorSettings",(e=>{this.props.sensorSettings(e)})),ht(this,"gatewaySettings",(e=>{this.props.gatewaySettings(e)})),ht(this,"addGateway",(e=>{this.props.addGateway(e)})),ht(this,"share",(e=>{this.props.share(e)})),ht(this,"handleMultipleDeleteSubmit",(()=>{this.deleteFolder(this.state.selection.filter((e=>"/"===e[e.length-1]))),this.deleteFile(this.state.selection.filter((e=>"/"!==e[e.length-1])))}))}componentDidMount(){"table"===this.props.renderStyle&&this.props.nestChildren&&console.warn("Invalid settings: Cannot nest table children in file browser"),window.addEventListener("click",this.handleGlobalClick)}componentWillUnmount(){window.removeEventListener("click",this.handleGlobalClick)}getBrowserProps(){return{nestChildren:this.props.nestChildren,fileRenderer:this.props.fileRenderer,fileRendererProps:this.props.fileRendererProps,folderRenderer:this.props.folderRenderer,folderRendererProps:this.props.folderRendererProps,confirmDeletionRenderer:this.props.confirmDeletionRenderer,confirmMultipleDeletionRenderer:this.props.confirmMultipleDeletionRenderer,icons:this.props.icons,openFolders:this.state.openFolders,nameFilter:this.state.nameFilter,selection:this.state.selection,activeAction:this.state.activeAction,actionTargets:this.state.actionTargets,select:this.select,openFolder:this.openFolder,toggleFolder:this.toggleFolder,beginAction:this.beginAction,endAction:this.endAction,preview:this.preview,createFiles:this.props.onCreateFiles?this.createFiles:void 0,createFolder:this.props.onCreateFolder?this.createFolder:void 0,renameFile:this.props.onRenameFile?this.renameFile:void 0,renameFolder:this.props.onRenameFolder?this.renameFolder:void 0,moveFile:this.props.onMoveFile?this.moveFile:void 0,moveFolder:this.props.onMoveFolder?this.moveFolder:void 0,deleteFile:this.props.onDeleteFile?this.deleteFile:void 0,deleteFolder:this.props.onDeleteFolder?this.deleteFolder:void 0,getItemProps:ut,sensorSettings:this.props.sensorSettings?this.sensorSettings:void 0,gatewaySettings:this.props.gatewaySettings?this.gatewaySettings:void 0,addGateway:this.props.addGateway?this.addGateway:void 0,share:this.props.share?this.share:void 0,statusIcon:this.props.statusIcon}}renderActionBar(e){const{icons:t,canFilter:r,filterRendererProps:n,filterRenderer:o,actionRenderer:s,onCreateFolder:i,onRenameFile:l,onRenameFolder:a,onDeleteFile:c,onDeleteFolder:d,onDownloadFile:p,onDownloadFolder:h}=this.props,m=this.getBrowserProps(),f=1===e.length&&R(e[0]);let g;r&&(g=u().createElement(o,dt({value:this.state.nameFilter,updateFilter:this.updateFilter},n)));const F=u().createElement(s,{browserProps:m,selectedItems:e,isFolder:f,icons:t,nameFilter:this.state.nameFilter,canCreateFolder:"function"==typeof i,onCreateFolder:this.handleActionBarAddFolderClick,canRenameFile:"function"==typeof l,onRenameFile:this.handleActionBarRenameClick,canRenameFolder:"function"==typeof a,onRenameFolder:this.handleActionBarRenameClick,canDeleteFile:"function"==typeof c,onDeleteFile:this.handleActionBarDeleteClick,canDeleteFolder:"function"==typeof d,onDeleteFolder:this.handleActionBarDeleteClick,canDownloadFile:"function"==typeof p,onDownloadFile:this.handleActionBarDownloadClick,canDownloadFolder:"function"==typeof h,onDownloadFolder:this.handleActionBarDownloadClick,addGateway:this.addGateway,share:this.share});return u().createElement("div",{className:"action-bar"},g,F)}renderFiles(e,t){const{fileRenderer:r,fileRendererProps:n,folderRenderer:o,folderRendererProps:s,statusIcon:i}=this.props,l=this.getBrowserProps();let a=[];return e.map((e=>{const c=pt(dt({},l.getItemProps(e,l)),{depth:this.state.nameFilter?0:t});R(e)?(!this.props.showFoldersOnFilter&&this.state.nameFilter||a.push(u().createElement(o,pt(dt(pt(dt(dt({},e),c),{browserProps:l}),s),{gatewaySettings:this.gatewaySettings,statusIcon:i}))),(this.state.nameFilter||c.isOpen&&!l.nestChildren)&&(a=a.concat(this.renderFiles(e.children,t+1)))):a.push(u().createElement(r,pt(dt(pt(dt(dt({},e),c),{browserProps:l}),n),{sensorSettings:this.sensorSettings})))})),a}getFiles(){let e=this.props.files.concat([]);if("createFolder"===this.state.activeAction&&e.push({key:this.state.actionTargets[0],size:0,draft:!0}),this.state.nameFilter){const t=[],r=this.state.nameFilter.toLowerCase().split(" ");e.map((e=>{let n=!1;r.map((t=>{-1===e.key.toLowerCase().trim().indexOf(t)&&(n=!0)})),n||t.push(e)})),e=t}if("function"==typeof this.props.group)e=this.props.group(e,"");else{const t=[];e.map((e=>{R(e)||t.push(e)})),e=t}return"function"==typeof this.props.sort&&(e=this.props.sort(e)),e}getSelectedItems(e){const{selection:t}=this.state,r=[],n=e=>{t.includes(e.key)&&r.push(e),e.children&&e.children.map(n)};return e.map(n),r}render(){const e={browserProps:this.getBrowserProps(),fileKey:"",fileCount:this.props.files.length};let t;const r=this.getFiles(),n=this.getSelectedItems(r);let o,s=this.renderFiles(r,0);switch(this.props.renderStyle){case"table":if(s.length){if(this.state.nameFilter){const e=s.length;s=s.slice(0,this.state.searchResultsShown),e>s.length&&s.push(u().createElement("tr",{key:"show-more"},u().createElement("td",{colSpan:100},u().createElement("a",{onClick:this.handleShowMoreClick,href:"#"},this.props.showMoreResults))))}}else s=this.state.nameFilter?u().createElement("tr",null,u().createElement("td",{colSpan:100},this.props.noMatchingFilesMessage(this.state.nameFilter))):u().createElement("tr",null,u().createElement("td",{colSpan:100},this.props.noFilesMessage));this.props.headerRenderer&&(o=u().createElement(this.props.headerRenderer,dt(dt({},e),this.props.headerRendererProps))),t=u().createElement(u().Fragment,null,u().createElement("table",{cellSpacing:"0",cellPadding:"0"},u().createElement("tbody",null,s)));break;case"list":if(s.length){let e;if(this.state.nameFilter){const t=s.length;s=s.slice(0,this.state.searchResultsShown),t>s.length&&(e=u().createElement("a",{onClick:this.handleShowMoreClick,href:"#"},this.props.showMoreResults))}s=u().createElement("div",null,u().createElement("ul",null,s),e)}else s=this.state.nameFilter?u().createElement("p",{className:"empty"},this.props.noMatchingFilesMessage(this.state.nameFilter)):u().createElement("p",{className:"empty"},this.props.noFilesMessage);this.props.headerRenderer&&(o=u().createElement(this.props.headerRenderer,dt(dt({},e),this.props.headerRendererProps))),t=u().createElement("div",null,s)}const i=this.props.confirmMultipleDeletionRenderer;return u().createElement("div",{className:"rendered-react-keyed-file-browser"},this.props.actions,u().createElement("div",{className:"rendered-file-browser",ref:e=>{this.browserRef=e}},this.props.showActionBar&&this.renderActionBar(n),"delete"===this.state.activeAction&&this.state.selection.length>1&&u().createElement(i,{handleDeleteSubmit:this.handleMultipleDeleteSubmit}),o,u().createElement("div",{className:"files"},t)))}}ht(ft,"propTypes",{files:h().arrayOf(h().shape({key:h().string.isRequired,modified:h().number,size:h().number})).isRequired,actions:h().node,showActionBar:h().bool.isRequired,canFilter:h().bool.isRequired,showFoldersOnFilter:h().bool,noFilesMessage:h().oneOfType([h().string,h().object]),noMatchingFilesMessage:h().func,showMoreResults:h().oneOfType([h().string,h().object]),group:h().func.isRequired,sort:h().func.isRequired,icons:h().shape({Folder:h().element,FolderOpen:h().element,File:h().element,PDF:h().element,Image:h().element,Delete:h().element,Rename:h().element,Loading:h().element,Download:h().element}),nestChildren:h().bool.isRequired,renderStyle:h().oneOf(["list","table"]).isRequired,startOpen:h().bool.isRequired,headerRenderer:h().func,headerRendererProps:h().object,filterRenderer:h().func,filterRendererProps:h().object,fileRenderer:h().func,fileRendererProps:h().object,folderRenderer:h().func,folderRendererProps:h().object,detailRenderer:h().func,detailRendererProps:h().object,actionRenderer:h().func,confirmDeletionRenderer:h().func,confirmMultipleDeletionRenderer:h().func,onCreateFiles:h().oneOfType([h().func,h().bool]),onCreateFolder:h().oneOfType([h().func,h().bool]),onMoveFile:h().oneOfType([h().func,h().bool]),onMoveFolder:h().oneOfType([h().func,h().bool]),onRenameFile:h().oneOfType([h().func,h().bool]),onRenameFolder:h().oneOfType([h().func,h().bool]),onDeleteFile:h().oneOfType([h().func,h().bool]),onDeleteFolder:h().oneOfType([h().func,h().bool]),onDownloadFile:h().oneOfType([h().func,h().bool]),onDownloadFolder:h().oneOfType([h().func,h().bool]),onSelect:h().func,onSelectFile:h().func,onSelectFolder:h().func,onPreviewOpen:h().func,onPreviewClose:h().func,onFolderOpen:h().func,onFolderClose:h().func,sensorSettings:h().func,gatewaySettings:h().func,addGateway:h().func,share:h().func,statusIcon:h().element}),ht(ft,"defaultProps",{showActionBar:!0,canFilter:!0,showFoldersOnFilter:!1,noFilesMessage:"No files.",noMatchingFilesMessage:e=>`No files matching "${e}".`,showMoreResults:"Show more results",group:Be,sort:Xe,nestChildren:!1,renderStyle:"table",startOpen:!1,headerRenderer:L,headerRendererProps:{},filterRenderer:S,filterRendererProps:{},fileRenderer:ie,fileRendererProps:{},folderRenderer:Se,folderRendererProps:{},detailRenderer:y,detailRendererProps:{},actionRenderer:rt,confirmDeletionRenderer:Pe,confirmMultipleDeletionRenderer:ke,icons:{},onSelect:e=>{},onSelectFile:e=>{},onSelectFolder:e=>{},onPreviewOpen:e=>{},onPreviewClose:e=>{},onFolderOpen:e=>{},onFolderClose:e=>{}});class gt extends m.Component{render(){return u().createElement(f.DndProvider,{backend:g.HTML5Backend},u().createElement(ft,dt({},this.props)))}}const Ft=e=>{const t=4===e?"fa":"fas",r=4===e?["FontAwesome",'"FontAwesome"']:['"Font Awesome 5 Free"','"Font Awesome 5 Pro"'];let n=!1;const o=document.createElement("span");var s;return o.className=t,o.style.display="none",document.body.insertBefore(o,document.body.firstChild),r.includes((s=o,"font-family",window.getComputedStyle(s,null).getPropertyValue("font-family")))?n=!0:console.warn(`Font Awesome ${e} was not detected but Font Awesome ${e} icons have been requested for \`react-object-list\``),document.body.removeChild(o),n},bt=(e=4)=>{switch(e){case 4:return Ft(4),{Gateway:u().createElement("i",{className:"gatewayFileIcon","aria-hidden":"true"}),Sensor:u().createElement("i",{className:"sensorFileIcon","aria-hidden":"true"}),Folder:u().createElement("i",{className:"folderFileIcon","aria-hidden":"true"}),FolderOpen:u().createElement("i",{className:"folderOpenFileIcon","aria-hidden":"true"}),FolderAdd:u().createElement("i",{className:"folderAddFileIcon","aria-hidden":"true"}),Rename:u().createElement("i",{className:"renameFileIcon","aria-hidden":"true"}),Delete:u().createElement("i",{className:"deleteFileIcon","aria-hidden":"true"}),GatewayAdd:u().createElement("i",{className:"gatewayAddFileIcon","aria-hidden":"true"}),Share:u().createElement("i",{className:"shareFileIcon","aria-hidden":"true"}),Loading:u().createElement("i",{className:"fa fa-circle-o-notch fa-spin","aria-hidden":"true"}),Download:u().createElement("i",{className:"fa fa-download","aria-hidden":"true"})};case 5:return Ft(5),{File:u().createElement("i",{className:"far fa-file","aria-hidden":"true"}),Image:u().createElement("i",{className:"far fa-file-image","aria-hidden":"true"}),Video:u().createElement("i",{className:"far fa-file-video","aria-hidden":"true"}),Audio:u().createElement("i",{className:"far fa-file-audio","aria-hidden":"true"}),Archive:u().createElement("i",{className:"far fa-file-archive","aria-hidden":"true"}),Word:u().createElement("i",{className:"far fa-file-word","aria-hidden":"true"}),Excel:u().createElement("i",{className:"far fa-file-excel","aria-hidden":"true"}),PowerPoint:u().createElement("i",{className:"far fa-file-powerpoint","aria-hidden":"true"}),Text:u().createElement("i",{className:"far fa-file-alt","aria-hidden":"true"}),PDF:u().createElement("i",{className:"far fa-file-pdf","aria-hidden":"true"}),Rename:u().createElement("i",{className:"fas fa-i-cursor","aria-hidden":"true"}),Folder:u().createElement("i",{className:"far fa-folder","aria-hidden":"true"}),FolderOpen:u().createElement("i",{className:"far fa-folder-open","aria-hidden":"true"}),Delete:u().createElement("i",{className:"far fa-trash-alt","aria-hidden":"true"}),Loading:u().createElement("i",{className:"fas fa-circle-notch fa-spin","aria-hidden":"true"}),Download:u().createElement("i",{className:"fas fa-download","aria-hidden":"true"})};default:console.warn(`Could not find config for version ${e}`,"Accepted versions are: 4, 5","Please make an issue in `react-object-list` to fix this.")}},wt=gt;return t})())); \ No newline at end of file diff --git a/src/browser.js b/src/browser.js index ae76119ac..371e2f8fb 100644 --- a/src/browser.js +++ b/src/browser.js @@ -640,6 +640,7 @@ class RawFileBrowser extends React.Component { const { fileRenderer: FileRenderer, fileRendererProps, folderRenderer: FolderRenderer, folderRendererProps, + statusIcon } = this.props const browserProps = this.getBrowserProps() let renderedFiles = [] @@ -670,7 +671,7 @@ class RawFileBrowser extends React.Component { browserProps={browserProps} {...folderRendererProps} gatewaySettings={this.gatewaySettings} - statusIcon={this.statusIcon} + statusIcon={statusIcon} /> ) }