1
2
3
|
/*! For license information please see files-sidebar.js.LICENSE.txt */
(()=>{var e,i,s,n={9165:(e,t,i)=>{"use strict";i.d(t,{NZC:()=>s,ZL5:()=>r,dF:()=>a,fEr:()=>n});var s="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",n="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",r="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",a="M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z"},21399:(e,t,i)=>{"use strict";i.d(t,{A:()=>o});var s=i(71354),n=i.n(s),r=i(76314),a=i.n(r)()(n());a.push([e.id,".system-tags[data-v-bfb8f97a]{display:flex;flex-direction:column}.system-tags__select[data-v-bfb8f97a]{width:100%}.system-tags__select[data-v-bfb8f97a] .vs__deselect{padding:0}","",{version:3,sources:["webpack://./apps/systemtags/src/components/SystemTags.vue"],names:[],mappings:"AACA,8BACC,YAAA,CACA,qBAAA,CAGA,sCACC,UAAA,CAEC,oDACC,SAAA",sourcesContent:["\n.system-tags {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t// Fix issue with AppSidebar styles overwriting NcSelect styles\n\t&__select {\n\t\twidth: 100%;\n\t\t:deep {\n\t\t\t.vs__deselect {\n\t\t\t\tpadding: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const o=a},42634:()=>{},43111:(e,t,i)=>{"use strict";i.d(t,{A:()=>o});var s=i(71354),n=i.n(s),r=i(76314),a=i.n(r)()(n());a.push([e.id,'.app-sidebar--has-preview[data-v-79629b3b] .app-sidebar-header__figure{background-size:cover}.app-sidebar--has-preview[data-v-79629b3b][data-mimetype="text/plain"] .app-sidebar-header__figure,.app-sidebar--has-preview[data-v-79629b3b][data-mimetype="text/markdown"] .app-sidebar-header__figure{background-size:contain}.app-sidebar--full[data-v-79629b3b]{position:fixed !important;z-index:2025 !important;top:0 !important;height:100% !important}.app-sidebar[data-v-79629b3b] .app-sidebar-header__description{margin:0 16px 4px 16px !important}.app-sidebar .svg-icon[data-v-79629b3b] svg{width:20px;height:20px;fill:currentColor}.sidebar__description[data-v-79629b3b]{display:flex;flex-direction:column;width:100%;gap:8px 0}',"",{version:3,sources:["webpack://./apps/files/src/views/Sidebar.vue"],names:[],mappings:"AAGE,uEACC,qBAAA,CAKA,yMACC,uBAAA,CAKH,oCACC,yBAAA,CACA,uBAAA,CACA,gBAAA,CACA,sBAAA,CAIA,+DACC,iCAAA,CAKD,4CACC,UAAA,CACA,WAAA,CACA,iBAAA,CAKH,uCACC,YAAA,CACA,qBAAA,CACA,UAAA,CACA,SAAA",sourcesContent:['\n.app-sidebar {\n\t&--has-preview:deep {\n\t\t.app-sidebar-header__figure {\n\t\t\tbackground-size: cover;\n\t\t}\n\n\t\t&[data-mimetype="text/plain"],\n\t\t&[data-mimetype="text/markdown"] {\n\t\t\t.app-sidebar-header__figure {\n\t\t\t\tbackground-size: contain;\n\t\t\t}\n\t\t}\n\t}\n\n\t&--full {\n\t\tposition: fixed !important;\n\t\tz-index: 2025 !important;\n\t\ttop: 0 !important;\n\t\theight: 100% !important;\n\t}\n\n\t:deep {\n\t\t.app-sidebar-header__description {\n\t\t\tmargin: 0 16px 4px 16px !important;\n\t\t}\n\t}\n\n\t.svg-icon {\n\t\t::v-deep svg {\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n}\n\n.sidebar__description {\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\tgap: 8px 0;\n}\n'],sourceRoot:""}]);const o=a},59169:()=>{},63779:()=>{},77199:()=>{},85638:(e,t,i)=>{"use strict";const{XMLParser:s,XMLValidator:n}=i(86454),r=e=>{if(null==e)return!1;if(0===(e=e.toString().trim()).length)return!1;if(!0!==n.validate(e))return!1;let t;const i=new s;try{t=i.parse(e)}catch(e){return!1}return!!t&&"svg"in t};e.exports=r,e.exports.default=r},86833:()=>{},88847:(e,i,s)=>{"use strict";var n=s(85471),r=s(53334),a=s(21777),o=s(87485),l=s(85168),d=s(61338),c=s(25883),u=s(71225),f=s(63814),h=s(77905),p=s(9165),g=s(65043),m=s(74692),y=s.n(m),b=s(65743),v=s(57505),A=s(4604),w=s(28326),T=s(6695);const _={name:"LegacyView",props:{component:{type:Object,required:!0},fileInfo:{type:Object,default:()=>{},required:!0}},watch:{fileInfo(e){this.setFileInfo(e)}},mounted(){this.component.$el.replaceAll(this.$el),this.setFileInfo(this.fileInfo)},methods:{setFileInfo(e){this.component.setFileInfo(new OCA.Files.FileInfoModel(e))}}};var S=s(14486);const C=(0,S.A)(_,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports,I={name:"SidebarTab",components:{NcAppSidebarTab:s(18608).A,NcEmptyContent:w.A},props:{fileInfo:{type:Object,default:()=>{},required:!0},id:{type:String,required:!0},name:{type:String,required:!0},icon:{type:String,required:!1},onMount:{type:Function,required:!0},onUpdate:{type:Function,required:!0},onDestroy:{type:Function,required:!0},onScrollBottomReached:{type:Function,default:()=>{}}},data:()=>({loading:!0}),computed:{activeTab(){return this.$parent.activeTab}},watch:{async fileInfo(e,t){e.id!==t.id&&(this.loading=!0,await this.onUpdate(this.fileInfo),this.loading=!1)}},async mounted(){this.loading=!0,await this.onMount(this.$refs.mount,this.fileInfo,this.$refs.tab),this.loading=!1},async beforeDestroy(){await this.onDestroy()}},x=(0,S.A)(I,(function(){var e=this,t=e._self._c;return t("NcAppSidebarTab",{ref:"tab",attrs:{id:e.id,name:e.name,icon:e.icon},on:{bottomReached:e.onScrollBottomReached},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("icon")]},proxy:!0}],null,!0)},[e._v(" "),e.loading?t("NcEmptyContent",{attrs:{icon:"icon-loading"}}):e._e(),e._v(" "),t("div",{ref:"mount"})],1)}),[],!1,null,null,null).exports;var F=s(59892),O=s(5212),L=s(71654);const E={userVisible:!0,userAssignable:!0,canAssign:!0},N=e=>e.map((e=>{let{props:t}=e;return Object.fromEntries(Object.entries(t).map((e=>{let[t,i]=e;return[(0,L.A)(t),"displayName"===(0,L.A)(t)?String(i):i]})))})),k=e=>{const t={...e};return t.name&&!t.displayName||(t.name=t.displayName,delete t.displayName),t};var P=s(60669);const D=(0,f.dC)("dav"),M=(0,P.UU)(D),B=e=>{M.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})};(0,a.zo)(B),B((0,a.do)());var R=s(35947);const j=(0,R.YK)().setApp("systemtags").detectUser().build(),$='<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t<d:prop>\n\t\t<oc:id />\n\t\t<oc:display-name />\n\t\t<oc:user-visible />\n\t\t<oc:user-assignable />\n\t\t<oc:can-assign />\n\t</d:prop>\n</d:propfind>',q=async(e,i)=>{const s="/systemtags-relations/files/"+i+"/"+e.id,n=k(e);try{await M.customRequest(s,{method:"PUT",data:n})}catch(e){throw j.error(t("systemtags","Failed to set tag for file"),{error:e}),new Error(t("systemtags","Failed to set tag for file"))}},U=n.Ay.extend({name:"SystemTags",components:{NcLoadingIcon:F.A,NcSelectTags:O.A},props:{fileId:{type:Number,required:!0}},data:()=>({sortedTags:[],selectedTags:[],loadingTags:!1,loading:!1}),async created(){try{const e=await(async()=>{try{const{data:e}=await M.getDirectoryContents("/systemtags",{data:$,details:!0,glob:"/systemtags/*"});return N(e)}catch(e){throw j.error((0,r.Tl)("systemtags","Failed to load tags"),{error:e}),new Error((0,r.Tl)("systemtags","Failed to load tags"))}})(),t=await(async()=>{const e=(0,f.Jv)("/apps/systemtags/lastused");try{const{data:t}=await g.Ay.get(e);return t.map(Number)}catch(e){throw j.error((0,r.Tl)("systemtags","Failed to load last used tags"),{error:e}),new Error((0,r.Tl)("systemtags","Failed to load last used tags"))}})(),i=[],s=[];for(const n of e)t.includes(n.id)?i.push(n):s.push(n);const n=(e,i)=>t.indexOf(e.id)-t.indexOf(i.id);i.sort(n),this.sortedTags=[...i,...s]}catch(e){(0,l.Qg)((0,r.Tl)("systemtags","Failed to load tags"))}},watch:{fileId:{immediate:!0,async handler(){this.loadingTags=!0;try{this.selectedTags=await(async()=>{const e="/systemtags-relations/files/"+this.fileId;try{const{data:t}=await M.getDirectoryContents(e,{data:$,details:!0,glob:"/systemtags-relations/files/*/*"});return N(t)}catch(e){throw j.error(t("systemtags","Failed to load tags for file"),{error:e}),new Error(t("systemtags","Failed to load tags for file"))}})()}catch(e){(0,l.Qg)((0,r.Tl)("systemtags","Failed to load selected tags"))}this.loadingTags=!1}}},methods:{t:r.Tl,createOption(e){for(const t of this.sortedTags){const{id:i,displayName:s,...n}=t;if(s===e&&Object.entries(n).every((e=>{let[t,i]=e;return E[t]===i})))return t}return{...E,displayName:e}},handleInput(e){this.selectedTags=e.filter((e=>Boolean(e.id)))},async handleSelect(e){const t=e[e.length-1];if(!t.id)return;const i=t;this.loading=!0;try{await q(i,this.fileId);const e=(e,t)=>e.id===i.id?-1:t.id===i.id?1:0;this.sortedTags.sort(e)}catch(e){(0,l.Qg)((0,r.Tl)("systemtags","Failed to select tag"))}this.loading=!1},async handleCreate(e){this.loading=!0;try{const t=await(async(e,t)=>{const i=k(e),s=await(async e=>{const t=k(e);try{const{headers:e}=await M.customRequest("/systemtags",{method:"POST",data:t}),i=e.get("content-location");if(i)return(e=>{const t=e.indexOf("?");t>0&&(e=e.substring(0,t));const i=e.split("/");let s;do{s=i[i.length-1],i.pop()}while(!s&&i.length>0);return Number(s)})(i);throw j.error((0,r.Tl)("systemtags",'Missing "Content-Location" header')),new Error((0,r.Tl)("systemtags",'Missing "Content-Location" header'))}catch(e){throw j.error((0,r.Tl)("systemtags","Failed to create tag"),{error:e}),new Error((0,r.Tl)("systemtags","Failed to create tag"))}})(i),n={...i,id:s};return await q(n,t),n.id})(e,this.fileId),i={...e,id:t};this.sortedTags.unshift(i),this.selectedTags.push(i)}catch(e){(0,l.Qg)((0,r.Tl)("systemtags","Failed to create tag"))}this.loading=!1},async handleDeselect(e){this.loading=!0;try{await(async e=>{const i="/systemtags-relations/files/"+this.fileId+"/"+e.id;try{await M.deleteFile(i)}catch(e){throw j.error(t("systemtags","Failed to delete tag for file"),{error:e}),new Error(t("systemtags","Failed to delete tag for file"))}})(e)}catch(e){(0,l.Qg)((0,r.Tl)("systemtags","Failed to delete tag"))}this.loading=!1}}});var z=s(85072),H=s.n(z),V=s(97825),W=s.n(V),Z=s(77659),K=s.n(Z),Q=s(55056),X=s.n(Q),Y=s(10540),G=s.n(Y),J=s(41113),ee=s.n(J),te=s(21399),ie={};ie.styleTagTransform=ee(),ie.setAttributes=X(),ie.insert=K().bind(null,"head"),ie.domAPI=W(),ie.insertStyleElement=G(),H()(te.A,ie),te.A&&te.A.locals&&te.A.locals;const se=(0,S.A)(U,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"system-tags"},[e.loadingTags?t("NcLoadingIcon",{attrs:{name:e.t("systemtags","Loading collaborative tags …"),size:32}}):[t("NcSelectTags",{staticClass:"system-tags__select",attrs:{"input-label":e.t("systemtags","Search or create collaborative tags"),placeholder:e.t("systemtags","Collaborative tags …"),options:e.sortedTags,value:e.selectedTags,"create-option":e.createOption,taggable:!0,passthru:!0,"fetch-tags":!1,loading:e.loading},on:{input:e.handleInput,"option:selected":e.handleSelect,"option:created":e.handleCreate,"option:deselected":e.handleDeselect},scopedSlots:e._u([{key:"no-options",fn:function(){return[e._v("\n\t\t\t\t"+e._s(e.t("systemtags","No tags to select, type to create a new tag"))+"\n\t\t\t")]},proxy:!0}])})]],2)}),[],!1,null,"bfb8f97a",null).exports,ne=(0,R.YK)().setApp("files").detectUser().build(),re={name:"Sidebar",components:{LegacyView:C,NcActionButton:v.A,NcAppSidebar:b.N,NcDateTime:A.A,NcEmptyContent:w.A,NcIconSvgWrapper:T.A,SidebarTab:x,SystemTags:se},setup:()=>({currentUser:(0,a.HW)(),mdiStar:p.ZL5,mdiStarOutline:p.dF}),data:()=>({Sidebar:OCA.Files.Sidebar.state,showTags:!1,showTagsDefault:!0,error:null,loading:!0,fileInfo:null,isFullScreen:!1,hasLowHeight:!1}),computed:{file(){return this.Sidebar.file},tabs(){return this.Sidebar.tabs},views(){return this.Sidebar.views},davPath(){const e=this.currentUser.uid;return(0,f.dC)(`dav/files/${e}${(0,u.O0)(this.file)}`)},activeTab(){return this.Sidebar.activeTab},size(){return(0,c.v7)(this.fileInfo?.size)},background(){return this.getPreviewIfAny(this.fileInfo)},appSidebar(){return this.fileInfo?{"data-mimetype":this.fileInfo.mimetype,active:this.activeTab,background:this.background,class:{"app-sidebar--has-preview":this.fileInfo.hasPreview&&!this.isFullScreen,"app-sidebar--full":this.isFullScreen},compact:this.hasLowHeight||!this.fileInfo.hasPreview||this.isFullScreen,loading:this.loading,name:this.fileInfo.name,title:this.fileInfo.name}:this.error?{key:"error",subname:"",name:"",class:{"app-sidebar--full":this.isFullScreen}}:{loading:this.loading,subname:"",name:"",class:{"app-sidebar--full":this.isFullScreen}}},defaultAction(){return this.fileInfo&&OCA.Files&&OCA.Files.App&&OCA.Files.App.fileList&&OCA.Files.App.fileList.fileActions&&OCA.Files.App.fileList.fileActions.getDefaultFileAction&&OCA.Files.App.fileList.fileActions.getDefaultFileAction(this.fileInfo.mimetype,this.fileInfo.type,OC.PERMISSION_READ)},defaultActionListener(){return this.defaultAction?"figure-click":null},isSystemTagsEnabled:()=>!0===(0,o.F)()?.systemtags?.enabled},created(){(0,d.B1)("files:node:deleted",this.onNodeDeleted),window.addEventListener("resize",this.handleWindowResize),this.handleWindowResize()},beforeDestroy(){(0,d.al)("file:node:deleted",this.onNodeDeleted),window.removeEventListener("resize",this.handleWindowResize)},methods:{canDisplay(e){return e.enabled(this.fileInfo)},resetData(){this.error=null,this.fileInfo=null,this.$nextTick((()=>{this.$refs.tabs&&this.$refs.tabs.updateTabs()}))},getPreviewIfAny(e){return e?.hasPreview&&!this.isFullScreen?(0,f.Jv)(`/core/preview?fileId=${e.id}&x=${screen.width}&y=${screen.height}&a=true`):this.getIconUrl(e)},getIconUrl(e){const t=e?.mimetype||"application/octet-stream";return"httpd/unix-directory"===t?"shared"===e.mountType||"shared-root"===e.mountType?OC.MimeType.getIconUrl("dir-shared"):"external-root"===e.mountType?OC.MimeType.getIconUrl("dir-external"):void 0!==e.mountType&&""!==e.mountType?OC.MimeType.getIconUrl("dir-"+e.mountType):e.shareTypes&&(e.shareTypes.indexOf(h.I.Link)>-1||e.shareTypes.indexOf(h.I.Email)>-1)?OC.MimeType.getIconUrl("dir-public"):e.shareTypes&&e.shareTypes.length>0?OC.MimeType.getIconUrl("dir-shared"):OC.MimeType.getIconUrl("dir"):OC.MimeType.getIconUrl(t)},setActiveTab(e){OCA.Files.Sidebar.setActiveTab(e),this.tabs.forEach((t=>{try{t.setIsActive(e===t.id)}catch(e){ne.error("Error while setting tab active state",{error:e,id:t.id,tab:t})}}))},async toggleStarred(e){try{await(0,g.Ay)({method:"PROPPATCH",url:this.davPath,data:`<?xml version="1.0"?>\n\t\t\t\t\t\t<d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t\t\t\t\t\t${e?"<d:set>":"<d:remove>"}\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t${e?"</d:set>":"</d:remove>"}\n\t\t\t\t\t\t</d:propertyupdate>`});const t="dir"===this.fileInfo.type,i=t?c.vd:c.ZH;(0,d.Ic)(e?"files:favorites:added":"files:favorites:removed",new i({fileid:this.fileInfo.id,source:this.davPath,root:`/files/${(0,a.HW)().uid}`,mime:t?void 0:this.fileInfo.mimetype})),this.fileInfo.isFavourited=e}catch(e){(0,l.Qg)(t("files","Unable to change the favourite state of the file")),ne.error("Unable to change favourite state",{error:e})}},onDefaultAction(){this.defaultAction&&this.defaultAction.action(this.fileInfo.name,{fileInfo:this.fileInfo,dir:this.fileInfo.dir,fileList:OCA.Files.App.fileList,$file:y()("body")})},toggleTags(){this.showTagsDefault=this.showTags=!this.showTags},async open(e){if(!e||""===e.trim())throw new Error(`Invalid path '${e}'`);const i=!!this.Sidebar.file;this.Sidebar.file=e,this.error=null,this.loading=!0;try{this.fileInfo=await async function(e){const t=await(0,g.Ay)({method:"PROPFIND",url:e,data:(0,c.VL)()}),i=OC.Files.getClient()._client.parseMultiStatus(t.data),s=OC.Files.getClient()._parseFileInfo(i[0]);return s.get=e=>s[e],s.isDirectory=()=>"httpd/unix-directory"===s.mimetype,s}(this.davPath),this.fileInfo.dir=this.file.split("/").slice(0,-1).join("/"),this.views.forEach((e=>{e.setFileInfo(this.fileInfo)})),await this.$nextTick(),this.setActiveTab(this.Sidebar.activeTab||this.tabs[0].id),this.loading=!1,await this.$nextTick(),i&&this.$refs.sidebar&&this.$refs.sidebar.focusActiveTabContent()}catch(e){throw this.loading=!1,this.error=t("files","Error while loading the file data"),console.error("Error while loading the file data",e),new Error(e)}},close(){this.Sidebar.file="",this.showTags=!1,this.resetData()},onNodeDeleted(e){this.fileInfo&&e&&this.fileInfo.id===e.fileid&&this.close()},setFullScreenMode(e){this.isFullScreen=e,e?document.querySelector("#content")?.classList.add("with-sidebar--full")||document.querySelector("#content-vue")?.classList.add("with-sidebar--full"):document.querySelector("#content")?.classList.remove("with-sidebar--full")||document.querySelector("#content-vue")?.classList.remove("with-sidebar--full")},setShowTagsDefault(e){this.showTagsDefault=e},handleOpening(){(0,d.Ic)("files:sidebar:opening")},handleOpened(){(0,d.Ic)("files:sidebar:opened")},handleClosing(){(0,d.Ic)("files:sidebar:closing")},handleClosed(){(0,d.Ic)("files:sidebar:closed")},handleWindowResize(){this.hasLowHeight=document.documentElement.clientHeight<1024}}},ae=re;var oe=s(43111),le={};le.styleTagTransform=ee(),le.setAttributes=X(),le.insert=K().bind(null,"head"),le.domAPI=W(),le.insertStyleElement=G(),H()(oe.A,le),oe.A&&oe.A.locals&&oe.A.locals;const de=(0,S.A)(ae,(function(){var e=this,t=e._self._c;return e.file?t("NcAppSidebar",e._b({ref:"sidebar",attrs:{"data-cy-sidebar":"","force-menu":!0},on:e._d({close:e.close,"update:active":e.setActiveTab,opening:e.handleOpening,opened:e.handleOpened,closing:e.handleClosing,closed:e.handleClosed},[e.defaultActionListener,function(t){return t.stopPropagation(),t.preventDefault(),e.onDefaultAction.apply(null,arguments)}]),scopedSlots:e._u([e.fileInfo?{key:"subname",fn:function(){return[e.fileInfo.isFavourited?t("NcIconSvgWrapper",{attrs:{path:e.mdiStar,name:e.t("files","Favorite"),inline:""}}):e._e(),e._v("\n\t\t"+e._s(e.size)+"\n\t\t"),t("NcDateTime",{attrs:{timestamp:e.fileInfo.mtime}})]},proxy:!0}:null,e.fileInfo?{key:"description",fn:function(){return[t("div",{staticClass:"sidebar__description"},[e.isSystemTagsEnabled&&e.showTagsDefault?t("SystemTags",{directives:[{name:"show",rawName:"v-show",value:e.showTags,expression:"showTags"}],attrs:{"file-id":e.fileInfo.id},on:{"has-tags":t=>e.showTags=t}}):e._e(),e._v(" "),e._l(e.views,(function(i){return t("LegacyView",{key:i.cid,attrs:{component:i,"file-info":e.fileInfo}})}))],2)]},proxy:!0}:null,e.fileInfo?{key:"secondary-actions",fn:function(){return[t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){return e.toggleStarred(!e.fileInfo.isFavourited)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{path:e.fileInfo.isFavourited?e.mdiStarOutline:e.mdiStar}})]},proxy:!0}],null,!1,3772937801)},[e._v("\n\t\t\t"+e._s(e.fileInfo.isFavourited?e.t("files","Remove from favorites"):e.t("files","Add to favorites"))+"\n\t\t")]),e._v(" "),e.isSystemTagsEnabled?t("NcActionButton",{attrs:{"close-after-click":!0,icon:"icon-tag"},on:{click:e.toggleTags}},[e._v("\n\t\t\t"+e._s(e.t("files","Tags"))+"\n\t\t")]):e._e()]},proxy:!0}:null],null,!0)},"NcAppSidebar",e.appSidebar,!1),[e._v(" "),e._v(" "),e._v(" "),e.error?t("NcEmptyContent",{attrs:{icon:"icon-error"}},[e._v("\n\t\t"+e._s(e.error)+"\n\t")]):e.fileInfo?e._l(e.tabs,(function(i){return[i.enabled(e.fileInfo)?t("SidebarTab",{directives:[{name:"show",rawName:"v-show",value:!e.loading,expression:"!loading"}],key:i.id,attrs:{id:i.id,name:i.name,icon:i.icon,"on-mount":i.mount,"on-update":i.update,"on-destroy":i.destroy,"on-scroll-bottom-reached":i.scrollBottomReached,"file-info":e.fileInfo},scopedSlots:e._u([void 0!==i.iconSvg?{key:"icon",fn:function(){return[t("span",{staticClass:"svg-icon",domProps:{innerHTML:e._s(i.iconSvg)}})]},proxy:!0}:null],null,!0)}):e._e()]})):e._e()],2):e._e()}),[],!1,null,"79629b3b",null).exports;var ce=s(48287),ue=s(85638),fe=s.n(ue);function he(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}n.Ay.prototype.t=r.Tl,window.OCA.Files||(window.OCA.Files={}),Object.assign(window.OCA.Files,{Sidebar:new class{constructor(){(function(e,t,i){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i})(this,"_state",void 0),this._state={},this._state.tabs=[],this._state.views=[],this._state.file="",this._state.activeTab="",console.debug("OCA.Files.Sidebar initialized")}get state(){return this._state}registerTab(e){return this._state.tabs.findIndex((t=>t.id===e.id))>-1?(console.error(`An tab with the same id ${e.id} already exists`,e),!1):(this._state.tabs.push(e),!0)}registerSecondaryView(e){return this._state.views.findIndex((t=>t.id===e.id))>-1?(console.error("A similar view already exists",e),!1):(this._state.views.push(e),!0)}get file(){return this._state.file}setActiveTab(e){this._state.activeTab=e}}}),Object.assign(window.OCA.Files.Sidebar,{Tab:class{constructor(){let{id:e,name:t,icon:i,iconSvg:s,mount:n,setIsActive:r,update:a,destroy:o,enabled:l,scrollBottomReached:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(he(this,"_id",void 0),he(this,"_name",void 0),he(this,"_icon",void 0),he(this,"_iconSvgSanitized",void 0),he(this,"_mount",void 0),he(this,"_setIsActive",void 0),he(this,"_update",void 0),he(this,"_destroy",void 0),he(this,"_enabled",void 0),he(this,"_scrollBottomReached",void 0),void 0===l&&(l=()=>!0),void 0===d&&(d=()=>{}),"string"!=typeof e||""===e.trim())throw new Error("The id argument is not a valid string");if("string"!=typeof t||""===t.trim())throw new Error("The name argument is not a valid string");if(("string"!=typeof i||""===i.trim())&&"string"!=typeof s)throw new Error("Missing valid string for icon or iconSvg argument");if("function"!=typeof n)throw new Error("The mount argument should be a function");if(void 0!==r&&"function"!=typeof r)throw new Error("The setIsActive argument should be a function");if("function"!=typeof a)throw new Error("The update argument should be a function");if("function"!=typeof o)throw new Error("The destroy argument should be a function");if("function"!=typeof l)throw new Error("The enabled argument should be a function");if("function"!=typeof d)throw new Error("The scrollBottomReached argument should be a function");this._id=e,this._name=t,this._icon=i,this._mount=n,this._setIsActive=r,this._update=a,this._destroy=o,this._enabled=l,this._scrollBottomReached=d,"string"==typeof s&&(async e=>{if(!e)throw new Error("Not an svg");let t="";if(t=ce.Buffer.isBuffer(e)||e instanceof File?await(e=>new Promise((t=>{if(void 0!==e.size){const i=new FileReader;i.onload=()=>{t(i.result)},i.readAsText(e)}else t(e.toString("utf-8"))})))(e):e,!fe()(t))throw new Error("Not an svg");const i=document.createElement("div");i.innerHTML=t;const s=i.firstElementChild,n=!!Array.from(s.attributes).map((({name:e})=>e)).find((e=>e.startsWith("on")));return 0!==s.getElementsByTagName("script").length||n?null:e})(s).then((e=>{this._iconSvgSanitized=e}))}get id(){return this._id}get name(){return this._name}get icon(){return this._icon}get iconSvg(){return this._iconSvgSanitized}get mount(){return this._mount}get setIsActive(){return this._setIsActive||(()=>{})}get update(){return this._update}get destroy(){return this._destroy}get enabled(){return this._enabled}get scrollBottomReached(){return this._scrollBottomReached}}}),window.addEventListener("DOMContentLoaded",(function(){const e=document.querySelector("body > .content")||document.querySelector("body > #content");if(e&&!document.getElementById("app-sidebar")){const t=document.createElement("div");t.id="app-sidebar",e.appendChild(t)}const t=new(n.Ay.extend(de))({name:"SidebarRoot"});t.$mount("#app-sidebar"),window.OCA.Files.Sidebar.open=t.open,window.OCA.Files.Sidebar.close=t.close,window.OCA.Files.Sidebar.setFullScreenMode=t.setFullScreenMode,window.OCA.Files.Sidebar.setShowTagsDefault=t.setShowTagsDefault}))}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=n,e=[],a.O=(t,i,s,n)=>{if(!i){var r=1/0;for(c=0;c<e.length;c++){i=e[c][0],s=e[c][1],n=e[c][2];for(var o=!0,l=0;l<i.length;l++)(!1&n||r>=n)&&Object.keys(a.O).every((e=>a.O[e](i[l])))?i.splice(l--,1):(o=!1,n<r&&(r=n));if(o){e.splice(c--,1);var d=s();void 0!==d&&(t=d)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[i,s,n]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,i)=>(a.f[i](e,t),t)),[])),a.u=e=>e+"-"+e+".js?v="+{2441:"bd6d3dc836e836cd4795",5775:"bdb5a44b157eaff757ea",5862:"18c97d281a8207f0ce8d"}[e],a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},s="nextcloud:",a.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var o,l;if(void 0!==n)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var u=d[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==s+n){o=u;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",s+n),o.src=e),i[e]=[t];var f=(t,s)=>{o.onerror=o.onload=null,clearTimeout(h);var n=i[e];if(delete i[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(s))),t)return t(s)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),l&&document.head.appendChild(o)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),a.j=4763,(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var s=i.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=i[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{a.b=document.baseURI||self.location.href;var e={4763:0};a.f.j=(t,i)=>{var s=a.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else{var n=new Promise(((i,n)=>s=e[t]=[i,n]));i.push(s[2]=n);var r=a.p+a.u(t),o=new Error;a.l(r,(i=>{if(a.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var n=i&&("load"===i.type?"missing":i.type),r=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+n+": "+r+")",o.name="ChunkLoadError",o.type=n,o.request=r,s[1](o)}}),"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,i)=>{var s,n,r=i[0],o=i[1],l=i[2],d=0;if(r.some((t=>0!==e[t]))){for(s in o)a.o(o,s)&&(a.m[s]=o[s]);if(l)var c=l(a)}for(t&&t(i);d<r.length;d++)n=r[d],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return a.O(c)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),a.nc=void 0;var o=a.O(void 0,[4208],(()=>a(88847)));o=a.O(o)})();
//# sourceMappingURL=files-sidebar.js.map?v=6494a7023341b4aa277a
|