Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/notifications-main.js')
-rw-r--r--js/notifications-main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/notifications-main.js b/js/notifications-main.js
index 4afa47d..2af6fc5 100644
--- a/js/notifications-main.js
+++ b/js/notifications-main.js
@@ -315,7 +315,7 @@ var r=n(668),a=n(669),o=n(670);function i(){return l.TYPED_ARRAY_SUPPORT?2147483
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
-t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";n(72),Object.defineProperty(e,"__esModule",{value:!0}),e.loadState=function(t,e,n){var r=document.querySelector("#initial-state-".concat(t,"-").concat(e));if(null===r){if(void 0!==n)return n;throw new Error("Could not find initial state ".concat(e," of ").concat(t))}try{return JSON.parse(atob(r.value))}catch(n){throw new Error("Could not parse initial state ".concat(e," of ").concat(t))}}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,o=a&&!r.call({1:2},1);e.f=o?function(t){var e=a(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(16),a=n(36),o=r.document,i=a(o)&&a(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(16),a=n(92),o=n(48),i=n(147),s=n(391),l=n(730),u=l.get,c=l.enforce,d=String(String).split("String");(t.exports=function(t,e,n,s){var l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||a(n,"name",e),c(n).source=d.join("string"==typeof e?e:"")),t!==r?(l?!p&&t[e]&&(u=!0):delete t[e],u?t[e]=n:a(t,e,n)):u?t[e]=n:i(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},function(t,e,n){var r,a,o,i=n(731),s=n(16),l=n(36),u=n(92),c=n(48),d=n(732),p=n(396),f=s.WeakMap;if(i){var m=new f,h=m.get,_=m.has,A=m.set;r=function(t,e){return A.call(m,t,e),e},a=function(t){return h.call(m,t)||{}},o=function(t){return _.call(m,t)}}else{var g=d("state");p[g]=!0,r=function(t,e){return u(t,g,e),e},a=function(t){return c(t,g)?t[g]:{}},o=function(t){return c(t,g)}}t.exports={set:r,get:a,has:o,enforce:function(t){return o(t)?a(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=a(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(16),a=n(391),o=r.WeakMap;t.exports="function"==typeof o&&/native code/.test(a(o))},function(t,e,n){var r=n(393),a=n(395),o=r("keys");t.exports=function(t){return o[t]||(o[t]=a(t))}},function(t,e,n){var r=n(48),a=n(734),o=n(140),i=n(146);t.exports=function(t,e){for(var n=a(e),s=i.f,l=o.f,u=0;u<n.length;u++){var c=n[u];r(t,c)||s(t,c,l(e,c))}}},function(t,e,n){var r=n(397),a=n(736),o=n(739),i=n(390);t.exports=r("Reflect","ownKeys")||function(t){var e=a.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(16);t.exports=r},function(t,e,n){var r=n(398),a=n(400).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,a)}},function(t,e,n){var r=n(142),a=n(93),o=n(738),i=function(t){return function(e,n,i){var s,l=r(e),u=a(l.length),c=o(i,u);if(t&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}};t.exports={includes:i(!0),indexOf:i(!1)}},function(t,e,n){var r=n(399),a=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?a(n+e,0):o(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(18),a=/#|\.prototype\./,o=function(t,e){var n=s[i(t)];return n==u||n!=l&&("function"==typeof e?r(e):!!e)},i=o.normalize=function(t){return String(t).replace(a,".").toLowerCase()},s=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},function(t,e,n){var r=n(742);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,a){return t.call(e,n,r,a)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(404);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(397);t.exports=r("navigator","userAgent")||""},function(t,e,n){var r=n(398),a=n(400);t.exports=Object.keys||function(t){return r(t,a)}},function(t,e,n){var r=n(747);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(36),a=n(143),o=n(64)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==a(t))}},function(t,e,n){var r=n(64)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,a=(r=n(409))&&r.__esModule?r:{default:r};function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"appId",void 0),i(this,"persisted",!1),i(this,"clearedOnLogout",!1),this.appId=e}var e,n,r;return e=t,(n=[{key:"persist",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.persisted=t,this}},{key:"clearOnLogout",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.clearedOnLogout=t,this}},{key:"build",value:function(){return new a.default(this.appId,this.persisted?window.localStorage:window.sessionStorage,!this.clearedOnLogout)}}])&&o(e.prototype,n),r&&o(e,r),t}();e.default=s},function(t,e,n){"use strict";var r=n(63),a=n(18),o=n(403),i=n(36),s=n(148),l=n(93),u=n(751),c=n(402),d=n(149),p=n(64),f=n(405),m=p("isConcatSpreadable"),h=f>=51||!a((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),_=d("concat"),A=function(t){if(!i(t))return!1;var e=t[m];return void 0!==e?!!e:o(t)};r({target:"Array",proto:!0,forced:!h||!_},{concat:function(t){var e,n,r,a,o,i=s(this),d=c(i,0),p=0;for(e=-1,r=arguments.length;e<r;e++)if(A(o=-1===e?i:arguments[e])){if(p+(a=l(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,p++)n in o&&u(d,p,o[n])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");u(d,p++,o)}return d.length=p,d}})},function(t,e,n){"use strict";var r=n(145),a=n(146),o=n(141);t.exports=function(t,e,n){var i=r(e);i in t?a.f(t,i,o(0,n)):t[i]=n}},function(t,e,n){"use strict";var r=n(2),a=n(753),o=n(24),i=n(9),s=n(42),l=n(70);r({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=o(this),n=i(e.length),r=l(e,0);return r.length=a(r,e,e,n,0,void 0===t?1:s(t)),r}})},function(t,e,n){"use strict";var r=n(71),a=n(9),o=n(31),i=function(t,e,n,s,l,u,c,d){for(var p,f=l,m=0,h=!!c&&o(c,d,3);m<s;){if(m in n){if(p=h?h(n[m],m,e):n[m],u>0&&r(p))f=i(t,e,p,a(p.length),f,u-1)-1;else{if(f>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[f]=p}f++}m++}return f};t.exports=i},function(t,e,n){n(111)("flat")},function(t,e,n){var r=n(12),a=n(3),o=n(52),i=n(116),s=n(15).f,l=n(101).f,u=n(133),c=n(129),d=n(206),p=n(13),f=n(1),m=n(26).set,h=n(118),_=n(4)("match"),A=a.RegExp,g=A.prototype,v=/a/g,y=/a/g,b=new A(v)!==v,w=d.UNSUPPORTED_Y;if(r&&o("RegExp",!b||w||f((function(){return y[_]=!1,A(v)!=v||A(y)==y||"/a/i"!=A(v,"i")})))){for(var M=function(t,e){var n,r=this instanceof M,a=u(t),o=void 0===e;if(!r&&a&&t.constructor===M&&o)return t;b?a&&!o&&(t=t.source):t instanceof M&&(o&&(e=c.call(t)),t=t.source),w&&(n=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var s=i(b?new A(t,e):A(t,e),r?this:g,M);return w&&n&&m(s,{sticky:n}),s},x=function(t){t in M||s(M,t,{configurable:!0,get:function(){return A[t]},set:function(e){A[t]=e}})},L=l(A),T=0;L.length>T;)x(L[T++]);g.constructor=M,M.prototype=g,p(a,"RegExp",M)}h("RegExp")},function(t,e,n){"use strict";var r=n(130),a=n(5),o=n(9),i=n(22),s=n(131),l=n(132);r("match",1,(function(t,e,n){return[function(e){var n=i(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var i=a(t),u=String(this);if(!i.global)return l(i,u);var c=i.unicode;i.lastIndex=0;for(var d,p=[],f=0;null!==(d=l(i,u));){var m=String(d[0]);p[f]=m,""===m&&(i.lastIndex=s(u,o(i.lastIndex),c)),f++}return 0===f?null:p}]}))},function(t,e,n){"use strict";var r=n(2),a=n(76).codeAt;r({target:"String",proto:!0},{codePointAt:function(t){return a(this,t)}})},function(t,e,n){var r=n(2),a=n(68),o=String.fromCharCode,i=String.fromCodePoint;r({target:"String",stat:!0,forced:!!i&&1!=i.length},{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,i=0;r>i;){if(e=+arguments[i++],a(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";n(410)},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o)()(a.a);i.push([t.i,".mention[data-v-0fd54af1]{display:contents;white-space:nowrap}\n","",{version:3,sources:["webpack://./src/Components/Parameters/User.vue"],names:[],mappings:"AAwEA,0BACC,gBAAiB,CACjB,kBAAmB",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.mention {\n\tdisplay: contents;\n\twhite-space: nowrap;\n}\n"],sourceRoot:""}]),e.default=i},function(t,e,n){"use strict";n(411)},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o)()(a.a);i.push([t.i,"[data-v-5c9d3bb9] .rich-text--wrapper{white-space:pre-wrap;word-break:break-word}\n","",{version:3,sources:["webpack://./src/Components/Notification.vue"],names:[],mappings:"AAiSA,sCACC,oBAAqB,CACrB,qBAAsB",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n::v-deep .rich-text--wrapper {\n\twhite-space: pre-wrap;\n\tword-break: break-word;\n}\n"],sourceRoot:""}]),e.default=i},function(t,e,n){"use strict";n(412)},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o)()(a.a);i.push([t.i,"\n.fade-enter-active[data-v-ce8f06d2],\n.fade-leave-active[data-v-ce8f06d2],\n.fade-collapse-enter-active[data-v-ce8f06d2],\n.fade-collapse-leave-active[data-v-ce8f06d2] {\n\ttransition: opacity var(--animation-quick), max-height var(--animation-quick);\n}\n.fade-collapse-enter[data-v-ce8f06d2],\n.fade-collapse-leave-to[data-v-ce8f06d2] {\n\topacity: 0;\n\tmax-height: 0;\n}\n.fade-enter[data-v-ce8f06d2],\n.fade-leave-to[data-v-ce8f06d2] {\n\topacity: 0;\n}\n","",{version:3,sources:["webpack://./src/App.vue"],names:[],mappings:";AAkVA;;;;CAIA,6EAAA;AACA;AAEA;;CAEA,UAAA;CACA,aAAA;AACA;AAEA;;CAEA,UAAA;AACA",sourcesContent:["<template>\n\t<div v-if=\"!shutdown\" class=\"notifications\">\n\t\t<div ref=\"button\"\n\t\t\tclass=\"notifications-button menutoggle\"\n\t\t\t:class=\"{ hasNotifications: notifications.length }\"\n\t\t\ttabindex=\"0\"\n\t\t\trole=\"button\"\n\t\t\t:aria-label=\"t('notifications', 'Notifications')\"\n\t\t\taria-haspopup=\"true\"\n\t\t\taria-controls=\"notification-container\"\n\t\t\taria-expanded=\"false\"\n\t\t\t@click=\"requestWebNotificationPermissions\">\n\t\t\t<img ref=\"icon\"\n\t\t\t\tclass=\"svg\"\n\t\t\t\talt=\"\"\n\t\t\t\t:title=\"t('notifications', 'Notifications')\"\n\t\t\t\t:src=\"iconPath\">\n\t\t</div>\n\t\t<div ref=\"container\" class=\"notification-container\">\n\t\t\t<transition name=\"fade\">\n\t\t\t\t<ul v-if=\"notifications.length > 0\" class=\"notification-wrapper\">\n\t\t\t\t\t<transition-group name=\"fade-collapse\" tag=\"li\">\n\t\t\t\t\t\t<Notification\n\t\t\t\t\t\t\tv-for=\"(n, index) in notifications\"\n\t\t\t\t\t\t\t:key=\"n.notification_id\"\n\t\t\t\t\t\t\tv-bind=\"n\"\n\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t:notification-id=\"n.notification_id\"\n\t\t\t\t\t\t\t:object-id=\"n.object_id\"\n\t\t\t\t\t\t\t:object-type=\"n.object_type\"\n\t\t\t\t\t\t\t@remove=\"onRemove\" />\n\t\t\t\t\t</transition-group>\n\t\t\t\t\t<li v-if=\"notifications.length > 2\">\n\t\t\t\t\t\t<div class=\"dismiss-all\" @click=\"onDismissAll\">\n\t\t\t\t\t\t\t<span class=\"icon icon-close svg\" :title=\"t('notifications', 'Dismiss all notifications')\" /> {{ t('notifications', 'Dismiss all notifications') }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<div v-else class=\"emptycontent\">\n\t\t\t\t\t<div class=\"icon icon-notifications-dark\" />\n\t\t\t\t\t<h2 v-if=\"webNotificationsGranted === null\">\n\t\t\t\t\t\t{{ t('notifications', 'Requesting browser permissions to show notifications') }}\n\t\t\t\t\t</h2>\n\t\t\t\t\t<h2 v-else>\n\t\t\t\t\t\t{{ t('notifications', 'No notifications') }}\n\t\t\t\t\t</h2>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport Notification from './Components/Notification'\nimport axios from '@nextcloud/axios'\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { showError } from '@nextcloud/dialogs'\nimport { imagePath, generateOcsUrl } from '@nextcloud/router'\nimport { getNotificationsData } from './services/notificationsService'\nimport { listen } from '@nextcloud/notify_push'\n\nexport default {\n\tname: 'App',\n\n\tcomponents: {\n\t\tNotification,\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\twebNotificationsGranted: null,\n\t\t\thadNotifications: false,\n\t\t\tbackgroundFetching: false,\n\t\t\tshutdown: false,\n\t\t\tnotifications: [],\n\t\t\tlastETag: null,\n\t\t\tlastTabId: null,\n\t\t\tuserStatus: null,\n\t\t\ttabId: null,\n\n\t\t\t/** @type {number} */\n\t\t\tpollIntervalBase: 30000, // milliseconds\n\t\t\t/** @type {number} */\n\t\t\tpollIntervalCurrent: 30000, // milliseconds\n\n\t\t\t/** @type {number|null} */\n\t\t\tinterval: null,\n\t\t\tpushEndpoints: null\n\t\t}\n\t},\n\n\t_$icon: null,\n\n\tcomputed: {\n\t\ticonPath() {\n\t\t\tlet iconPath = 'notifications'\n\n\t\t\tif (this.webNotificationsGranted === null || this.notifications.length) {\n\t\t\t\tif (this.isRedThemed()) {\n\t\t\t\t\ticonPath += '-red'\n\t\t\t\t}\n\t\t\t\ticonPath += '-new'\n\t\t\t}\n\n\t\t\tif (this.invertedTheme()) {\n\t\t\t\ticonPath += '-dark'\n\t\t\t}\n\n\t\t\treturn imagePath('notifications', iconPath)\n\t\t},\n\n\t\tshowBrowserNotifications() {\n\t\t\treturn this.backgroundFetching\n\t\t\t\t&& this.webNotificationsGranted\n\t\t\t\t&& this.userStatus !== 'dnd'\n\t\t\t\t&& this.tabId !== this.lastTabId\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.tabId = OC.requestToken || ('' + Math.random())\n\t\tthis._$icon = $(this.$refs.icon)\n\n\t\t// Bind the button click event\n\t\tOC.registerMenu($(this.$refs.button), $(this.$refs.container), undefined, true)\n\n\t\tthis.checkWebNotificationPermissions()\n\n\t\t// Initial call to the notification endpoint\n\t\tthis._fetch()\n\n\t\tconst hasPush = listen('notify_notification', () => {\n\t\t\tthis._fetch()\n\t\t})\n\t\tif (hasPush) {\n\t\t\tthis.pollIntervalBase = 15 * 60 * 1000\n\t\t}\n\n\t\t// Setup the background checker\n\t\tthis._setPollingInterval(this.pollIntervalBase)\n\n\t\tsubscribe('networkOffline', this.handleNetworkOffline)\n\t\tsubscribe('networkOnline', this.handleNetworkOnline)\n\t},\n\n\tbeforeDestroy() {\n\t\tunsubscribe('networkOffline', this.handleNetworkOffline)\n\t\tunsubscribe('networkOnline', this.handleNetworkOnline)\n\t},\n\n\tupdated() {\n\t\tthis._$icon.attr('src', this.iconPath)\n\n\t\tif (!this.hadNotifications && this.notifications.length) {\n\t\t\tthis._$icon\n\t\t\t\t.animate({ opacity: 0.6 }, 600)\n\t\t\t\t.animate({ opacity: 1 }, 600)\n\t\t\t\t.animate({ opacity: 0.6 }, 600)\n\t\t\t\t.animate({ opacity: 1 }, 600)\n\t\t}\n\n\t\tthis.hadNotifications = this.notifications.length > 0\n\t},\n\n\tmethods: {\n\t\thandleNetworkOffline() {\n\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t},\n\n\t\thandleNetworkOnline() {\n\t\t\tthis._fetch()\n\t\t\tthis._setPollingInterval(this.pollIntervalBase)\n\t\t},\n\n\t\tsetupBackgroundFetcher() {\n\t\t\tif (OC.config.session_keepalive) {\n\t\t\t\tthis.interval = window.setInterval(this._backgroundFetch.bind(this), this.pollIntervalCurrent)\n\t\t\t}\n\t\t},\n\n\t\tonDismissAll() {\n\t\t\taxios\n\t\t\t\t.delete(generateOcsUrl('apps/notifications/api/v2', 2) + 'notifications')\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.notifications = []\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tshowError(t('notifications', 'Failed to dismiss all notifications'))\n\t\t\t\t})\n\t\t},\n\t\tonRemove(index) {\n\t\t\tthis.notifications.splice(index, 1)\n\t\t},\n\n\t\tinvertedTheme() {\n\t\t\treturn OCA.Theming && OCA.Theming.inverted\n\t\t},\n\n\t\tisRedThemed() {\n\t\t\tif (OCA.Theming && OCA.Theming.color) {\n\t\t\t\tconst hsl = this.rgbToHsl(OCA.Theming.color.substring(1, 3),\n\t\t\t\t\tOCA.Theming.color.substring(3, 5),\n\t\t\t\t\tOCA.Theming.color.substring(5, 7))\n\t\t\t\tconst h = hsl[0] * 360\n\t\t\t\treturn (h >= 330 || h <= 15) && hsl[1] > 0.7 && (hsl[2] > 0.1 || hsl[2] < 0.6)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\trgbToHsl(r, g, b) {\n\t\t\tr = parseInt(r, 16) / 255; g = parseInt(g, 16) / 255; b = parseInt(b, 16) / 255\n\t\t\tconst max = Math.max(r, g, b); const min = Math.min(r, g, b)\n\t\t\tlet h; let s; const l = (max + min) / 2\n\n\t\t\tif (max === min) {\n\t\t\t\th = s = 0\n\t\t\t} else {\n\t\t\t\tconst d = max - min\n\t\t\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min)\n\t\t\t\tswitch (max) {\n\t\t\t\tcase r: h = (g - b) / d + (g < b ? 6 : 0); break\n\t\t\t\tcase g: h = (b - r) / d + 2; break\n\t\t\t\tcase b: h = (r - g) / d + 4; break\n\t\t\t\t}\n\t\t\t\th /= 6\n\t\t\t}\n\n\t\t\treturn [h, s, l]\n\t\t},\n\n\t\t/**\n\t\t\t * Performs the AJAX request to retrieve the notifications\n\t\t\t */\n\t\tasync _fetch() {\n\t\t\tconst response = await getNotificationsData(this.tabId, this.lastETag, !this.backgroundFetching)\n\n\t\t\tif (response.status === 204) {\n\t\t\t\t// 204 No Content - Intercept when no notifiers are there.\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t} else if (response.status === 200) {\n\t\t\t\tthis.userStatus = response.headers['x-nextcloud-user-status']\n\t\t\t\tthis.lastETag = response.headers.etag\n\t\t\t\tthis.lastTabId = response.lastTabId\n\t\t\t\tthis.notifications = response.data\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase)\n\t\t\t} else if (response.status === 304) {\n\t\t\t\t// 304 - Not modified\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase)\n\t\t\t} else if (response.status === 503) {\n\t\t\t\t// 503 - Maintenance mode\n\t\t\t\tconsole.info('Slowing down notifications: instance is in maintenance mode.')\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t} else if (response.status === 404) {\n\t\t\t\t// 404 - App disabled\n\t\t\t\tconsole.info('Slowing down notifications: app is disabled.')\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t} else {\n\t\t\t\tconsole.info('Slowing down notifications: Status ' + response.status)\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t}\n\t\t},\n\n\t\t_backgroundFetch() {\n\t\t\tthis.backgroundFetching = true\n\t\t\tthis._fetch()\n\t\t},\n\n\t\t_setPollingInterval(pollInterval) {\n\t\t\tif (this.interval && pollInterval === this.pollIntervalCurrent) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (this.interval) {\n\t\t\t\twindow.clearInterval(this.interval)\n\t\t\t\tthis.interval = null\n\t\t\t}\n\n\t\t\tthis.pollIntervalCurrent = pollInterval\n\t\t\tthis.setupBackgroundFetcher()\n\t\t},\n\n\t\t/**\n\t\t * The app was disabled or has no notifiers, so we can stop polling\n\t\t * And hide the UI as well\n\t\t * @param {Boolean} temporary If false, the notification bell will be hidden\n\t\t */\n\t\t_shutDownNotifications(temporary) {\n\t\t\tif (this.interval) {\n\t\t\t\twindow.clearInterval(this.interval)\n\t\t\t\tthis.interval = null\n\t\t\t}\n\t\t\tthis.shutdown = !temporary\n\t\t},\n\n\t\t/**\n\t\t * Check if we can do web notifications\n\t\t */\n\t\tcheckWebNotificationPermissions() {\n\t\t\tif (!('Notification' in window)) {\n\t\t\t\tconsole.info('Browser does not support notifications')\n\t\t\t\tthis.webNotificationsGranted = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (window.Notification.permission === 'granted') {\n\t\t\t\tconsole.debug('Notifications permissions granted')\n\t\t\t\tthis.webNotificationsGranted = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (window.Notification.permission === 'denied') {\n\t\t\t\tconsole.debug('Notifications permissions denied')\n\t\t\t\tthis.webNotificationsGranted = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconsole.info('Notifications permissions not yet requested')\n\t\t},\n\n\t\t/**\n\t\t * Check if we can do web notifications\n\t\t */\n\t\tasync requestWebNotificationPermissions() {\n\t\t\tif (this.webNotificationsGranted !== null) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconsole.info('Requesting notifications permissions')\n\t\t\twindow.Notification.requestPermission()\n\t\t\t\t.then((permissions) => {\n\t\t\t\t\tthis.webNotificationsGranted = permissions === 'granted'\n\t\t\t\t})\n\t\t},\n\t},\n}\n<\/script>\n\n<style scoped>\n\t.fade-enter-active,\n\t.fade-leave-active,\n\t.fade-collapse-enter-active,\n\t.fade-collapse-leave-active {\n\t\ttransition: opacity var(--animation-quick), max-height var(--animation-quick);\n\t}\n\n\t.fade-collapse-enter,\n\t.fade-collapse-leave-to {\n\t\topacity: 0;\n\t\tmax-height: 0;\n\t}\n\n\t.fade-enter,\n\t.fade-leave-to {\n\t\topacity: 0;\n\t}\n</style>\n"],sourceRoot:""}]),e.default=i},function(t,e,n){var r=n(62),a=n(766);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[t.i,a,""]]);var o={insert:"head",singleton:!1};r(a,o);t.exports=a.locals||{}},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o),s=n(152),l=n.n(s),u=n(426),c=n(427),d=i()(a.a),p=l()(u.a),f=l()(c.a);d.push([t.i,".toastify.dialogs{min-width:200px;background:none;background-color:var(--color-main-background);color:var(--color-main-text);box-shadow:0 0 6px 0 var(--color-box-shadow);padding:12px;padding-right:34px;margin-top:45px;position:fixed;z-index:10100;border-radius:var(--border-radius)}.toastify.dialogs .toast-undo-button,.toastify.dialogs .toast-close{position:absolute;top:0;right:0;overflow:hidden;box-sizing:border-box;min-width:44px;height:100%;padding:12px;white-space:nowrap;background-repeat:no-repeat;background-position:center;background-color:transparent;min-height:0}.toastify.dialogs .toast-undo-button.toast-close,.toastify.dialogs .toast-close.toast-close{background-image:url("+p+");text-indent:200%;opacity:.4}.toastify.dialogs .toast-undo-button.toast-undo-button,.toastify.dialogs .toast-close.toast-undo-button{margin:3px;height:calc(100% - 2 * 3px)}.toastify.dialogs .toast-undo-button:hover,.toastify.dialogs .toast-undo-button:focus,.toastify.dialogs .toast-undo-button:active,.toastify.dialogs .toast-close:hover,.toastify.dialogs .toast-close:focus,.toastify.dialogs .toast-close:active{cursor:pointer;opacity:1}.toastify.dialogs.toastify-top{right:10px}.toastify.dialogs.toast-with-click{cursor:pointer}.toastify.dialogs.toast-error{border-left:3px solid var(--color-error)}.toastify.dialogs.toast-info{border-left:3px solid var(--color-primary)}.toastify.dialogs.toast-warning{border-left:3px solid var(--color-warning)}.toastify.dialogs.toast-success{border-left:3px solid var(--color-success)}.toastify.dialogs.toast-undo{border-left:3px solid var(--color-success)}.theme--dark .toastify.dialogs .toast-close.toast-close{background-image:url("+f+")}\n","",{version:3,sources:["webpack://./node_modules/@nextcloud/dialogs/styles/toast.scss"],names:[],mappings:"AAwBA,kBACC,eAAgB,CAChB,eAAgB,CAChB,6CAA8C,CAC9C,4BAA6B,CAC7B,4CAA6C,CAC7C,YAAa,CACb,kBAAmB,CACnB,eAAgB,CAChB,cAAe,CACf,aAAc,CACd,kCAAmC,CAXpC,oEAeE,iBAAkB,CAClB,KAAM,CACN,OAAQ,CACR,eAAgB,CAChB,qBAAsB,CACtB,cAAe,CACf,WAAY,CACZ,YAAa,CACb,kBAAmB,CACnB,2BAA4B,CAC5B,0BAA2B,CAC3B,4BAA6B,CAC7B,YAAa,CA3Bf,4FA+BG,wDAAoC,CACpC,gBAAiB,CACjB,UAAW,CAjCd,wGAsCG,UADY,CAEZ,2BAAmC,CAvCtC,kPA2CG,cAAe,CACf,SAAU,CA5Cb,+BAiDE,UAAW,CAjDb,mCAsDE,cAAe,CAtDjB,8BA2DE,wCAAyC,CA3D3C,6BA+DE,0CAA2C,CA/D7C,gCAmEE,0CAA2C,CAnE7C,gCAuEE,0CAA2C,CAvE7C,6BA2EE,0CAA2C,CAC3C,wDASE,wDAAyC",sourcesContent:["/**\n * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>\n *\n * @author Julius Härtl <jus@bitgrid.net>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// using a different class than server\n// remember to import this scss file into your app\n.toastify.dialogs {\n\tmin-width: 200px;\n\tbackground: none;\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tbox-shadow: 0 0 6px 0 var(--color-box-shadow);\n\tpadding: 12px;\n\tpadding-right: 34px;\n\tmargin-top: 45px;\n\tposition: fixed;\n\tz-index: 10100;\n\tborder-radius: var(--border-radius);\n\n\t.toast-undo-button,\n\t.toast-close {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\toverflow: hidden;\n\t\tbox-sizing: border-box;\n\t\tmin-width: 44px;\n\t\theight: 100%;\n\t\tpadding: 12px;\n\t\twhite-space: nowrap;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\tbackground-color: transparent;\n\t\tmin-height: 0;\n\n\t\t// icon styling\n\t\t&.toast-close {\n\t\t\tbackground-image: url('./close.svg');\n\t\t\ttext-indent: 200%;\n\t\t\topacity: .4;\n\t\t}\n\n\t\t&.toast-undo-button {\n\t\t\t$margin: 3px;\n\t\t\tmargin: $margin;\n\t\t\theight: calc(100% - 2 * #{$margin});\n\t\t}\n\n\t\t&:hover, &:focus, &:active {\n\t\t\tcursor: pointer;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t&.toastify-top {\n\t\tright: 10px;\n\t}\n\n\t// Toast with onClick callback\n\t&.toast-with-click {\n\t\tcursor: pointer;\n\t}\n\n\t// Various toasts types\n\t&.toast-error {\n\t\tborder-left: 3px solid var(--color-error);\n\t}\n\n\t&.toast-info {\n\t\tborder-left: 3px solid var(--color-primary);\n\t}\n\n\t&.toast-warning {\n\t\tborder-left: 3px solid var(--color-warning);\n\t}\n\n\t&.toast-success {\n\t\tborder-left: 3px solid var(--color-success);\n\t}\n\n\t&.toast-undo {\n\t\tborder-left: 3px solid var(--color-success);\n\t}\n}\n\n/* dark theme overrides */\n.theme--dark {\n\t.toastify.dialogs {\n\t\t.toast-close {\n\t\t\t/* close icon style */\n\t\t\t&.toast-close {\n\t\t\t\tbackground-image: url('./close-dark.svg');\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),e.default=d},function(e,r,a){"use strict";a.r(r);var o=a(38),i=a(19),s=a.n(i),l=a(94),u=a.n(l),c=a(49);function d(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}function p(t,e,n,r,a,o,i,s){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),i?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=l):a&&(l=s?function(){a.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:a),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:u}}var f=p({name:"Action",props:{label:{type:String,default:"",required:!0},link:{type:String,default:"",required:!0},type:{type:String,default:"",required:!0},primary:{type:Boolean,default:!1,required:!0}},methods:{onClickActionButton:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEB"!==(r=n.type||"GET")){e.next=4;break}return window.location=n.link,e.abrupt("return");case 4:return e.prev=4,e.next=7,s()({method:r,url:n.link});case 7:n.$parent._$el.fadeOut(OC.menuSpeed),n.$parent.$emit("remove");try{$("body").trigger(new $.Event("OCA.Notification.Action",{notification:n.$parent,action:{url:n.link,type:r}}))}catch(t){console.error(t)}e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to perform action",e.t0),Object(c.a)(t("notifications","Failed to perform action"));case 16:case"end":return e.stop()}}),e,null,[[4,12]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(t){d(o,r,a,i,s,"next",t)}function s(t){d(o,r,a,i,s,"throw",t)}i(void 0)}))})()}}},(function(){var t=this.$createElement;return(this._self._c||t)("button",{staticClass:"action-button pull-right",class:{primary:this.primary},attrs:{"data-type":this.type,"data-href":this.link},on:{click:this.onClickActionButton}},[this._v("\n\t"+this._s(this.label)+"\n")])}),[],!1,null,null,null).exports,m=a(28),h=a(37),_=a.n(h),A=(a(72),a(128),a(557),a(558),a(84),a(336),a(416)),g=a.n(A),v=a(417),y=a.n(v),b=a(418),w=a.n(b),M=a(419),x=a.n(M),L=a(420),T=a.n(L),k=(a(174),a(105),a(368),a(369),a(665),a(666),a(185),a(421)),C=a.n(k),Y=a(422),D=a.n(Y),S=a(423);const{selectAll:E}=S;var O=t=>{const e=Object.entries(t).map(j);return t=>e.forEach(e=>e(t))};const j=([t,e])=>{const n=I(e);return e=>E(t,e).forEach(n)},I=t=>({properties:e})=>{e.className?e.className+=" "+t:e.className=t};function B(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){B(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function H(t){return function(t){if(Array.isArray(t))return R(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||F(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t,e){if(t){if("string"==typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var U=function(){return!1},z=function(t){return function(){throw new Error(t)}};function W(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.block,r=void 0===n?[]:n,a=e.inline,o=void 0===a?[]:a;r.length&&r.filter((function(t){return Array.isArray(t)?r.map((function(t){return t[0]})).includes(t[0]):r.includes(t)})).forEach((function(e){Array.isArray(e)&&2===e.length?t.Parser.prototype.blockTokenizers[e[0]]=z(e[1]):t.Parser.prototype.blockTokenizers[e]=U})),o.length&&o.filter((function(t){return Array.isArray(t)?o.map((function(t){return t[0]})).includes(t[0]):o.includes(t)})).forEach((function(e){var n,r;Array.isArray(e)&&2===e.length?(n=e[0],r=z(e[1])):(n=e,r=C()(U)),t.Parser.prototype.inlineTokenizers[n]&&Object.keys(t.Parser.prototype.inlineTokenizers[n]).forEach((function(e){r[e]=t.Parser.prototype.inlineTokenizers[n][e]})),t.Parser.prototype.inlineTokenizers[n]=r}))}function G(){var t=this.Parser.prototype,e=t.inlineTokenizers,n=t.inlineMethods;e.component=function(t,e,n){var r=/^\{([-\w]+)\}/.exec(e);if(r){if(n)return!0;var a=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}}(t,e)||F(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,2),o=a[0],i=a[1];return t(o)({type:"component",component:"#".concat(i),value:""})}},e.component.locator=function(t,e){return t.indexOf("{",e)},n.splice(n.indexOf("text"),0,"component")}var Q=function(t,e,n,r,a,o,i,s,l,u){"boolean"!=typeof i&&(l=s,s=i,i=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,a&&(d.functional=!0)),r&&(d._scopeId=r),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=c):e&&(c=i?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return n}({},void 0,{name:"RichText",props:{text:{type:String,default:""},arguments:{type:Object,default:function(){return{}}},markdownCssClasses:{type:Object,default:function(){return{a:"rich-text--external-link",ol:"rich-text--ordered-list",ul:"rich-text--un-ordered-list",li:"rich-text--list-item",strong:"rich-text--strong",em:"rich-text--italic",h1:"rich-text--heading rich-text--heading-1",h2:"rich-text--heading rich-text--heading-2",h3:"rich-text--heading rich-text--heading-3",h4:"rich-text--heading rich-text--heading-4",h5:"rich-text--heading rich-text--heading-5",h6:"rich-text--heading rich-text--heading-6",hr:"rich-text--hr",table:"rich-text--table",pre:"rich-text--pre",code:"rich-text--code",blockquote:"rich-text--blockquote"}}},useMarkdown:{type:Boolean,default:!1},disableMarkdownInlineFeatures:{type:Array,default:function(){return[]}},disableMarkdownBlockFeatures:{type:Array,default:function(){return[]}},disableHTML:{type:Boolean,default:!0},autolink:{type:Boolean,default:!1}},computed:{remarkDisableOptions:function(){var t=this.autolink?[]:["url"],e=this.disableHTML?["html"]:[];return this.useMarkdown?{inline:[].concat(t,e,H(this.disableMarkdownInlineFeatures)),block:[].concat(e,H(this.disableMarkdownBlockFeatures))}:{inline:[].concat(t,["escape","autoLink","email","html","link","reference","strong","emphasis","deletion","code"]),block:["indentedCode","fencedCode","blockquote","atxHeading","thematicBreak","list","setextHeading","html","definition","table"]}}},render:function(t){var e=this,n=g()().use(y.a).use(D.a,{target:"_blank",rel:["noopener noreferrer"]}).use(w.a).use(W,this.remarkDisableOptions).use(x.a,{handlers:{component:function(t,e){return t(e,e.component,{value:e.value})}}}).use(O,this.markdownCssClasses).use(G).use(T.a,{createElement:function(n,r,a){if(!n.startsWith("#"))return t(n,r,a);var o=e.arguments[n.slice(1)];return o?o.component?t(o.component,{attrs:r,props:o.props,class:"rich-text--component"},a):t("span",r,[o]):t("span",P(P({},{attrs:r}),{class:"rich-text--fallback"}),["{".concat(n.slice(1),"}")])},prefix:!1}).processSync(this.text).result;return t("div",{class:"rich-text--wrapper"},[n])}},"data-v-30428f72",void 0,void 0,!1,void 0,void 0,void 0),J={name:"DefaultParameter",props:{type:{type:String,required:!0},id:{type:[Number,String],required:!0},name:{type:String,required:!0},link:{type:String,default:""}}},Z=(a(690),p(J,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.link?n("a",{staticClass:"external",attrs:{href:t.link,target:"_blank",rel:"noopener noreferrer"}},[n("strong",[t._v(t._s(t.name))])]):n("strong",[t._v(t._s(t.name))])}),[],!1,null,"49ca75ce",null).exports),q=p({name:"File",directives:{tooltip:u.a},props:{type:{type:String,required:!0},id:{type:[Number,String],required:!0},name:{type:String,required:!0},path:{type:String,default:""},link:{type:String,default:""}},computed:{title:function(){var e=this.path.lastIndexOf("/"),n=this.path.indexOf("/"),r=this.path.substring(0===n?1:0,e);return 0===r.length?"":t("notifications","in {path}",{path:r})}}},(function(){var t=this.$createElement;return(this._self._c||t)("a",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:this.title,expression:"title",modifiers:{bottom:!0}}],staticClass:"filename",attrs:{href:this.link}},[this._v(this._s(this.name))])}),[],!1,null,null,null).exports,V=a(424),X={name:"User",components:{UserBubble:a.n(V).a},props:{type:{type:String,required:!0},id:{type:String,required:!0},name:{type:String,required:!0},server:{type:String,default:""}},computed:{cloudId:function(){return this.server?this.id+"@"+this.server:""}}},K=(a(759),p(X,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"mention"},[this.cloudId?e("strong",{attrs:{title:this.cloudId}},[this._v("\n\t\t"+this._s(this.name)+"\n\t")]):e("UserBubble",{attrs:{"display-name":this.name,user:this.id}})],1)}),[],!1,null,"0fd54af1",null).exports),tt={name:"Notification",components:{Action:f,RichText:Q},directives:{tooltip:u.a},props:{notificationId:{type:Number,default:-1,required:!0},datetime:{type:String,default:"",required:!0},app:{type:String,default:"",required:!0},icon:{type:String,default:"",required:!0},link:{type:String,default:"",required:!0},user:{type:String,default:"",required:!0},message:{type:String,default:"",required:!0},messageRich:{type:String,default:"",required:!0},messageRichParameters:{type:[Object,Array],default:function(){return{}},required:!0},subject:{type:String,default:"",required:!0},subjectRich:{type:String,default:"",required:!0},subjectRichParameters:{type:[Object,Array],default:function(){return{}},required:!0},objectType:{type:String,default:"",required:!0},objectId:{type:String,default:"",required:!0},actions:{type:Array,default:function(){return[]},required:!0},index:{type:Number,default:-1,required:!0}},data:function(){return{showFullMessage:!1}},_$el:null,computed:{timestamp:function(){return new Date(this.datetime).valueOf()},absoluteDate:function(){return _()(this.timestamp).format("LLL")},relativeDate:function(){var e=_()().diff(_()(this.timestamp));return e>=0&&e<45e3?t("core","seconds ago"):_()(this.timestamp).fromNow()},useLink:function(){if(!this.link)return!1;var t=!1;return Object.keys(this.subjectRichParameters).forEach((function(e){e.link&&(t=!0)})),t},preparedSubjectParameters:function(){return this.prepareParameters(this.subjectRichParameters)},preparedMessageParameters:function(){return this.prepareParameters(this.messageRichParameters)},isCollapsedMessage:function(){return this.message.length>200&&!this.showFullMessage}},mounted:function(){this._$el=$(this.$el),this.$parent.$parent.showBrowserNotifications&&this._createWebNotification()},methods:{prepareParameters:function(t){var e={};return Object.keys(t).forEach((function(n){var r=t[n].type;e[n]="user"===r?{component:K,props:t[n]}:"file"===r?{component:q,props:t[n]}:{component:Z,props:t[n]}})),e},onClickMessage:function(t){(t.target.classList.contains("rich-text--wrapper")||!this.messageRich&&this.message)&&(this.showFullMessage=!this.showFullMessage)},onDismissNotification:function(){var e=this;s.a.delete(Object(m.generateOcsUrl)("apps/notifications/api/v2",2)+"notifications/"+this.notificationId).then((function(){e.$emit("remove",e.index)})).catch((function(){Object(c.a)(t("notifications","Failed to dismiss notification"))}))},_createWebNotification:function(){var t=new Notification(this.subject,{title:this.subject,lang:OC.getLocale(),body:this.message,icon:this.icon,tag:this.notificationId});this.link&&(t.onclick=function(t){t.preventDefault(),window.location.href=this.link}.bind(this)),setTimeout(t.close.bind(t),5e3)}}},et=(a(761),p(tt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"notification",attrs:{"data-id":t.notificationId,"data-timestamp":t.timestamp}},[n("div",{staticClass:"notification-heading"},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:t.absoluteDate,expression:"absoluteDate",modifiers:{bottom:!0}}],staticClass:"notification-time live-relative-timestamp",attrs:{"data-timestamp":t.timestamp}},[t._v(t._s(t.relativeDate))]),t._v(" "),n("div",{staticClass:"notification-delete",on:{click:t.onDismissNotification}},[n("span",{staticClass:"icon icon-close svg",attrs:{title:t.t("notifications","Dismiss")}})])]),t._v(" "),t.useLink?n("a",{staticClass:"notification-subject full-subject-link",attrs:{href:t.link}},[t.icon?n("span",{staticClass:"image"},[n("img",{staticClass:"notification-icon",attrs:{src:t.icon}})]):t._e(),t._v(" "),t.subjectRich?n("RichText",{attrs:{text:t.subjectRich,arguments:t.preparedSubjectParameters}}):n("span",{staticClass:"subject"},[t._v(t._s(t.subject))])],1):n("div",{staticClass:"notification-subject"},[t.icon?n("span",{staticClass:"image"},[n("img",{staticClass:"notification-icon",attrs:{src:t.icon}})]):t._e(),t._v(" "),t.subjectRich?n("RichText",{attrs:{text:t.subjectRich,arguments:t.preparedSubjectParameters}}):n("span",{staticClass:"subject"},[t._v(t._s(t.subject))])],1),t._v(" "),t.message?n("div",{staticClass:"notification-message",on:{click:t.onClickMessage}},[n("div",{staticClass:"message-container",class:{collapsed:t.isCollapsedMessage}},[t.messageRich?n("RichText",{attrs:{text:t.messageRich,arguments:t.preparedMessageParameters,autolink:!0}}):n("span",[t._v(t._s(t.message))])],1),t._v(" "),t.isCollapsedMessage?n("div",{staticClass:"notification-overflow"}):t._e()]):t._e(),t._v(" "),t.actions.length?n("div",{staticClass:"notification-actions"},t._l(t.actions,(function(e,r){return n("Action",t._b({key:r},"Action",e,!1))})),1):t._e()])}),[],!1,null,"5c9d3bb9",null).exports),nt=a(27),rt=a(150),at=Object(rt.getBuilder)("notifications").clearOnLogout().persist().build();function ot(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}function it(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){ot(o,r,a,i,s,"next",t)}function s(t){ot(o,r,a,i,s,"throw",t)}i(void 0)}))}}
+t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";n(72),Object.defineProperty(e,"__esModule",{value:!0}),e.loadState=function(t,e,n){var r=document.querySelector("#initial-state-".concat(t,"-").concat(e));if(null===r){if(void 0!==n)return n;throw new Error("Could not find initial state ".concat(e," of ").concat(t))}try{return JSON.parse(atob(r.value))}catch(n){throw new Error("Could not parse initial state ".concat(e," of ").concat(t))}}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,o=a&&!r.call({1:2},1);e.f=o?function(t){var e=a(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(16),a=n(36),o=r.document,i=a(o)&&a(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(16),a=n(92),o=n(48),i=n(147),s=n(391),l=n(730),u=l.get,c=l.enforce,d=String(String).split("String");(t.exports=function(t,e,n,s){var l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||a(n,"name",e),c(n).source=d.join("string"==typeof e?e:"")),t!==r?(l?!p&&t[e]&&(u=!0):delete t[e],u?t[e]=n:a(t,e,n)):u?t[e]=n:i(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},function(t,e,n){var r,a,o,i=n(731),s=n(16),l=n(36),u=n(92),c=n(48),d=n(732),p=n(396),f=s.WeakMap;if(i){var m=new f,h=m.get,_=m.has,A=m.set;r=function(t,e){return A.call(m,t,e),e},a=function(t){return h.call(m,t)||{}},o=function(t){return _.call(m,t)}}else{var g=d("state");p[g]=!0,r=function(t,e){return u(t,g,e),e},a=function(t){return c(t,g)?t[g]:{}},o=function(t){return c(t,g)}}t.exports={set:r,get:a,has:o,enforce:function(t){return o(t)?a(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=a(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(16),a=n(391),o=r.WeakMap;t.exports="function"==typeof o&&/native code/.test(a(o))},function(t,e,n){var r=n(393),a=n(395),o=r("keys");t.exports=function(t){return o[t]||(o[t]=a(t))}},function(t,e,n){var r=n(48),a=n(734),o=n(140),i=n(146);t.exports=function(t,e){for(var n=a(e),s=i.f,l=o.f,u=0;u<n.length;u++){var c=n[u];r(t,c)||s(t,c,l(e,c))}}},function(t,e,n){var r=n(397),a=n(736),o=n(739),i=n(390);t.exports=r("Reflect","ownKeys")||function(t){var e=a.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},function(t,e,n){var r=n(16);t.exports=r},function(t,e,n){var r=n(398),a=n(400).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,a)}},function(t,e,n){var r=n(142),a=n(93),o=n(738),i=function(t){return function(e,n,i){var s,l=r(e),u=a(l.length),c=o(i,u);if(t&&n!=n){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}};t.exports={includes:i(!0),indexOf:i(!1)}},function(t,e,n){var r=n(399),a=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?a(n+e,0):o(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(18),a=/#|\.prototype\./,o=function(t,e){var n=s[i(t)];return n==u||n!=l&&("function"==typeof e?r(e):!!e)},i=o.normalize=function(t){return String(t).replace(a,".").toLowerCase()},s=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},function(t,e,n){var r=n(742);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,a){return t.call(e,n,r,a)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(404);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(397);t.exports=r("navigator","userAgent")||""},function(t,e,n){var r=n(398),a=n(400);t.exports=Object.keys||function(t){return r(t,a)}},function(t,e,n){var r=n(747);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(36),a=n(143),o=n(64)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==a(t))}},function(t,e,n){var r=n(64)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,a=(r=n(409))&&r.__esModule?r:{default:r};function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),i(this,"appId",void 0),i(this,"persisted",!1),i(this,"clearedOnLogout",!1),this.appId=e}var e,n,r;return e=t,(n=[{key:"persist",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.persisted=t,this}},{key:"clearOnLogout",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.clearedOnLogout=t,this}},{key:"build",value:function(){return new a.default(this.appId,this.persisted?window.localStorage:window.sessionStorage,!this.clearedOnLogout)}}])&&o(e.prototype,n),r&&o(e,r),t}();e.default=s},function(t,e,n){"use strict";var r=n(63),a=n(18),o=n(403),i=n(36),s=n(148),l=n(93),u=n(751),c=n(402),d=n(149),p=n(64),f=n(405),m=p("isConcatSpreadable"),h=f>=51||!a((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),_=d("concat"),A=function(t){if(!i(t))return!1;var e=t[m];return void 0!==e?!!e:o(t)};r({target:"Array",proto:!0,forced:!h||!_},{concat:function(t){var e,n,r,a,o,i=s(this),d=c(i,0),p=0;for(e=-1,r=arguments.length;e<r;e++)if(A(o=-1===e?i:arguments[e])){if(p+(a=l(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<a;n++,p++)n in o&&u(d,p,o[n])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");u(d,p++,o)}return d.length=p,d}})},function(t,e,n){"use strict";var r=n(145),a=n(146),o=n(141);t.exports=function(t,e,n){var i=r(e);i in t?a.f(t,i,o(0,n)):t[i]=n}},function(t,e,n){"use strict";var r=n(2),a=n(753),o=n(24),i=n(9),s=n(42),l=n(70);r({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=o(this),n=i(e.length),r=l(e,0);return r.length=a(r,e,e,n,0,void 0===t?1:s(t)),r}})},function(t,e,n){"use strict";var r=n(71),a=n(9),o=n(31),i=function(t,e,n,s,l,u,c,d){for(var p,f=l,m=0,h=!!c&&o(c,d,3);m<s;){if(m in n){if(p=h?h(n[m],m,e):n[m],u>0&&r(p))f=i(t,e,p,a(p.length),f,u-1)-1;else{if(f>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[f]=p}f++}m++}return f};t.exports=i},function(t,e,n){n(111)("flat")},function(t,e,n){var r=n(12),a=n(3),o=n(52),i=n(116),s=n(15).f,l=n(101).f,u=n(133),c=n(129),d=n(206),p=n(13),f=n(1),m=n(26).set,h=n(118),_=n(4)("match"),A=a.RegExp,g=A.prototype,v=/a/g,y=/a/g,b=new A(v)!==v,w=d.UNSUPPORTED_Y;if(r&&o("RegExp",!b||w||f((function(){return y[_]=!1,A(v)!=v||A(y)==y||"/a/i"!=A(v,"i")})))){for(var M=function(t,e){var n,r=this instanceof M,a=u(t),o=void 0===e;if(!r&&a&&t.constructor===M&&o)return t;b?a&&!o&&(t=t.source):t instanceof M&&(o&&(e=c.call(t)),t=t.source),w&&(n=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var s=i(b?new A(t,e):A(t,e),r?this:g,M);return w&&n&&m(s,{sticky:n}),s},x=function(t){t in M||s(M,t,{configurable:!0,get:function(){return A[t]},set:function(e){A[t]=e}})},L=l(A),T=0;L.length>T;)x(L[T++]);g.constructor=M,M.prototype=g,p(a,"RegExp",M)}h("RegExp")},function(t,e,n){"use strict";var r=n(130),a=n(5),o=n(9),i=n(22),s=n(131),l=n(132);r("match",1,(function(t,e,n){return[function(e){var n=i(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var i=a(t),u=String(this);if(!i.global)return l(i,u);var c=i.unicode;i.lastIndex=0;for(var d,p=[],f=0;null!==(d=l(i,u));){var m=String(d[0]);p[f]=m,""===m&&(i.lastIndex=s(u,o(i.lastIndex),c)),f++}return 0===f?null:p}]}))},function(t,e,n){"use strict";var r=n(2),a=n(76).codeAt;r({target:"String",proto:!0},{codePointAt:function(t){return a(this,t)}})},function(t,e,n){var r=n(2),a=n(68),o=String.fromCharCode,i=String.fromCodePoint;r({target:"String",stat:!0,forced:!!i&&1!=i.length},{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,i=0;r>i;){if(e=+arguments[i++],a(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){"use strict";n(410)},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o)()(a.a);i.push([t.i,".mention[data-v-0fd54af1]{display:contents;white-space:nowrap}\n","",{version:3,sources:["webpack://./src/Components/Parameters/User.vue"],names:[],mappings:"AAwEA,0BACC,gBAAiB,CACjB,kBAAmB",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.mention {\n\tdisplay: contents;\n\twhite-space: nowrap;\n}\n"],sourceRoot:""}]),e.default=i},function(t,e,n){"use strict";n(411)},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o)()(a.a);i.push([t.i,"[data-v-38932a7f] .rich-text--wrapper{white-space:pre-wrap;word-break:break-word}\n","",{version:3,sources:["webpack://./src/Components/Notification.vue"],names:[],mappings:"AAqSA,sCACC,oBAAqB,CACrB,qBAAsB",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n::v-deep .rich-text--wrapper {\n\twhite-space: pre-wrap;\n\tword-break: break-word;\n}\n"],sourceRoot:""}]),e.default=i},function(t,e,n){"use strict";n(412)},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o)()(a.a);i.push([t.i,"\n.fade-enter-active[data-v-455361fd],\n.fade-leave-active[data-v-455361fd],\n.fade-collapse-enter-active[data-v-455361fd],\n.fade-collapse-leave-active[data-v-455361fd] {\n\ttransition: opacity var(--animation-quick), max-height var(--animation-quick);\n}\n.fade-collapse-enter[data-v-455361fd],\n.fade-collapse-leave-to[data-v-455361fd] {\n\topacity: 0;\n\tmax-height: 0;\n}\n.fade-enter[data-v-455361fd],\n.fade-leave-to[data-v-455361fd] {\n\topacity: 0;\n}\n","",{version:3,sources:["webpack://./src/App.vue"],names:[],mappings:";AAkVA;;;;CAIA,6EAAA;AACA;AAEA;;CAEA,UAAA;CACA,aAAA;AACA;AAEA;;CAEA,UAAA;AACA",sourcesContent:["<template>\n\t<div v-if=\"!shutdown\" class=\"notifications\">\n\t\t<div ref=\"button\"\n\t\t\tclass=\"notifications-button menutoggle\"\n\t\t\t:class=\"{ hasNotifications: notifications.length }\"\n\t\t\ttabindex=\"0\"\n\t\t\trole=\"button\"\n\t\t\t:aria-label=\"t('notifications', 'Notifications')\"\n\t\t\taria-haspopup=\"true\"\n\t\t\taria-controls=\"notification-container\"\n\t\t\taria-expanded=\"false\"\n\t\t\t@click=\"requestWebNotificationPermissions\">\n\t\t\t<img ref=\"icon\"\n\t\t\t\tclass=\"svg\"\n\t\t\t\talt=\"\"\n\t\t\t\t:title=\"t('notifications', 'Notifications')\"\n\t\t\t\t:src=\"iconPath\">\n\t\t</div>\n\t\t<div ref=\"container\" class=\"notification-container\">\n\t\t\t<transition name=\"fade\">\n\t\t\t\t<ul v-if=\"notifications.length > 0\" class=\"notification-wrapper\">\n\t\t\t\t\t<transition-group name=\"fade-collapse\" tag=\"li\">\n\t\t\t\t\t\t<Notification\n\t\t\t\t\t\t\tv-for=\"(n, index) in notifications\"\n\t\t\t\t\t\t\t:key=\"n.notification_id\"\n\t\t\t\t\t\t\tv-bind=\"n\"\n\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t:notification-id=\"n.notification_id\"\n\t\t\t\t\t\t\t:object-id=\"n.object_id\"\n\t\t\t\t\t\t\t:object-type=\"n.object_type\"\n\t\t\t\t\t\t\t@remove=\"onRemove\" />\n\t\t\t\t\t</transition-group>\n\t\t\t\t\t<li v-if=\"notifications.length > 2\">\n\t\t\t\t\t\t<div class=\"dismiss-all\" @click=\"onDismissAll\">\n\t\t\t\t\t\t\t<span class=\"icon icon-close svg\" :title=\"t('notifications', 'Dismiss all notifications')\" /> {{ t('notifications', 'Dismiss all notifications') }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<div v-else class=\"emptycontent\">\n\t\t\t\t\t<div class=\"icon icon-notifications-dark\" />\n\t\t\t\t\t<h2 v-if=\"webNotificationsGranted === null\">\n\t\t\t\t\t\t{{ t('notifications', 'Requesting browser permissions to show notifications') }}\n\t\t\t\t\t</h2>\n\t\t\t\t\t<h2 v-else>\n\t\t\t\t\t\t{{ t('notifications', 'No notifications') }}\n\t\t\t\t\t</h2>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport Notification from './Components/Notification'\nimport axios from '@nextcloud/axios'\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { showError } from '@nextcloud/dialogs'\nimport { imagePath, generateOcsUrl } from '@nextcloud/router'\nimport { getNotificationsData } from './services/notificationsService'\nimport { listen } from '@nextcloud/notify_push'\n\nexport default {\n\tname: 'App',\n\n\tcomponents: {\n\t\tNotification,\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\twebNotificationsGranted: null,\n\t\t\thadNotifications: false,\n\t\t\tbackgroundFetching: false,\n\t\t\tshutdown: false,\n\t\t\tnotifications: [],\n\t\t\tlastETag: null,\n\t\t\tlastTabId: null,\n\t\t\tuserStatus: null,\n\t\t\ttabId: null,\n\n\t\t\t/** @type {number} */\n\t\t\tpollIntervalBase: 30000, // milliseconds\n\t\t\t/** @type {number} */\n\t\t\tpollIntervalCurrent: 30000, // milliseconds\n\n\t\t\t/** @type {number|null} */\n\t\t\tinterval: null,\n\t\t\tpushEndpoints: null\n\t\t}\n\t},\n\n\t_$icon: null,\n\n\tcomputed: {\n\t\ticonPath() {\n\t\t\tlet iconPath = 'notifications'\n\n\t\t\tif (this.webNotificationsGranted === null || this.notifications.length) {\n\t\t\t\tif (this.isRedThemed()) {\n\t\t\t\t\ticonPath += '-red'\n\t\t\t\t}\n\t\t\t\ticonPath += '-new'\n\t\t\t}\n\n\t\t\tif (this.invertedTheme()) {\n\t\t\t\ticonPath += '-dark'\n\t\t\t}\n\n\t\t\treturn imagePath('notifications', iconPath)\n\t\t},\n\n\t\tshowBrowserNotifications() {\n\t\t\treturn this.backgroundFetching\n\t\t\t\t&& this.webNotificationsGranted\n\t\t\t\t&& this.userStatus !== 'dnd'\n\t\t\t\t&& this.tabId === this.lastTabId\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.tabId = OC.requestToken || ('' + Math.random())\n\t\tthis._$icon = $(this.$refs.icon)\n\n\t\t// Bind the button click event\n\t\tOC.registerMenu($(this.$refs.button), $(this.$refs.container), undefined, true)\n\n\t\tthis.checkWebNotificationPermissions()\n\n\t\t// Initial call to the notification endpoint\n\t\tthis._fetch()\n\n\t\tconst hasPush = listen('notify_notification', () => {\n\t\t\tthis._fetch()\n\t\t})\n\t\tif (hasPush) {\n\t\t\tthis.pollIntervalBase = 15 * 60 * 1000\n\t\t}\n\n\t\t// Setup the background checker\n\t\tthis._setPollingInterval(this.pollIntervalBase)\n\n\t\tsubscribe('networkOffline', this.handleNetworkOffline)\n\t\tsubscribe('networkOnline', this.handleNetworkOnline)\n\t},\n\n\tbeforeDestroy() {\n\t\tunsubscribe('networkOffline', this.handleNetworkOffline)\n\t\tunsubscribe('networkOnline', this.handleNetworkOnline)\n\t},\n\n\tupdated() {\n\t\tthis._$icon.attr('src', this.iconPath)\n\n\t\tif (!this.hadNotifications && this.notifications.length) {\n\t\t\tthis._$icon\n\t\t\t\t.animate({ opacity: 0.6 }, 600)\n\t\t\t\t.animate({ opacity: 1 }, 600)\n\t\t\t\t.animate({ opacity: 0.6 }, 600)\n\t\t\t\t.animate({ opacity: 1 }, 600)\n\t\t}\n\n\t\tthis.hadNotifications = this.notifications.length > 0\n\t},\n\n\tmethods: {\n\t\thandleNetworkOffline() {\n\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t},\n\n\t\thandleNetworkOnline() {\n\t\t\tthis._fetch()\n\t\t\tthis._setPollingInterval(this.pollIntervalBase)\n\t\t},\n\n\t\tsetupBackgroundFetcher() {\n\t\t\tif (OC.config.session_keepalive) {\n\t\t\t\tthis.interval = window.setInterval(this._backgroundFetch.bind(this), this.pollIntervalCurrent)\n\t\t\t}\n\t\t},\n\n\t\tonDismissAll() {\n\t\t\taxios\n\t\t\t\t.delete(generateOcsUrl('apps/notifications/api/v2', 2) + 'notifications')\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.notifications = []\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tshowError(t('notifications', 'Failed to dismiss all notifications'))\n\t\t\t\t})\n\t\t},\n\t\tonRemove(index) {\n\t\t\tthis.notifications.splice(index, 1)\n\t\t},\n\n\t\tinvertedTheme() {\n\t\t\treturn OCA.Theming && OCA.Theming.inverted\n\t\t},\n\n\t\tisRedThemed() {\n\t\t\tif (OCA.Theming && OCA.Theming.color) {\n\t\t\t\tconst hsl = this.rgbToHsl(OCA.Theming.color.substring(1, 3),\n\t\t\t\t\tOCA.Theming.color.substring(3, 5),\n\t\t\t\t\tOCA.Theming.color.substring(5, 7))\n\t\t\t\tconst h = hsl[0] * 360\n\t\t\t\treturn (h >= 330 || h <= 15) && hsl[1] > 0.7 && (hsl[2] > 0.1 || hsl[2] < 0.6)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\trgbToHsl(r, g, b) {\n\t\t\tr = parseInt(r, 16) / 255; g = parseInt(g, 16) / 255; b = parseInt(b, 16) / 255\n\t\t\tconst max = Math.max(r, g, b); const min = Math.min(r, g, b)\n\t\t\tlet h; let s; const l = (max + min) / 2\n\n\t\t\tif (max === min) {\n\t\t\t\th = s = 0\n\t\t\t} else {\n\t\t\t\tconst d = max - min\n\t\t\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min)\n\t\t\t\tswitch (max) {\n\t\t\t\tcase r: h = (g - b) / d + (g < b ? 6 : 0); break\n\t\t\t\tcase g: h = (b - r) / d + 2; break\n\t\t\t\tcase b: h = (r - g) / d + 4; break\n\t\t\t\t}\n\t\t\t\th /= 6\n\t\t\t}\n\n\t\t\treturn [h, s, l]\n\t\t},\n\n\t\t/**\n\t\t\t * Performs the AJAX request to retrieve the notifications\n\t\t\t */\n\t\tasync _fetch() {\n\t\t\tconst response = await getNotificationsData(this.tabId, this.lastETag, !this.backgroundFetching)\n\n\t\t\tif (response.status === 204) {\n\t\t\t\t// 204 No Content - Intercept when no notifiers are there.\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t} else if (response.status === 200) {\n\t\t\t\tthis.userStatus = response.headers['x-nextcloud-user-status']\n\t\t\t\tthis.lastETag = response.headers.etag\n\t\t\t\tthis.lastTabId = response.tabId\n\t\t\t\tthis.notifications = response.data\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase)\n\t\t\t} else if (response.status === 304) {\n\t\t\t\t// 304 - Not modified\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase)\n\t\t\t} else if (response.status === 503) {\n\t\t\t\t// 503 - Maintenance mode\n\t\t\t\tconsole.info('Slowing down notifications: instance is in maintenance mode.')\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t} else if (response.status === 404) {\n\t\t\t\t// 404 - App disabled\n\t\t\t\tconsole.info('Slowing down notifications: app is disabled.')\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t} else {\n\t\t\t\tconsole.info('Slowing down notifications: Status ' + response.status)\n\t\t\t\tthis._setPollingInterval(this.pollIntervalBase * 10)\n\t\t\t}\n\t\t},\n\n\t\t_backgroundFetch() {\n\t\t\tthis.backgroundFetching = true\n\t\t\tthis._fetch()\n\t\t},\n\n\t\t_setPollingInterval(pollInterval) {\n\t\t\tif (this.interval && pollInterval === this.pollIntervalCurrent) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (this.interval) {\n\t\t\t\twindow.clearInterval(this.interval)\n\t\t\t\tthis.interval = null\n\t\t\t}\n\n\t\t\tthis.pollIntervalCurrent = pollInterval\n\t\t\tthis.setupBackgroundFetcher()\n\t\t},\n\n\t\t/**\n\t\t * The app was disabled or has no notifiers, so we can stop polling\n\t\t * And hide the UI as well\n\t\t * @param {Boolean} temporary If false, the notification bell will be hidden\n\t\t */\n\t\t_shutDownNotifications(temporary) {\n\t\t\tif (this.interval) {\n\t\t\t\twindow.clearInterval(this.interval)\n\t\t\t\tthis.interval = null\n\t\t\t}\n\t\t\tthis.shutdown = !temporary\n\t\t},\n\n\t\t/**\n\t\t * Check if we can do web notifications\n\t\t */\n\t\tcheckWebNotificationPermissions() {\n\t\t\tif (!('Notification' in window)) {\n\t\t\t\tconsole.info('Browser does not support notifications')\n\t\t\t\tthis.webNotificationsGranted = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (window.Notification.permission === 'granted') {\n\t\t\t\tconsole.debug('Notifications permissions granted')\n\t\t\t\tthis.webNotificationsGranted = true\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (window.Notification.permission === 'denied') {\n\t\t\t\tconsole.debug('Notifications permissions denied')\n\t\t\t\tthis.webNotificationsGranted = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconsole.info('Notifications permissions not yet requested')\n\t\t},\n\n\t\t/**\n\t\t * Check if we can do web notifications\n\t\t */\n\t\tasync requestWebNotificationPermissions() {\n\t\t\tif (this.webNotificationsGranted !== null) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconsole.info('Requesting notifications permissions')\n\t\t\twindow.Notification.requestPermission()\n\t\t\t\t.then((permissions) => {\n\t\t\t\t\tthis.webNotificationsGranted = permissions === 'granted'\n\t\t\t\t})\n\t\t},\n\t},\n}\n<\/script>\n\n<style scoped>\n\t.fade-enter-active,\n\t.fade-leave-active,\n\t.fade-collapse-enter-active,\n\t.fade-collapse-leave-active {\n\t\ttransition: opacity var(--animation-quick), max-height var(--animation-quick);\n\t}\n\n\t.fade-collapse-enter,\n\t.fade-collapse-leave-to {\n\t\topacity: 0;\n\t\tmax-height: 0;\n\t}\n\n\t.fade-enter,\n\t.fade-leave-to {\n\t\topacity: 0;\n\t}\n</style>\n"],sourceRoot:""}]),e.default=i},function(t,e,n){var r=n(62),a=n(766);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[t.i,a,""]]);var o={insert:"head",singleton:!1};r(a,o);t.exports=a.locals||{}},function(t,e,n){"use strict";n.r(e);var r=n(20),a=n.n(r),o=n(21),i=n.n(o),s=n(152),l=n.n(s),u=n(426),c=n(427),d=i()(a.a),p=l()(u.a),f=l()(c.a);d.push([t.i,".toastify.dialogs{min-width:200px;background:none;background-color:var(--color-main-background);color:var(--color-main-text);box-shadow:0 0 6px 0 var(--color-box-shadow);padding:12px;padding-right:34px;margin-top:45px;position:fixed;z-index:10100;border-radius:var(--border-radius)}.toastify.dialogs .toast-undo-button,.toastify.dialogs .toast-close{position:absolute;top:0;right:0;overflow:hidden;box-sizing:border-box;min-width:44px;height:100%;padding:12px;white-space:nowrap;background-repeat:no-repeat;background-position:center;background-color:transparent;min-height:0}.toastify.dialogs .toast-undo-button.toast-close,.toastify.dialogs .toast-close.toast-close{background-image:url("+p+");text-indent:200%;opacity:.4}.toastify.dialogs .toast-undo-button.toast-undo-button,.toastify.dialogs .toast-close.toast-undo-button{margin:3px;height:calc(100% - 2 * 3px)}.toastify.dialogs .toast-undo-button:hover,.toastify.dialogs .toast-undo-button:focus,.toastify.dialogs .toast-undo-button:active,.toastify.dialogs .toast-close:hover,.toastify.dialogs .toast-close:focus,.toastify.dialogs .toast-close:active{cursor:pointer;opacity:1}.toastify.dialogs.toastify-top{right:10px}.toastify.dialogs.toast-with-click{cursor:pointer}.toastify.dialogs.toast-error{border-left:3px solid var(--color-error)}.toastify.dialogs.toast-info{border-left:3px solid var(--color-primary)}.toastify.dialogs.toast-warning{border-left:3px solid var(--color-warning)}.toastify.dialogs.toast-success{border-left:3px solid var(--color-success)}.toastify.dialogs.toast-undo{border-left:3px solid var(--color-success)}.theme--dark .toastify.dialogs .toast-close.toast-close{background-image:url("+f+")}\n","",{version:3,sources:["webpack://./node_modules/@nextcloud/dialogs/styles/toast.scss"],names:[],mappings:"AAwBA,kBACC,eAAgB,CAChB,eAAgB,CAChB,6CAA8C,CAC9C,4BAA6B,CAC7B,4CAA6C,CAC7C,YAAa,CACb,kBAAmB,CACnB,eAAgB,CAChB,cAAe,CACf,aAAc,CACd,kCAAmC,CAXpC,oEAeE,iBAAkB,CAClB,KAAM,CACN,OAAQ,CACR,eAAgB,CAChB,qBAAsB,CACtB,cAAe,CACf,WAAY,CACZ,YAAa,CACb,kBAAmB,CACnB,2BAA4B,CAC5B,0BAA2B,CAC3B,4BAA6B,CAC7B,YAAa,CA3Bf,4FA+BG,wDAAoC,CACpC,gBAAiB,CACjB,UAAW,CAjCd,wGAsCG,UADY,CAEZ,2BAAmC,CAvCtC,kPA2CG,cAAe,CACf,SAAU,CA5Cb,+BAiDE,UAAW,CAjDb,mCAsDE,cAAe,CAtDjB,8BA2DE,wCAAyC,CA3D3C,6BA+DE,0CAA2C,CA/D7C,gCAmEE,0CAA2C,CAnE7C,gCAuEE,0CAA2C,CAvE7C,6BA2EE,0CAA2C,CAC3C,wDASE,wDAAyC",sourcesContent:["/**\n * @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>\n *\n * @author Julius Härtl <jus@bitgrid.net>\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// using a different class than server\n// remember to import this scss file into your app\n.toastify.dialogs {\n\tmin-width: 200px;\n\tbackground: none;\n\tbackground-color: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tbox-shadow: 0 0 6px 0 var(--color-box-shadow);\n\tpadding: 12px;\n\tpadding-right: 34px;\n\tmargin-top: 45px;\n\tposition: fixed;\n\tz-index: 10100;\n\tborder-radius: var(--border-radius);\n\n\t.toast-undo-button,\n\t.toast-close {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\toverflow: hidden;\n\t\tbox-sizing: border-box;\n\t\tmin-width: 44px;\n\t\theight: 100%;\n\t\tpadding: 12px;\n\t\twhite-space: nowrap;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\tbackground-color: transparent;\n\t\tmin-height: 0;\n\n\t\t// icon styling\n\t\t&.toast-close {\n\t\t\tbackground-image: url('./close.svg');\n\t\t\ttext-indent: 200%;\n\t\t\topacity: .4;\n\t\t}\n\n\t\t&.toast-undo-button {\n\t\t\t$margin: 3px;\n\t\t\tmargin: $margin;\n\t\t\theight: calc(100% - 2 * #{$margin});\n\t\t}\n\n\t\t&:hover, &:focus, &:active {\n\t\t\tcursor: pointer;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t&.toastify-top {\n\t\tright: 10px;\n\t}\n\n\t// Toast with onClick callback\n\t&.toast-with-click {\n\t\tcursor: pointer;\n\t}\n\n\t// Various toasts types\n\t&.toast-error {\n\t\tborder-left: 3px solid var(--color-error);\n\t}\n\n\t&.toast-info {\n\t\tborder-left: 3px solid var(--color-primary);\n\t}\n\n\t&.toast-warning {\n\t\tborder-left: 3px solid var(--color-warning);\n\t}\n\n\t&.toast-success {\n\t\tborder-left: 3px solid var(--color-success);\n\t}\n\n\t&.toast-undo {\n\t\tborder-left: 3px solid var(--color-success);\n\t}\n}\n\n/* dark theme overrides */\n.theme--dark {\n\t.toastify.dialogs {\n\t\t.toast-close {\n\t\t\t/* close icon style */\n\t\t\t&.toast-close {\n\t\t\t\tbackground-image: url('./close-dark.svg');\n\t\t\t}\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),e.default=d},function(e,r,a){"use strict";a.r(r);var o=a(38),i=a(19),s=a.n(i),l=a(94),u=a.n(l),c=a(49);function d(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}function p(t,e,n,r,a,o,i,s){var l,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),i?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=l):a&&(l=s?function(){a.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:a),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(t,e){return l.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:u}}var f=p({name:"Action",props:{label:{type:String,default:"",required:!0},link:{type:String,default:"",required:!0},type:{type:String,default:"",required:!0},primary:{type:Boolean,default:!1,required:!0}},methods:{onClickActionButton:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEB"!==(r=n.type||"GET")){e.next=4;break}return window.location=n.link,e.abrupt("return");case 4:return e.prev=4,e.next=7,s()({method:r,url:n.link});case 7:n.$parent._$el.fadeOut(OC.menuSpeed),n.$parent.$emit("remove");try{$("body").trigger(new $.Event("OCA.Notification.Action",{notification:n.$parent,action:{url:n.link,type:r}}))}catch(t){console.error(t)}e.next=16;break;case 12:e.prev=12,e.t0=e.catch(4),console.error("Failed to perform action",e.t0),Object(c.a)(t("notifications","Failed to perform action"));case 16:case"end":return e.stop()}}),e,null,[[4,12]])})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(t){d(o,r,a,i,s,"next",t)}function s(t){d(o,r,a,i,s,"throw",t)}i(void 0)}))})()}}},(function(){var t=this.$createElement;return(this._self._c||t)("button",{staticClass:"action-button pull-right",class:{primary:this.primary},attrs:{"data-type":this.type,"data-href":this.link},on:{click:this.onClickActionButton}},[this._v("\n\t"+this._s(this.label)+"\n")])}),[],!1,null,null,null).exports,m=a(28),h=a(37),_=a.n(h),A=(a(72),a(128),a(557),a(558),a(84),a(336),a(416)),g=a.n(A),v=a(417),y=a.n(v),b=a(418),w=a.n(b),M=a(419),x=a.n(M),L=a(420),T=a.n(L),k=(a(174),a(105),a(368),a(369),a(665),a(666),a(185),a(421)),C=a.n(k),Y=a(422),D=a.n(Y),S=a(423);const{selectAll:E}=S;var O=t=>{const e=Object.entries(t).map(j);return t=>e.forEach(e=>e(t))};const j=([t,e])=>{const n=I(e);return e=>E(t,e).forEach(n)},I=t=>({properties:e})=>{e.className?e.className+=" "+t:e.className=t};function B(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){B(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function H(t){return function(t){if(Array.isArray(t))return R(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||F(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t,e){if(t){if("string"==typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var U=function(){return!1},z=function(t){return function(){throw new Error(t)}};function W(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.block,r=void 0===n?[]:n,a=e.inline,o=void 0===a?[]:a;r.length&&r.filter((function(t){return Array.isArray(t)?r.map((function(t){return t[0]})).includes(t[0]):r.includes(t)})).forEach((function(e){Array.isArray(e)&&2===e.length?t.Parser.prototype.blockTokenizers[e[0]]=z(e[1]):t.Parser.prototype.blockTokenizers[e]=U})),o.length&&o.filter((function(t){return Array.isArray(t)?o.map((function(t){return t[0]})).includes(t[0]):o.includes(t)})).forEach((function(e){var n,r;Array.isArray(e)&&2===e.length?(n=e[0],r=z(e[1])):(n=e,r=C()(U)),t.Parser.prototype.inlineTokenizers[n]&&Object.keys(t.Parser.prototype.inlineTokenizers[n]).forEach((function(e){r[e]=t.Parser.prototype.inlineTokenizers[n][e]})),t.Parser.prototype.inlineTokenizers[n]=r}))}function G(){var t=this.Parser.prototype,e=t.inlineTokenizers,n=t.inlineMethods;e.component=function(t,e,n){var r=/^\{([-\w]+)\}/.exec(e);if(r){if(n)return!0;var a=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n}}(t,e)||F(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,2),o=a[0],i=a[1];return t(o)({type:"component",component:"#".concat(i),value:""})}},e.component.locator=function(t,e){return t.indexOf("{",e)},n.splice(n.indexOf("text"),0,"component")}var Q=function(t,e,n,r,a,o,i,s,l,u){"boolean"!=typeof i&&(l=s,s=i,i=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,a&&(d.functional=!0)),r&&(d._scopeId=r),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=c):e&&(c=i?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return n}({},void 0,{name:"RichText",props:{text:{type:String,default:""},arguments:{type:Object,default:function(){return{}}},markdownCssClasses:{type:Object,default:function(){return{a:"rich-text--external-link",ol:"rich-text--ordered-list",ul:"rich-text--un-ordered-list",li:"rich-text--list-item",strong:"rich-text--strong",em:"rich-text--italic",h1:"rich-text--heading rich-text--heading-1",h2:"rich-text--heading rich-text--heading-2",h3:"rich-text--heading rich-text--heading-3",h4:"rich-text--heading rich-text--heading-4",h5:"rich-text--heading rich-text--heading-5",h6:"rich-text--heading rich-text--heading-6",hr:"rich-text--hr",table:"rich-text--table",pre:"rich-text--pre",code:"rich-text--code",blockquote:"rich-text--blockquote"}}},useMarkdown:{type:Boolean,default:!1},disableMarkdownInlineFeatures:{type:Array,default:function(){return[]}},disableMarkdownBlockFeatures:{type:Array,default:function(){return[]}},disableHTML:{type:Boolean,default:!0},autolink:{type:Boolean,default:!1}},computed:{remarkDisableOptions:function(){var t=this.autolink?[]:["url"],e=this.disableHTML?["html"]:[];return this.useMarkdown?{inline:[].concat(t,e,H(this.disableMarkdownInlineFeatures)),block:[].concat(e,H(this.disableMarkdownBlockFeatures))}:{inline:[].concat(t,["escape","autoLink","email","html","link","reference","strong","emphasis","deletion","code"]),block:["indentedCode","fencedCode","blockquote","atxHeading","thematicBreak","list","setextHeading","html","definition","table"]}}},render:function(t){var e=this,n=g()().use(y.a).use(D.a,{target:"_blank",rel:["noopener noreferrer"]}).use(w.a).use(W,this.remarkDisableOptions).use(x.a,{handlers:{component:function(t,e){return t(e,e.component,{value:e.value})}}}).use(O,this.markdownCssClasses).use(G).use(T.a,{createElement:function(n,r,a){if(!n.startsWith("#"))return t(n,r,a);var o=e.arguments[n.slice(1)];return o?o.component?t(o.component,{attrs:r,props:o.props,class:"rich-text--component"},a):t("span",r,[o]):t("span",P(P({},{attrs:r}),{class:"rich-text--fallback"}),["{".concat(n.slice(1),"}")])},prefix:!1}).processSync(this.text).result;return t("div",{class:"rich-text--wrapper"},[n])}},"data-v-30428f72",void 0,void 0,!1,void 0,void 0,void 0),J={name:"DefaultParameter",props:{type:{type:String,required:!0},id:{type:[Number,String],required:!0},name:{type:String,required:!0},link:{type:String,default:""}}},Z=(a(690),p(J,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.link?n("a",{staticClass:"external",attrs:{href:t.link,target:"_blank",rel:"noopener noreferrer"}},[n("strong",[t._v(t._s(t.name))])]):n("strong",[t._v(t._s(t.name))])}),[],!1,null,"49ca75ce",null).exports),q=p({name:"File",directives:{tooltip:u.a},props:{type:{type:String,required:!0},id:{type:[Number,String],required:!0},name:{type:String,required:!0},path:{type:String,default:""},link:{type:String,default:""}},computed:{title:function(){var e=this.path.lastIndexOf("/"),n=this.path.indexOf("/"),r=this.path.substring(0===n?1:0,e);return 0===r.length?"":t("notifications","in {path}",{path:r})}}},(function(){var t=this.$createElement;return(this._self._c||t)("a",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:this.title,expression:"title",modifiers:{bottom:!0}}],staticClass:"filename",attrs:{href:this.link}},[this._v(this._s(this.name))])}),[],!1,null,null,null).exports,V=a(424),X={name:"User",components:{UserBubble:a.n(V).a},props:{type:{type:String,required:!0},id:{type:String,required:!0},name:{type:String,required:!0},server:{type:String,default:""}},computed:{cloudId:function(){return this.server?this.id+"@"+this.server:""}}},K=(a(759),p(X,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"mention"},[this.cloudId?e("strong",{attrs:{title:this.cloudId}},[this._v("\n\t\t"+this._s(this.name)+"\n\t")]):e("UserBubble",{attrs:{"display-name":this.name,user:this.id}})],1)}),[],!1,null,"0fd54af1",null).exports),tt={name:"Notification",components:{Action:f,RichText:Q},directives:{tooltip:u.a},props:{notificationId:{type:Number,default:-1,required:!0},datetime:{type:String,default:"",required:!0},app:{type:String,default:"",required:!0},icon:{type:String,default:"",required:!0},link:{type:String,default:"",required:!0},user:{type:String,default:"",required:!0},message:{type:String,default:"",required:!0},messageRich:{type:String,default:"",required:!0},messageRichParameters:{type:[Object,Array],default:function(){return{}},required:!0},subject:{type:String,default:"",required:!0},subjectRich:{type:String,default:"",required:!0},subjectRichParameters:{type:[Object,Array],default:function(){return{}},required:!0},objectType:{type:String,default:"",required:!0},objectId:{type:String,default:"",required:!0},actions:{type:Array,default:function(){return[]},required:!0},index:{type:Number,default:-1,required:!0}},data:function(){return{showFullMessage:!1}},_$el:null,computed:{timestamp:function(){return new Date(this.datetime).valueOf()},absoluteDate:function(){return _()(this.timestamp).format("LLL")},relativeDate:function(){var e=_()().diff(_()(this.timestamp));return e>=0&&e<45e3?t("core","seconds ago"):_()(this.timestamp).fromNow()},useLink:function(){if(!this.link)return!1;var t=!1;return Object.keys(this.subjectRichParameters).forEach((function(e){e.link&&(t=!0)})),t},preparedSubjectParameters:function(){return this.prepareParameters(this.subjectRichParameters)},preparedMessageParameters:function(){return this.prepareParameters(this.messageRichParameters)},isCollapsedMessage:function(){return this.message.length>200&&!this.showFullMessage}},mounted:function(){this._$el=$(this.$el),void 0===this.$parent.$parent.showBrowserNotifications&&console.error("Failed to read showBrowserNotifications property from App component"),this.$parent.$parent.showBrowserNotifications&&this._createWebNotification()},methods:{prepareParameters:function(t){var e={};return Object.keys(t).forEach((function(n){var r=t[n].type;e[n]="user"===r?{component:K,props:t[n]}:"file"===r?{component:q,props:t[n]}:{component:Z,props:t[n]}})),e},onClickMessage:function(t){(t.target.classList.contains("rich-text--wrapper")||!this.messageRich&&this.message)&&(this.showFullMessage=!this.showFullMessage)},onDismissNotification:function(){var e=this;s.a.delete(Object(m.generateOcsUrl)("apps/notifications/api/v2",2)+"notifications/"+this.notificationId).then((function(){e.$emit("remove",e.index)})).catch((function(){Object(c.a)(t("notifications","Failed to dismiss notification"))}))},_createWebNotification:function(){var t=new Notification(this.subject,{title:this.subject,lang:OC.getLocale(),body:this.message,icon:this.icon,tag:this.notificationId});this.link&&(t.onclick=function(t){t.preventDefault(),window.location.href=this.link}.bind(this)),setTimeout(t.close.bind(t),5e3)}}},et=(a(761),p(tt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"notification",attrs:{"data-id":t.notificationId,"data-timestamp":t.timestamp}},[n("div",{staticClass:"notification-heading"},[n("span",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:t.absoluteDate,expression:"absoluteDate",modifiers:{bottom:!0}}],staticClass:"notification-time live-relative-timestamp",attrs:{"data-timestamp":t.timestamp}},[t._v(t._s(t.relativeDate))]),t._v(" "),n("div",{staticClass:"notification-delete",on:{click:t.onDismissNotification}},[n("span",{staticClass:"icon icon-close svg",attrs:{title:t.t("notifications","Dismiss")}})])]),t._v(" "),t.useLink?n("a",{staticClass:"notification-subject full-subject-link",attrs:{href:t.link}},[t.icon?n("span",{staticClass:"image"},[n("img",{staticClass:"notification-icon",attrs:{src:t.icon}})]):t._e(),t._v(" "),t.subjectRich?n("RichText",{attrs:{text:t.subjectRich,arguments:t.preparedSubjectParameters}}):n("span",{staticClass:"subject"},[t._v(t._s(t.subject))])],1):n("div",{staticClass:"notification-subject"},[t.icon?n("span",{staticClass:"image"},[n("img",{staticClass:"notification-icon",attrs:{src:t.icon}})]):t._e(),t._v(" "),t.subjectRich?n("RichText",{attrs:{text:t.subjectRich,arguments:t.preparedSubjectParameters}}):n("span",{staticClass:"subject"},[t._v(t._s(t.subject))])],1),t._v(" "),t.message?n("div",{staticClass:"notification-message",on:{click:t.onClickMessage}},[n("div",{staticClass:"message-container",class:{collapsed:t.isCollapsedMessage}},[t.messageRich?n("RichText",{attrs:{text:t.messageRich,arguments:t.preparedMessageParameters,autolink:!0}}):n("span",[t._v(t._s(t.message))])],1),t._v(" "),t.isCollapsedMessage?n("div",{staticClass:"notification-overflow"}):t._e()]):t._e(),t._v(" "),t.actions.length?n("div",{staticClass:"notification-actions"},t._l(t.actions,(function(e,r){return n("Action",t._b({key:r},"Action",e,!1))})),1):t._e()])}),[],!1,null,"38932a7f",null).exports),nt=a(27),rt=a(150),at=Object(rt.getBuilder)("notifications").clearOnLogout().persist().build();function ot(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}function it(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){ot(o,r,a,i,s,"next",t)}function s(t){ot(o,r,a,i,s,"throw",t)}i(void 0)}))}}
/**
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
*
@@ -334,7 +334,7 @@ t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeo
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */var st=function(){var t=it(regeneratorRuntime.mark((function t(e,n,r){var a,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=parseInt(at.getItem("lastUpdated"),10),o=at.getItem("tabId"),i=_()().format("X"),!(r||o===e&&a+25<i||a+35<i)){t.next=8;break}return at.setItem("tabId",e),at.setItem("lastUpdated",i),t.next=8,lt(n);case 8:return t.abrupt("return",{status:parseInt(at.getItem("status"),10),headers:JSON.parse(at.getItem("headers")||"[]"),data:JSON.parse(at.getItem("data")||"[]"),tabId:at.getItem("tabId"),lastUpdated:parseInt(at.getItem("lastUpdated"),10)});case 9:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),lt=function(){var t=it(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={},e&&(n={headers:{"If-None-Match":e}}),t.prev=2,t.next=5,s.a.get(Object(m.generateOcsUrl)("apps/notifications/api/v2",2)+"notifications",n);case 5:r=t.sent,at.setItem("status",""+r.status),204!==r.status&&(at.setItem("headers",JSON.stringify(r.headers)),at.setItem("data",JSON.stringify(r.data.ocs.data))),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),at.setItem("status",""+t.t0.response.status);case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e){return t.apply(this,arguments)}}(),ut=a(425);function ct(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}function dt(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){ct(o,r,a,i,s,"next",t)}function s(t){ct(o,r,a,i,s,"throw",t)}i(void 0)}))}}var pt={name:"App",components:{Notification:et},data:function(){return{webNotificationsGranted:null,hadNotifications:!1,backgroundFetching:!1,shutdown:!1,notifications:[],lastETag:null,lastTabId:null,userStatus:null,tabId:null,pollIntervalBase:3e4,pollIntervalCurrent:3e4,interval:null,pushEndpoints:null}},_$icon:null,computed:{iconPath:function(){var t="notifications";return(null===this.webNotificationsGranted||this.notifications.length)&&(this.isRedThemed()&&(t+="-red"),t+="-new"),this.invertedTheme()&&(t+="-dark"),Object(m.imagePath)("notifications",t)},showBrowserNotifications:function(){return this.backgroundFetching&&this.webNotificationsGranted&&"dnd"!==this.userStatus&&this.tabId!==this.lastTabId}},mounted:function(){var t=this;this.tabId=OC.requestToken||""+Math.random(),this._$icon=$(this.$refs.icon),OC.registerMenu($(this.$refs.button),$(this.$refs.container),void 0,!0),this.checkWebNotificationPermissions(),this._fetch(),Object(ut.listen)("notify_notification",(function(){t._fetch()}))&&(this.pollIntervalBase=9e5),this._setPollingInterval(this.pollIntervalBase),Object(nt.subscribe)("networkOffline",this.handleNetworkOffline),Object(nt.subscribe)("networkOnline",this.handleNetworkOnline)},beforeDestroy:function(){Object(nt.unsubscribe)("networkOffline",this.handleNetworkOffline),Object(nt.unsubscribe)("networkOnline",this.handleNetworkOnline)},updated:function(){this._$icon.attr("src",this.iconPath),!this.hadNotifications&&this.notifications.length&&this._$icon.animate({opacity:.6},600).animate({opacity:1},600).animate({opacity:.6},600).animate({opacity:1},600),this.hadNotifications=this.notifications.length>0},methods:{handleNetworkOffline:function(){this._setPollingInterval(10*this.pollIntervalBase)},handleNetworkOnline:function(){this._fetch(),this._setPollingInterval(this.pollIntervalBase)},setupBackgroundFetcher:function(){OC.config.session_keepalive&&(this.interval=window.setInterval(this._backgroundFetch.bind(this),this.pollIntervalCurrent))},onDismissAll:function(){var e=this;s.a.delete(Object(m.generateOcsUrl)("apps/notifications/api/v2",2)+"notifications").then((function(){e.notifications=[]})).catch((function(){Object(c.a)(t("notifications","Failed to dismiss all notifications"))}))},onRemove:function(t){this.notifications.splice(t,1)},invertedTheme:function(){return OCA.Theming&&OCA.Theming.inverted},isRedThemed:function(){if(OCA.Theming&&OCA.Theming.color){var t=this.rgbToHsl(OCA.Theming.color.substring(1,3),OCA.Theming.color.substring(3,5),OCA.Theming.color.substring(5,7)),e=360*t[0];return(e>=330||e<=15)&&t[1]>.7&&(t[2]>.1||t[2]<.6)}return!1},rgbToHsl:function(t,e,n){t=parseInt(t,16)/255,e=parseInt(e,16)/255,n=parseInt(n,16)/255;var r,a,o=Math.max(t,e,n),i=Math.min(t,e,n),s=(o+i)/2;if(o===i)r=a=0;else{var l=o-i;switch(a=s>.5?l/(2-o-i):l/(o+i),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return[r,a,s]},_fetch:function(){var t=this;return dt(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,st(t.tabId,t.lastETag,!t.backgroundFetching);case 2:204===(n=e.sent).status?t._setPollingInterval(10*t.pollIntervalBase):200===n.status?(t.userStatus=n.headers["x-nextcloud-user-status"],t.lastETag=n.headers.etag,t.lastTabId=n.lastTabId,t.notifications=n.data,t._setPollingInterval(t.pollIntervalBase)):304===n.status?t._setPollingInterval(t.pollIntervalBase):503===n.status?(console.info("Slowing down notifications: instance is in maintenance mode."),t._setPollingInterval(10*t.pollIntervalBase)):404===n.status?(console.info("Slowing down notifications: app is disabled."),t._setPollingInterval(10*t.pollIntervalBase)):(console.info("Slowing down notifications: Status "+n.status),t._setPollingInterval(10*t.pollIntervalBase));case 4:case"end":return e.stop()}}),e)})))()},_backgroundFetch:function(){this.backgroundFetching=!0,this._fetch()},_setPollingInterval:function(t){this.interval&&t===this.pollIntervalCurrent||(this.interval&&(window.clearInterval(this.interval),this.interval=null),this.pollIntervalCurrent=t,this.setupBackgroundFetcher())},_shutDownNotifications:function(t){this.interval&&(window.clearInterval(this.interval),this.interval=null),this.shutdown=!t},checkWebNotificationPermissions:function(){return"Notification"in window?"granted"===window.Notification.permission?(console.debug("Notifications permissions granted"),void(this.webNotificationsGranted=!0)):"denied"===window.Notification.permission?(console.debug("Notifications permissions denied"),void(this.webNotificationsGranted=!1)):void console.info("Notifications permissions not yet requested"):(console.info("Browser does not support notifications"),void(this.webNotificationsGranted=!1))},requestWebNotificationPermissions:function(){var t=this;return dt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===t.webNotificationsGranted){e.next=2;break}return e.abrupt("return");case 2:console.info("Requesting notifications permissions"),window.Notification.requestPermission().then((function(e){t.webNotificationsGranted="granted"===e}));case 4:case"end":return e.stop()}}),e)})))()}}},ft=(a(763),p(pt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.shutdown?t._e():n("div",{staticClass:"notifications"},[n("div",{ref:"button",staticClass:"notifications-button menutoggle",class:{hasNotifications:t.notifications.length},attrs:{tabindex:"0",role:"button","aria-label":t.t("notifications","Notifications"),"aria-haspopup":"true","aria-controls":"notification-container","aria-expanded":"false"},on:{click:t.requestWebNotificationPermissions}},[n("img",{ref:"icon",staticClass:"svg",attrs:{alt:"",title:t.t("notifications","Notifications"),src:t.iconPath}})]),t._v(" "),n("div",{ref:"container",staticClass:"notification-container"},[n("transition",{attrs:{name:"fade"}},[t.notifications.length>0?n("ul",{staticClass:"notification-wrapper"},[n("transition-group",{attrs:{name:"fade-collapse",tag:"li"}},t._l(t.notifications,(function(e,r){return n("Notification",t._b({key:e.notification_id,attrs:{index:r,"notification-id":e.notification_id,"object-id":e.object_id,"object-type":e.object_type},on:{remove:t.onRemove}},"Notification",e,!1))})),1),t._v(" "),t.notifications.length>2?n("li",[n("div",{staticClass:"dismiss-all",on:{click:t.onDismissAll}},[n("span",{staticClass:"icon icon-close svg",attrs:{title:t.t("notifications","Dismiss all notifications")}}),t._v(" "+t._s(t.t("notifications","Dismiss all notifications"))+"\n\t\t\t\t\t")])]):t._e()],1):n("div",{staticClass:"emptycontent"},[n("div",{staticClass:"icon icon-notifications-dark"}),t._v(" "),null===t.webNotificationsGranted?n("h2",[t._v("\n\t\t\t\t\t"+t._s(t.t("notifications","Requesting browser permissions to show notifications"))+"\n\t\t\t\t")]):n("h2",[t._v("\n\t\t\t\t\t"+t._s(t.t("notifications","No notifications"))+"\n\t\t\t\t")])])])],1)])}),[],!1,null,"ce8f06d2",null).exports);a(765);
+ */var st=function(){var t=it(regeneratorRuntime.mark((function t(e,n,r){var a,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=parseInt(at.getItem("lastUpdated"),10),o=at.getItem("tabId"),i=_()().format("X"),!(r||o===e&&a+25<i||a+35<i)){t.next=8;break}return at.setItem("tabId",e),at.setItem("lastUpdated",i),t.next=8,lt(n);case 8:return t.abrupt("return",{status:parseInt(at.getItem("status"),10),headers:JSON.parse(at.getItem("headers")||"[]"),data:JSON.parse(at.getItem("data")||"[]"),tabId:at.getItem("tabId"),lastUpdated:parseInt(at.getItem("lastUpdated"),10)});case 9:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),lt=function(){var t=it(regeneratorRuntime.mark((function t(e){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={},e&&(n={headers:{"If-None-Match":e}}),t.prev=2,t.next=5,s.a.get(Object(m.generateOcsUrl)("apps/notifications/api/v2",2)+"notifications",n);case 5:r=t.sent,at.setItem("status",""+r.status),204!==r.status&&(at.setItem("headers",JSON.stringify(r.headers)),at.setItem("data",JSON.stringify(r.data.ocs.data))),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(2),at.setItem("status",""+t.t0.response.status);case 13:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e){return t.apply(this,arguments)}}(),ut=a(425);function ct(t,e,n,r,a,o,i){try{var s=t[o](i),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,a)}function dt(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var o=t.apply(e,n);function i(t){ct(o,r,a,i,s,"next",t)}function s(t){ct(o,r,a,i,s,"throw",t)}i(void 0)}))}}var pt={name:"App",components:{Notification:et},data:function(){return{webNotificationsGranted:null,hadNotifications:!1,backgroundFetching:!1,shutdown:!1,notifications:[],lastETag:null,lastTabId:null,userStatus:null,tabId:null,pollIntervalBase:3e4,pollIntervalCurrent:3e4,interval:null,pushEndpoints:null}},_$icon:null,computed:{iconPath:function(){var t="notifications";return(null===this.webNotificationsGranted||this.notifications.length)&&(this.isRedThemed()&&(t+="-red"),t+="-new"),this.invertedTheme()&&(t+="-dark"),Object(m.imagePath)("notifications",t)},showBrowserNotifications:function(){return this.backgroundFetching&&this.webNotificationsGranted&&"dnd"!==this.userStatus&&this.tabId===this.lastTabId}},mounted:function(){var t=this;this.tabId=OC.requestToken||""+Math.random(),this._$icon=$(this.$refs.icon),OC.registerMenu($(this.$refs.button),$(this.$refs.container),void 0,!0),this.checkWebNotificationPermissions(),this._fetch(),Object(ut.listen)("notify_notification",(function(){t._fetch()}))&&(this.pollIntervalBase=9e5),this._setPollingInterval(this.pollIntervalBase),Object(nt.subscribe)("networkOffline",this.handleNetworkOffline),Object(nt.subscribe)("networkOnline",this.handleNetworkOnline)},beforeDestroy:function(){Object(nt.unsubscribe)("networkOffline",this.handleNetworkOffline),Object(nt.unsubscribe)("networkOnline",this.handleNetworkOnline)},updated:function(){this._$icon.attr("src",this.iconPath),!this.hadNotifications&&this.notifications.length&&this._$icon.animate({opacity:.6},600).animate({opacity:1},600).animate({opacity:.6},600).animate({opacity:1},600),this.hadNotifications=this.notifications.length>0},methods:{handleNetworkOffline:function(){this._setPollingInterval(10*this.pollIntervalBase)},handleNetworkOnline:function(){this._fetch(),this._setPollingInterval(this.pollIntervalBase)},setupBackgroundFetcher:function(){OC.config.session_keepalive&&(this.interval=window.setInterval(this._backgroundFetch.bind(this),this.pollIntervalCurrent))},onDismissAll:function(){var e=this;s.a.delete(Object(m.generateOcsUrl)("apps/notifications/api/v2",2)+"notifications").then((function(){e.notifications=[]})).catch((function(){Object(c.a)(t("notifications","Failed to dismiss all notifications"))}))},onRemove:function(t){this.notifications.splice(t,1)},invertedTheme:function(){return OCA.Theming&&OCA.Theming.inverted},isRedThemed:function(){if(OCA.Theming&&OCA.Theming.color){var t=this.rgbToHsl(OCA.Theming.color.substring(1,3),OCA.Theming.color.substring(3,5),OCA.Theming.color.substring(5,7)),e=360*t[0];return(e>=330||e<=15)&&t[1]>.7&&(t[2]>.1||t[2]<.6)}return!1},rgbToHsl:function(t,e,n){t=parseInt(t,16)/255,e=parseInt(e,16)/255,n=parseInt(n,16)/255;var r,a,o=Math.max(t,e,n),i=Math.min(t,e,n),s=(o+i)/2;if(o===i)r=a=0;else{var l=o-i;switch(a=s>.5?l/(2-o-i):l/(o+i),o){case t:r=(e-n)/l+(e<n?6:0);break;case e:r=(n-t)/l+2;break;case n:r=(t-e)/l+4}r/=6}return[r,a,s]},_fetch:function(){var t=this;return dt(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,st(t.tabId,t.lastETag,!t.backgroundFetching);case 2:204===(n=e.sent).status?t._setPollingInterval(10*t.pollIntervalBase):200===n.status?(t.userStatus=n.headers["x-nextcloud-user-status"],t.lastETag=n.headers.etag,t.lastTabId=n.tabId,t.notifications=n.data,t._setPollingInterval(t.pollIntervalBase)):304===n.status?t._setPollingInterval(t.pollIntervalBase):503===n.status?(console.info("Slowing down notifications: instance is in maintenance mode."),t._setPollingInterval(10*t.pollIntervalBase)):404===n.status?(console.info("Slowing down notifications: app is disabled."),t._setPollingInterval(10*t.pollIntervalBase)):(console.info("Slowing down notifications: Status "+n.status),t._setPollingInterval(10*t.pollIntervalBase));case 4:case"end":return e.stop()}}),e)})))()},_backgroundFetch:function(){this.backgroundFetching=!0,this._fetch()},_setPollingInterval:function(t){this.interval&&t===this.pollIntervalCurrent||(this.interval&&(window.clearInterval(this.interval),this.interval=null),this.pollIntervalCurrent=t,this.setupBackgroundFetcher())},_shutDownNotifications:function(t){this.interval&&(window.clearInterval(this.interval),this.interval=null),this.shutdown=!t},checkWebNotificationPermissions:function(){return"Notification"in window?"granted"===window.Notification.permission?(console.debug("Notifications permissions granted"),void(this.webNotificationsGranted=!0)):"denied"===window.Notification.permission?(console.debug("Notifications permissions denied"),void(this.webNotificationsGranted=!1)):void console.info("Notifications permissions not yet requested"):(console.info("Browser does not support notifications"),void(this.webNotificationsGranted=!1))},requestWebNotificationPermissions:function(){var t=this;return dt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===t.webNotificationsGranted){e.next=2;break}return e.abrupt("return");case 2:console.info("Requesting notifications permissions"),window.Notification.requestPermission().then((function(e){t.webNotificationsGranted="granted"===e}));case 4:case"end":return e.stop()}}),e)})))()}}},ft=(a(763),p(pt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.shutdown?t._e():n("div",{staticClass:"notifications"},[n("div",{ref:"button",staticClass:"notifications-button menutoggle",class:{hasNotifications:t.notifications.length},attrs:{tabindex:"0",role:"button","aria-label":t.t("notifications","Notifications"),"aria-haspopup":"true","aria-controls":"notification-container","aria-expanded":"false"},on:{click:t.requestWebNotificationPermissions}},[n("img",{ref:"icon",staticClass:"svg",attrs:{alt:"",title:t.t("notifications","Notifications"),src:t.iconPath}})]),t._v(" "),n("div",{ref:"container",staticClass:"notification-container"},[n("transition",{attrs:{name:"fade"}},[t.notifications.length>0?n("ul",{staticClass:"notification-wrapper"},[n("transition-group",{attrs:{name:"fade-collapse",tag:"li"}},t._l(t.notifications,(function(e,r){return n("Notification",t._b({key:e.notification_id,attrs:{index:r,"notification-id":e.notification_id,"object-id":e.object_id,"object-type":e.object_type},on:{remove:t.onRemove}},"Notification",e,!1))})),1),t._v(" "),t.notifications.length>2?n("li",[n("div",{staticClass:"dismiss-all",on:{click:t.onDismissAll}},[n("span",{staticClass:"icon icon-close svg",attrs:{title:t.t("notifications","Dismiss all notifications")}}),t._v(" "+t._s(t.t("notifications","Dismiss all notifications"))+"\n\t\t\t\t\t")])]):t._e()],1):n("div",{staticClass:"emptycontent"},[n("div",{staticClass:"icon icon-notifications-dark"}),t._v(" "),null===t.webNotificationsGranted?n("h2",[t._v("\n\t\t\t\t\t"+t._s(t.t("notifications","Requesting browser permissions to show notifications"))+"\n\t\t\t\t")]):n("h2",[t._v("\n\t\t\t\t\t"+t._s(t.t("notifications","No notifications"))+"\n\t\t\t\t")])])])],1)])}),[],!1,null,"455361fd",null).exports);a(765);
/**
* @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
*
@@ -355,4 +355,4 @@ t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeo
*
*/
o.default.prototype.t=t,o.default.prototype.n=n,o.default.prototype.OC=OC,o.default.prototype.OCA=OCA;r.default=new o.default({el:"#notifications",render:function(t){return t(ft)}})}]);
-//# sourceMappingURL=notifications-main.js.map?v=279e8a2eb00971177e87 \ No newline at end of file
+//# sourceMappingURL=notifications-main.js.map?v=a6200f901dc23686c1c2 \ No newline at end of file