nextcloud/dist/comments-comments-tab.js
Anna Larch 685115710b fix(assets): rebuild dist with correct stable31 dependencies
The dist files merged in #60621 were built using master's node_modules,
which had @nextcloud/dialogs@7.3.0. That version bundles a Vue 3-compiled
floating-vue/vue-resize that imports withScopeId, openBlock, createBlock
from 'vue'. Vue 2.7.16 (used in stable31) does not export these APIs,
causing a TypeError on page load that crashed all Cypress tests.

Rebuilt using stable31's package-lock.json (@nextcloud/dialogs@6.4.2)
with Node 20 as required by the project's engine constraint.

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
2026-05-28 10:15:34 +02:00

2 lines
No EOL
7.7 KiB
JavaScript

(()=>{var e,o,n,r={58040(e,o,n){"use strict";var r=n(21777),i=n(32981),a=n(19051),s=n(51651),d=n(63814),c=n(85471),l=n(96689),u=n(68680),m=n(54290),p=n(90176),f=n(35550);const b=async function({resourceType:t,resourceId:e},o){const n=["",t,e].join("/"),r=o.datetime?`<oc:datetime>${o.datetime.toISOString()}</oc:datetime>`:"",i=await f.A.customRequest(n,Object.assign({method:"REPORT",data:`<?xml version="1.0"?>\n\t\t\t<oc:filter-comments\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<oc:limit>${o.limit??20}</oc:limit>\n\t\t\t\t<oc:offset>${o.offset||0}</oc:offset>\n\t\t\t\t${r}\n\t\t\t</oc:filter-comments>`},o)),a=await i.text(),s=await(0,u.h4)(a),d=v(s,!0);return(0,m.hq)(i,d,!0)},v=function(t,e=!1){const{multistatus:{response:o}}=t;return o.map((t=>{const o=t.propstat.prop;return(0,p.ch)(o,o.id.toString(),e)}))};var h=n(65899);let g,y;if(c.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(t,{context:e,fileInfo:o,reload:r})=>{const i=(0,h.Ey)();if(!g){const{default:t}=await Promise.all([n.e(4208),n.e(7462),n.e(8057)]).then(n.bind(n,98057));g=c.Ay.extend(t)}y=new g({el:t,parent:e,pinia:i,propsData:{reloadCallback:r,resourceId:o.id}}),l.A.info("Comments plugin mounted in Activity sidebar action",{fileInfo:o})},unmount:()=>{y&&y.$destroy()}}),window.OCA.Activity.registerSidebarEntries((async({fileInfo:t,limit:e,offset:o})=>{const{data:i}=await b({resourceType:"files",resourceId:t.id},{limit:e,offset:o});l.A.debug("Loaded comments",{fileInfo:t,comments:i});const u=t.node;u&&(u.attributes["comments-unread"]=0,window._nc_event_bus?.emit("files:node:updated",u)),((t,e,o)=>{const n=["","files",e].join("/"),r=o.toUTCString();return f.A.customRequest(n,{method:"PROPPATCH",data:`<?xml version="1.0"?>\n\t\t\t<d:propertyupdate\n\t\t\t\txmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns">\n\t\t\t<d:set>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:readMarker>${r}</oc:readMarker>\n\t\t\t\t</d:prop>\n\t\t\t</d:set>\n\t\t\t</d:propertyupdate>`})})(0,t.id,new Date).catch((()=>{}));const m=(0,r.HW)();if(m)for(const t of i){const e=Object.values(t.props?.mentions??{});t.props?.id&&e.some((t=>"user"===t.mentionType&&t.mentionId===m.uid))&&a.Ay.delete((0,d.Jv)("/apps/comments/notifications/{id}",{id:t.props.id})).catch((()=>{}))}const{default:p}=await Promise.all([n.e(4208),n.e(7462),n.e(3920)]).then(n.bind(n,93920)),v=c.Ay.extend(p);return i.map((e=>({_CommentsViewInstance:void 0,timestamp:(0,s.A)(e.props?.creationDateTime).toDate().getTime(),mount(o,{context:n,reload:r}){this._CommentsViewInstance=new v({el:o,parent:n,propsData:{comment:e,resourceId:t.id,reloadCallback:r}})},unmount(){this._CommentsViewInstance?.$destroy()}})))})),window.OCA.Activity.registerSidebarFilter((t=>"comments"!==t.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:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-message-reply-text" viewBox="0 0 24 24"><path d="M18,8H6V6H18V8M18,11H6V9H18V11M18,14H6V12H18V14M22,4A2,2 0 0,0 20,2H4A2,2 0 0,0 2,4V16A2,2 0 0,0 4,18H18L22,22V4Z" /></svg>',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(t,e,o){"use strict";o.d(e,{A:()=>n});const n=(0,o(35947).YK)().setApp("comments").detectUser().build()},35550(t,e,o){"use strict";o.d(e,{A:()=>d});var n=o(68680),r=o(17003),i=o(21777);const a=(0,n.UU)((0,r.e)()),s=t=>{a.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})};(0,i.zo)(s),s((0,i.do)());const d=a},17003(t,e,o){"use strict";o.d(e,{e:()=>r});var n=o(63814);const r=function(){return(0,n.dC)("dav/comments")}},42634(){},63779(){},77199(){},59169(){},86833(){}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={id:t,loaded:!1,exports:{}};return r[t].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<e.length;l++){for(var[o,n,r]=e[l],s=!0,d=0;d<o.length;d++)(!1&r||i>=r)&&Object.keys(a.O).every((t=>a.O[t](o[d])))?o.splice(d--,1):(s=!1,r<i&&(i=r));if(s){e.splice(l--,1);var c=n();void 0!==c&&(t=c)}}return t}r=r||0;for(var l=e.length;l>0&&e[l-1][2]>r;l--)e[l]=e[l-1];e[l]=[o,n,r]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,o)=>(a.f[o](t,e),e)),[])),a.u=t=>t+"-"+t+".js?v="+{256:"8da30012aeb0f023e7bd",3731:"03a157235c000f83910a",3920:"e9c98e3ed3d86308486e",4508:"d6117ecbd809cc086bd9",5528:"038ccce61ab067c13a0e",5862:"10fe36062cea7941d5a0",6329:"da6ad198a7ca85dde977",7462:"1175efdf300cbbf5bc0c",7471:"c2afd3e83467ce503d3e",8057:"eea84acac1f5f57ba80e"}[t],a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o={},n="nextcloud:",a.l=(t,e,r,i)=>{if(o[t])o[t].push(e);else{var s,d;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var u=c[l];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==n+r){s=u;break}}s||(d=!0,(s=document.createElement("script")).charset="utf-8",a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",n+r),s.src=t),o[t]=[e];var m=(e,n)=>{s.onerror=s.onload=null,clearTimeout(p);var r=o[t];if(delete o[t],s.parentNode&&s.parentNode.removeChild(s),r&&r.forEach((t=>t(n))),e)return e(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),d&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),a.j=2122,(()=>{var t;globalThis.importScripts&&(t=globalThis.location+"");var e=globalThis.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var o=e.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=o[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{a.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={2122:0};a.f.j=(e,o)=>{var n=a.o(t,e)?t[e]:void 0;if(0!==n)if(n)o.push(n[2]);else{var r=new Promise(((o,r)=>n=t[e]=[o,r]));o.push(n[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(o=>{if(a.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var r=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,n[1](s)}}),"chunk-"+e,e)}},a.O.j=e=>0===t[e];var e=(e,o)=>{var n,r,[i,s,d]=o,c=0;if(i.some((e=>0!==t[e]))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);if(d)var l=d(a)}for(e&&e(o);c<i.length;c++)r=i[c],a.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return a.O(l)},o=globalThis.webpackChunknextcloud=globalThis.webpackChunknextcloud||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),a.nc=void 0;var s=a.O(void 0,[4208],(()=>a(58040)));s=a.O(s)})();
//# sourceMappingURL=comments-comments-tab.js.map?v=30c15578dc25cde7ee02