diff --git a/apps/comments/appinfo/routes.php b/apps/comments/appinfo/routes.php index 903f1b2168c99..1e009f0eb1f5f 100644 --- a/apps/comments/appinfo/routes.php +++ b/apps/comments/appinfo/routes.php @@ -8,5 +8,6 @@ return [ 'routes' => [ ['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'], + ['name' => 'Notifications#dismiss', 'url' => '/notifications/{id}', 'verb' => 'DELETE'], ] ]; diff --git a/apps/comments/lib/Controller/NotificationsController.php b/apps/comments/lib/Controller/NotificationsController.php index a892198c2e9b5..7c97bfa616293 100644 --- a/apps/comments/lib/Controller/NotificationsController.php +++ b/apps/comments/lib/Controller/NotificationsController.php @@ -11,6 +11,7 @@ use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\Attribute\OpenAPI; use OCP\AppFramework\Http\Attribute\PublicPage; +use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Http\RedirectResponse; use OCP\Comments\IComment; @@ -92,6 +93,37 @@ public function view(string $id): RedirectResponse|NotFoundResponse { } } + /** + * Dismiss the mention notification for a comment + * + * @NoAdminRequired + * + * @param string $id ID of the comment + * + * @return DataResponse|DataResponse|DataResponse + * + * 200: Notification dismissed successfully + * 403: Not logged in + * 404: Comment not found + */ + public function dismiss(string $id): DataResponse { + $currentUser = $this->userSession->getUser(); + if (!$currentUser instanceof IUser) { + return new DataResponse([], Http::STATUS_FORBIDDEN); + } + + try { + $comment = $this->commentsManager->get($id); + if ($comment->getObjectType() !== 'files') { + return new DataResponse([], Http::STATUS_NOT_FOUND); + } + $this->markProcessed($comment, $currentUser); + return new DataResponse([]); + } catch (\Exception $e) { + return new DataResponse([], Http::STATUS_NOT_FOUND); + } + } + /** * Marks the notification about a comment as processed */ diff --git a/apps/comments/src/comments-activity-tab.ts b/apps/comments/src/comments-activity-tab.ts index 77f6c9bca04b0..d00b01197e201 100644 --- a/apps/comments/src/comments-activity-tab.ts +++ b/apps/comments/src/comments-activity-tab.ts @@ -2,10 +2,14 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ +import { getCurrentUser } from '@nextcloud/auth' +import axios from '@nextcloud/axios' import moment from '@nextcloud/moment' +import { generateUrl } from '@nextcloud/router' import Vue, { type ComponentPublicInstance } from 'vue' import logger from './logger.js' import { getComments } from './services/GetComments.js' +import { markCommentsAsRead } from './services/ReadComments.js' import { PiniaVuePlugin, createPinia } from 'pinia' @@ -48,6 +52,31 @@ export function registerCommentsPlugins() { window.OCA.Activity.registerSidebarEntries(async ({ fileInfo, limit, offset }) => { const { data: comments } = await getComments({ resourceType: 'files', resourceId: fileInfo.id }, { limit, offset }) logger.debug('Loaded comments', { fileInfo, comments }) + + // Optimistically clear the unread bubble immediately via the global event bus + // (window._nc_event_bus) so the UI updates without a page refresh. + // fileInfo.node is the underlying @nextcloud/files Node set by the Files sidebar. + const node = fileInfo.node + if (node) { + node.attributes['comments-unread'] = 0 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ;(window as any)._nc_event_bus?.emit('files:node:updated', node) + } + markCommentsAsRead('files', fileInfo.id, new Date()).catch(() => {}) + + // Mark mention notifications as read for comments that mention the current user + const currentUser = getCurrentUser() + if (currentUser) { + for (const comment of comments) { + const mentions = Object.values(comment.props?.mentions ?? {}) as { mentionType: string, mentionId: string }[] + const isMentioned = comment.props?.id && mentions.some((m) => m.mentionType === 'user' && m.mentionId === currentUser.uid) + if (isMentioned) { + axios.delete(generateUrl('/apps/comments/notifications/{id}', { id: comment.props.id })) + .catch(() => {}) + } + } + } + const { default: CommentView } = await import('./views/ActivityCommentEntry.vue') // @ts-expect-error Types are broken for Vue2 const CommentsViewObject = Vue.extend(CommentView) diff --git a/apps/comments/tests/Unit/Controller/NotificationsTest.php b/apps/comments/tests/Unit/Controller/NotificationsTest.php index 04490ca63e84c..f6fde7ba425d4 100644 --- a/apps/comments/tests/Unit/Controller/NotificationsTest.php +++ b/apps/comments/tests/Unit/Controller/NotificationsTest.php @@ -10,6 +10,7 @@ namespace OCA\Comments\Tests\Unit\Controller; use OCA\Comments\Controller\NotificationsController; +use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Http\RedirectResponse; use OCP\Comments\IComment; @@ -211,4 +212,102 @@ public function testViewNoFile(): void { $response = $this->notificationsController->view('42'); $this->assertInstanceOf(NotFoundResponse::class, $response); } + + public function testDismissNotLoggedIn(): void { + $this->session->expects($this->once()) + ->method('getUser') + ->willReturn(null); + + $this->commentsManager->expects($this->never()) + ->method('get'); + $this->notificationManager->expects($this->never()) + ->method('markProcessed'); + + $response = $this->notificationsController->dismiss('42'); + $this->assertInstanceOf(DataResponse::class, $response); + $this->assertSame(403, $response->getStatus()); + } + + public function testDismissSuccess(): void { + $comment = $this->createMock(IComment::class); + $comment->expects($this->any()) + ->method('getObjectType') + ->willReturn('files'); + $comment->expects($this->any()) + ->method('getId') + ->willReturn('1234'); + + $this->commentsManager->expects($this->once()) + ->method('get') + ->with('42') + ->willReturn($comment); + + $user = $this->createMock(IUser::class); + $user->expects($this->any()) + ->method('getUID') + ->willReturn('user'); + + $this->session->expects($this->once()) + ->method('getUser') + ->willReturn($user); + + $notification = $this->createMock(INotification::class); + $notification->expects($this->any()) + ->method($this->anything()) + ->willReturn($notification); + + $this->notificationManager->expects($this->once()) + ->method('createNotification') + ->willReturn($notification); + $this->notificationManager->expects($this->once()) + ->method('markProcessed') + ->with($notification); + + $response = $this->notificationsController->dismiss('42'); + $this->assertInstanceOf(DataResponse::class, $response); + $this->assertSame(200, $response->getStatus()); + } + + public function testDismissInvalidComment(): void { + $this->commentsManager->expects($this->once()) + ->method('get') + ->with('42') + ->willThrowException(new NotFoundException()); + + $user = $this->createMock(IUser::class); + $this->session->expects($this->once()) + ->method('getUser') + ->willReturn($user); + + $this->notificationManager->expects($this->never()) + ->method('markProcessed'); + + $response = $this->notificationsController->dismiss('42'); + $this->assertInstanceOf(DataResponse::class, $response); + $this->assertSame(404, $response->getStatus()); + } + + public function testDismissNonFileComment(): void { + $comment = $this->createMock(IComment::class); + $comment->expects($this->any()) + ->method('getObjectType') + ->willReturn('calendar'); + + $this->commentsManager->expects($this->once()) + ->method('get') + ->with('42') + ->willReturn($comment); + + $user = $this->createMock(IUser::class); + $this->session->expects($this->once()) + ->method('getUser') + ->willReturn($user); + + $this->notificationManager->expects($this->never()) + ->method('markProcessed'); + + $response = $this->notificationsController->dismiss('42'); + $this->assertInstanceOf(DataResponse::class, $response); + $this->assertSame(404, $response->getStatus()); + } } diff --git a/dist/comments-comments-tab.js b/dist/comments-comments-tab.js index 98a62abed0b4e..18ef2ec94774d 100644 --- a/dist/comments-comments-tab.js +++ b/dist/comments-comments-tab.js @@ -1,2 +1,2 @@ -(()=>{var e,o,n,r={1836(e,o,n){"use strict";var r=n(21777),i=n(81222),a=n(51651),s=n(85471),c=n(96689),d=n(67342),l=n(81690),u=n(90176),m=n(35550);var f=n(65899);let p,b;function v(){window.OCA.Activity.registerSidebarAction({mount:async(e,{fileInfo:t,reload:o})=>{const r=(0,f.Ey)();if(!p){const{default:e}=await Promise.all([n.e(4208),n.e(7462),n.e(8057)]).then(n.bind(n,98057));p=s.Ay.extend(e)}b=new p({el:e,pinia:r,propsData:{reloadCallback:o,resourceId:t.id}}),c.A.info("Comments plugin mounted in Activity sidebar action",{fileInfo:t})},unmount:()=>{b&&b.$destroy()}}),window.OCA.Activity.registerSidebarEntries(async({fileInfo:e,limit:t,offset:o})=>{const{data:r}=await async function({resourceType:e,resourceId:t},o){const n=["",e,t].join("/"),r=o.datetime?`${o.datetime.toISOString()}`:"",i=await m.A.customRequest(n,Object.assign({method:"REPORT",data:`\n\t\t\t\n\t\t\t\t${o.limit??20}\n\t\t\t\t${o.offset||0}\n\t\t\t\t${r}\n\t\t\t`},o)),a=await i.text(),s=function(e,t=!1){const{multistatus:{response:o}}=e;return o.map(e=>{const o=e.propstat.prop;return(0,u.ch)(o,o.id.toString(),t)})}(await(0,d.h4)(a),!0);return(0,l.hq)(i,s,!0)}({resourceType:"files",resourceId:e.id},{limit:t,offset:o});c.A.debug("Loaded comments",{fileInfo:e,comments:r});const{default:i}=await Promise.all([n.e(4208),n.e(7462),n.e(3920)]).then(n.bind(n,93920)),f=s.Ay.extend(i);return r.map(t=>({_CommentsViewInstance:void 0,timestamp:(0,a.A)(t.props?.creationDateTime).toDate().getTime(),mount(o,{reload:n}){this._CommentsViewInstance=new f({el:o,propsData:{comment:t,resourceId:e.id,reloadCallback:n}})},unmount(){this._CommentsViewInstance?.$destroy()}}))}),window.OCA.Activity.registerSidebarFilter(e=>"comments"!==e.type),c.A.info("Comments plugin registered for Activity sidebar action")}if(s.Ay.use(f.R2),n.nc=(0,r.aV)(),(0,i.C)("comments","activityEnabled",!1)&&void 0!==OCA?.Activity?.registerSidebarAction)window.addEventListener("DOMContentLoaded",function(){v()});else{let e=null;const o=new OCA.Files.Sidebar.Tab({id:"comments",name:t("comments","Comments"),iconSvg:'',async mount(t,o,n){e&&e.$destroy(),e=new OCA.Comments.View("files",{parent:n,propsData:{resourceId:o.id}}),await e.update(o.id),e.$mount(t)},update(t){e.update(t.id)},destroy(){e.$destroy(),e=null},scrollBottomReached(){e.onScrollBottomReached()}});window.addEventListener("DOMContentLoaded",function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(o)})}},96689(e,t,o){"use strict";o.d(t,{A:()=>n});const n=(0,o(35947).YK)().setApp("comments").detectUser().build()},35550(e,t,o){"use strict";o.d(t,{A:()=>c});var n=o(67342),r=o(17003),i=o(21777);const a=(0,n.UU)((0,r.e)()),s=e=>{a.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})};(0,i.zo)(s),s((0,i.do)());const c=a},17003(e,t,o){"use strict";o.d(t,{e:()=>r});var n=o(63814);const r=function(){return(0,n.dC)("dav/comments")}},42634(){},63779(){},77199(){},59169(){},86833(){}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=r,e=[],a.O=(t,o,n,r)=>{if(!o){var i=1/0;for(l=0;l=r)&&Object.keys(a.O).every(e=>a.O[e](o[c]))?o.splice(c--,1):(s=!1,r0&&e[l-1][2]>r;l--)e[l]=e[l-1];e[l]=[o,n,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,o)=>(a.f[o](e,t),t),[])),a.u=e=>e+"-"+e+".js?v="+{1580:"db6e25f4cedf2163ba34",3718:"bc66d84a737451505bcd",3920:"152abc588f20048b8ee0",4508:"d486721068805717f26b",5862:"e58c0b75c4ec864adc49",6015:"2a54e0cc1ee940aaa935",6408:"534c4af5ee0627730bb7",6461:"5e474c653fdcc7ff861c",6822:"757e25bd67d586bfeadb",7462:"efc49de29cffc8c89dbd",7859:"d4268a8759e7cef70872",7910:"5a57df2e6293e721d8c8",8057:"23e496be1eabac1c642e",8815:"d39d628a163817b0a4bc"}[e],a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},n="nextcloud:",a.l=(e,t,r,i)=>{if(o[e])o[e].push(t);else{var s,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),l=0;l{s.onerror=s.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach(e=>e(n)),t)return t(n)},f=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),c&&document.head.appendChild(s)}},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=2122,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].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="undefined"!=typeof document&&document.baseURI||self.location.href;var e={2122:0};a.f.j=(t,o)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{var r=new Promise((o,r)=>n=e[t]=[o,r]);o.push(n[2]=r);var i=a.p+a.u(t),s=new Error;a.l(i,o=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,n[1](s)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,o)=>{var n,r,[i,s,c]=o,d=0;if(i.some(t=>0!==e[t])){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);if(c)var l=c(a)}for(t&&t(o);da(1836));s=a.O(s)})(); -//# sourceMappingURL=comments-comments-tab.js.map?v=f796786f4dd94234d3d4 \ No newline at end of file +(()=>{var e,o,n,r={58040(e,o,n){"use strict";var r=n(21777),i=n(81222),a=n(19051),s=n(51651),c=n(63814),d=n(85471),l=n(96689),u=n(67342),m=n(81690),p=n(90176),f=n(35550);const b=async function({resourceType:e,resourceId:t},o){const n=["",e,t].join("/"),r=o.datetime?`${o.datetime.toISOString()}`:"",i=await f.A.customRequest(n,Object.assign({method:"REPORT",data:`\n\t\t\t\n\t\t\t\t${o.limit??20}\n\t\t\t\t${o.offset||0}\n\t\t\t\t${r}\n\t\t\t`},o)),a=await i.text(),s=await(0,u.h4)(a),c=v(s,!0);return(0,m.hq)(i,c,!0)},v=function(e,t=!1){const{multistatus:{response:o}}=e;return o.map(e=>{const o=e.propstat.prop;return(0,p.ch)(o,o.id.toString(),t)})};var h=n(65899);let g,y;if(d.Ay.use(h.R2),n.nc=(0,r.aV)(),(0,i.C)("comments","activityEnabled",!1)&&void 0!==OCA?.Activity?.registerSidebarAction)window.addEventListener("DOMContentLoaded",function(){window.OCA.Activity.registerSidebarAction({mount:async(e,{fileInfo:t,reload:o})=>{const r=(0,h.Ey)();if(!g){const{default:e}=await Promise.all([n.e(4208),n.e(7462),n.e(8057)]).then(n.bind(n,98057));g=d.Ay.extend(e)}y=new g({el:e,pinia:r,propsData:{reloadCallback:o,resourceId:t.id}}),l.A.info("Comments plugin mounted in Activity sidebar action",{fileInfo:t})},unmount:()=>{y&&y.$destroy()}}),window.OCA.Activity.registerSidebarEntries(async({fileInfo:e,limit:t,offset:o})=>{const{data:i}=await b({resourceType:"files",resourceId:e.id},{limit:t,offset:o});l.A.debug("Loaded comments",{fileInfo:e,comments:i});const u=e.node;u&&(u.attributes["comments-unread"]=0,window._nc_event_bus?.emit("files:node:updated",u)),((e,t,o)=>{const n=["","files",t].join("/"),r=o.toUTCString();return f.A.customRequest(n,{method:"PROPPATCH",data:`\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${r}\n\t\t\t\t\n\t\t\t\n\t\t\t`})})(0,e.id,new Date).catch(()=>{});const m=(0,r.HW)();if(m)for(const e of i){const t=Object.values(e.props?.mentions??{});e.props?.id&&t.some(e=>"user"===e.mentionType&&e.mentionId===m.uid)&&a.Ay.delete((0,c.Jv)("/apps/comments/notifications/{id}",{id:e.props.id})).catch(()=>{})}const{default:p}=await Promise.all([n.e(4208),n.e(7462),n.e(3920)]).then(n.bind(n,93920)),v=d.Ay.extend(p);return i.map(t=>({_CommentsViewInstance:void 0,timestamp:(0,s.A)(t.props?.creationDateTime).toDate().getTime(),mount(o,{reload:n}){this._CommentsViewInstance=new v({el:o,propsData:{comment:t,resourceId:e.id,reloadCallback:n}})},unmount(){this._CommentsViewInstance?.$destroy()}}))}),window.OCA.Activity.registerSidebarFilter(e=>"comments"!==e.type),l.A.info("Comments plugin registered for Activity sidebar action")});else{let e=null;const o=new OCA.Files.Sidebar.Tab({id:"comments",name:t("comments","Comments"),iconSvg:'',async mount(t,o,n){e&&e.$destroy(),e=new OCA.Comments.View("files",{parent:n,propsData:{resourceId:o.id}}),await e.update(o.id),e.$mount(t)},update(t){e.update(t.id)},destroy(){e.$destroy(),e=null},scrollBottomReached(){e.onScrollBottomReached()}});window.addEventListener("DOMContentLoaded",function(){OCA.Files&&OCA.Files.Sidebar&&OCA.Files.Sidebar.registerTab(o)})}},96689(e,t,o){"use strict";o.d(t,{A:()=>n});const n=(0,o(35947).YK)().setApp("comments").detectUser().build()},35550(e,t,o){"use strict";o.d(t,{A:()=>c});var n=o(67342),r=o(17003),i=o(21777);const a=(0,n.UU)((0,r.e)()),s=e=>{a.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})};(0,i.zo)(s),s((0,i.do)());const c=a},17003(e,t,o){"use strict";o.d(t,{e:()=>r});var n=o(63814);const r=function(){return(0,n.dC)("dav/comments")}},42634(){},63779(){},77199(){},59169(){},86833(){}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.m=r,e=[],a.O=(t,o,n,r)=>{if(!o){var i=1/0;for(l=0;l=r)&&Object.keys(a.O).every(e=>a.O[e](o[c]))?o.splice(c--,1):(s=!1,r0&&e[l-1][2]>r;l--)e[l]=e[l-1];e[l]=[o,n,r]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,o)=>(a.f[o](e,t),t),[])),a.u=e=>e+"-"+e+".js?v="+{1580:"db6e25f4cedf2163ba34",3718:"bc66d84a737451505bcd",3920:"152abc588f20048b8ee0",4508:"d486721068805717f26b",5862:"e58c0b75c4ec864adc49",6015:"2a54e0cc1ee940aaa935",6408:"534c4af5ee0627730bb7",6461:"5e474c653fdcc7ff861c",6822:"757e25bd67d586bfeadb",7462:"efc49de29cffc8c89dbd",7859:"d4268a8759e7cef70872",7910:"5a57df2e6293e721d8c8",8057:"23e496be1eabac1c642e",8815:"d39d628a163817b0a4bc"}[e],a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},n="nextcloud:",a.l=(e,t,r,i)=>{if(o[e])o[e].push(t);else{var s,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),l=0;l{s.onerror=s.onload=null,clearTimeout(p);var r=o[e];if(delete o[e],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach(e=>e(n)),t)return t(n)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),c&&document.head.appendChild(s)}},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=2122,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].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="undefined"!=typeof document&&document.baseURI||self.location.href;var e={2122:0};a.f.j=(t,o)=>{var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{var r=new Promise((o,r)=>n=e[t]=[o,r]);o.push(n[2]=r);var i=a.p+a.u(t),s=new Error;a.l(i,o=>{if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,n[1](s)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,o)=>{var n,r,[i,s,c]=o,d=0;if(i.some(t=>0!==e[t])){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);if(c)var l=c(a)}for(t&&t(o);da(58040));s=a.O(s)})(); +//# sourceMappingURL=comments-comments-tab.js.map?v=37c3168cf66f8acf795b \ No newline at end of file diff --git a/dist/comments-comments-tab.js.license b/dist/comments-comments-tab.js.license index 8eebb3ca2f632..855200a324523 100644 --- a/dist/comments-comments-tab.js.license +++ b/dist/comments-comments-tab.js.license @@ -21,6 +21,7 @@ SPDX-FileCopyrightText: Paul Vorbach (http://vorb.de) SPDX-FileCopyrightText: Olivier Scherrer SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors SPDX-FileCopyrightText: Nathan Rajlich (http://n8.io/) +SPDX-FileCopyrightText: Matt Zabriskie SPDX-FileCopyrightText: Mathias Bynens SPDX-FileCopyrightText: Julian Gruber SPDX-FileCopyrightText: Joyent @@ -48,6 +49,9 @@ This file is generated from multiple sources. Included packages: - @nextcloud/auth - version: 2.6.0 - license: GPL-3.0-or-later +- @nextcloud/axios + - version: 2.5.2 + - license: GPL-3.0-or-later - @nextcloud/browser-storage - version: 0.5.0 - license: GPL-3.0-or-later @@ -81,6 +85,9 @@ This file is generated from multiple sources. Included packages: - available-typed-arrays - version: 1.0.7 - license: MIT +- axios + - version: 1.13.4 + - license: MIT - balanced-match - version: 1.0.2 - license: MIT diff --git a/dist/comments-comments-tab.js.map b/dist/comments-comments-tab.js.map index 1b869e4cf47cc..a6688f22f2d05 100644 --- a/dist/comments-comments-tab.js.map +++ b/dist/comments-comments-tab.js.map @@ -1 +1 @@ -{"version":3,"file":"comments-comments-tab.js?v=f796786f4dd94234d3d4","mappings":"UAAIA,ECAAC,EACAC,E,kJCSJ,IAAIC,EACAC,EAIG,SAASC,IACZC,OAAOC,IAAIC,SAASC,sBAAsB,CACtCC,MAAOC,MAAOC,GAAMC,WAAUC,aAC1B,MAAMC,GAAQC,EAAAA,EAAAA,MACd,IAAKb,EAAuB,CACxB,MAAQc,QAASC,SAAgC,mEAEjDf,EAAwBgB,EAAAA,GAAIC,OAAOF,EACvC,CACAd,EAA4B,IAAID,EAAsB,CAClDS,KACAG,QACAM,UAAW,CACPC,eAAgBR,EAChBS,WAAYV,EAASW,MAG7BC,EAAAA,EAAOC,KAAK,qDAAsD,CAAEb,cAExEc,QAASA,KAEDvB,GACAA,EAA0BwB,cAItCtB,OAAOC,IAAIC,SAASqB,uBAAuBlB,OAASE,WAAUiB,QAAOC,aACjE,MAAQC,KAAMC,SCpBKtB,gBAAgB,aAAEuB,EAAY,WAAEX,GAAcY,GACrE,MAAMC,EAAe,CAAC,GAAIF,EAAcX,GAAYc,KAAK,KACnDC,EAAWH,EAAQG,SAAW,gBAAgBH,EAAQG,SAASC,8BAAgC,GAC/FC,QAAiBC,EAAAA,EAAOC,cAAcN,EAAcO,OAAOC,OAAO,CACpEC,OAAQ,SACRb,KAAM,sPAMEG,EAAQL,OAxBK,qCAyBZK,EAAQJ,QAAU,0BAC7BO,kCAECH,IACGW,QAAqBN,EAASO,OAE9BC,EAIgB,SAAUC,EAAQC,GAAa,GAErD,MAAQC,aAAeX,SAAUY,IAAqBH,EAEtD,OAAOG,EAAcC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AA2BlM,GACrDoG,EAAIL,EAASM,OAAQD,IACzBqB,EAAU1B,EAASK,GAChBf,EAAoB8B,EAAEoE,EAAiB9D,IAAY8D,EAAgB9D,IACrE8D,EAAgB9D,GAAS,KAE1B8D,EAAgB9D,GAAW,EAE5B,OAAOpC,EAAoBS,EAAE7E,IAG1BqL,EAAqB7B,WAAkC,sBAAIA,WAAkC,uBAAK,GACtG6B,EAAmB1C,QAAQqC,EAAqBnC,KAAK,KAAM,IAC3DwC,EAAmBjE,KAAO4D,EAAqBnC,KAAK,KAAMwC,EAAmBjE,KAAKyB,KAAKwC,G,KCrFvFjH,EAAoB0D,QAAK1G,ECGzB,IAAIkK,EAAsBlH,EAAoBS,OAAEzD,EAAW,CAAC,MAAO,IAAOgD,EAAoB,OAC9FkH,EAAsBlH,EAAoBS,EAAEyG,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/load script","webpack:///nextcloud/apps/comments/src/comments-activity-tab.ts","webpack:///nextcloud/apps/comments/src/services/GetComments.ts","webpack:///nextcloud/apps/comments/src/comments-tab.js","webpack:///nextcloud/apps/comments/src/logger.js","webpack:///nextcloud/apps/comments/src/services/DavClient.js","webpack:///nextcloud/apps/comments/src/utils/davUtils.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/get javascript chunk filename","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/publicPath","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"nextcloud:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport moment from '@nextcloud/moment';\nimport Vue, {} from 'vue';\nimport logger from './logger.js';\nimport { getComments } from './services/GetComments.js';\nimport { PiniaVuePlugin, createPinia } from 'pinia';\nVue.use(PiniaVuePlugin);\nlet ActivityTabPluginView;\nlet ActivityTabPluginInstance;\n/**\n * Register the comments plugins for the Activity sidebar\n */\nexport function registerCommentsPlugins() {\n window.OCA.Activity.registerSidebarAction({\n mount: async (el, { fileInfo, reload }) => {\n const pinia = createPinia();\n if (!ActivityTabPluginView) {\n const { default: ActivityCommentAction } = await import('./views/ActivityCommentAction.vue');\n // @ts-expect-error Types are broken for Vue2\n ActivityTabPluginView = Vue.extend(ActivityCommentAction);\n }\n ActivityTabPluginInstance = new ActivityTabPluginView({\n el,\n pinia,\n propsData: {\n reloadCallback: reload,\n resourceId: fileInfo.id,\n },\n });\n logger.info('Comments plugin mounted in Activity sidebar action', { fileInfo });\n },\n unmount: () => {\n // destroy previous instance if available\n if (ActivityTabPluginInstance) {\n ActivityTabPluginInstance.$destroy();\n }\n },\n });\n window.OCA.Activity.registerSidebarEntries(async ({ fileInfo, limit, offset }) => {\n const { data: comments } = await getComments({ resourceType: 'files', resourceId: fileInfo.id }, { limit, offset });\n logger.debug('Loaded comments', { fileInfo, comments });\n const { default: CommentView } = await import('./views/ActivityCommentEntry.vue');\n // @ts-expect-error Types are broken for Vue2\n const CommentsViewObject = Vue.extend(CommentView);\n return comments.map((comment) => ({\n _CommentsViewInstance: undefined,\n timestamp: moment(comment.props?.creationDateTime).toDate().getTime(),\n mount(element, { reload }) {\n this._CommentsViewInstance = new CommentsViewObject({\n el: element,\n propsData: {\n comment,\n resourceId: fileInfo.id,\n reloadCallback: reload,\n },\n });\n },\n unmount() {\n this._CommentsViewInstance?.$destroy();\n },\n }));\n });\n window.OCA.Activity.registerSidebarFilter((activity) => activity.type !== 'comments');\n logger.info('Comments plugin registered for Activity sidebar action');\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { parseXML } from 'webdav';\n// https://github.com/perry-mitchell/webdav-client/issues/339\nimport { processResponsePayload } from 'webdav/dist/node/response.js';\nimport { prepareFileFromProps } from 'webdav/dist/node/tools/dav.js';\nimport client from './DavClient.js';\nexport const DEFAULT_LIMIT = 20;\n/**\n * Retrieve the comments list\n *\n * @param {object} data destructuring object\n * @param {string} data.resourceType the resource type\n * @param {number} data.resourceId the resource ID\n * @param {object} [options] optional options for axios\n * @param {number} [options.offset] the pagination offset\n * @param {number} [options.limit] the pagination limit, defaults to 20\n * @param {Date} [options.datetime] optional date to query\n * @return {{data: object[]}} the comments list\n */\nexport const getComments = async function ({ resourceType, resourceId }, options) {\n const resourcePath = ['', resourceType, resourceId].join('/');\n const datetime = options.datetime ? `${options.datetime.toISOString()}` : '';\n const response = await client.customRequest(resourcePath, Object.assign({\n method: 'REPORT',\n data: `\n\t\t\t\n\t\t\t\t${options.limit ?? DEFAULT_LIMIT}\n\t\t\t\t${options.offset || 0}\n\t\t\t\t${datetime}\n\t\t\t`,\n }, options));\n const responseData = await response.text();\n const result = await parseXML(responseData);\n const stat = getDirectoryFiles(result, true);\n return processResponsePayload(response, stat, true);\n};\n// https://github.com/perry-mitchell/webdav-client/blob/8d9694613c978ce7404e26a401c39a41f125f87f/source/operations/directoryContents.ts\nconst getDirectoryFiles = function (result, isDetailed = false) {\n // Extract the response items (directory contents)\n const { multistatus: { response: responseItems }, } = result;\n // Map all items to a consistent output structure (results)\n return responseItems.map(item => {\n // Each item should contain a stat object\n const props = item.propstat.prop;\n return prepareFileFromProps(props, props.id.toString(), isDetailed);\n });\n};\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n// eslint-disable-next-line n/no-missing-import, import/no-unresolved\nimport MessageReplyText from '@mdi/svg/svg/message-reply-text.svg?raw'\nimport { getCSPNonce } from '@nextcloud/auth'\nimport { loadState } from '@nextcloud/initial-state'\nimport { registerCommentsPlugins } from './comments-activity-tab.ts'\n\n// @ts-expect-error __webpack_nonce__ is injected by webpack\n__webpack_nonce__ = getCSPNonce()\n\nif (loadState('comments', 'activityEnabled', false) && OCA?.Activity?.registerSidebarAction !== undefined) {\n\t// Do not mount own tab but mount into activity\n\twindow.addEventListener('DOMContentLoaded', function() {\n\t\tregisterCommentsPlugins()\n\t})\n} else {\n\t// Init Comments tab component\n\tlet TabInstance = null\n\tconst commentTab = new OCA.Files.Sidebar.Tab({\n\t\tid: 'comments',\n\t\tname: t('comments', 'Comments'),\n\t\ticonSvg: MessageReplyText,\n\n\t\tasync mount(el, fileInfo, context) {\n\t\t\tif (TabInstance) {\n\t\t\t\tTabInstance.$destroy()\n\t\t\t}\n\t\t\tTabInstance = new OCA.Comments.View('files', {\n\t\t\t\t// Better integration with vue parent component\n\t\t\t\tparent: context,\n\t\t\t\tpropsData: {\n\t\t\t\t\tresourceId: fileInfo.id,\n\t\t\t\t},\n\t\t\t})\n\t\t\t// Only mount after we have all the info we need\n\t\t\tawait TabInstance.update(fileInfo.id)\n\t\t\tTabInstance.$mount(el)\n\t\t},\n\t\tupdate(fileInfo) {\n\t\t\tTabInstance.update(fileInfo.id)\n\t\t},\n\t\tdestroy() {\n\t\t\tTabInstance.$destroy()\n\t\t\tTabInstance = null\n\t\t},\n\t\tscrollBottomReached() {\n\t\t\tTabInstance.onScrollBottomReached()\n\t\t},\n\t})\n\n\twindow.addEventListener('DOMContentLoaded', function() {\n\t\tif (OCA.Files && OCA.Files.Sidebar) {\n\t\t\tOCA.Files.Sidebar.registerTab(commentTab)\n\t\t}\n\t})\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('comments')\n\t.detectUser()\n\t.build()\n","/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { createClient } from 'webdav'\nimport { getRootPath } from '../utils/davUtils.js'\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth'\n\n// init webdav client\nconst client = createClient(getRootPath())\n\n// set CSRF token header\nconst setHeaders = (token) => {\n\tclient.setHeaders({\n\t\t// Add this so the server knows it is an request from the browser\n\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t// Inject user auth\n\t\trequesttoken: token ?? '',\n\t})\n}\n\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders)\nsetHeaders(getRequestToken())\n\nexport default client\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { generateRemoteUrl } from '@nextcloud/router'\n\nconst getRootPath = function() {\n\treturn generateRemoteUrl('dav/comments')\n}\n\nexport { getRootPath }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \"-\" + chunkId + \".js?v=\" + {\"1580\":\"db6e25f4cedf2163ba34\",\"3718\":\"bc66d84a737451505bcd\",\"3920\":\"152abc588f20048b8ee0\",\"4508\":\"d486721068805717f26b\",\"5862\":\"e58c0b75c4ec864adc49\",\"6015\":\"2a54e0cc1ee940aaa935\",\"6408\":\"534c4af5ee0627730bb7\",\"6461\":\"5e474c653fdcc7ff861c\",\"6822\":\"757e25bd67d586bfeadb\",\"7462\":\"efc49de29cffc8c89dbd\",\"7859\":\"d4268a8759e7cef70872\",\"7910\":\"5a57df2e6293e721d8c8\",\"8057\":\"23e496be1eabac1c642e\",\"8815\":\"d39d628a163817b0a4bc\"}[chunkId] + \"\";\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2122;","var scriptUrl;\nif (globalThis.importScripts) scriptUrl = globalThis.location + \"\";\nvar document = globalThis.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2122: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunknextcloud\"] = globalThis[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(1836)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","ActivityTabPluginView","ActivityTabPluginInstance","registerCommentsPlugins","window","OCA","Activity","registerSidebarAction","mount","async","el","fileInfo","reload","pinia","createPinia","default","ActivityCommentAction","Vue","extend","propsData","reloadCallback","resourceId","id","logger","info","unmount","$destroy","registerSidebarEntries","limit","offset","data","comments","resourceType","options","resourcePath","join","datetime","toISOString","response","client","customRequest","Object","assign","method","responseData","text","stat","result","isDetailed","multistatus","responseItems","map","item","props","propstat","prop","prepareFileFromProps","toString","getDirectoryFiles","parseXML","processResponsePayload","getComments","debug","CommentView","CommentsViewObject","comment","_CommentsViewInstance","undefined","timestamp","moment","creationDateTime","toDate","getTime","element","this","registerSidebarFilter","activity","type","use","PiniaVuePlugin","__webpack_nonce__","getCSPNonce","loadState","addEventListener","TabInstance","commentTab","Files","Sidebar","Tab","name","t","iconSvg","context","Comments","View","parent","update","$mount","destroy","scrollBottomReached","onScrollBottomReached","registerTab","getLoggerBuilder","setApp","detectUser","build","createClient","getRootPath","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","generateRemoteUrl","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","m","O","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","reduce","promises","u","obj","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","timeout","doneFns","parentNode","removeChild","forEach","setTimeout","bind","target","head","appendChild","Symbol","toStringTag","value","nmd","paths","children","scriptUrl","globalThis","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","b","baseURI","self","href","installedChunks","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"comments-comments-tab.js?v=37c3168cf66f8acf795b","mappings":"UAAIA,ECAAC,EACAC,E,0JCQG,MAaMC,EAAcC,gBAAgB,aAAEC,EAAY,WAAEC,GAAcC,GACrE,MAAMC,EAAe,CAAC,GAAIH,EAAcC,GAAYG,KAAK,KACnDC,EAAWH,EAAQG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ACvD,IAGIyH,EAAUkC,GAHT1B,EAAUoG,EAAaC,GAAWtO,EAGhBsI,EAAI,EAC3B,GAAGL,EAAS7D,KAAMjD,GAAgC,IAAxBsM,EAAgBtM,IAAa,CACtD,IAAIsG,KAAY4G,EACZ7G,EAAoB6B,EAAEgF,EAAa5G,KACrCD,EAAoBnD,EAAEoD,GAAY4G,EAAY5G,IAGhD,GAAG6G,EAAS,IAAIjO,EAASiO,EAAQ9G,EAClC,CAEA,IADG4G,GAA4BA,EAA2BpO,GACrDsI,EAAIL,EAASM,OAAQD,IACzBqB,EAAU1B,EAASK,GAChBd,EAAoB6B,EAAEoE,EAAiB9D,IAAY8D,EAAgB9D,IACrE8D,EAAgB9D,GAAS,KAE1B8D,EAAgB9D,GAAW,EAE5B,OAAOnC,EAAoBQ,EAAE3H,IAG1BkO,EAAqB5B,WAAkC,sBAAIA,WAAkC,uBAAK,GACtG4B,EAAmBzC,QAAQqC,EAAqBnC,KAAK,KAAM,IAC3DuC,EAAmBhE,KAAO4D,EAAqBnC,KAAK,KAAMuC,EAAmBhE,KAAKyB,KAAKuC,G,KCrFvF/G,EAAoByD,QAAKpJ,ECGzB,IAAI2M,EAAsBhH,EAAoBQ,OAAEnG,EAAW,CAAC,MAAO,IAAO2F,EAAoB,QAC9FgH,EAAsBhH,EAAoBQ,EAAEwG,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/load script","webpack:///nextcloud/apps/comments/src/services/GetComments.ts","webpack:///nextcloud/apps/comments/src/comments-activity-tab.ts","webpack:///nextcloud/apps/comments/src/comments-tab.js","webpack:///nextcloud/apps/comments/src/services/ReadComments.ts","webpack:///nextcloud/apps/comments/src/logger.js","webpack:///nextcloud/apps/comments/src/services/DavClient.js","webpack:///nextcloud/apps/comments/src/utils/davUtils.js","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/get javascript chunk filename","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/publicPath","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"nextcloud:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { parseXML } from 'webdav';\n// https://github.com/perry-mitchell/webdav-client/issues/339\nimport { processResponsePayload } from 'webdav/dist/node/response.js';\nimport { prepareFileFromProps } from 'webdav/dist/node/tools/dav.js';\nimport client from './DavClient.js';\nexport const DEFAULT_LIMIT = 20;\n/**\n * Retrieve the comments list\n *\n * @param {object} data destructuring object\n * @param {string} data.resourceType the resource type\n * @param {number} data.resourceId the resource ID\n * @param {object} [options] optional options for axios\n * @param {number} [options.offset] the pagination offset\n * @param {number} [options.limit] the pagination limit, defaults to 20\n * @param {Date} [options.datetime] optional date to query\n * @return {{data: object[]}} the comments list\n */\nexport const getComments = async function ({ resourceType, resourceId }, options) {\n const resourcePath = ['', resourceType, resourceId].join('/');\n const datetime = options.datetime ? `${options.datetime.toISOString()}` : '';\n const response = await client.customRequest(resourcePath, Object.assign({\n method: 'REPORT',\n data: `\n\t\t\t\n\t\t\t\t${options.limit ?? DEFAULT_LIMIT}\n\t\t\t\t${options.offset || 0}\n\t\t\t\t${datetime}\n\t\t\t`,\n }, options));\n const responseData = await response.text();\n const result = await parseXML(responseData);\n const stat = getDirectoryFiles(result, true);\n return processResponsePayload(response, stat, true);\n};\n// https://github.com/perry-mitchell/webdav-client/blob/8d9694613c978ce7404e26a401c39a41f125f87f/source/operations/directoryContents.ts\nconst getDirectoryFiles = function (result, isDetailed = false) {\n // Extract the response items (directory contents)\n const { multistatus: { response: responseItems }, } = result;\n // Map all items to a consistent output structure (results)\n return responseItems.map(item => {\n // Each item should contain a stat object\n const props = item.propstat.prop;\n return prepareFileFromProps(props, props.id.toString(), isDetailed);\n });\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getCurrentUser } from '@nextcloud/auth';\nimport axios from '@nextcloud/axios';\nimport moment from '@nextcloud/moment';\nimport { generateUrl } from '@nextcloud/router';\nimport Vue, {} from 'vue';\nimport logger from './logger.js';\nimport { getComments } from './services/GetComments.js';\nimport { markCommentsAsRead } from './services/ReadComments.js';\nimport { PiniaVuePlugin, createPinia } from 'pinia';\nVue.use(PiniaVuePlugin);\nlet ActivityTabPluginView;\nlet ActivityTabPluginInstance;\n/**\n * Register the comments plugins for the Activity sidebar\n */\nexport function registerCommentsPlugins() {\n window.OCA.Activity.registerSidebarAction({\n mount: async (el, { fileInfo, reload }) => {\n const pinia = createPinia();\n if (!ActivityTabPluginView) {\n const { default: ActivityCommentAction } = await import('./views/ActivityCommentAction.vue');\n // @ts-expect-error Types are broken for Vue2\n ActivityTabPluginView = Vue.extend(ActivityCommentAction);\n }\n ActivityTabPluginInstance = new ActivityTabPluginView({\n el,\n pinia,\n propsData: {\n reloadCallback: reload,\n resourceId: fileInfo.id,\n },\n });\n logger.info('Comments plugin mounted in Activity sidebar action', { fileInfo });\n },\n unmount: () => {\n // destroy previous instance if available\n if (ActivityTabPluginInstance) {\n ActivityTabPluginInstance.$destroy();\n }\n },\n });\n window.OCA.Activity.registerSidebarEntries(async ({ fileInfo, limit, offset }) => {\n const { data: comments } = await getComments({ resourceType: 'files', resourceId: fileInfo.id }, { limit, offset });\n logger.debug('Loaded comments', { fileInfo, comments });\n // Optimistically clear the unread bubble immediately via the global event bus\n // (window._nc_event_bus) so the UI updates without a page refresh.\n // fileInfo.node is the underlying @nextcloud/files Node set by the Files sidebar.\n const node = fileInfo.node;\n if (node) {\n node.attributes['comments-unread'] = 0;\n window._nc_event_bus?.emit('files:node:updated', node);\n }\n markCommentsAsRead('files', fileInfo.id, new Date()).catch(() => { });\n // Mark mention notifications as read for comments that mention the current user\n const currentUser = getCurrentUser();\n if (currentUser) {\n for (const comment of comments) {\n const mentions = Object.values(comment.props?.mentions ?? {});\n const isMentioned = comment.props?.id && mentions.some((m) => m.mentionType === 'user' && m.mentionId === currentUser.uid);\n if (isMentioned) {\n axios.delete(generateUrl('/apps/comments/notifications/{id}', { id: comment.props.id }))\n .catch(() => { });\n }\n }\n }\n const { default: CommentView } = await import('./views/ActivityCommentEntry.vue');\n // @ts-expect-error Types are broken for Vue2\n const CommentsViewObject = Vue.extend(CommentView);\n return comments.map((comment) => ({\n _CommentsViewInstance: undefined,\n timestamp: moment(comment.props?.creationDateTime).toDate().getTime(),\n mount(element, { reload }) {\n this._CommentsViewInstance = new CommentsViewObject({\n el: element,\n propsData: {\n comment,\n resourceId: fileInfo.id,\n reloadCallback: reload,\n },\n });\n },\n unmount() {\n this._CommentsViewInstance?.$destroy();\n },\n }));\n });\n window.OCA.Activity.registerSidebarFilter((activity) => activity.type !== 'comments');\n logger.info('Comments plugin registered for Activity sidebar action');\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n// eslint-disable-next-line n/no-missing-import, import/no-unresolved\nimport MessageReplyText from '@mdi/svg/svg/message-reply-text.svg?raw'\nimport { getCSPNonce } from '@nextcloud/auth'\nimport { loadState } from '@nextcloud/initial-state'\nimport { registerCommentsPlugins } from './comments-activity-tab.ts'\n\n// @ts-expect-error __webpack_nonce__ is injected by webpack\n__webpack_nonce__ = getCSPNonce()\n\nif (loadState('comments', 'activityEnabled', false) && OCA?.Activity?.registerSidebarAction !== undefined) {\n\t// Do not mount own tab but mount into activity\n\twindow.addEventListener('DOMContentLoaded', function() {\n\t\tregisterCommentsPlugins()\n\t})\n} else {\n\t// Init Comments tab component\n\tlet TabInstance = null\n\tconst commentTab = new OCA.Files.Sidebar.Tab({\n\t\tid: 'comments',\n\t\tname: t('comments', 'Comments'),\n\t\ticonSvg: MessageReplyText,\n\n\t\tasync mount(el, fileInfo, context) {\n\t\t\tif (TabInstance) {\n\t\t\t\tTabInstance.$destroy()\n\t\t\t}\n\t\t\tTabInstance = new OCA.Comments.View('files', {\n\t\t\t\t// Better integration with vue parent component\n\t\t\t\tparent: context,\n\t\t\t\tpropsData: {\n\t\t\t\t\tresourceId: fileInfo.id,\n\t\t\t\t},\n\t\t\t})\n\t\t\t// Only mount after we have all the info we need\n\t\t\tawait TabInstance.update(fileInfo.id)\n\t\t\tTabInstance.$mount(el)\n\t\t},\n\t\tupdate(fileInfo) {\n\t\t\tTabInstance.update(fileInfo.id)\n\t\t},\n\t\tdestroy() {\n\t\t\tTabInstance.$destroy()\n\t\t\tTabInstance = null\n\t\t},\n\t\tscrollBottomReached() {\n\t\t\tTabInstance.onScrollBottomReached()\n\t\t},\n\t})\n\n\twindow.addEventListener('DOMContentLoaded', function() {\n\t\tif (OCA.Files && OCA.Files.Sidebar) {\n\t\t\tOCA.Files.Sidebar.registerTab(commentTab)\n\t\t}\n\t})\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport client from './DavClient.js';\n/**\n * Mark comments older than the date timestamp as read\n *\n * @param resourceType the resource type\n * @param resourceId the resource ID\n * @param date the date object\n */\nexport const markCommentsAsRead = (resourceType, resourceId, date) => {\n const resourcePath = ['', resourceType, resourceId].join('/');\n const readMarker = date.toUTCString();\n return client.customRequest(resourcePath, {\n method: 'PROPPATCH',\n data: `\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${readMarker}\n\t\t\t\t\n\t\t\t\n\t\t\t`,\n });\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport default getLoggerBuilder()\n\t.setApp('comments')\n\t.detectUser()\n\t.build()\n","/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { createClient } from 'webdav'\nimport { getRootPath } from '../utils/davUtils.js'\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth'\n\n// init webdav client\nconst client = createClient(getRootPath())\n\n// set CSRF token header\nconst setHeaders = (token) => {\n\tclient.setHeaders({\n\t\t// Add this so the server knows it is an request from the browser\n\t\t'X-Requested-With': 'XMLHttpRequest',\n\t\t// Inject user auth\n\t\trequesttoken: token ?? '',\n\t})\n}\n\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders)\nsetHeaders(getRequestToken())\n\nexport default client\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { generateRemoteUrl } from '@nextcloud/router'\n\nconst getRootPath = function() {\n\treturn generateRemoteUrl('dav/comments')\n}\n\nexport { getRootPath }\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \"-\" + chunkId + \".js?v=\" + {\"1580\":\"db6e25f4cedf2163ba34\",\"3718\":\"bc66d84a737451505bcd\",\"3920\":\"152abc588f20048b8ee0\",\"4508\":\"d486721068805717f26b\",\"5862\":\"e58c0b75c4ec864adc49\",\"6015\":\"2a54e0cc1ee940aaa935\",\"6408\":\"534c4af5ee0627730bb7\",\"6461\":\"5e474c653fdcc7ff861c\",\"6822\":\"757e25bd67d586bfeadb\",\"7462\":\"efc49de29cffc8c89dbd\",\"7859\":\"d4268a8759e7cef70872\",\"7910\":\"5a57df2e6293e721d8c8\",\"8057\":\"23e496be1eabac1c642e\",\"8815\":\"d39d628a163817b0a4bc\"}[chunkId] + \"\";\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2122;","var scriptUrl;\nif (globalThis.importScripts) scriptUrl = globalThis.location + \"\";\nvar document = globalThis.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2122: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunknextcloud\"] = globalThis[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(58040)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","getComments","async","resourceType","resourceId","options","resourcePath","join","datetime","toISOString","response","client","customRequest","Object","assign","method","data","limit","offset","responseData","text","result","parseXML","stat","getDirectoryFiles","processResponsePayload","isDetailed","multistatus","responseItems","map","item","props","propstat","prop","prepareFileFromProps","id","toString","ActivityTabPluginView","ActivityTabPluginInstance","Vue","use","PiniaVuePlugin","__webpack_nonce__","getCSPNonce","loadState","undefined","OCA","Activity","registerSidebarAction","window","addEventListener","mount","el","fileInfo","reload","pinia","createPinia","default","ActivityCommentAction","extend","propsData","reloadCallback","logger","info","unmount","$destroy","registerSidebarEntries","comments","debug","node","attributes","_nc_event_bus","emit","markCommentsAsRead","date","readMarker","toUTCString","Date","catch","currentUser","getCurrentUser","comment","mentions","values","some","m","mentionType","mentionId","uid","axios","delete","generateUrl","CommentView","CommentsViewObject","_CommentsViewInstance","timestamp","moment","creationDateTime","toDate","getTime","element","this","registerSidebarFilter","activity","type","TabInstance","commentTab","Files","Sidebar","Tab","name","t","iconSvg","context","Comments","View","parent","update","$mount","destroy","scrollBottomReached","onScrollBottomReached","registerTab","getLoggerBuilder","setApp","detectUser","build","createClient","getRootPath","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","generateRemoteUrl","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","O","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","keys","every","key","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","reduce","promises","u","obj","prototype","hasOwnProperty","l","url","done","push","script","needAttach","scripts","document","getElementsByTagName","s","getAttribute","createElement","charset","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","timeout","doneFns","parentNode","removeChild","forEach","setTimeout","bind","target","head","appendChild","Symbol","toStringTag","value","nmd","paths","children","scriptUrl","globalThis","importScripts","location","currentScript","tagName","toUpperCase","test","Error","replace","p","b","baseURI","self","href","installedChunks","installedChunkData","promise","resolve","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file