comments-comments-tab.js 31 KB

123
  1. /*! For license information please see comments-comments-tab.js.LICENSE.txt */
  2. (()=>{var e,n,r,o={23165:(e,n,r)=>{"use strict";var o=r(92457),i=r(38613),s=r(51651),a=r(85471),c=r(96689),l=r(44719),u=r(68928);const p={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},h=t=>t.replace(/[[\]\\-]/g,"\\$&"),f=t=>t.join(""),d=(t,e)=>{const n=e;if("["!==t.charAt(n))throw new Error("not in a brace expression");const r=[],o=[];let i=n+1,s=!1,a=!1,c=!1,l=!1,u=n,d="";t:for(;i<t.length;){const e=t.charAt(i);if("!"!==e&&"^"!==e||i!==n+1){if("]"===e&&s&&!c){u=i+1;break}if(s=!0,"\\"!==e||c){if("["===e&&!c)for(const[e,[s,c,l]]of Object.entries(p))if(t.startsWith(e,i)){if(d)return["$.",!1,t.length-n,!0];i+=e.length,l?o.push(s):r.push(s),a=a||c;continue t}c=!1,d?(e>d?r.push(h(d)+"-"+h(e)):e===d&&r.push(h(e)),d="",i++):t.startsWith("-]",i+1)?(r.push(h(e+"-")),i+=2):t.startsWith("-",i+1)?(d=e,i+=2):(r.push(h(e)),i++)}else c=!0,i++}else l=!0,i++}if(u<i)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,t.length-n,!0];if(0===o.length&&1===r.length&&/^\\?.$/.test(r[0])&&!l){return[(g=2===r[0].length?r[0].slice(-1):r[0],g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,u-n,!1]}var g;const m="["+(l?"^":"")+f(r)+"]",b="["+(l?"":"^")+f(o)+"]";return[r.length&&o.length?"("+m+"|"+b+")":r.length?m:b,a,u-n,!0]};var g=r(65606),m=r(96763);const b=(t,e,n={})=>(U(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Y(e,n).match(t)),v=/^\*+([^+@!?\*\[\(]*)$/,y=t=>e=>!e.startsWith(".")&&e.endsWith(t),w=t=>e=>e.endsWith(t),O=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),j=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),x=/^\*+\.\*+$/,A=t=>!t.startsWith(".")&&t.includes("."),S=t=>"."!==t&&".."!==t&&t.includes("."),E=/^\.\*+$/,C=t=>"."!==t&&".."!==t&&t.startsWith("."),P=/^\*+$/,M=t=>0!==t.length&&!t.startsWith("."),$=t=>0!==t.length&&"."!==t&&".."!==t,L=/^\?+([^+@!?\*\[\(]*)?$/,T=([t,e=""])=>{const n=W([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},R=([t,e=""])=>{const n=_([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},N=([t,e=""])=>{const n=_([t]);return e?t=>n(t)&&t.endsWith(e):n},k=([t,e=""])=>{const n=W([t]);return e?t=>n(t)&&t.endsWith(e):n},W=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},_=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},I="object"==typeof g&&g?"object"==typeof g.env&&g.env&&g.env.__MINIMATCH_TESTING_PLATFORM__||g.platform:"posix";b.sep="win32"===I?"\\":"/";const z=Symbol("globstar **");b.GLOBSTAR=z;const V={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},F="[^/]",B=F+"*?",H=t=>t.split("").reduce(((t,e)=>(t[e]=!0,t)),{}),D=H("().*{}+?[]^$\\!"),G=H("[.(");b.filter=(t,e={})=>n=>b(n,t,e);const Z=(t,e={})=>Object.assign({},t,e);b.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return b;const e=b;return Object.assign(((n,r,o={})=>e(n,r,Z(t,o))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,Z(t,n))}static defaults(n){return e.defaults(Z(t,n)).Minimatch}},unescape:(n,r={})=>e.unescape(n,Z(t,r)),escape:(n,r={})=>e.escape(n,Z(t,r)),filter:(n,r={})=>e.filter(n,Z(t,r)),defaults:n=>e.defaults(Z(t,n)),makeRe:(n,r={})=>e.makeRe(n,Z(t,r)),braceExpand:(n,r={})=>e.braceExpand(n,Z(t,r)),match:(n,r,o={})=>e.match(n,r,Z(t,o)),sep:e.sep,GLOBSTAR:z})};const q=(t,e={})=>(U(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:u(t));b.braceExpand=q;const U=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};b.makeRe=(t,e={})=>new Y(t,e).makeRe(),b.match=(t,e,n={})=>{const r=new Y(e,n);return t=t.filter((t=>r.match(t))),r.options.nonull&&!t.length&&t.push(e),t};const X=/[?*]|[+@!]\(.*?\)|\[|\]/,K=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Y{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){U(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||I,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>m.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map(((t,e,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&X.test(t[2])||X.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(n)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,r),this.set=r.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const r=t[n];1===n&&""===r&&""===t[0]||"."!==r&&""!==r||(e=!0,t.splice(n,1),n--)}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const r=t[n-1];r&&"."!==r&&".."!==r&&"**"!==r&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let r=-1;for(;-1!==(r=n.indexOf("**",r+1));){let o=r;for(;"**"===n[o+1];)o++;o>r&&n.splice(r+1,o-r);let i=n[r+1];const s=n[r+2],a=n[r+3];if(".."!==i)continue;if(!s||"."===s||".."===s||!a||"."===a||".."===a)continue;e=!0,n.splice(r,1);const c=n.slice(0);c[r]="**",t.push(c),r--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const r=n[t];1===t&&""===r&&""===n[0]||"."!==r&&""!==r||(e=!0,n.splice(t,1),t--)}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let o=0;for(;-1!==(o=n.indexOf("..",o+1));){const t=n[o-1];if(t&&"."!==t&&".."!==t&&"**"!==t){e=!0;const t=1===o&&"**"===n[o+1]?["."]:[];n.splice(o-1,2,...t),0===n.length&&n.push(""),o-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const r=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);r&&(t[e]=r,t[n]=[])}return t.filter((t=>t.length))}partsMatch(t,e,n=!1){let r=0,o=0,i=[],s="";for(;r<t.length&&o<e.length;)if(t[r]===e[o])i.push("b"===s?e[o]:t[r]),r++,o++;else if(n&&"**"===t[r]&&e[o]===t[r+1])i.push(t[r]),r++;else if(n&&"**"===e[o]&&t[r]===e[o+1])i.push(e[o]),o++;else if("*"!==t[r]||!e[o]||!this.options.dot&&e[o].startsWith(".")||"**"===e[o]){if("*"!==e[o]||!t[r]||!this.options.dot&&t[r].startsWith(".")||"**"===t[r])return!1;if("a"===s)return!1;s="b",i.push(e[o]),r++,o++}else{if("b"===s)return!1;s="a",i.push(t[r]),r++,o++}return t.length===e.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let r=0;r<t.length&&"!"===t.charAt(r);r++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const r=this.options;if(this.isWindows){const n=""===t[0]&&""===t[1]&&"?"===t[2]&&"string"==typeof t[3]&&/^[a-z]:$/i.test(t[3]),r=""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3]);if(n&&r){const n=t[3],r=e[3];n.toLowerCase()===r.toLowerCase()&&(t[3]=r)}else if(r&&"string"==typeof t[0]){const n=e[3],r=t[0];n.toLowerCase()===r.toLowerCase()&&(e[3]=r,e=e.slice(3))}else if(n&&"string"==typeof e[0]){const n=t[3];n.toLowerCase()===e[0].toLowerCase()&&(e[0]=n,t=t.slice(3))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var i=0,s=0,a=t.length,c=e.length;i<a&&s<c;i++,s++){this.debug("matchOne loop");var l=e[s],u=t[i];if(this.debug(e,l,u),!1===l)return!1;if(l===z){this.debug("GLOBSTAR",[e,l,u]);var p=i,h=s+1;if(h===c){for(this.debug("** at the end");i<a;i++)if("."===t[i]||".."===t[i]||!r.dot&&"."===t[i].charAt(0))return!1;return!0}for(;p<a;){var f=t[p];if(this.debug("\nglobstar while",t,p,e,h,f),this.matchOne(t.slice(p),e.slice(h),n))return this.debug("globstar found match!",p,a,f),!0;if("."===f||".."===f||!r.dot&&"."===f.charAt(0)){this.debug("dot detected!",t,p,e,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!n||(this.debug("\n>>> no match, partial?",t,p,e,h),p!==a))}let o;if("string"==typeof l?(o=u===l,this.debug("string match",l,u,o)):(o=l.test(u),this.debug("pattern match",l,u,o)),!o)return!1}if(i===a&&s===c)return!0;if(i===a)return n;if(s===c)return i===a-1&&""===t[i];throw new Error("wtf?")}braceExpand(){return q(this.pattern,this.options)}parse(t){U(t);const e=this.options;if("**"===t)return z;if(""===t)return"";let n,r=null;(n=t.match(P))?r=e.dot?$:M:(n=t.match(v))?r=(e.nocase?e.dot?j:O:e.dot?w:y)(n[1]):(n=t.match(L))?r=(e.nocase?e.dot?R:T:e.dot?N:k)(n):(n=t.match(x))?r=e.dot?S:A:(n=t.match(E))&&(r=C);let o="",i=!1,s=!1;const a=[],c=[];let l,u=!1,p=!1,h="."===t.charAt(0),f=e.dot||h;const g=t=>"."===t.charAt(0)?"":e.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=()=>{if(u){switch(u){case"*":o+=B,i=!0;break;case"?":o+=F,i=!0;break;default:o+="\\"+u}this.debug("clearStateChar %j %j",u,o),u=!1}};for(let n,r=0;r<t.length&&(n=t.charAt(r));r++)if(this.debug("%s\t%s %s %j",t,r,o,n),s){if("/"===n)return!1;D[n]&&(o+="\\"),o+=n,s=!1}else switch(n){case"/":return!1;case"\\":m(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s\t%s %s %j <-- stateChar",t,r,o,n),this.debug("call clearStateChar %j",u),m(),u=n,e.noext&&m();continue;case"(":{if(!u){o+="\\(";continue}const e={type:u,start:r-1,reStart:o.length,open:V[u].open,close:V[u].close};this.debug(this.pattern,"\t",e),a.push(e),o+=e.open,0===e.start&&"!"!==e.type&&(h=!0,o+=g(t.slice(r+1))),this.debug("plType %j %j",u,o),u=!1;continue}case")":{const t=a[a.length-1];if(!t){o+="\\)";continue}a.pop(),m(),i=!0,l=t,o+=l.close,"!"===l.type&&c.push(Object.assign(l,{reEnd:o.length}));continue}case"|":{const e=a[a.length-1];if(!e){o+="\\|";continue}m(),o+="|",0===e.start&&"!"!==e.type&&(h=!0,o+=g(t.slice(r+1)));continue}case"[":m();const[f,b,v,y]=d(t,r);v?(o+=f,p=p||b,r+=v-1,i=i||y):o+="\\[";continue;case"]":o+="\\"+n;continue;default:m(),o+=K(n)}for(l=a.pop();l;l=a.pop()){let t;t=o.slice(l.reStart+l.open.length),this.debug(this.pattern,"setting tail",o,l),t=t.replace(/((?:\\{2}){0,64})(\\?)\|/g,((t,e,n)=>(n||(n="\\"),e+e+n+"|"))),this.debug("tail=%j\n %s",t,t,l,o);const e="*"===l.type?B:"?"===l.type?F:"\\"+l.type;i=!0,o=o.slice(0,l.reStart)+e+"\\("+t}m(),s&&(o+="\\\\");const b=G[o.charAt(0)];for(let t=c.length-1;t>-1;t--){const e=c[t],n=o.slice(0,e.reStart),r=o.slice(e.reStart,e.reEnd-8);let i=o.slice(e.reEnd);const s=o.slice(e.reEnd-8,e.reEnd)+i,a=n.split(")").length,l=n.split("(").length-a;let u=i;for(let t=0;t<l;t++)u=u.replace(/\)[+*?]?/,"");i=u,o=n+r+i+(""===i?"(?:$|\\/)":"")+s}if(""!==o&&i&&(o="(?=.)"+o),b&&(o=(h?"":f?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)")+o),!e.nocase||i||e.nocaseMagicOnly||(i=t.toUpperCase()!==t.toLowerCase()),!i)return o.replace(/\\(.)/g,"$1");const W=(e.nocase?"i":"")+(p?"u":"");try{const e=r?{_glob:t,_src:o,test:r}:{_glob:t,_src:o};return Object.assign(new RegExp("^"+o+"$",W),e)}catch(t){return this.debug("invalid regexp",t),new RegExp("$.")}}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?B:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=e.nocase?"i":"";let o=t.map((t=>{const e=t.map((t=>"string"==typeof t?K(t):t===z?z:t._src));return e.forEach(((t,r)=>{const o=e[r+1],i=e[r-1];t===z&&i!==z&&(void 0===i?void 0!==o&&o!==z?e[r+1]="(?:\\/|"+n+"\\/)?"+o:e[r]=n:void 0===o?e[r-1]=i+"(?:\\/|"+n+")?":o!==z&&(e[r-1]=i+"(?:\\/|\\/"+n+"\\/)"+o,e[r+1]=z))})),e.filter((t=>t!==z)).join("/")})).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,r)}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const r=this.slashSplit(t);this.debug(this.pattern,"split",r);const o=this.set;this.debug(this.pattern,"set",o);let i=r[r.length-1];if(!i)for(let t=r.length-2;!i&&t>=0;t--)i=r[t];for(let t=0;t<o.length;t++){const s=o[t];let a=r;if(n.matchBase&&1===s.length&&(a=[i]),this.matchOne(a,s,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return b.defaults(t).Minimatch}}b.Minimatch=Y,b.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),b.unescape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var J,Q=r(79605),tt=r(12692);r(86454),r(26602),Error,function(t){t.Array="array",t.Object="object",t.Original="original"}(J||(J={}));var et=r(35550);const nt=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{multistatus:{response:n}}=t;return n.map((t=>{const{propstat:{prop:n}}=t;return function(t,e,n=!1){const{getlastmodified:r=null,getcontentlength:o="0",resourcetype:i=null,getcontenttype:s=null,getetag:a=null}=t,c=i&&"object"==typeof i&&void 0!==i.collection?"directory":"file",l={filename:e,basename:tt.basename(e),lastmod:r,size:parseInt(o,10),type:c,etag:"string"==typeof a?a.replace(/"/g,""):null};return"file"===c&&(l.mime=s&&"string"==typeof s?s.split(";")[0]:""),n&&(l.props=t),l}(n,n.id.toString(),e)}))};let rt,ot;var it;if(r.nc=btoa((0,o.do)()),(0,i.C)("comments","activityEnabled",!1)&&void 0!==(null===(it=OCA)||void 0===it||null===(it=it.Activity)||void 0===it?void 0:it.registerSidebarAction))window.addEventListener("DOMContentLoaded",(function(){window.OCA.Activity.registerSidebarAction({mount:async(t,e)=>{let{context:n,fileInfo:o,reload:i}=e;if(!rt){const{default:t}=await Promise.all([r.e(4208),r.e(7462),r.e(2913)]).then(r.bind(r,72913));rt=a.Ay.extend(t)}ot=new rt({parent:n,propsData:{reloadCallback:i,resourceId:o.id}}),ot.$mount(t),c.A.info("Comments plugin mounted in Activity sidebar action",{fileInfo:o})},unmount:()=>{ot&&ot.$destroy()}}),window.OCA.Activity.registerSidebarEntries((async t=>{let{fileInfo:e,limit:n,offset:o}=t;const{data:i}=await async function(t,e){var n;let{resourceType:r,resourceId:o}=t;const i=["",r,o].join("/"),s=e.datetime?"<oc:datetime>".concat(e.datetime.toISOString(),"</oc:datetime>"):"",a=await et.A.customRequest(i,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>'.concat(null!==(n=e.limit)&&void 0!==n?n:20,"</oc:limit>\n\t\t\t\t<oc:offset>").concat(e.offset||0,"</oc:offset>\n\t\t\t\t").concat(s,"\n\t\t\t</oc:filter-comments>")},e)),c=await a.text(),u=await(0,l.h4)(c);return function(t,e,n=!1){return n?{data:e,headers:t.headers?(0,Q.N)(t.headers):{},status:t.status,statusText:t.statusText}:e}(a,nt(u,!0),!0)}({resourceType:"files",resourceId:e.id},{limit:n,offset:o});c.A.debug("Loaded comments",{fileInfo:e,comments:i});const{default:u}=await Promise.all([r.e(4208),r.e(7462),r.e(5632)]).then(r.bind(r,25632)),p=a.Ay.extend(u);return i.map((t=>({timestamp:(0,s.A)(t.props.creationDateTime).toDate().getTime(),mount(n,r){let{context:o,reload:i}=r;this._CommentsViewInstance=new p({parent:o,propsData:{comment:t,resourceId:e.id,reloadCallback:i}}),this._CommentsViewInstance.$mount(n)},unmount(){this._CommentsViewInstance.$destroy()}})))})),window.OCA.Activity.registerSidebarFilter((t=>"comments"!==t.type)),c.A.info("Comments plugin registered for Activity sidebar action")}));else{let e=null;const n=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,n,r){e&&e.$destroy(),e=new OCA.Comments.View("files",{parent:r}),await e.update(n.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(n)}))}},96689:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r=(0,n(53529).YK)().setApp("comments").detectUser().build()},35550:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r,o=n(44719),i=n(17003),s=n(92457);const a=(0,o.UU)((0,i.e)(),{headers:{"X-Requested-With":"XMLHttpRequest",requesttoken:null!==(r=(0,s.do)())&&void 0!==r?r:""}})},17003:(t,e,n)=>{"use strict";n.d(e,{e:()=>o});var r=n(99498);const o=function(){return(0,r.dC)("dav/comments")}},8505:t=>{"use strict";function e(t,e,o){t instanceof RegExp&&(t=n(t,o)),e instanceof RegExp&&(e=n(e,o));var i=r(t,e,o);return i&&{start:i[0],end:i[1],pre:o.slice(0,i[0]),body:o.slice(i[0]+t.length,i[1]),post:o.slice(i[1]+e.length)}}function n(t,e){var n=e.match(t);return n?n[0]:null}function r(t,e,n){var r,o,i,s,a,c=n.indexOf(t),l=n.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(r=[],i=n.length;u>=0&&!a;)u==c?(r.push(u),c=n.indexOf(t,u+1)):1==r.length?a=[r.pop(),l]:((o=r.pop())<i&&(i=o,s=l),l=n.indexOf(e,u+1)),u=c<l&&c>=0?c:l;r.length&&(a=[i,s])}return a}t.exports=e,e.range=r},68928:(t,e,n)=>{var r=n(8505);t.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),m(function(t){return t.split("\\\\").join(o).split("\\{").join(i).split("\\}").join(s).split("\\,").join(a).split("\\.").join(c)}(t),!0).map(u)):[]};var o="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",c="\0PERIOD"+Math.random()+"\0";function l(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function u(t){return t.split(o).join("\\").split(i).join("{").split(s).join("}").split(a).join(",").split(c).join(".")}function p(t){if(!t)return[""];var e=[],n=r("{","}",t);if(!n)return t.split(",");var o=n.pre,i=n.body,s=n.post,a=o.split(",");a[a.length-1]+="{"+i+"}";var c=p(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}function h(t){return"{"+t+"}"}function f(t){return/^-?0\d/.test(t)}function d(t,e){return t<=e}function g(t,e){return t>=e}function m(t,e){var n=[],o=r("{","}",t);if(!o)return[t];var i=o.pre,a=o.post.length?m(o.post,!1):[""];if(/\$$/.test(o.pre))for(var c=0;c<a.length;c++){var u=i+"{"+o.body+"}"+a[c];n.push(u)}else{var b,v,y=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),w=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),O=y||w,j=o.body.indexOf(",")>=0;if(!O&&!j)return o.post.match(/,.*\}/)?m(t=o.pre+"{"+o.body+s+o.post):[t];if(O)b=o.body.split(/\.\./);else if(1===(b=p(o.body)).length&&1===(b=m(b[0],!1).map(h)).length)return a.map((function(t){return o.pre+b[0]+t}));if(O){var x=l(b[0]),A=l(b[1]),S=Math.max(b[0].length,b[1].length),E=3==b.length?Math.abs(l(b[2])):1,C=d;A<x&&(E*=-1,C=g);var P=b.some(f);v=[];for(var M=x;C(M,A);M+=E){var $;if(w)"\\"===($=String.fromCharCode(M))&&($="");else if($=String(M),P){var L=S-$.length;if(L>0){var T=new Array(L+1).join("0");$=M<0?"-"+T+$.slice(1):T+$}}v.push($)}}else{v=[];for(var R=0;R<b.length;R++)v.push.apply(v,m(b[R],!1))}for(R=0;R<v.length;R++)for(c=0;c<a.length;c++)u=i+v[R]+a[c],(!e||O||u)&&n.push(u)}return n}},86454:(t,e,n)=>{"use strict";const r=n(43918),o=n(32923),i=n(8904);t.exports={XMLParser:o,XMLValidator:r,XMLBuilder:i}},26602:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){var e="function"==typeof Map?new Map:void 0;return n=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,s)}function s(){return r(t,arguments,i(this).constructor)}return s.prototype=Object.create(t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),o(s,t)},n(t)}function r(t,e,n){return r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&o(i,n.prototype),i},r.apply(null,arguments)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}var s=function(t){function n(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(r=function(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):n}(this,i(n).call(this,t))).name="ObjectPrototypeMutationError",r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(n,t),n}(n(Error));function a(t,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},o=n.split("."),i=o.length,s=function(e){var n=o[e];if(!t)return{v:void 0};if("+"===n){if(Array.isArray(t))return{v:t.map((function(n,i){var s=o.slice(e+1);return s.length>0?a(n,s.join("."),r):r(t,i,o,e)}))};var i=o.slice(0,e).join(".");throw new Error("Object at wildcard (".concat(i,") is not an array"))}t=r(t,n,o,e)},c=0;c<i;c++){var l=s(c);if("object"===e(l))return l.v}return t}function c(t,e){return t.length===e+1}t.exports={set:function(t,n,r){if("object"!=e(t)||null===t)return t;if(void 0===n)return t;if("number"==typeof n)return t[n]=r,t[n];try{return a(t,n,(function(t,e,n,o){if(t===Reflect.getPrototypeOf({}))throw new s("Attempting to mutate Object.prototype");if(!t[e]){var i=Number.isInteger(Number(n[o+1])),a="+"===n[o+1];t[e]=i||a?[]:{}}return c(n,o)&&(t[e]=r),t[e]}))}catch(e){if(e instanceof s)throw e;return t}},get:function(t,n){if("object"!=e(t)||null===t)return t;if(void 0===n)return t;if("number"==typeof n)return t[n];try{return a(t,n,(function(t,e){return t[e]}))}catch(e){return t}},has:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!=e(t)||null===t)return!1;if(void 0===n)return!1;if("number"==typeof n)return n in t;try{var o=!1;return a(t,n,(function(t,e,n,i){if(!c(n,i))return t&&t[e];o=r.own?t.hasOwnProperty(e):e in t})),o}catch(t){return!1}},hasOwn:function(t,e,n){return this.has(t,e,n||{own:!0})},isIn:function(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("object"!=e(t)||null===t)return!1;if(void 0===n)return!1;try{var i=!1,s=!1;return a(t,n,(function(t,n,o,a){return i=i||t===r||!!t&&t[n]===r,s=c(o,a)&&"object"===e(t)&&n in t,t&&t[n]})),o.validPath?i&&s:i}catch(t){return!1}},ObjectPrototypeMutationError:s}},12692:(t,e,n)=>{"use strict";var r=n(65606),o=n(40537),i=function(t){return"string"==typeof t};function s(t,e){for(var n=[],r=0;r<t.length;r++){var o=t[r];o&&"."!==o&&(".."===o?n.length&&".."!==n[n.length-1]?n.pop():e&&n.push(".."):n.push(o))}return n}var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,c={};function l(t){return a.exec(t).slice(1)}c.resolve=function(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var o=n>=0?arguments[n]:r.cwd();if(!i(o))throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,e="/"===o.charAt(0))}return(e?"/":"")+(t=s(t.split("/"),!e).join("/"))||"."},c.normalize=function(t){var e=c.isAbsolute(t),n="/"===t.substr(-1);return(t=s(t.split("/"),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t},c.isAbsolute=function(t){return"/"===t.charAt(0)},c.join=function(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];if(!i(n))throw new TypeError("Arguments to path.join must be strings");n&&(t+=t?"/"+n:n)}return c.normalize(t)},c.relative=function(t,e){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n+1)}t=c.resolve(t).substr(1),e=c.resolve(e).substr(1);for(var r=n(t.split("/")),o=n(e.split("/")),i=Math.min(r.length,o.length),s=i,a=0;a<i;a++)if(r[a]!==o[a]){s=a;break}var l=[];for(a=s;a<r.length;a++)l.push("..");return(l=l.concat(o.slice(s))).join("/")},c._makeLong=function(t){return t},c.dirname=function(t){var e=l(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},c.basename=function(t,e){var n=l(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},c.extname=function(t){return l(t)[3]},c.format=function(t){if(!o.isObject(t))throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof t);var e=t.root||"";if(!i(e))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof t.root);return(t.dir?t.dir+c.sep:"")+(t.base||"")},c.parse=function(t){if(!i(t))throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=l(t);if(!e||4!==e.length)throw new TypeError("Invalid path '"+t+"'");return e[1]=e[1]||"",e[2]=e[2]||"",e[3]=e[3]||"",{root:e[0],dir:e[0]+e[1].slice(0,e[1].length-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},c.sep="/",c.delimiter=":",t.exports=c}},i={};function s(t){var e=i[t];if(void 0!==e)return e.exports;var n=i[t]={id:t,loaded:!1,exports:{}};return o[t].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=o,e=[],s.O=(t,n,r,o)=>{if(!n){var i=1/0;for(u=0;u<e.length;u++){n=e[u][0],r=e[u][1],o=e[u][2];for(var a=!0,c=0;c<n.length;c++)(!1&o||i>=o)&&Object.keys(s.O).every((t=>s.O[t](n[c])))?n.splice(c--,1):(a=!1,o<i&&(i=o));if(a){e.splice(u--,1);var l=r();void 0!==l&&(t=l)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,n)=>(s.f[n](t,e),e)),[])),s.u=t=>t+"-"+t+".js?v="+{2913:"1ccb2adaaea884424d3c",3747:"bb4bbdf7802c276cc6d5",5528:"a811fe13115fafc1fa2e",5632:"f16542372833977f05d1",5662:"d1f20e62402d8be29948",7462:"c694a3e8612f892fcd21"}[t],s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},r="nextcloud:",s.l=(t,e,o,i)=>{if(n[t])n[t].push(e);else{var a,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var p=l[u];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+o){a=p;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+o),a.src=t),n[t]=[e];var h=(e,r)=>{a.onerror=a.onload=null,clearTimeout(f);var o=n[t];if(delete n[t],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((t=>t(r))),e)return e(r)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=2122,(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=n[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{s.b=document.baseURI||self.location.href;var t={2122:0};s.f.j=(e,n)=>{var r=s.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=t[e]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(e),a=new Error;s.l(i,(n=>{if(s.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+e,e)}},s.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,i=n[0],a=n[1],c=n[2],l=0;if(i.some((e=>0!==t[e]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(c)var u=c(s)}for(e&&e(n);l<i.length;l++)o=i[l],s.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return s.O(u)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),s.nc=void 0;var a=s.O(void 0,[4208],(()=>s(23165)));a=s.O(a)})();
  3. //# sourceMappingURL=comments-comments-tab.js.map?v=9ec6c5148bae5fc769bb