nextcloud/dist/comments-init.js
Ferdinand Thiessen e3068bfe6b
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-02-06 11:46:47 +01:00

2 lines
No EOL
7.2 KiB
JavaScript

(()=>{var e,n={39224(e,n,i){"use strict";var t=i(380),r=i(36520),o=i(20005),a=i(53334);class d extends t.m{}const s=Object.freeze({DEFAULT:"default",HIDDEN:"hidden"});t.m,Object.freeze({UploadFromDevice:0,CreateNew:1,Other:2});class c{get#e(){return window.OCA?.Files?._sidebar?.()}get available(){return!!this.#e}get isOpen(){return this.#e?.isOpen??!1}get activeTab(){return this.#e?.activeTab}get node(){return this.#e?.node}open(e,n){this.#e?.open(e,n)}close(){this.#e?.close()}setActiveTab(e){this.#e?.setActiveTab(e)}registerTab(e){!function(e){!function(e){if("object"!=typeof e)throw new Error("Sidebar tab is not an object");if(!e.id||"string"!=typeof e.id||e.id!==CSS.escape(e.id))throw new Error("Sidebar tabs need to have an id conforming to the HTML id attribute specifications");if(!e.tagName||"string"!=typeof e.tagName)throw new Error("Sidebar tabs need to have the tagName name set");if(!e.tagName.match(/^[a-z][a-z0-9-_]+$/))throw new Error('Sidebar tab "tagName" is invalid');if(!e.displayName||"string"!=typeof e.displayName)throw new Error("Sidebar tabs need to have a name set");if("string"!=typeof e.iconSvgInline||!(0,o.A)(e.iconSvgInline))throw new Error("Sidebar tabs need to have an valid SVG icon");if("number"!=typeof e.order)throw new Error("Sidebar tabs need to have a numeric order set");if(e.enabled&&"function"!=typeof e.enabled)throw new Error('Sidebar tab "enabled" is not a function');if(e.onInit&&"function"!=typeof e.onInit)throw new Error('Sidebar tab "onInit" is not a function')}(e),window._nc_files_sidebar_tabs??=new Map,window._nc_files_sidebar_tabs.has(e.id)?r.l.warn(`Sidebar tab with id "${e.id}" already registered. Skipping.`):(window._nc_files_sidebar_tabs.set(e.id,e),r.l.debug(`New sidebar tab with id "${e.id}" registered.`))}(e)}getTabs(e){return this.#e?.getTabs(e)??[]}getActions(e){return this.#e?.getActions(e)??[]}registerAction(e){!function(e){!function(e){if("object"!=typeof e)throw new Error("Sidebar action is not an object");if(!e.id||"string"!=typeof e.id||e.id!==CSS.escape(e.id))throw new Error("Sidebar actions need to have an id conforming to the HTML id attribute specifications");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Sidebar actions need to have a displayName function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Sidebar actions need to have a iconSvgInline function");if(!e.enabled||"function"!=typeof e.enabled)throw new Error("Sidebar actions need to have an enabled function");if(!e.onClick||"function"!=typeof e.onClick)throw new Error("Sidebar actions need to have an onClick function")}(e),window._nc_files_sidebar_actions??=new Map,window._nc_files_sidebar_actions.has(e.id)?r.l.warn(`Sidebar action with id "${e.id}" already registered. Skipping.`):(window._nc_files_sidebar_actions.set(e.id,e),r.l.debug(`New sidebar action with id "${e.id}" registered.`))}(e)}}Object.freeze({ReservedName:"reserved name",Character:"character",Extension:"extension"}),Error,Object.freeze({Name:"basename",Modified:"mtime",Size:"size"});const l=(0,i(35947).YK)().setApp("comments").detectUser().build();var f;(function(e){if(!e.id||"string"!=typeof e.id)throw new Error("Invalid id");if(!e.displayName||"function"!=typeof e.displayName)throw new Error("Invalid displayName function");if("title"in e&&"function"!=typeof e.title)throw new Error("Invalid title function");if(!e.iconSvgInline||"function"!=typeof e.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!e.exec||"function"!=typeof e.exec)throw new Error("Invalid exec function");if("enabled"in e&&"function"!=typeof e.enabled)throw new Error("Invalid enabled function");if("execBatch"in e&&"function"!=typeof e.execBatch)throw new Error("Invalid execBatch function");if("order"in e&&"number"!=typeof e.order)throw new Error("Invalid order");if(void 0!==e.destructive&&"boolean"!=typeof e.destructive)throw new Error("Invalid destructive flag");if("parent"in e&&"string"!=typeof e.parent)throw new Error("Invalid parent");if(e.default&&!Object.values(s).includes(e.default))throw new Error("Invalid default");if("inline"in e&&"function"!=typeof e.inline)throw new Error("Invalid inline function");if("renderInline"in e&&"function"!=typeof e.renderInline)throw new Error("Invalid renderInline function");if("hotkey"in e&&void 0!==e.hotkey){if("object"!=typeof e.hotkey)throw new Error("Invalid hotkey configuration");if("string"!=typeof e.hotkey.key||!e.hotkey.key)throw new Error("Missing or invalid hotkey key");if("string"!=typeof e.hotkey.description||!e.hotkey.description)throw new Error("Missing or invalid hotkey description")}})(f={id:"comments-unread",title({nodes:e}){const n=e[0]?.attributes["comments-unread"];return"number"==typeof n&&n>=0?(0,a.n)("comments","1 new comment","{unread} new comments",n,{unread:n}):(0,a.t)("comments","Comment")},displayName:()=>"",iconSvgInline:()=>'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-comment-processing" viewBox="0 0 24 24"><path d="M9,22A1,1 0 0,1 8,21V18H4A2,2 0 0,1 2,16V4C2,2.89 2.9,2 4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H13.9L10.2,21.71C10,21.9 9.75,22 9.5,22V22H9M17,11V9H15V11H17M13,11V9H11V11H13M9,11V9H7V11H9Z" /></svg>',enabled({nodes:e}){const n=e[0]?.attributes?.["comments-unread"];return"number"==typeof n&&n>0},async exec({nodes:e}){if(1!==e.length||!e[0])return!1;try{return(new c).open(e[0],"comments"),null}catch(e){return l.error("Error while opening sidebar",{error:e}),!1}},inline:()=>!0,order:-140}),window._nc_fileactions??=[],window._nc_fileactions.find(e=>e.id===f.id)?r.l.error(`FileAction ${f.id} already registered`,{action:f}):(window._nc_fileactions.push(f),(window._nc_files_registry_v4??=new d,window._nc_files_registry_v4).dispatchTypedEvent("register:action",new CustomEvent("register:action",{detail:f})))},63779(){},77199(){}},i={};function t(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=n,e=[],t.O=(n,i,r,o)=>{if(!i){var a=1/0;for(l=0;l<e.length;l++){for(var[i,r,o]=e[l],d=!0,s=0;s<i.length;s++)(!1&o||a>=o)&&Object.keys(t.O).every(e=>t.O[e](i[s]))?i.splice(s--,1):(d=!1,o<a&&(a=o));if(d){e.splice(l--,1);var c=r();void 0!==c&&(n=c)}}return n}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[i,r,o]},t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.e=()=>Promise.resolve(),t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.j=3260,(()=>{t.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={3260:0};t.O.j=n=>0===e[n];var n=(n,i)=>{var r,o,[a,d,s]=i,c=0;if(a.some(n=>0!==e[n])){for(r in d)t.o(d,r)&&(t.m[r]=d[r]);if(s)var l=s(t)}for(n&&n(i);c<a.length;c++)o=a[c],t.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return t.O(l)},i=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];i.forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i))})(),t.nc=void 0;var r=t.O(void 0,[4208],()=>t(39224));r=t.O(r)})();
//# sourceMappingURL=comments-init.js.map?v=ef151a647c8cb38b9e8c