From 75edf61c0e103f89a5b0032087ea7b11e81dbb08 Mon Sep 17 00:00:00 2001 From: Peter Ringelmann Date: Tue, 8 Sep 2026 18:11:02 +0200 Subject: [PATCH 1/2] perf(user_status): skip heartbeats another tab already sent Signed-off-by: Peter Ringelmann --- .../src/services/heartbeatScheduler.spec.ts | 72 +++++++++++++++++++ .../src/services/heartbeatScheduler.ts | 40 ++++++++++- 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/apps/user_status/src/services/heartbeatScheduler.spec.ts b/apps/user_status/src/services/heartbeatScheduler.spec.ts index ddb9234de6fe8..6255fe4c519be 100644 --- a/apps/user_status/src/services/heartbeatScheduler.spec.ts +++ b/apps/user_status/src/services/heartbeatScheduler.spec.ts @@ -3,16 +3,21 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +import { getBuilder } from '@nextcloud/browser-storage' import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' import { AWAY_TIMEOUT, HEARTBEAT_INTERVAL, + HEARTBEAT_THROTTLE, MOUSE_MOVE_DEBOUNCE, startHeartbeat, } from './heartbeatScheduler.ts' const HOUR = 60 * 60 * 1000 +// The same scoped store the scheduler writes to, so seeding uses the real key +const storage = getBuilder('user_status').clearOnLogout().persist().build() + let stop: (() => void) | undefined /** @@ -37,6 +42,7 @@ describe('heartbeat scheduler', () => { beforeEach(() => { vi.clearAllTimers() vi.resetAllMocks() + localStorage.clear() }) afterEach(() => { @@ -118,4 +124,70 @@ describe('heartbeat scheduler', () => { expect(beat).toHaveBeenCalledTimes(1) expect(vi.getTimerCount()).toBe(0) }) + + it('skips the start heartbeat when another tab reported recently', () => { + storage.setItem('lastHeartbeat', String(Date.now() - HEARTBEAT_THROTTLE + 1000)) + const beat = vi.fn() + stop = startHeartbeat(beat) + + expect(beat).not.toHaveBeenCalled() + }) + + it('sends the start heartbeat once the throttle window has passed', () => { + storage.setItem('lastHeartbeat', String(Date.now() - HEARTBEAT_THROTTLE - 1000)) + const beat = vi.fn() + stop = startHeartbeat(beat) + + expect(beat).toHaveBeenCalledTimes(1) + }) + + it.each([ + ['a timestamp from the future', () => String(Date.now() + HOUR)], + ['an unparseable timestamp', () => 'not a number'], + ])('sends the start heartbeat despite %s', (_label, stored) => { + storage.setItem('lastHeartbeat', stored()) + const beat = vi.fn() + stop = startHeartbeat(beat) + + expect(beat).toHaveBeenCalledTimes(1) + }) + + it('sends one heartbeat in total for two schedulers on the same page', () => { + const first = vi.fn() + const second = vi.fn() + stop = startHeartbeat(first) + const stopSecond = startHeartbeat(second) + + expect(first).toHaveBeenCalledTimes(1) + expect(second).not.toHaveBeenCalled() + stopSecond() + }) + + it('never throttles the user coming back from away', async () => { + const beat = vi.fn() + stop = startHeartbeat(beat) + + window.dispatchEvent(new MouseEvent('mousemove')) + await vi.advanceTimersByTimeAsync(AWAY_TIMEOUT + MOUSE_MOVE_DEBOUNCE) + beat.mockClear() + + // Well inside the throttle window + window.dispatchEvent(new MouseEvent('mousemove')) + + expect(beat).toHaveBeenCalledTimes(1) + }) + + it('waits for the first reveal before announcing a background tab', () => { + const visibility = vi.spyOn(document, 'visibilityState', 'get').mockReturnValue('hidden') + const beat = vi.fn() + stop = startHeartbeat(beat) + + expect(beat).not.toHaveBeenCalled() + + visibility.mockReturnValue('visible') + document.dispatchEvent(new Event('visibilitychange')) + + expect(beat).toHaveBeenCalledTimes(1) + visibility.mockRestore() + }) }) diff --git a/apps/user_status/src/services/heartbeatScheduler.ts b/apps/user_status/src/services/heartbeatScheduler.ts index 2102254c9b2a1..de0403018b62e 100644 --- a/apps/user_status/src/services/heartbeatScheduler.ts +++ b/apps/user_status/src/services/heartbeatScheduler.ts @@ -3,8 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ +import { getBuilder } from '@nextcloud/browser-storage' import debounce from 'debounce' +const browserStorage = getBuilder('user_status').clearOnLogout().persist().build() + /** Has to stay below the server margin between `StatusService::REFRESH_STATUS_THRESHOLD` and `StatusService::INVALIDATE_STATUS_THRESHOLD`. */ export const HEARTBEAT_INTERVAL = 5 * 60 * 1000 @@ -12,6 +15,9 @@ export const AWAY_TIMEOUT = 2 * 60 * 1000 export const MOUSE_MOVE_DEBOUNCE = 2 * 1000 +/** Below `HEARTBEAT_INTERVAL`, so a lone tab is never suppressed and its gap to the server never grows. */ +export const HEARTBEAT_THROTTLE = 4 * 60 * 1000 + /** * Send heartbeats on a fixed interval, and once more whenever the user comes back from being away. * @@ -21,6 +27,18 @@ export const MOUSE_MOVE_DEBOUNCE = 2 * 1000 export function startHeartbeat(beat: (isAway: boolean) => void): () => void { let isAway = false let awayTimeout: ReturnType | undefined + let onVisible: (() => void) | undefined + + const announce = (force = false) => { + // NaN (missing or unparseable) and a negative age (future timestamp) + // both fail this test, so both send + const age = Date.now() - Number.parseInt(browserStorage.getItem('lastHeartbeat') ?? '', 10) + if (!force && age >= 0 && age < HEARTBEAT_THROTTLE) { + return + } + browserStorage.setItem('lastHeartbeat', String(Date.now())) + beat(isAway) + } const onMouseMove = debounce(() => { const wasAway = isAway @@ -32,22 +50,38 @@ export function startHeartbeat(beat: (isAway: boolean) => void): () => void { }, AWAY_TIMEOUT) if (wasAway) { - beat(isAway) + // Coming back is real signal, so it is never throttled + announce(true) } }, MOUSE_MOVE_DEBOUNCE, { immediate: true }) - const interval = setInterval(() => beat(isAway), HEARTBEAT_INTERVAL) + const interval = setInterval(() => announce(), HEARTBEAT_INTERVAL) window.addEventListener('mousemove', onMouseMove, { capture: true, passive: true, }) - beat(isAway) + if (document.visibilityState === 'hidden') { + // A tab opened in the background has nothing to report until it is looked at + onVisible = () => { + if (document.visibilityState === 'hidden') { + return + } + document.removeEventListener('visibilitychange', onVisible!) + announce() + } + document.addEventListener('visibilitychange', onVisible) + } else { + announce() + } return () => { clearInterval(interval) clearTimeout(awayTimeout) onMouseMove.clear() window.removeEventListener('mousemove', onMouseMove, { capture: true }) + if (onVisible) { + document.removeEventListener('visibilitychange', onVisible) + } } } From d810bbb3ec2bf245ed80695394fc2094aee7822b Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Thu, 10 Sep 2026 10:15:30 +0000 Subject: [PATCH 2/2] chore(assets): Recompile assets Signed-off-by: nextcloud-command --- dist/user_status-menu.mjs | 2 +- dist/user_status-menu.mjs.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/user_status-menu.mjs b/dist/user_status-menu.mjs index d42cd76977586..eb95475de33c4 100644 --- a/dist/user_status-menu.mjs +++ b/dist/user_status-menu.mjs @@ -1,3 +1,3 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/SetStatusModal-ByuIyikD.chunk.mjs'),window.OC.filePath('', '', 'dist/index-DtFnHTNv.chunk.mjs'),window.OC.filePath('', '', 'dist/preload-helper-DaivvT3M.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BgeXkQgu.chunk.mjs'),window.OC.filePath('', '', 'dist/NcModal-CE9u3Gsc.chunk.mjs'),window.OC.filePath('', '', 'dist/Check-KMcgcx9_.chunk.mjs'),window.OC.filePath('', '', 'dist/Web-DAo7hh-V.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CWUMrdUf.chunk.mjs'),window.OC.filePath('', '', 'dist/public-DUDgMnHe.chunk.mjs'),window.OC.filePath('', '', 'dist/_plugin-vue_export-helper-CqVUm19z.chunk.mjs'),window.OC.filePath('', '', 'dist/common-Web-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/common-Check-3plNpBrB.chunk.css'),window.OC.filePath('', '', 'dist/common-NcModal-BPjW7F4U.chunk.css'),window.OC.filePath('', '', 'dist/formatRelative-CtrHxjNv.chunk.mjs'),window.OC.filePath('', '', 'dist/common-formatRelative-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/common-mdi-DYA_tnKg.chunk.css'),window.OC.filePath('', '', 'dist/NcNoteCard-B1HE2gEt.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcNoteCard-BWNFKLbC.chunk.css'),window.OC.filePath('', '', 'dist/index-B7p2yACf.chunk.mjs'),window.OC.filePath('', '', 'dist/NcTextField.vue_vue_type_script_setup_true_lang-DFHMl-Af.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-BwjlRAaG.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcInputField-B5YBBomo.chunk.css'),window.OC.filePath('', '', 'dist/common-index-lRjtpfvB.chunk.css'),window.OC.filePath('', '', 'dist/NcEmojiPicker-CT65kTpS.chunk.mjs'),window.OC.filePath('', '', 'dist/emoji-nsQ5Oi3i.chunk.mjs'),window.OC.filePath('', '', 'dist/index-CFcNW3nM.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-BvEosbt9.chunk.mjs'),window.OC.filePath('', '', 'dist/common-index-bfXBK-tQ.chunk.css'),window.OC.filePath('', '', 'dist/common-NcEmojiPicker-ChsL0oK6.chunk.css'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-BneCMAh5.chunk.mjs'),window.OC.filePath('', '', 'dist/TrashCanOutline-C1Npic_W.chunk.mjs'),window.OC.filePath('', '', 'dist/util-BUUeB7_Z.chunk.mjs'),window.OC.filePath('', '', 'dist/common-NcUserStatusIcon-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/TrayArrowDown-BLvClPCQ.chunk.mjs'),window.OC.filePath('', '', 'dist/common-TrayArrowDown-BEbvWlY3.chunk.css'),window.OC.filePath('', '', 'dist/user_status-SetStatusModal-FTEE4Jmr.chunk.css')])))=>i.map(i=>d[i]); -import{g as ft,c as g,a as v,u as mt,s as K,e as I}from"./public-DUDgMnHe.chunk.mjs";import{ab as ht,Q as gt,B as z,p as _t,r as M,o as O,g as F,c as N,w as C,k as E,n as j,O as G,j as yt,t as vt,i as bt,F as St,a as wt,_ as It,f as q}from"./preload-helper-DaivvT3M.chunk.mjs";import{g as Mt,N as Ot}from"./Check-KMcgcx9_.chunk.mjs";import{N as kt}from"./TrayArrowDown-BLvClPCQ.chunk.mjs";import{N as At}from"./NcUserStatusIcon-BneCMAh5.chunk.mjs";import{a as Ct}from"./index-DtFnHTNv.chunk.mjs";import{t as h}from"./index-CWUMrdUf.chunk.mjs";import{c as _}from"./TrashCanOutline-C1Npic_W.chunk.mjs";import{_ as Et,l as jt}from"./_plugin-vue_export-helper-CqVUm19z.chunk.mjs";import{f as $,r as Tt}from"./NcModal-CE9u3Gsc.chunk.mjs";import"./Web-DAo7hh-V.chunk.mjs";import"./mdi-BgeXkQgu.chunk.mjs";import"./formatRelative-CtrHxjNv.chunk.mjs";import"./NcNoteCard-B1HE2gEt.chunk.mjs";import"./util-BUUeB7_Z.chunk.mjs";const X=ft().detectLogLevel().setApp("user_status").build();function Pt(){return Y().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Y(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const xt=typeof Proxy=="function",Dt="devtools-plugin:setup",Lt="plugin:settings:set";let w,x;function Ut(){var t;return w!==void 0||(typeof window<"u"&&window.performance?(w=!0,x=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(w=!0,x=globalThis.perf_hooks.performance):w=!1),w}function Ft(){return Ut()?x.now():Date.now()}class Nt{constructor(e,s){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=s;const a={};if(e.settings)for(const r in e.settings){const i=e.settings[r];a[r]=i.defaultValue}const n=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},a);try{const r=localStorage.getItem(n),i=JSON.parse(r);Object.assign(o,i)}catch{}this.fallbacks={getSettings(){return o},setSettings(r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}o=r},now(){return Ft()}},s&&s.on(Lt,(r,i)=>{r===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(r,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(r,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:i,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const s of this.onQueue)this.target.on[s.method](...s.args);for(const s of this.targetQueue)s.resolve(await this.target[s.method](...s.args))}}function Gt(t,e){const s=t,a=Y(),n=Pt(),o=xt&&s.enableEarlyProxy;if(n&&(a.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))n.emit(Dt,t,e);else{const r=o?new Nt(s,n):null;(a.__VUE_DEVTOOLS_PLUGINS__=a.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:s,setupFn:e,proxy:r}),r&&e(r.proxiedTarget)}}var $t="store";function S(t,e){Object.keys(t).forEach(function(s){return e(t[s],s)})}function Z(t){return t!==null&&typeof t=="object"}function Bt(t){return t&&typeof t.then=="function"}function Vt(t,e){return function(){return t(e)}}function B(t,e,s){return e.indexOf(t)<0&&(s&&s.prepend?e.unshift(t):e.push(t)),function(){var a=e.indexOf(t);a>-1&&e.splice(a,1)}}function V(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var s=t.state;A(t,s,[],t._modules.root,!0),L(t,s,e)}function L(t,e,s){var a=t._state,n=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,r={},i={},u=ht(!0);u.run(function(){S(o,function(c,l){r[l]=Vt(c,t),i[l]=_t(function(){return r[l]()}),Object.defineProperty(t.getters,l,{get:function(){return i[l].value},enumerable:!0})})}),t._state=gt({data:e}),t._scope=u,t.strict&&Jt(t),a&&s&&t._withCommit(function(){a.data=null}),n&&n.stop()}function A(t,e,s,a,n){var o=!s.length,r=t._modules.getNamespace(s);if(a.namespaced&&(t._modulesNamespaceMap[r],t._modulesNamespaceMap[r]=a),!o&&!n){var i=U(e,s.slice(0,-1)),u=s[s.length-1];t._withCommit(function(){i[u]=a.state})}var c=a.context=Ht(t,r,s);a.forEachMutation(function(l,d){var p=r+d;Qt(t,p,l,c)}),a.forEachAction(function(l,d){var p=l.root?d:r+d,pt=l.handler||l;Rt(t,p,pt,c)}),a.forEachGetter(function(l,d){var p=r+d;Wt(t,p,l,c)}),a.forEachChild(function(l,d){A(t,e,s.concat(d),l,n)})}function Ht(t,e,s){var a=e==="",n={dispatch:a?t.dispatch:function(o,r,i){var u=k(o,r,i),c=u.payload,l=u.options,d=u.type;return(!l||!l.root)&&(d=e+d),t.dispatch(d,c)},commit:a?t.commit:function(o,r,i){var u=k(o,r,i),c=u.payload,l=u.options,d=u.type;(!l||!l.root)&&(d=e+d),t.commit(d,c,l)}};return Object.defineProperties(n,{getters:{get:a?function(){return t.getters}:function(){return tt(t,e)}},state:{get:function(){return U(t.state,s)}}}),n}function tt(t,e){if(!t._makeLocalGettersCache[e]){var s={},a=e.length;Object.keys(t.getters).forEach(function(n){if(n.slice(0,a)===e){var o=n.slice(a);Object.defineProperty(s,o,{get:function(){return t.getters[n]},enumerable:!0})}}),t._makeLocalGettersCache[e]=s}return t._makeLocalGettersCache[e]}function Qt(t,e,s,a){var n=t._mutations[e]||(t._mutations[e]=[]);n.push(function(o){s.call(t,a.state,o)})}function Rt(t,e,s,a){var n=t._actions[e]||(t._actions[e]=[]);n.push(function(o){var r=s.call(t,{dispatch:a.dispatch,commit:a.commit,getters:a.getters,state:a.state,rootGetters:t.getters,rootState:t.state},o);return Bt(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(i){throw t._devtoolHook.emit("vuex:error",i),i}):r})}function Wt(t,e,s,a){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(n){return s(a.state,a.getters,n.state,n.getters)})}function Jt(t){z(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function U(t,e){return e.reduce(function(s,a){return s[a]},t)}function k(t,e,s){return Z(t)&&t.type&&(s=e,e=t,t=t.type),{type:t,payload:e,options:s}}var Kt="vuex bindings",H="vuex:mutations",T="vuex:actions",b="vuex",zt=0;function qt(t,e){Gt({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[Kt]},function(s){s.addTimelineLayer({id:H,label:"Vuex Mutations",color:Q}),s.addTimelineLayer({id:T,label:"Vuex Actions",color:Q}),s.addInspector({id:b,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),s.on.getInspectorTree(function(a){if(a.app===t&&a.inspectorId===b)if(a.filter){var n=[];nt(n,e._modules.root,a.filter,""),a.rootNodes=n}else a.rootNodes=[at(e._modules.root,"")]}),s.on.getInspectorState(function(a){if(a.app===t&&a.inspectorId===b){var n=a.nodeId;tt(e,n),a.state=Zt(ee(e._modules,n),n==="root"?e.getters:e._makeLocalGettersCache,n)}}),s.on.editInspectorState(function(a){if(a.app===t&&a.inspectorId===b){var n=a.nodeId,o=a.path;n!=="root"&&(o=n.split("/").filter(Boolean).concat(o)),e._withCommit(function(){a.set(e._state.data,o,a.state.value)})}}),e.subscribe(function(a,n){var o={};a.payload&&(o.payload=a.payload),o.state=n,s.notifyComponentUpdate(),s.sendInspectorTree(b),s.sendInspectorState(b),s.addTimelineEvent({layerId:H,event:{time:Date.now(),title:a.type,data:o}})}),e.subscribeAction({before:function(a,n){var o={};a.payload&&(o.payload=a.payload),a._id=zt++,a._time=Date.now(),o.state=n,s.addTimelineEvent({layerId:T,event:{time:a._time,title:a.type,groupId:a._id,subtitle:"start",data:o}})},after:function(a,n){var o={},r=Date.now()-a._time;o.duration={_custom:{type:"duration",display:r+"ms",tooltip:"Action duration",value:r}},a.payload&&(o.payload=a.payload),o.state=n,s.addTimelineEvent({layerId:T,event:{time:Date.now(),title:a.type,groupId:a._id,subtitle:"end",data:o}})}})})}var Q=8702998,Xt=6710886,Yt=16777215,et={label:"namespaced",textColor:Yt,backgroundColor:Xt};function st(t){return t&&t!=="root"?t.split("/").slice(-2,-1)[0]:"Root"}function at(t,e){return{id:e||"root",label:st(e),tags:t.namespaced?[et]:[],children:Object.keys(t._children).map(function(s){return at(t._children[s],e+s+"/")})}}function nt(t,e,s,a){a.includes(s)&&t.push({id:a||"root",label:a.endsWith("/")?a.slice(0,a.length-1):a||"Root",tags:e.namespaced?[et]:[]}),Object.keys(e._children).forEach(function(n){nt(t,e._children[n],s,a+n+"/")})}function Zt(t,e,s){e=s==="root"?e:e[s];var a=Object.keys(e),n={state:Object.keys(t.state).map(function(r){return{key:r,editable:!0,value:t.state[r]}})};if(a.length){var o=te(e);n.getters=Object.keys(o).map(function(r){return{key:r.endsWith("/")?st(r):r,editable:!1,value:D(function(){return o[r]})}})}return n}function te(t){var e={};return Object.keys(t).forEach(function(s){var a=s.split("/");if(a.length>1){var n=e,o=a.pop();a.forEach(function(r){n[r]||(n[r]={_custom:{value:{},display:r,tooltip:"Module",abstract:!0}}),n=n[r]._custom.value}),n[o]=D(function(){return t[s]})}else e[s]=D(function(){return t[s]})}),e}function ee(t,e){var s=e.split("/").filter(function(a){return a});return s.reduce(function(a,n,o){var r=a[n];if(!r)throw new Error('Missing module "'+n+'" for path "'+e+'".');return o===s.length-1?r:r._children},e==="root"?t:t.root._children)}function D(t){try{return t()}catch(e){return e}}var m=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var s=t.state;this.state=(typeof s=="function"?s():s)||{}},R={namespaced:{configurable:!0}};R.namespaced.get=function(){return!!this._rawModule.namespaced},m.prototype.addChild=function(t,e){this._children[t]=e},m.prototype.removeChild=function(t){delete this._children[t]},m.prototype.getChild=function(t){return this._children[t]},m.prototype.hasChild=function(t){return t in this._children},m.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},m.prototype.forEachChild=function(t){S(this._children,t)},m.prototype.forEachGetter=function(t){this._rawModule.getters&&S(this._rawModule.getters,t)},m.prototype.forEachAction=function(t){this._rawModule.actions&&S(this._rawModule.actions,t)},m.prototype.forEachMutation=function(t){this._rawModule.mutations&&S(this._rawModule.mutations,t)},Object.defineProperties(m.prototype,R);var y=function(t){this.register([],t,!1)};y.prototype.get=function(t){return t.reduce(function(e,s){return e.getChild(s)},this.root)},y.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(s,a){return e=e.getChild(a),s+(e.namespaced?a+"/":"")},"")},y.prototype.update=function(t){ot([],this.root,t)},y.prototype.register=function(t,e,s){var a=this;s===void 0&&(s=!0);var n=new m(e,s);if(t.length===0)this.root=n;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],n)}e.modules&&S(e.modules,function(r,i){a.register(t.concat(i),r,s)})},y.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),s=t[t.length-1],a=e.getChild(s);a&&a.runtime&&e.removeChild(s)},y.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),s=t[t.length-1];return e?e.hasChild(s):!1};function ot(t,e,s){if(e.update(s),s.modules)for(var a in s.modules){if(!e.getChild(a))return;ot(t.concat(a),e.getChild(a),s.modules[a])}}function se(t){return new f(t)}var f=function(t){var e=this;t===void 0&&(t={});var s=t.plugins;s===void 0&&(s=[]);var a=t.strict;a===void 0&&(a=!1);var n=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new y(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=n;var o=this,r=this,i=r.dispatch,u=r.commit;this.dispatch=function(l,d){return i.call(o,l,d)},this.commit=function(l,d,p){return u.call(o,l,d,p)},this.strict=a;var c=this._modules.root.state;A(this,c,[],this._modules.root),L(this,c),s.forEach(function(l){return l(e)})},P={state:{configurable:!0}};f.prototype.install=function(t,e){t.provide(e||$t,this),t.config.globalProperties.$store=this;var s=this._devtools!==void 0?this._devtools:!1;s&&qt(t,this)},P.state.get=function(){return this._state.data},P.state.set=function(t){},f.prototype.commit=function(t,e,s){var a=this,n=k(t,e,s),o=n.type,r=n.payload,i={type:o,payload:r},u=this._mutations[o];u&&(this._withCommit(function(){u.forEach(function(c){c(r)})}),this._subscribers.slice().forEach(function(c){return c(i,a.state)}))},f.prototype.dispatch=function(t,e){var s=this,a=k(t,e),n=a.type,o=a.payload,r={type:n,payload:o},i=this._actions[n];if(i){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(r,s.state)})}catch{}var u=i.length>1?Promise.all(i.map(function(c){return c(o)})):i[0](o);return new Promise(function(c,l){u.then(function(d){try{s._actionSubscribers.filter(function(p){return p.after}).forEach(function(p){return p.after(r,s.state)})}catch{}c(d)},function(d){try{s._actionSubscribers.filter(function(p){return p.error}).forEach(function(p){return p.error(r,s.state,d)})}catch{}l(d)})})}},f.prototype.subscribe=function(t,e){return B(t,this._subscribers,e)},f.prototype.subscribeAction=function(t,e){var s=typeof t=="function"?{before:t}:t;return B(s,this._actionSubscribers,e)},f.prototype.watch=function(t,e,s){var a=this;return z(function(){return t(a.state,a.getters)},e,Object.assign({},s))},f.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._state.data=t})},f.prototype.registerModule=function(t,e,s){s===void 0&&(s={}),typeof t=="string"&&(t=[t]),this._modules.register(t,e),A(this,this.state,t,this._modules.get(t),s.preserveState),L(this,this.state)},f.prototype.unregisterModule=function(t){var e=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var s=U(e.state,t.slice(0,-1));delete s[t[t.length-1]]}),V(this)},f.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)},f.prototype.hotUpdate=function(t){this._modules.update(t),V(this,!0)},f.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(f.prototype,P);var ae=it(function(t,e){var s={};return rt(e).forEach(function(a){var n=a.key,o=a.val;s[n]=function(){var r=this.$store.state,i=this.$store.getters;if(t){var u=ut(this.$store,"mapState",t);if(!u)return;r=u.context.state,i=u.context.getters}return typeof o=="function"?o.call(this,r,i):r[o]},s[n].vuex=!0}),s}),os=it(function(t,e){var s={};return rt(e).forEach(function(a){var n=a.key,o=a.val;o=t+o,s[n]=function(){if(!(t&&!ut(this.$store,"mapGetters",t)))return this.$store.getters[o]},s[n].vuex=!0}),s});function rt(t){return ne(t)?Array.isArray(t)?t.map(function(e){return{key:e,val:e}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}}):[]}function ne(t){return Array.isArray(t)||Z(t)}function it(t){return function(e,s){return typeof e!="string"?(s=e,e=""):e.charAt(e.length-1)!=="/"&&(e+="/"),t(e,s)}}function ut(t,e,s){var a=t._modulesNamespaceMap[s];return a}const oe={computed:{...ae({statusType:t=>t.userStatus.status,statusIsUserDefined:t=>t.userStatus.statusIsUserDefined,customIcon:t=>t.userStatus.icon,customMessage:t=>t.userStatus.message}),visibleMessage(){if(this.customIcon&&this.customMessage)return`${this.customIcon} ${this.customMessage}`;if(this.customMessage)return this.customMessage;if(this.statusIsUserDefined)switch(this.statusType){case"online":return h("user_status","Online");case"away":return h("user_status","Away");case"busy":return h("user_status","Busy");case"dnd":return h("user_status","Do not disturb");case"invisible":return h("user_status","Invisible");case"offline":return h("user_status","Offline")}return h("user_status","Set status")}},methods:{async changeStatus(t){try{await this.$store.dispatch("setStatus",{statusType:t})}catch(e){Ct(h("user_status","There was an error saving the new status")),X.debug(e)}}}},re=300*1e3,ie=120*1e3,ue=2*1e3;function ce(t){let e=!1,s;const a=Mt(()=>{const o=e;e=!1,clearTimeout(s),s=setTimeout(()=>{e=!0},ie),o&&t(e)},ue,{immediate:!0}),n=setInterval(()=>t(e),re);return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),t(e),()=>{clearInterval(n),clearTimeout(s),a.clear(),window.removeEventListener("mousemove",a,{capture:!0})}}async function le(t){const e=g("apps/user_status/api/v1/heartbeat?format=json");return(await _.put(e,{status:t?"away":"online"})).data.ocs.data}const de="_userStatusMenuItem_1rva6_1",pe="_userStatusIcon_1rva6_6",fe={userStatusMenuItem:de,userStatusIcon:pe},me={name:"UserStatus",components:{NcButton:Ot,NcListItem:kt,NcUserStatusIcon:At,SetStatusModal:wt(()=>It(()=>import("./SetStatusModal-ByuIyikD.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url))},mixins:[oe],props:{inline:{type:Boolean,default:!1}},data(){return{isModalOpen:!1,stopHeartbeat:null}},mounted(){this.$store.dispatch("loadStatusFromInitialState"),OC.config.session_keepalive&&(this.stopHeartbeat=ce(t=>this._backgroundHeartbeat(t))),K("user_status:status.updated",this.handleUserStatusUpdated)},beforeUnmount(){this.stopHeartbeat?.(),mt("user_status:status.updated",this.handleUserStatusUpdated)},methods:{openModal(){this.isModalOpen=!0},closeModal(){this.isModalOpen=!1},async _backgroundHeartbeat(t){try{const e=await le(t);e?.userId?this.$store.dispatch("setStatusFromHeartbeat",e):await this.$store.dispatch("reFetchStatusFromServer")}catch(e){X.debug("Failed sending heartbeat, got: "+e.response?.status)}},handleUserStatusUpdated(t){v()?.uid===t.userId&&this.$store.dispatch("setStatusFromObject",{status:t.status,icon:t.icon,message:t.message})}}},he={key:1};function ge(t,e,s,a,n,o){const r=M("NcUserStatusIcon"),i=M("NcListItem"),u=M("NcButton"),c=M("SetStatusModal");return O(),F(St,null,[s.inline?(O(),F("div",he,[E(u,{onClick:G(o.openModal,["stop"])},{icon:C(()=>[E(r,{class:j(t.$style.userStatusIcon),status:t.statusType,"aria-hidden":"true"},null,8,["class","status"])]),default:C(()=>[yt(" "+vt(t.visibleMessage),1)]),_:1},8,["onClick"])])):(O(),N(i,{key:0,class:j(t.$style.userStatusMenuItem),compact:"",name:t.visibleMessage,onClick:G(o.openModal,["stop"])},{icon:C(()=>[E(r,{class:j(t.$style.userStatusIcon),status:t.statusType,"aria-hidden":"true"},null,8,["class","status"])]),_:1},8,["class","name","onClick"])),n.isModalOpen?(O(),N(c,{key:2,inline:s.inline,onClose:o.closeModal},null,8,["inline","onClose"])):bt("",!0)],64)}const _e={$style:fe},ct=Et(me,[["render",ge],["__cssModules",_e]]);async function ye(){const t=g("apps/user_status/api/v1/predefined_statuses?format=json");return(await _.get(t)).data.ocs.data}const ve=()=>({predefinedStatuses:[]}),be={addPredefinedStatus(t,e){t.predefinedStatuses=[...t.predefinedStatuses,e]}},Se={statusesHaveLoaded(t){return t.predefinedStatuses.length>0}},we={async loadAllPredefinedStatuses({state:t,commit:e}){if(t.predefinedStatuses.length>0)return;const s=await ye();for(const a of s)e("addPredefinedStatus",a)}},Ie={state:ve,mutations:be,getters:Se,actions:we};async function Me(){const t=g("apps/user_status/api/v1/user_status");return(await _.get(t)).data.ocs.data}async function Oe(t){const e=g("apps/user_status/api/v1/statuses/{userId}",{userId:"_"+t});return(await _.get(e)).data.ocs.data}async function ke(t){const e=g("apps/user_status/api/v1/user_status/status");await _.put(e,{statusType:t})}async function Ae(t,e=null){const s=g("apps/user_status/api/v1/user_status/message/predefined?format=json");await _.put(s,{messageId:t,clearAt:e})}async function Ce(t,e=null,s=null){const a=g("apps/user_status/api/v1/user_status/message/custom?format=json");await _.put(a,{message:t,statusIcon:e,clearAt:s})}async function Ee(){const t=g("apps/user_status/api/v1/user_status/message?format=json");await _.delete(t)}async function je(t){const e=g("apps/user_status/api/v1/user_status/revert/{messageId}",{messageId:t});return(await _.delete(e)).data.ocs.data}const Te=()=>({status:null,statusIsUserDefined:null,message:null,icon:null,clearAt:null,messageIsPredefined:null,messageId:null}),Pe={loadBackupStatusFromServer(t,{status:e,statusIsUserDefined:s,message:a,icon:n,clearAt:o,messageIsPredefined:r,messageId:i}){t.status=e,t.message=a,t.icon=n,typeof s<"u"&&(t.statusIsUserDefined=s),typeof o<"u"&&(t.clearAt=o),typeof r<"u"&&(t.messageIsPredefined=r),typeof i<"u"&&(t.messageId=i)}},xe={},De={async fetchBackupFromServer({commit:t}){try{const e=await Oe(v()?.uid);t("loadBackupStatusFromServer",e)}catch{}},async revertBackupFromServer({commit:t},{messageId:e}){const s=await je(e);s&&(t("loadBackupStatusFromServer",{}),t("loadStatusFromServer",s),I("user_status:status.updated",{status:s.status,message:s.message,icon:s.icon,clearAt:s.clearAt,userId:v()?.uid}))}},Le={state:Te,mutations:Pe,getters:xe,actions:De};function Ue(){return new Date}function W(t){if(t===null)return null;const e=Ue();if(t.type==="period")return e.setSeconds(e.getSeconds()+t.time),Math.floor(e.getTime()/1e3);if(t.type==="end-of")switch(t.time){case"day":return Math.floor(lt(e).getTime()/1e3);case"week":return Math.floor(Fe(e).getTime()/1e3)}return t.type==="_time"?t.time:null}function rs(t){if(t===null)return h("user_status","Don't clear");if(t.type==="end-of")switch(t.time){case"day":return h("user_status","Today");case"week":return h("user_status","This week");default:return null}return t.type==="period"?$(Date.now()+t.time*1e3):t.type==="_time"?$(t.time*1e3):null}function lt(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function Fe(t){const e=lt(t);return e.setDate(t.getDate()+(Tt()-1-e.getDay()+7)%7),e}const Ne=()=>({status:null,statusIsUserDefined:null,message:null,icon:null,clearAt:null,messageIsPredefined:null,messageId:null}),Ge={setStatus(t,{statusType:e}){t.status=e,t.statusIsUserDefined=!0},setPredefinedMessage(t,{messageId:e,clearAt:s,message:a,icon:n}){t.messageId=e,t.messageIsPredefined=!0,t.message=a,t.icon=n,t.clearAt=s},setCustomMessage(t,{message:e,icon:s,clearAt:a}){t.messageId=null,t.messageIsPredefined=!1,t.message=e,t.icon=s,t.clearAt=a},clearMessage(t){t.messageId=null,t.messageIsPredefined=!1,t.message=null,t.icon=null,t.clearAt=null},loadStatusFromServer(t,{status:e,statusIsUserDefined:s,message:a,icon:n,clearAt:o,messageIsPredefined:r,messageId:i}){t.status=e,t.message=a,t.icon=n,typeof s<"u"&&(t.statusIsUserDefined=s),typeof o<"u"&&(t.clearAt=o),typeof r<"u"&&(t.messageIsPredefined=r),typeof i<"u"&&(t.messageId=i)}},$e={},Be={async setStatus({commit:t,state:e},{statusType:s}){await ke(s),t("setStatus",{statusType:s}),I("user_status:status.updated",{status:e.status,message:e.message,icon:e.icon,clearAt:e.clearAt,userId:v()?.uid})},async setStatusFromObject({commit:t},e){t("loadStatusFromServer",e)},async setPredefinedMessage({commit:t,rootState:e,state:s},{messageId:a,clearAt:n}){const o=W(n);await Ae(a,o);const r=e.predefinedStatuses.predefinedStatuses.find(c=>c.id===a),{message:i,icon:u}=r;t("setPredefinedMessage",{messageId:a,clearAt:o,message:i,icon:u}),I("user_status:status.updated",{status:s.status,message:s.message,icon:s.icon,clearAt:s.clearAt,userId:v()?.uid})},async setCustomMessage({commit:t,state:e},{message:s,icon:a,clearAt:n}){const o=W(n);await Ce(s,a,o),t("setCustomMessage",{message:s,icon:a,clearAt:o}),I("user_status:status.updated",{status:e.status,message:e.message,icon:e.icon,clearAt:e.clearAt,userId:v()?.uid})},async clearMessage({commit:t,state:e}){await Ee(),t("clearMessage"),I("user_status:status.updated",{status:e.status,message:e.message,icon:e.icon,clearAt:e.clearAt,userId:v()?.uid})},async reFetchStatusFromServer({commit:t}){const e=await Me();t("loadStatusFromServer",e)},async setStatusFromHeartbeat({commit:t},e){t("loadStatusFromServer",e)},loadStatusFromInitialState({commit:t}){const e=jt("user_status","status");t("loadStatusFromServer",e)}},Ve={state:Ne,mutations:Ge,getters:$e,actions:Be},dt=se({modules:{predefinedStatuses:Ie,userStatus:Ve,userBackupStatus:Le},strict:!0}),He=document.getElementById("user_status-menu-entry");function J(){const t=document.getElementById("user_status-menu-entry"),e=document.createElement("div");e.style.display="contents",t.replaceWith(e),q(ct).use(dt).mount(e)}He?J():K("core:user-menu:mounted",J),document.addEventListener("DOMContentLoaded",function(){OCA.Dashboard&&OCA.Dashboard.registerStatus("status",t=>{q(ct,{inline:!0}).use(dt).mount(t)})});export{oe as O,ae as a,rs as c,X as l,os as m}; +import{g as mt,l as ht,c as g,a as v,u as gt,s as z,e as I}from"./public-DUDgMnHe.chunk.mjs";import{ab as _t,Q as yt,B as X,p as vt,r as O,o as M,g as F,c as N,w as E,k as C,n as j,O as G,j as bt,t as St,i as wt,F as It,a as Ot,_ as Mt,f as Y}from"./preload-helper-DaivvT3M.chunk.mjs";import{g as kt,N as At}from"./Check-KMcgcx9_.chunk.mjs";import{N as Et}from"./TrayArrowDown-BLvClPCQ.chunk.mjs";import{N as Ct}from"./NcUserStatusIcon-BneCMAh5.chunk.mjs";import{a as jt}from"./index-DtFnHTNv.chunk.mjs";import{t as h}from"./index-CWUMrdUf.chunk.mjs";import{c as _}from"./TrashCanOutline-C1Npic_W.chunk.mjs";import{_ as Tt,l as Pt}from"./_plugin-vue_export-helper-CqVUm19z.chunk.mjs";import{f as $,r as xt}from"./NcModal-CE9u3Gsc.chunk.mjs";import"./Web-DAo7hh-V.chunk.mjs";import"./mdi-BgeXkQgu.chunk.mjs";import"./formatRelative-CtrHxjNv.chunk.mjs";import"./NcNoteCard-B1HE2gEt.chunk.mjs";import"./util-BUUeB7_Z.chunk.mjs";const q=mt().detectLogLevel().setApp("user_status").build();function Dt(){return Z().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Z(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Lt=typeof Proxy=="function",Ut="devtools-plugin:setup",Ft="plugin:settings:set";let w,x;function Nt(){var t;return w!==void 0||(typeof window<"u"&&window.performance?(w=!0,x=window.performance):typeof globalThis<"u"&&!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance?(w=!0,x=globalThis.perf_hooks.performance):w=!1),w}function Gt(){return Nt()?x.now():Date.now()}class $t{constructor(e,s){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=s;const a={};if(e.settings)for(const r in e.settings){const i=e.settings[r];a[r]=i.defaultValue}const n=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},a);try{const r=localStorage.getItem(n),i=JSON.parse(r);Object.assign(o,i)}catch{}this.fallbacks={getSettings(){return o},setSettings(r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}o=r},now(){return Gt()}},s&&s.on(Ft,(r,i)=>{r===this.plugin.id&&this.fallbacks.setSettings(i)}),this.proxiedOn=new Proxy({},{get:(r,i)=>this.target?this.target.on[i]:(...u)=>{this.onQueue.push({method:i,args:u})}}),this.proxiedTarget=new Proxy({},{get:(r,i)=>this.target?this.target[i]:i==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(i)?(...u)=>(this.targetQueue.push({method:i,args:u,resolve:()=>{}}),this.fallbacks[i](...u)):(...u)=>new Promise(c=>{this.targetQueue.push({method:i,args:u,resolve:c})})})}async setRealTarget(e){this.target=e;for(const s of this.onQueue)this.target.on[s.method](...s.args);for(const s of this.targetQueue)s.resolve(await this.target[s.method](...s.args))}}function Bt(t,e){const s=t,a=Z(),n=Dt(),o=Lt&&s.enableEarlyProxy;if(n&&(a.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))n.emit(Ut,t,e);else{const r=o?new $t(s,n):null;(a.__VUE_DEVTOOLS_PLUGINS__=a.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:s,setupFn:e,proxy:r}),r&&e(r.proxiedTarget)}}var Vt="store";function S(t,e){Object.keys(t).forEach(function(s){return e(t[s],s)})}function tt(t){return t!==null&&typeof t=="object"}function Ht(t){return t&&typeof t.then=="function"}function Qt(t,e){return function(){return t(e)}}function B(t,e,s){return e.indexOf(t)<0&&(s&&s.prepend?e.unshift(t):e.push(t)),function(){var a=e.indexOf(t);a>-1&&e.splice(a,1)}}function V(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var s=t.state;A(t,s,[],t._modules.root,!0),L(t,s,e)}function L(t,e,s){var a=t._state,n=t._scope;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,r={},i={},u=_t(!0);u.run(function(){S(o,function(c,l){r[l]=Qt(c,t),i[l]=vt(function(){return r[l]()}),Object.defineProperty(t.getters,l,{get:function(){return i[l].value},enumerable:!0})})}),t._state=yt({data:e}),t._scope=u,t.strict&&zt(t),a&&s&&t._withCommit(function(){a.data=null}),n&&n.stop()}function A(t,e,s,a,n){var o=!s.length,r=t._modules.getNamespace(s);if(a.namespaced&&(t._modulesNamespaceMap[r],t._modulesNamespaceMap[r]=a),!o&&!n){var i=U(e,s.slice(0,-1)),u=s[s.length-1];t._withCommit(function(){i[u]=a.state})}var c=a.context=Rt(t,r,s);a.forEachMutation(function(l,d){var p=r+d;Wt(t,p,l,c)}),a.forEachAction(function(l,d){var p=l.root?d:r+d,ft=l.handler||l;Jt(t,p,ft,c)}),a.forEachGetter(function(l,d){var p=r+d;Kt(t,p,l,c)}),a.forEachChild(function(l,d){A(t,e,s.concat(d),l,n)})}function Rt(t,e,s){var a=e==="",n={dispatch:a?t.dispatch:function(o,r,i){var u=k(o,r,i),c=u.payload,l=u.options,d=u.type;return(!l||!l.root)&&(d=e+d),t.dispatch(d,c)},commit:a?t.commit:function(o,r,i){var u=k(o,r,i),c=u.payload,l=u.options,d=u.type;(!l||!l.root)&&(d=e+d),t.commit(d,c,l)}};return Object.defineProperties(n,{getters:{get:a?function(){return t.getters}:function(){return et(t,e)}},state:{get:function(){return U(t.state,s)}}}),n}function et(t,e){if(!t._makeLocalGettersCache[e]){var s={},a=e.length;Object.keys(t.getters).forEach(function(n){if(n.slice(0,a)===e){var o=n.slice(a);Object.defineProperty(s,o,{get:function(){return t.getters[n]},enumerable:!0})}}),t._makeLocalGettersCache[e]=s}return t._makeLocalGettersCache[e]}function Wt(t,e,s,a){var n=t._mutations[e]||(t._mutations[e]=[]);n.push(function(o){s.call(t,a.state,o)})}function Jt(t,e,s,a){var n=t._actions[e]||(t._actions[e]=[]);n.push(function(o){var r=s.call(t,{dispatch:a.dispatch,commit:a.commit,getters:a.getters,state:a.state,rootGetters:t.getters,rootState:t.state},o);return Ht(r)||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(i){throw t._devtoolHook.emit("vuex:error",i),i}):r})}function Kt(t,e,s,a){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(n){return s(a.state,a.getters,n.state,n.getters)})}function zt(t){X(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function U(t,e){return e.reduce(function(s,a){return s[a]},t)}function k(t,e,s){return tt(t)&&t.type&&(s=e,e=t,t=t.type),{type:t,payload:e,options:s}}var Xt="vuex bindings",H="vuex:mutations",T="vuex:actions",b="vuex",Yt=0;function qt(t,e){Bt({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[Xt]},function(s){s.addTimelineLayer({id:H,label:"Vuex Mutations",color:Q}),s.addTimelineLayer({id:T,label:"Vuex Actions",color:Q}),s.addInspector({id:b,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),s.on.getInspectorTree(function(a){if(a.app===t&&a.inspectorId===b)if(a.filter){var n=[];ot(n,e._modules.root,a.filter,""),a.rootNodes=n}else a.rootNodes=[nt(e._modules.root,"")]}),s.on.getInspectorState(function(a){if(a.app===t&&a.inspectorId===b){var n=a.nodeId;et(e,n),a.state=ee(ae(e._modules,n),n==="root"?e.getters:e._makeLocalGettersCache,n)}}),s.on.editInspectorState(function(a){if(a.app===t&&a.inspectorId===b){var n=a.nodeId,o=a.path;n!=="root"&&(o=n.split("/").filter(Boolean).concat(o)),e._withCommit(function(){a.set(e._state.data,o,a.state.value)})}}),e.subscribe(function(a,n){var o={};a.payload&&(o.payload=a.payload),o.state=n,s.notifyComponentUpdate(),s.sendInspectorTree(b),s.sendInspectorState(b),s.addTimelineEvent({layerId:H,event:{time:Date.now(),title:a.type,data:o}})}),e.subscribeAction({before:function(a,n){var o={};a.payload&&(o.payload=a.payload),a._id=Yt++,a._time=Date.now(),o.state=n,s.addTimelineEvent({layerId:T,event:{time:a._time,title:a.type,groupId:a._id,subtitle:"start",data:o}})},after:function(a,n){var o={},r=Date.now()-a._time;o.duration={_custom:{type:"duration",display:r+"ms",tooltip:"Action duration",value:r}},a.payload&&(o.payload=a.payload),o.state=n,s.addTimelineEvent({layerId:T,event:{time:Date.now(),title:a.type,groupId:a._id,subtitle:"end",data:o}})}})})}var Q=8702998,Zt=6710886,te=16777215,st={label:"namespaced",textColor:te,backgroundColor:Zt};function at(t){return t&&t!=="root"?t.split("/").slice(-2,-1)[0]:"Root"}function nt(t,e){return{id:e||"root",label:at(e),tags:t.namespaced?[st]:[],children:Object.keys(t._children).map(function(s){return nt(t._children[s],e+s+"/")})}}function ot(t,e,s,a){a.includes(s)&&t.push({id:a||"root",label:a.endsWith("/")?a.slice(0,a.length-1):a||"Root",tags:e.namespaced?[st]:[]}),Object.keys(e._children).forEach(function(n){ot(t,e._children[n],s,a+n+"/")})}function ee(t,e,s){e=s==="root"?e:e[s];var a=Object.keys(e),n={state:Object.keys(t.state).map(function(r){return{key:r,editable:!0,value:t.state[r]}})};if(a.length){var o=se(e);n.getters=Object.keys(o).map(function(r){return{key:r.endsWith("/")?at(r):r,editable:!1,value:D(function(){return o[r]})}})}return n}function se(t){var e={};return Object.keys(t).forEach(function(s){var a=s.split("/");if(a.length>1){var n=e,o=a.pop();a.forEach(function(r){n[r]||(n[r]={_custom:{value:{},display:r,tooltip:"Module",abstract:!0}}),n=n[r]._custom.value}),n[o]=D(function(){return t[s]})}else e[s]=D(function(){return t[s]})}),e}function ae(t,e){var s=e.split("/").filter(function(a){return a});return s.reduce(function(a,n,o){var r=a[n];if(!r)throw new Error('Missing module "'+n+'" for path "'+e+'".');return o===s.length-1?r:r._children},e==="root"?t:t.root._children)}function D(t){try{return t()}catch(e){return e}}var m=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var s=t.state;this.state=(typeof s=="function"?s():s)||{}},R={namespaced:{configurable:!0}};R.namespaced.get=function(){return!!this._rawModule.namespaced},m.prototype.addChild=function(t,e){this._children[t]=e},m.prototype.removeChild=function(t){delete this._children[t]},m.prototype.getChild=function(t){return this._children[t]},m.prototype.hasChild=function(t){return t in this._children},m.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},m.prototype.forEachChild=function(t){S(this._children,t)},m.prototype.forEachGetter=function(t){this._rawModule.getters&&S(this._rawModule.getters,t)},m.prototype.forEachAction=function(t){this._rawModule.actions&&S(this._rawModule.actions,t)},m.prototype.forEachMutation=function(t){this._rawModule.mutations&&S(this._rawModule.mutations,t)},Object.defineProperties(m.prototype,R);var y=function(t){this.register([],t,!1)};y.prototype.get=function(t){return t.reduce(function(e,s){return e.getChild(s)},this.root)},y.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(s,a){return e=e.getChild(a),s+(e.namespaced?a+"/":"")},"")},y.prototype.update=function(t){rt([],this.root,t)},y.prototype.register=function(t,e,s){var a=this;s===void 0&&(s=!0);var n=new m(e,s);if(t.length===0)this.root=n;else{var o=this.get(t.slice(0,-1));o.addChild(t[t.length-1],n)}e.modules&&S(e.modules,function(r,i){a.register(t.concat(i),r,s)})},y.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),s=t[t.length-1],a=e.getChild(s);a&&a.runtime&&e.removeChild(s)},y.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),s=t[t.length-1];return e?e.hasChild(s):!1};function rt(t,e,s){if(e.update(s),s.modules)for(var a in s.modules){if(!e.getChild(a))return;rt(t.concat(a),e.getChild(a),s.modules[a])}}function ne(t){return new f(t)}var f=function(t){var e=this;t===void 0&&(t={});var s=t.plugins;s===void 0&&(s=[]);var a=t.strict;a===void 0&&(a=!1);var n=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new y(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=n;var o=this,r=this,i=r.dispatch,u=r.commit;this.dispatch=function(l,d){return i.call(o,l,d)},this.commit=function(l,d,p){return u.call(o,l,d,p)},this.strict=a;var c=this._modules.root.state;A(this,c,[],this._modules.root),L(this,c),s.forEach(function(l){return l(e)})},P={state:{configurable:!0}};f.prototype.install=function(t,e){t.provide(e||Vt,this),t.config.globalProperties.$store=this;var s=this._devtools!==void 0?this._devtools:!1;s&&qt(t,this)},P.state.get=function(){return this._state.data},P.state.set=function(t){},f.prototype.commit=function(t,e,s){var a=this,n=k(t,e,s),o=n.type,r=n.payload,i={type:o,payload:r},u=this._mutations[o];u&&(this._withCommit(function(){u.forEach(function(c){c(r)})}),this._subscribers.slice().forEach(function(c){return c(i,a.state)}))},f.prototype.dispatch=function(t,e){var s=this,a=k(t,e),n=a.type,o=a.payload,r={type:n,payload:o},i=this._actions[n];if(i){try{this._actionSubscribers.slice().filter(function(c){return c.before}).forEach(function(c){return c.before(r,s.state)})}catch{}var u=i.length>1?Promise.all(i.map(function(c){return c(o)})):i[0](o);return new Promise(function(c,l){u.then(function(d){try{s._actionSubscribers.filter(function(p){return p.after}).forEach(function(p){return p.after(r,s.state)})}catch{}c(d)},function(d){try{s._actionSubscribers.filter(function(p){return p.error}).forEach(function(p){return p.error(r,s.state,d)})}catch{}l(d)})})}},f.prototype.subscribe=function(t,e){return B(t,this._subscribers,e)},f.prototype.subscribeAction=function(t,e){var s=typeof t=="function"?{before:t}:t;return B(s,this._actionSubscribers,e)},f.prototype.watch=function(t,e,s){var a=this;return X(function(){return t(a.state,a.getters)},e,Object.assign({},s))},f.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._state.data=t})},f.prototype.registerModule=function(t,e,s){s===void 0&&(s={}),typeof t=="string"&&(t=[t]),this._modules.register(t,e),A(this,this.state,t,this._modules.get(t),s.preserveState),L(this,this.state)},f.prototype.unregisterModule=function(t){var e=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var s=U(e.state,t.slice(0,-1));delete s[t[t.length-1]]}),V(this)},f.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)},f.prototype.hotUpdate=function(t){this._modules.update(t),V(this,!0)},f.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(f.prototype,P);var oe=ut(function(t,e){var s={};return it(e).forEach(function(a){var n=a.key,o=a.val;s[n]=function(){var r=this.$store.state,i=this.$store.getters;if(t){var u=ct(this.$store,"mapState",t);if(!u)return;r=u.context.state,i=u.context.getters}return typeof o=="function"?o.call(this,r,i):r[o]},s[n].vuex=!0}),s}),us=ut(function(t,e){var s={};return it(e).forEach(function(a){var n=a.key,o=a.val;o=t+o,s[n]=function(){if(!(t&&!ct(this.$store,"mapGetters",t)))return this.$store.getters[o]},s[n].vuex=!0}),s});function it(t){return re(t)?Array.isArray(t)?t.map(function(e){return{key:e,val:e}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}}):[]}function re(t){return Array.isArray(t)||tt(t)}function ut(t){return function(e,s){return typeof e!="string"?(s=e,e=""):e.charAt(e.length-1)!=="/"&&(e+="/"),t(e,s)}}function ct(t,e,s){var a=t._modulesNamespaceMap[s];return a}const ie={computed:{...oe({statusType:t=>t.userStatus.status,statusIsUserDefined:t=>t.userStatus.statusIsUserDefined,customIcon:t=>t.userStatus.icon,customMessage:t=>t.userStatus.message}),visibleMessage(){if(this.customIcon&&this.customMessage)return`${this.customIcon} ${this.customMessage}`;if(this.customMessage)return this.customMessage;if(this.statusIsUserDefined)switch(this.statusType){case"online":return h("user_status","Online");case"away":return h("user_status","Away");case"busy":return h("user_status","Busy");case"dnd":return h("user_status","Do not disturb");case"invisible":return h("user_status","Invisible");case"offline":return h("user_status","Offline")}return h("user_status","Set status")}},methods:{async changeStatus(t){try{await this.$store.dispatch("setStatus",{statusType:t})}catch(e){jt(h("user_status","There was an error saving the new status")),q.debug(e)}}}},W=ht("user_status").clearOnLogout().persist().build(),ue=300*1e3,ce=120*1e3,le=2*1e3,de=240*1e3;function pe(t){let e=!1,s,a;const n=(i=!1)=>{const u=Date.now()-Number.parseInt(W.getItem("lastHeartbeat")??"",10);!i&&u>=0&&u{const i=e;e=!1,clearTimeout(s),s=setTimeout(()=>{e=!0},ce),i&&n(!0)},le,{immediate:!0}),r=setInterval(()=>n(),ue);return window.addEventListener("mousemove",o,{capture:!0,passive:!0}),document.visibilityState==="hidden"?(a=()=>{document.visibilityState!=="hidden"&&(document.removeEventListener("visibilitychange",a),n())},document.addEventListener("visibilitychange",a)):n(),()=>{clearInterval(r),clearTimeout(s),o.clear(),window.removeEventListener("mousemove",o,{capture:!0}),a&&document.removeEventListener("visibilitychange",a)}}async function fe(t){const e=g("apps/user_status/api/v1/heartbeat?format=json");return(await _.put(e,{status:t?"away":"online"})).data.ocs.data}const me="_userStatusMenuItem_1rva6_1",he="_userStatusIcon_1rva6_6",ge={userStatusMenuItem:me,userStatusIcon:he},_e={name:"UserStatus",components:{NcButton:At,NcListItem:Et,NcUserStatusIcon:Ct,SetStatusModal:Ot(()=>Mt(()=>import("./SetStatusModal-ByuIyikD.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url))},mixins:[ie],props:{inline:{type:Boolean,default:!1}},data(){return{isModalOpen:!1,stopHeartbeat:null}},mounted(){this.$store.dispatch("loadStatusFromInitialState"),OC.config.session_keepalive&&(this.stopHeartbeat=pe(t=>this._backgroundHeartbeat(t))),z("user_status:status.updated",this.handleUserStatusUpdated)},beforeUnmount(){this.stopHeartbeat?.(),gt("user_status:status.updated",this.handleUserStatusUpdated)},methods:{openModal(){this.isModalOpen=!0},closeModal(){this.isModalOpen=!1},async _backgroundHeartbeat(t){try{const e=await fe(t);e?.userId?this.$store.dispatch("setStatusFromHeartbeat",e):await this.$store.dispatch("reFetchStatusFromServer")}catch(e){q.debug("Failed sending heartbeat, got: "+e.response?.status)}},handleUserStatusUpdated(t){v()?.uid===t.userId&&this.$store.dispatch("setStatusFromObject",{status:t.status,icon:t.icon,message:t.message})}}},ye={key:1};function ve(t,e,s,a,n,o){const r=O("NcUserStatusIcon"),i=O("NcListItem"),u=O("NcButton"),c=O("SetStatusModal");return M(),F(It,null,[s.inline?(M(),F("div",ye,[C(u,{onClick:G(o.openModal,["stop"])},{icon:E(()=>[C(r,{class:j(t.$style.userStatusIcon),status:t.statusType,"aria-hidden":"true"},null,8,["class","status"])]),default:E(()=>[bt(" "+St(t.visibleMessage),1)]),_:1},8,["onClick"])])):(M(),N(i,{key:0,class:j(t.$style.userStatusMenuItem),compact:"",name:t.visibleMessage,onClick:G(o.openModal,["stop"])},{icon:E(()=>[C(r,{class:j(t.$style.userStatusIcon),status:t.statusType,"aria-hidden":"true"},null,8,["class","status"])]),_:1},8,["class","name","onClick"])),n.isModalOpen?(M(),N(c,{key:2,inline:s.inline,onClose:o.closeModal},null,8,["inline","onClose"])):wt("",!0)],64)}const be={$style:ge},lt=Tt(_e,[["render",ve],["__cssModules",be]]);async function Se(){const t=g("apps/user_status/api/v1/predefined_statuses?format=json");return(await _.get(t)).data.ocs.data}const we=()=>({predefinedStatuses:[]}),Ie={addPredefinedStatus(t,e){t.predefinedStatuses=[...t.predefinedStatuses,e]}},Oe={statusesHaveLoaded(t){return t.predefinedStatuses.length>0}},Me={async loadAllPredefinedStatuses({state:t,commit:e}){if(t.predefinedStatuses.length>0)return;const s=await Se();for(const a of s)e("addPredefinedStatus",a)}},ke={state:we,mutations:Ie,getters:Oe,actions:Me};async function Ae(){const t=g("apps/user_status/api/v1/user_status");return(await _.get(t)).data.ocs.data}async function Ee(t){const e=g("apps/user_status/api/v1/statuses/{userId}",{userId:"_"+t});return(await _.get(e)).data.ocs.data}async function Ce(t){const e=g("apps/user_status/api/v1/user_status/status");await _.put(e,{statusType:t})}async function je(t,e=null){const s=g("apps/user_status/api/v1/user_status/message/predefined?format=json");await _.put(s,{messageId:t,clearAt:e})}async function Te(t,e=null,s=null){const a=g("apps/user_status/api/v1/user_status/message/custom?format=json");await _.put(a,{message:t,statusIcon:e,clearAt:s})}async function Pe(){const t=g("apps/user_status/api/v1/user_status/message?format=json");await _.delete(t)}async function xe(t){const e=g("apps/user_status/api/v1/user_status/revert/{messageId}",{messageId:t});return(await _.delete(e)).data.ocs.data}const De=()=>({status:null,statusIsUserDefined:null,message:null,icon:null,clearAt:null,messageIsPredefined:null,messageId:null}),Le={loadBackupStatusFromServer(t,{status:e,statusIsUserDefined:s,message:a,icon:n,clearAt:o,messageIsPredefined:r,messageId:i}){t.status=e,t.message=a,t.icon=n,typeof s<"u"&&(t.statusIsUserDefined=s),typeof o<"u"&&(t.clearAt=o),typeof r<"u"&&(t.messageIsPredefined=r),typeof i<"u"&&(t.messageId=i)}},Ue={},Fe={async fetchBackupFromServer({commit:t}){try{const e=await Ee(v()?.uid);t("loadBackupStatusFromServer",e)}catch{}},async revertBackupFromServer({commit:t},{messageId:e}){const s=await xe(e);s&&(t("loadBackupStatusFromServer",{}),t("loadStatusFromServer",s),I("user_status:status.updated",{status:s.status,message:s.message,icon:s.icon,clearAt:s.clearAt,userId:v()?.uid}))}},Ne={state:De,mutations:Le,getters:Ue,actions:Fe};function Ge(){return new Date}function J(t){if(t===null)return null;const e=Ge();if(t.type==="period")return e.setSeconds(e.getSeconds()+t.time),Math.floor(e.getTime()/1e3);if(t.type==="end-of")switch(t.time){case"day":return Math.floor(dt(e).getTime()/1e3);case"week":return Math.floor($e(e).getTime()/1e3)}return t.type==="_time"?t.time:null}function cs(t){if(t===null)return h("user_status","Don't clear");if(t.type==="end-of")switch(t.time){case"day":return h("user_status","Today");case"week":return h("user_status","This week");default:return null}return t.type==="period"?$(Date.now()+t.time*1e3):t.type==="_time"?$(t.time*1e3):null}function dt(t){const e=new Date(t);return e.setHours(23,59,59,999),e}function $e(t){const e=dt(t);return e.setDate(t.getDate()+(xt()-1-e.getDay()+7)%7),e}const Be=()=>({status:null,statusIsUserDefined:null,message:null,icon:null,clearAt:null,messageIsPredefined:null,messageId:null}),Ve={setStatus(t,{statusType:e}){t.status=e,t.statusIsUserDefined=!0},setPredefinedMessage(t,{messageId:e,clearAt:s,message:a,icon:n}){t.messageId=e,t.messageIsPredefined=!0,t.message=a,t.icon=n,t.clearAt=s},setCustomMessage(t,{message:e,icon:s,clearAt:a}){t.messageId=null,t.messageIsPredefined=!1,t.message=e,t.icon=s,t.clearAt=a},clearMessage(t){t.messageId=null,t.messageIsPredefined=!1,t.message=null,t.icon=null,t.clearAt=null},loadStatusFromServer(t,{status:e,statusIsUserDefined:s,message:a,icon:n,clearAt:o,messageIsPredefined:r,messageId:i}){t.status=e,t.message=a,t.icon=n,typeof s<"u"&&(t.statusIsUserDefined=s),typeof o<"u"&&(t.clearAt=o),typeof r<"u"&&(t.messageIsPredefined=r),typeof i<"u"&&(t.messageId=i)}},He={},Qe={async setStatus({commit:t,state:e},{statusType:s}){await Ce(s),t("setStatus",{statusType:s}),I("user_status:status.updated",{status:e.status,message:e.message,icon:e.icon,clearAt:e.clearAt,userId:v()?.uid})},async setStatusFromObject({commit:t},e){t("loadStatusFromServer",e)},async setPredefinedMessage({commit:t,rootState:e,state:s},{messageId:a,clearAt:n}){const o=J(n);await je(a,o);const r=e.predefinedStatuses.predefinedStatuses.find(c=>c.id===a),{message:i,icon:u}=r;t("setPredefinedMessage",{messageId:a,clearAt:o,message:i,icon:u}),I("user_status:status.updated",{status:s.status,message:s.message,icon:s.icon,clearAt:s.clearAt,userId:v()?.uid})},async setCustomMessage({commit:t,state:e},{message:s,icon:a,clearAt:n}){const o=J(n);await Te(s,a,o),t("setCustomMessage",{message:s,icon:a,clearAt:o}),I("user_status:status.updated",{status:e.status,message:e.message,icon:e.icon,clearAt:e.clearAt,userId:v()?.uid})},async clearMessage({commit:t,state:e}){await Pe(),t("clearMessage"),I("user_status:status.updated",{status:e.status,message:e.message,icon:e.icon,clearAt:e.clearAt,userId:v()?.uid})},async reFetchStatusFromServer({commit:t}){const e=await Ae();t("loadStatusFromServer",e)},async setStatusFromHeartbeat({commit:t},e){t("loadStatusFromServer",e)},loadStatusFromInitialState({commit:t}){const e=Pt("user_status","status");t("loadStatusFromServer",e)}},Re={state:Be,mutations:Ve,getters:He,actions:Qe},pt=ne({modules:{predefinedStatuses:ke,userStatus:Re,userBackupStatus:Ne},strict:!0}),We=document.getElementById("user_status-menu-entry");function K(){const t=document.getElementById("user_status-menu-entry"),e=document.createElement("div");e.style.display="contents",t.replaceWith(e),Y(lt).use(pt).mount(e)}We?K():z("core:user-menu:mounted",K),document.addEventListener("DOMContentLoaded",function(){OCA.Dashboard&&OCA.Dashboard.registerStatus("status",t=>{Y(lt,{inline:!0}).use(pt).mount(t)})});export{ie as O,oe as a,cs as c,q as l,us as m}; //# sourceMappingURL=user_status-menu.mjs.map diff --git a/dist/user_status-menu.mjs.map b/dist/user_status-menu.mjs.map index e89560db43ec8..4c4605d375227 100644 --- a/dist/user_status-menu.mjs.map +++ b/dist/user_status-menu.mjs.map @@ -1 +1 @@ -{"version":3,"mappings":";q5BAOO,MAAMA,EAASC,KACpB,iBACA,OAAO,aAAa,EACpB,QCVK,SAASC,IAAwB,CACpC,OAAOC,EAAS,EAAG,4BACvB,CACO,SAASA,GAAY,CAExB,OAAQ,OAAO,UAAc,KAAe,OAAO,OAAW,IACxD,OACA,OAAO,WAAe,IAClB,WACA,EACd,CACO,MAAMC,GAAmB,OAAO,OAAU,WCXpCC,GAAa,wBACbC,GAA2B,sBCDxC,IAAIC,EACAC,EACG,SAASC,IAAyB,CACrC,IAAIC,EACJ,OAAIH,IAAc,SAGd,OAAO,OAAW,KAAe,OAAO,aACxCA,EAAY,GACZC,EAAO,OAAO,aAET,OAAO,WAAe,KAAiB,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AAeiG,GAAY,CAC1B,QAAS,CACR,mBAAAyE,GACA,WAAA8B,GACA,iBAAAb,EACF,EACC,OAAQ,EACT,CAAC,ECLKc,GAAa,SAAS,eAAe,wBAAwB,EAKnE,SAASC,GAAiB,CACzB,MAAMD,EAAa,SAAS,eAAe,wBAAwB,EAK7DE,EAAwB,SAAS,cAAc,KAAK,EAC1DA,EAAsB,MAAM,QAAU,WACtCF,EAAW,YAAYE,CAAqB,EAE5CC,EAAUC,EAAU,EAClB,IAAI7M,EAAK,EACT,MAAM2M,CAAqB,CAC9B,CAEIF,GACHC,EAAc,EAEdtD,EAAU,yBAA0BsD,CAAc,EAInD,SAAS,iBAAiB,mBAAoB,UAAW,CACnD,IAAI,WAIT,IAAI,UAAU,eAAe,SAAWI,GAAO,CAC9CF,EAAUC,GAAY,CACrB,OAAQ,EACX,CAAG,EACC,IAAI7M,EAAK,EACT,MAAM8M,CAAE,CACX,CAAC,CACF,CAAC","names":["logger","getLoggerBuilder","getDevtoolsGlobalHook","getTarget","isProxyAvailable","HOOK_SETUP","HOOK_PLUGIN_SETTINGS_SET","supported","perf","isPerformanceSupported","_a","now","ApiProxy","plugin","hook","defaultSettings","id","item","localSettingsSaveId","currentSettings","raw","data","value","pluginId","_target","prop","args","resolve","target","setupDevtoolsPlugin","pluginDescriptor","setupFn","descriptor","enableProxy","proxy","storeKey","forEachValue","obj","fn","key","isObject","isPromise","val","partial","arg","genericSubscribe","subs","options","i","resetStore","store","hot","state","installModule","resetStoreState","oldState","oldScope","wrappedGetters","computedObj","computedCache","scope","effectScope","computed","reactive","enableStrictMode","rootState","path","module","isRoot","namespace","parentState","getNestedState","moduleName","local","makeLocalContext","mutation","namespacedType","registerMutation","action","type","handler","registerAction","getter","registerGetter","child","noNamespace","_type","_payload","_options","unifyObjectStyle","payload","makeLocalGetters","gettersProxy","splitPos","localType","entry","res","err","rawGetter","watch","LABEL_VUEX_BINDINGS","MUTATIONS_LAYER_ID","ACTIONS_LAYER_ID","INSPECTOR_ID","actionId","addDevtools","app","api","COLOR_LIME_500","nodes","flattenStoreForInspectorTree","formatStoreForInspectorTree","modulePath","formatStoreForInspectorState","getStoreModule","duration","COLOR_DARK","COLOR_WHITE","TAG_NAMESPACED","extractNameFromPath","result","filter","getters","gettersKeys","storeState","tree","transformPathsToObjectTree","canThrow","leafKey","p","moduleMap","names","n","cb","Module","rawModule","runtime","rawState","prototypeAccessors$1","ModuleCollection","rawRootModule","update","this$1$1","newModule","parent","rawChildModule","targetModule","createStore","Store","plugins","strict","devtools","ref","dispatch","commit","prototypeAccessors","injectKey","useDevtools","v","sub","reject","error","newOptions","committing","mapState","normalizeNamespace","states","normalizeMap","getModuleByNamespace","mapGetters","map","isValidMap","helper","OnlineStatusMixin","t","statusType","showError","HEARTBEAT_INTERVAL","AWAY_TIMEOUT","MOUSE_MOVE_DEBOUNCE","startHeartbeat","beat","isAway","awayTimeout","onMouseMove","debounce","wasAway","interval","sendHeartbeat","url","generateOcsUrl","HttpClient","_sfc_main","NcButton","NcListItem","NcUserStatusIcon","defineAsyncComponent","__vitePreload","subscribe","unsubscribe","status","getCurrentUser","$props","_createElementBlock","_hoisted_1","_createVNode","_component_NcButton","$options","_component_NcUserStatusIcon","_normalizeClass","_ctx","_createTextVNode","_createBlock","_component_NcListItem","$data","_component_SetStatusModal","fetchAllPredefinedStatuses","mutations","actions","statuses","predefinedStatuses","fetchCurrentStatus","fetchBackupStatus","userId","setStatus","setPredefinedMessage","messageId","clearAt","setCustomMessage","message","statusIcon","clearMessage","revertToBackupStatus","statusIsUserDefined","icon","messageIsPredefined","emit","userBackupStatus","dateFactory","getTimestampForClearAt","date","getEndOfDay","getEndOfWeek","clearAtFormat","formatRelativeTime","endOfDay","endOfWeek","getFirstDay","resolvedClearAt","loadState","userStatus","mountPoint","mountMenuEntry","transparentMountPoint","createApp","UserStatus","el"],"ignoreList":[1,2,3,4,5,6],"sources":["../build/frontend/apps/user_status/src/logger.ts","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/env.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/const.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/time.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/proxy.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/index.js","../node_modules/vuex/dist/vuex.esm-bundler.js","../build/frontend/apps/user_status/src/mixins/OnlineStatusMixin.js","../build/frontend/apps/user_status/src/services/heartbeatScheduler.ts","../build/frontend/apps/user_status/src/services/heartbeatService.js","../build/frontend/apps/user_status/src/UserStatus.vue","../build/frontend/apps/user_status/src/services/predefinedStatusService.js","../build/frontend/apps/user_status/src/store/predefinedStatuses.js","../build/frontend/apps/user_status/src/services/statusService.js","../build/frontend/apps/user_status/src/store/userBackupStatus.js","../build/frontend/apps/user_status/src/services/dateService.js","../build/frontend/apps/user_status/src/services/clearAtService.js","../build/frontend/apps/user_status/src/store/userStatus.js","../build/frontend/apps/user_status/src/store/index.js","../build/frontend/apps/user_status/src/menu.js"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport const logger = getLoggerBuilder()\n\t.detectLogLevel()\n\t.setApp('user_status')\n\t.build()\n","export function getDevtoolsGlobalHook() {\n return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;\n}\nexport function getTarget() {\n // @ts-expect-error navigator and windows are not available in all environments\n return (typeof navigator !== 'undefined' && typeof window !== 'undefined')\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : {};\n}\nexport const isProxyAvailable = typeof Proxy === 'function';\n","export const HOOK_SETUP = 'devtools-plugin:setup';\nexport const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';\n","let supported;\nlet perf;\nexport function isPerformanceSupported() {\n var _a;\n if (supported !== undefined) {\n return supported;\n }\n if (typeof window !== 'undefined' && window.performance) {\n supported = true;\n perf = window.performance;\n }\n else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {\n supported = true;\n perf = globalThis.perf_hooks.performance;\n }\n else {\n supported = false;\n }\n return supported;\n}\nexport function now() {\n return isPerformanceSupported() ? perf.now() : Date.now();\n}\n","import { HOOK_PLUGIN_SETTINGS_SET } from './const.js';\nimport { now } from './time.js';\nexport class ApiProxy {\n constructor(plugin, hook) {\n this.target = null;\n this.targetQueue = [];\n this.onQueue = [];\n this.plugin = plugin;\n this.hook = hook;\n const defaultSettings = {};\n if (plugin.settings) {\n for (const id in plugin.settings) {\n const item = plugin.settings[id];\n defaultSettings[id] = item.defaultValue;\n }\n }\n const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;\n let currentSettings = Object.assign({}, defaultSettings);\n try {\n const raw = localStorage.getItem(localSettingsSaveId);\n const data = JSON.parse(raw);\n Object.assign(currentSettings, data);\n }\n catch (e) {\n // noop\n }\n this.fallbacks = {\n getSettings() {\n return currentSettings;\n },\n setSettings(value) {\n try {\n localStorage.setItem(localSettingsSaveId, JSON.stringify(value));\n }\n catch (e) {\n // noop\n }\n currentSettings = value;\n },\n now() {\n return now();\n },\n };\n if (hook) {\n hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {\n if (pluginId === this.plugin.id) {\n this.fallbacks.setSettings(value);\n }\n });\n }\n this.proxiedOn = new Proxy({}, {\n get: (_target, prop) => {\n if (this.target) {\n return this.target.on[prop];\n }\n else {\n return (...args) => {\n this.onQueue.push({\n method: prop,\n args,\n });\n };\n }\n },\n });\n this.proxiedTarget = new Proxy({}, {\n get: (_target, prop) => {\n if (this.target) {\n return this.target[prop];\n }\n else if (prop === 'on') {\n return this.proxiedOn;\n }\n else if (Object.keys(this.fallbacks).includes(prop)) {\n return (...args) => {\n this.targetQueue.push({\n method: prop,\n args,\n resolve: () => { },\n });\n return this.fallbacks[prop](...args);\n };\n }\n else {\n return (...args) => {\n return new Promise((resolve) => {\n this.targetQueue.push({\n method: prop,\n args,\n resolve,\n });\n });\n };\n }\n },\n });\n }\n async setRealTarget(target) {\n this.target = target;\n for (const item of this.onQueue) {\n this.target.on[item.method](...item.args);\n }\n for (const item of this.targetQueue) {\n item.resolve(await this.target[item.method](...item.args));\n }\n }\n}\n","import { getDevtoolsGlobalHook, getTarget, isProxyAvailable } from './env.js';\nimport { HOOK_SETUP } from './const.js';\nimport { ApiProxy } from './proxy.js';\nexport * from './api/index.js';\nexport * from './plugin.js';\nexport * from './time.js';\nexport function setupDevtoolsPlugin(pluginDescriptor, setupFn) {\n const descriptor = pluginDescriptor;\n const target = getTarget();\n const hook = getDevtoolsGlobalHook();\n const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;\n if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {\n hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);\n }\n else {\n const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;\n const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];\n list.push({\n pluginDescriptor: descriptor,\n setupFn,\n proxy,\n });\n if (proxy) {\n setupFn(proxy.proxiedTarget);\n }\n }\n}\n","/*!\n * vuex v4.1.0\n * (c) 2022 Evan You\n * @license MIT\n */\nimport { inject, effectScope, reactive, watch, computed } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\nvar storeKey = 'store';\n\nfunction useStore (key) {\n if ( key === void 0 ) key = null;\n\n return inject(key !== null ? key : storeKey)\n}\n\n/**\n * Get the first item that pass the test\n * by second argument function\n *\n * @param {Array} list\n * @param {Function} f\n * @return {*}\n */\nfunction find (list, f) {\n return list.filter(f)[0]\n}\n\n/**\n * Deep copy the given object considering circular structure.\n * This function caches all nested objects and its copies.\n * If it detects circular structure, use cached copy to avoid infinite loop.\n *\n * @param {*} obj\n * @param {Array} cache\n * @return {*}\n */\nfunction deepCopy (obj, cache) {\n if ( cache === void 0 ) cache = [];\n\n // just return if obj is immutable value\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n // if obj is hit, it is in circular structure\n var hit = find(cache, function (c) { return c.original === obj; });\n if (hit) {\n return hit.copy\n }\n\n var copy = Array.isArray(obj) ? [] : {};\n // put the copy into cache at first\n // because we want to refer it in recursive deepCopy\n cache.push({\n original: obj,\n copy: copy\n });\n\n Object.keys(obj).forEach(function (key) {\n copy[key] = deepCopy(obj[key], cache);\n });\n\n return copy\n}\n\n/**\n * forEach for object\n */\nfunction forEachValue (obj, fn) {\n Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });\n}\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isPromise (val) {\n return val && typeof val.then === 'function'\n}\n\nfunction assert (condition, msg) {\n if (!condition) { throw new Error((\"[vuex] \" + msg)) }\n}\n\nfunction partial (fn, arg) {\n return function () {\n return fn(arg)\n }\n}\n\nfunction genericSubscribe (fn, subs, options) {\n if (subs.indexOf(fn) < 0) {\n options && options.prepend\n ? subs.unshift(fn)\n : subs.push(fn);\n }\n return function () {\n var i = subs.indexOf(fn);\n if (i > -1) {\n subs.splice(i, 1);\n }\n }\n}\n\nfunction resetStore (store, hot) {\n store._actions = Object.create(null);\n store._mutations = Object.create(null);\n store._wrappedGetters = Object.create(null);\n store._modulesNamespaceMap = Object.create(null);\n var state = store.state;\n // init all modules\n installModule(store, state, [], store._modules.root, true);\n // reset state\n resetStoreState(store, state, hot);\n}\n\nfunction resetStoreState (store, state, hot) {\n var oldState = store._state;\n var oldScope = store._scope;\n\n // bind store public getters\n store.getters = {};\n // reset local getters cache\n store._makeLocalGettersCache = Object.create(null);\n var wrappedGetters = store._wrappedGetters;\n var computedObj = {};\n var computedCache = {};\n\n // create a new effect scope and create computed object inside it to avoid\n // getters (computed) getting destroyed on component unmount.\n var scope = effectScope(true);\n\n scope.run(function () {\n forEachValue(wrappedGetters, function (fn, key) {\n // use computed to leverage its lazy-caching mechanism\n // direct inline function use will lead to closure preserving oldState.\n // using partial to return function with only arguments preserved in closure environment.\n computedObj[key] = partial(fn, store);\n computedCache[key] = computed(function () { return computedObj[key](); });\n Object.defineProperty(store.getters, key, {\n get: function () { return computedCache[key].value; },\n enumerable: true // for local getters\n });\n });\n });\n\n store._state = reactive({\n data: state\n });\n\n // register the newly created effect scope to the store so that we can\n // dispose the effects when this method runs again in the future.\n store._scope = scope;\n\n // enable strict mode for new state\n if (store.strict) {\n enableStrictMode(store);\n }\n\n if (oldState) {\n if (hot) {\n // dispatch changes in all subscribed watchers\n // to force getter re-evaluation for hot reloading.\n store._withCommit(function () {\n oldState.data = null;\n });\n }\n }\n\n // dispose previously registered effect scope if there is one.\n if (oldScope) {\n oldScope.stop();\n }\n}\n\nfunction installModule (store, rootState, path, module, hot) {\n var isRoot = !path.length;\n var namespace = store._modules.getNamespace(path);\n\n // register in namespace map\n if (module.namespaced) {\n if (store._modulesNamespaceMap[namespace] && (process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] duplicate namespace \" + namespace + \" for the namespaced module \" + (path.join('/'))));\n }\n store._modulesNamespaceMap[namespace] = module;\n }\n\n // set state\n if (!isRoot && !hot) {\n var parentState = getNestedState(rootState, path.slice(0, -1));\n var moduleName = path[path.length - 1];\n store._withCommit(function () {\n if ((process.env.NODE_ENV !== 'production')) {\n if (moduleName in parentState) {\n console.warn(\n (\"[vuex] state field \\\"\" + moduleName + \"\\\" was overridden by a module with the same name at \\\"\" + (path.join('.')) + \"\\\"\")\n );\n }\n }\n parentState[moduleName] = module.state;\n });\n }\n\n var local = module.context = makeLocalContext(store, namespace, path);\n\n module.forEachMutation(function (mutation, key) {\n var namespacedType = namespace + key;\n registerMutation(store, namespacedType, mutation, local);\n });\n\n module.forEachAction(function (action, key) {\n var type = action.root ? key : namespace + key;\n var handler = action.handler || action;\n registerAction(store, type, handler, local);\n });\n\n module.forEachGetter(function (getter, key) {\n var namespacedType = namespace + key;\n registerGetter(store, namespacedType, getter, local);\n });\n\n module.forEachChild(function (child, key) {\n installModule(store, rootState, path.concat(key), child, hot);\n });\n}\n\n/**\n * make localized dispatch, commit, getters and state\n * if there is no namespace, just use root ones\n */\nfunction makeLocalContext (store, namespace, path) {\n var noNamespace = namespace === '';\n\n var local = {\n dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ((process.env.NODE_ENV !== 'production') && !store._actions[type]) {\n console.error((\"[vuex] unknown local action type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n return store.dispatch(type, payload)\n },\n\n commit: noNamespace ? store.commit : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ((process.env.NODE_ENV !== 'production') && !store._mutations[type]) {\n console.error((\"[vuex] unknown local mutation type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n store.commit(type, payload, options);\n }\n };\n\n // getters and state object must be gotten lazily\n // because they will be changed by state update\n Object.defineProperties(local, {\n getters: {\n get: noNamespace\n ? function () { return store.getters; }\n : function () { return makeLocalGetters(store, namespace); }\n },\n state: {\n get: function () { return getNestedState(store.state, path); }\n }\n });\n\n return local\n}\n\nfunction makeLocalGetters (store, namespace) {\n if (!store._makeLocalGettersCache[namespace]) {\n var gettersProxy = {};\n var splitPos = namespace.length;\n Object.keys(store.getters).forEach(function (type) {\n // skip if the target getter is not match this namespace\n if (type.slice(0, splitPos) !== namespace) { return }\n\n // extract local getter type\n var localType = type.slice(splitPos);\n\n // Add a port to the getters proxy.\n // Define as getter property because\n // we do not want to evaluate the getters in this time.\n Object.defineProperty(gettersProxy, localType, {\n get: function () { return store.getters[type]; },\n enumerable: true\n });\n });\n store._makeLocalGettersCache[namespace] = gettersProxy;\n }\n\n return store._makeLocalGettersCache[namespace]\n}\n\nfunction registerMutation (store, type, handler, local) {\n var entry = store._mutations[type] || (store._mutations[type] = []);\n entry.push(function wrappedMutationHandler (payload) {\n handler.call(store, local.state, payload);\n });\n}\n\nfunction registerAction (store, type, handler, local) {\n var entry = store._actions[type] || (store._actions[type] = []);\n entry.push(function wrappedActionHandler (payload) {\n var res = handler.call(store, {\n dispatch: local.dispatch,\n commit: local.commit,\n getters: local.getters,\n state: local.state,\n rootGetters: store.getters,\n rootState: store.state\n }, payload);\n if (!isPromise(res)) {\n res = Promise.resolve(res);\n }\n if (store._devtoolHook) {\n return res.catch(function (err) {\n store._devtoolHook.emit('vuex:error', err);\n throw err\n })\n } else {\n return res\n }\n });\n}\n\nfunction registerGetter (store, type, rawGetter, local) {\n if (store._wrappedGetters[type]) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] duplicate getter key: \" + type));\n }\n return\n }\n store._wrappedGetters[type] = function wrappedGetter (store) {\n return rawGetter(\n local.state, // local state\n local.getters, // local getters\n store.state, // root state\n store.getters // root getters\n )\n };\n}\n\nfunction enableStrictMode (store) {\n watch(function () { return store._state.data; }, function () {\n if ((process.env.NODE_ENV !== 'production')) {\n assert(store._committing, \"do not mutate vuex store state outside mutation handlers.\");\n }\n }, { deep: true, flush: 'sync' });\n}\n\nfunction getNestedState (state, path) {\n return path.reduce(function (state, key) { return state[key]; }, state)\n}\n\nfunction unifyObjectStyle (type, payload, options) {\n if (isObject(type) && type.type) {\n options = payload;\n payload = type;\n type = type.type;\n }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof type === 'string', (\"expects string as the type, but found \" + (typeof type) + \".\"));\n }\n\n return { type: type, payload: payload, options: options }\n}\n\nvar LABEL_VUEX_BINDINGS = 'vuex bindings';\nvar MUTATIONS_LAYER_ID = 'vuex:mutations';\nvar ACTIONS_LAYER_ID = 'vuex:actions';\nvar INSPECTOR_ID = 'vuex';\n\nvar actionId = 0;\n\nfunction addDevtools (app, store) {\n setupDevtoolsPlugin(\n {\n id: 'org.vuejs.vuex',\n app: app,\n label: 'Vuex',\n homepage: 'https://next.vuex.vuejs.org/',\n logo: 'https://vuejs.org/images/icons/favicon-96x96.png',\n packageName: 'vuex',\n componentStateTypes: [LABEL_VUEX_BINDINGS]\n },\n function (api) {\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: 'Vuex Mutations',\n color: COLOR_LIME_500\n });\n\n api.addTimelineLayer({\n id: ACTIONS_LAYER_ID,\n label: 'Vuex Actions',\n color: COLOR_LIME_500\n });\n\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Vuex',\n icon: 'storage',\n treeFilterPlaceholder: 'Filter stores...'\n });\n\n api.on.getInspectorTree(function (payload) {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n if (payload.filter) {\n var nodes = [];\n flattenStoreForInspectorTree(nodes, store._modules.root, payload.filter, '');\n payload.rootNodes = nodes;\n } else {\n payload.rootNodes = [\n formatStoreForInspectorTree(store._modules.root, '')\n ];\n }\n }\n });\n\n api.on.getInspectorState(function (payload) {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n var modulePath = payload.nodeId;\n makeLocalGetters(store, modulePath);\n payload.state = formatStoreForInspectorState(\n getStoreModule(store._modules, modulePath),\n modulePath === 'root' ? store.getters : store._makeLocalGettersCache,\n modulePath\n );\n }\n });\n\n api.on.editInspectorState(function (payload) {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n var modulePath = payload.nodeId;\n var path = payload.path;\n if (modulePath !== 'root') {\n path = modulePath.split('/').filter(Boolean).concat( path);\n }\n store._withCommit(function () {\n payload.set(store._state.data, path, payload.state.value);\n });\n }\n });\n\n store.subscribe(function (mutation, state) {\n var data = {};\n\n if (mutation.payload) {\n data.payload = mutation.payload;\n }\n\n data.state = state;\n\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: Date.now(),\n title: mutation.type,\n data: data\n }\n });\n });\n\n store.subscribeAction({\n before: function (action, state) {\n var data = {};\n if (action.payload) {\n data.payload = action.payload;\n }\n action._id = actionId++;\n action._time = Date.now();\n data.state = state;\n\n api.addTimelineEvent({\n layerId: ACTIONS_LAYER_ID,\n event: {\n time: action._time,\n title: action.type,\n groupId: action._id,\n subtitle: 'start',\n data: data\n }\n });\n },\n after: function (action, state) {\n var data = {};\n var duration = Date.now() - action._time;\n data.duration = {\n _custom: {\n type: 'duration',\n display: (duration + \"ms\"),\n tooltip: 'Action duration',\n value: duration\n }\n };\n if (action.payload) {\n data.payload = action.payload;\n }\n data.state = state;\n\n api.addTimelineEvent({\n layerId: ACTIONS_LAYER_ID,\n event: {\n time: Date.now(),\n title: action.type,\n groupId: action._id,\n subtitle: 'end',\n data: data\n }\n });\n }\n });\n }\n );\n}\n\n// extracted from tailwind palette\nvar COLOR_LIME_500 = 0x84cc16;\nvar COLOR_DARK = 0x666666;\nvar COLOR_WHITE = 0xffffff;\n\nvar TAG_NAMESPACED = {\n label: 'namespaced',\n textColor: COLOR_WHITE,\n backgroundColor: COLOR_DARK\n};\n\n/**\n * @param {string} path\n */\nfunction extractNameFromPath (path) {\n return path && path !== 'root' ? path.split('/').slice(-2, -1)[0] : 'Root'\n}\n\n/**\n * @param {*} module\n * @return {import('@vue/devtools-api').CustomInspectorNode}\n */\nfunction formatStoreForInspectorTree (module, path) {\n return {\n id: path || 'root',\n // all modules end with a `/`, we want the last segment only\n // cart/ -> cart\n // nested/cart/ -> cart\n label: extractNameFromPath(path),\n tags: module.namespaced ? [TAG_NAMESPACED] : [],\n children: Object.keys(module._children).map(function (moduleName) { return formatStoreForInspectorTree(\n module._children[moduleName],\n path + moduleName + '/'\n ); }\n )\n }\n}\n\n/**\n * @param {import('@vue/devtools-api').CustomInspectorNode[]} result\n * @param {*} module\n * @param {string} filter\n * @param {string} path\n */\nfunction flattenStoreForInspectorTree (result, module, filter, path) {\n if (path.includes(filter)) {\n result.push({\n id: path || 'root',\n label: path.endsWith('/') ? path.slice(0, path.length - 1) : path || 'Root',\n tags: module.namespaced ? [TAG_NAMESPACED] : []\n });\n }\n Object.keys(module._children).forEach(function (moduleName) {\n flattenStoreForInspectorTree(result, module._children[moduleName], filter, path + moduleName + '/');\n });\n}\n\n/**\n * @param {*} module\n * @return {import('@vue/devtools-api').CustomInspectorState}\n */\nfunction formatStoreForInspectorState (module, getters, path) {\n getters = path === 'root' ? getters : getters[path];\n var gettersKeys = Object.keys(getters);\n var storeState = {\n state: Object.keys(module.state).map(function (key) { return ({\n key: key,\n editable: true,\n value: module.state[key]\n }); })\n };\n\n if (gettersKeys.length) {\n var tree = transformPathsToObjectTree(getters);\n storeState.getters = Object.keys(tree).map(function (key) { return ({\n key: key.endsWith('/') ? extractNameFromPath(key) : key,\n editable: false,\n value: canThrow(function () { return tree[key]; })\n }); });\n }\n\n return storeState\n}\n\nfunction transformPathsToObjectTree (getters) {\n var result = {};\n Object.keys(getters).forEach(function (key) {\n var path = key.split('/');\n if (path.length > 1) {\n var target = result;\n var leafKey = path.pop();\n path.forEach(function (p) {\n if (!target[p]) {\n target[p] = {\n _custom: {\n value: {},\n display: p,\n tooltip: 'Module',\n abstract: true\n }\n };\n }\n target = target[p]._custom.value;\n });\n target[leafKey] = canThrow(function () { return getters[key]; });\n } else {\n result[key] = canThrow(function () { return getters[key]; });\n }\n });\n return result\n}\n\nfunction getStoreModule (moduleMap, path) {\n var names = path.split('/').filter(function (n) { return n; });\n return names.reduce(\n function (module, moduleName, i) {\n var child = module[moduleName];\n if (!child) {\n throw new Error((\"Missing module \\\"\" + moduleName + \"\\\" for path \\\"\" + path + \"\\\".\"))\n }\n return i === names.length - 1 ? child : child._children\n },\n path === 'root' ? moduleMap : moduleMap.root._children\n )\n}\n\nfunction canThrow (cb) {\n try {\n return cb()\n } catch (e) {\n return e\n }\n}\n\n// Base data struct for store's module, package with some attribute and method\nvar Module = function Module (rawModule, runtime) {\n this.runtime = runtime;\n // Store some children item\n this._children = Object.create(null);\n // Store the origin module object which passed by programmer\n this._rawModule = rawModule;\n var rawState = rawModule.state;\n\n // Store the origin module's state\n this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};\n};\n\nvar prototypeAccessors$1 = { namespaced: { configurable: true } };\n\nprototypeAccessors$1.namespaced.get = function () {\n return !!this._rawModule.namespaced\n};\n\nModule.prototype.addChild = function addChild (key, module) {\n this._children[key] = module;\n};\n\nModule.prototype.removeChild = function removeChild (key) {\n delete this._children[key];\n};\n\nModule.prototype.getChild = function getChild (key) {\n return this._children[key]\n};\n\nModule.prototype.hasChild = function hasChild (key) {\n return key in this._children\n};\n\nModule.prototype.update = function update (rawModule) {\n this._rawModule.namespaced = rawModule.namespaced;\n if (rawModule.actions) {\n this._rawModule.actions = rawModule.actions;\n }\n if (rawModule.mutations) {\n this._rawModule.mutations = rawModule.mutations;\n }\n if (rawModule.getters) {\n this._rawModule.getters = rawModule.getters;\n }\n};\n\nModule.prototype.forEachChild = function forEachChild (fn) {\n forEachValue(this._children, fn);\n};\n\nModule.prototype.forEachGetter = function forEachGetter (fn) {\n if (this._rawModule.getters) {\n forEachValue(this._rawModule.getters, fn);\n }\n};\n\nModule.prototype.forEachAction = function forEachAction (fn) {\n if (this._rawModule.actions) {\n forEachValue(this._rawModule.actions, fn);\n }\n};\n\nModule.prototype.forEachMutation = function forEachMutation (fn) {\n if (this._rawModule.mutations) {\n forEachValue(this._rawModule.mutations, fn);\n }\n};\n\nObject.defineProperties( Module.prototype, prototypeAccessors$1 );\n\nvar ModuleCollection = function ModuleCollection (rawRootModule) {\n // register root module (Vuex.Store options)\n this.register([], rawRootModule, false);\n};\n\nModuleCollection.prototype.get = function get (path) {\n return path.reduce(function (module, key) {\n return module.getChild(key)\n }, this.root)\n};\n\nModuleCollection.prototype.getNamespace = function getNamespace (path) {\n var module = this.root;\n return path.reduce(function (namespace, key) {\n module = module.getChild(key);\n return namespace + (module.namespaced ? key + '/' : '')\n }, '')\n};\n\nModuleCollection.prototype.update = function update$1 (rawRootModule) {\n update([], this.root, rawRootModule);\n};\n\nModuleCollection.prototype.register = function register (path, rawModule, runtime) {\n var this$1$1 = this;\n if ( runtime === void 0 ) runtime = true;\n\n if ((process.env.NODE_ENV !== 'production')) {\n assertRawModule(path, rawModule);\n }\n\n var newModule = new Module(rawModule, runtime);\n if (path.length === 0) {\n this.root = newModule;\n } else {\n var parent = this.get(path.slice(0, -1));\n parent.addChild(path[path.length - 1], newModule);\n }\n\n // register nested modules\n if (rawModule.modules) {\n forEachValue(rawModule.modules, function (rawChildModule, key) {\n this$1$1.register(path.concat(key), rawChildModule, runtime);\n });\n }\n};\n\nModuleCollection.prototype.unregister = function unregister (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n var child = parent.getChild(key);\n\n if (!child) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\n \"[vuex] trying to unregister module '\" + key + \"', which is \" +\n \"not registered\"\n );\n }\n return\n }\n\n if (!child.runtime) {\n return\n }\n\n parent.removeChild(key);\n};\n\nModuleCollection.prototype.isRegistered = function isRegistered (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n\n if (parent) {\n return parent.hasChild(key)\n }\n\n return false\n};\n\nfunction update (path, targetModule, newModule) {\n if ((process.env.NODE_ENV !== 'production')) {\n assertRawModule(path, newModule);\n }\n\n // update target module\n targetModule.update(newModule);\n\n // update nested modules\n if (newModule.modules) {\n for (var key in newModule.modules) {\n if (!targetModule.getChild(key)) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\n \"[vuex] trying to add a new module '\" + key + \"' on hot reloading, \" +\n 'manual reload is needed'\n );\n }\n return\n }\n update(\n path.concat(key),\n targetModule.getChild(key),\n newModule.modules[key]\n );\n }\n }\n}\n\nvar functionAssert = {\n assert: function (value) { return typeof value === 'function'; },\n expected: 'function'\n};\n\nvar objectAssert = {\n assert: function (value) { return typeof value === 'function' ||\n (typeof value === 'object' && typeof value.handler === 'function'); },\n expected: 'function or object with \"handler\" function'\n};\n\nvar assertTypes = {\n getters: functionAssert,\n mutations: functionAssert,\n actions: objectAssert\n};\n\nfunction assertRawModule (path, rawModule) {\n Object.keys(assertTypes).forEach(function (key) {\n if (!rawModule[key]) { return }\n\n var assertOptions = assertTypes[key];\n\n forEachValue(rawModule[key], function (value, type) {\n assert(\n assertOptions.assert(value),\n makeAssertionMessage(path, key, type, value, assertOptions.expected)\n );\n });\n });\n}\n\nfunction makeAssertionMessage (path, key, type, value, expected) {\n var buf = key + \" should be \" + expected + \" but \\\"\" + key + \".\" + type + \"\\\"\";\n if (path.length > 0) {\n buf += \" in module \\\"\" + (path.join('.')) + \"\\\"\";\n }\n buf += \" is \" + (JSON.stringify(value)) + \".\";\n return buf\n}\n\nfunction createStore (options) {\n return new Store(options)\n}\n\nvar Store = function Store (options) {\n var this$1$1 = this;\n if ( options === void 0 ) options = {};\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof Promise !== 'undefined', \"vuex requires a Promise polyfill in this browser.\");\n assert(this instanceof Store, \"store must be called with the new operator.\");\n }\n\n var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];\n var strict = options.strict; if ( strict === void 0 ) strict = false;\n var devtools = options.devtools;\n\n // store internal state\n this._committing = false;\n this._actions = Object.create(null);\n this._actionSubscribers = [];\n this._mutations = Object.create(null);\n this._wrappedGetters = Object.create(null);\n this._modules = new ModuleCollection(options);\n this._modulesNamespaceMap = Object.create(null);\n this._subscribers = [];\n this._makeLocalGettersCache = Object.create(null);\n\n // EffectScope instance. when registering new getters, we wrap them inside\n // EffectScope so that getters (computed) would not be destroyed on\n // component unmount.\n this._scope = null;\n\n this._devtools = devtools;\n\n // bind commit and dispatch to self\n var store = this;\n var ref = this;\n var dispatch = ref.dispatch;\n var commit = ref.commit;\n this.dispatch = function boundDispatch (type, payload) {\n return dispatch.call(store, type, payload)\n };\n this.commit = function boundCommit (type, payload, options) {\n return commit.call(store, type, payload, options)\n };\n\n // strict mode\n this.strict = strict;\n\n var state = this._modules.root.state;\n\n // init root module.\n // this also recursively registers all sub-modules\n // and collects all module getters inside this._wrappedGetters\n installModule(this, state, [], this._modules.root);\n\n // initialize the store state, which is responsible for the reactivity\n // (also registers _wrappedGetters as computed properties)\n resetStoreState(this, state);\n\n // apply plugins\n plugins.forEach(function (plugin) { return plugin(this$1$1); });\n};\n\nvar prototypeAccessors = { state: { configurable: true } };\n\nStore.prototype.install = function install (app, injectKey) {\n app.provide(injectKey || storeKey, this);\n app.config.globalProperties.$store = this;\n\n var useDevtools = this._devtools !== undefined\n ? this._devtools\n : (process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__;\n\n if (useDevtools) {\n addDevtools(app, this);\n }\n};\n\nprototypeAccessors.state.get = function () {\n return this._state.data\n};\n\nprototypeAccessors.state.set = function (v) {\n if ((process.env.NODE_ENV !== 'production')) {\n assert(false, \"use store.replaceState() to explicit replace store state.\");\n }\n};\n\nStore.prototype.commit = function commit (_type, _payload, _options) {\n var this$1$1 = this;\n\n // check object-style commit\n var ref = unifyObjectStyle(_type, _payload, _options);\n var type = ref.type;\n var payload = ref.payload;\n var options = ref.options;\n\n var mutation = { type: type, payload: payload };\n var entry = this._mutations[type];\n if (!entry) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] unknown mutation type: \" + type));\n }\n return\n }\n this._withCommit(function () {\n entry.forEach(function commitIterator (handler) {\n handler(payload);\n });\n });\n\n this._subscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .forEach(function (sub) { return sub(mutation, this$1$1.state); });\n\n if (\n (process.env.NODE_ENV !== 'production') &&\n options && options.silent\n ) {\n console.warn(\n \"[vuex] mutation type: \" + type + \". Silent option has been removed. \" +\n 'Use the filter functionality in the vue-devtools'\n );\n }\n};\n\nStore.prototype.dispatch = function dispatch (_type, _payload) {\n var this$1$1 = this;\n\n // check object-style dispatch\n var ref = unifyObjectStyle(_type, _payload);\n var type = ref.type;\n var payload = ref.payload;\n\n var action = { type: type, payload: payload };\n var entry = this._actions[type];\n if (!entry) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] unknown action type: \" + type));\n }\n return\n }\n\n try {\n this._actionSubscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .filter(function (sub) { return sub.before; })\n .forEach(function (sub) { return sub.before(action, this$1$1.state); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in before action subscribers: \");\n console.error(e);\n }\n }\n\n var result = entry.length > 1\n ? Promise.all(entry.map(function (handler) { return handler(payload); }))\n : entry[0](payload);\n\n return new Promise(function (resolve, reject) {\n result.then(function (res) {\n try {\n this$1$1._actionSubscribers\n .filter(function (sub) { return sub.after; })\n .forEach(function (sub) { return sub.after(action, this$1$1.state); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in after action subscribers: \");\n console.error(e);\n }\n }\n resolve(res);\n }, function (error) {\n try {\n this$1$1._actionSubscribers\n .filter(function (sub) { return sub.error; })\n .forEach(function (sub) { return sub.error(action, this$1$1.state, error); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in error action subscribers: \");\n console.error(e);\n }\n }\n reject(error);\n });\n })\n};\n\nStore.prototype.subscribe = function subscribe (fn, options) {\n return genericSubscribe(fn, this._subscribers, options)\n};\n\nStore.prototype.subscribeAction = function subscribeAction (fn, options) {\n var subs = typeof fn === 'function' ? { before: fn } : fn;\n return genericSubscribe(subs, this._actionSubscribers, options)\n};\n\nStore.prototype.watch = function watch$1 (getter, cb, options) {\n var this$1$1 = this;\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof getter === 'function', \"store.watch only accepts a function.\");\n }\n return watch(function () { return getter(this$1$1.state, this$1$1.getters); }, cb, Object.assign({}, options))\n};\n\nStore.prototype.replaceState = function replaceState (state) {\n var this$1$1 = this;\n\n this._withCommit(function () {\n this$1$1._state.data = state;\n });\n};\n\nStore.prototype.registerModule = function registerModule (path, rawModule, options) {\n if ( options === void 0 ) options = {};\n\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n assert(path.length > 0, 'cannot register the root module by using registerModule.');\n }\n\n this._modules.register(path, rawModule);\n installModule(this, this.state, path, this._modules.get(path), options.preserveState);\n // reset store to update getters...\n resetStoreState(this, this.state);\n};\n\nStore.prototype.unregisterModule = function unregisterModule (path) {\n var this$1$1 = this;\n\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n this._modules.unregister(path);\n this._withCommit(function () {\n var parentState = getNestedState(this$1$1.state, path.slice(0, -1));\n delete parentState[path[path.length - 1]];\n });\n resetStore(this);\n};\n\nStore.prototype.hasModule = function hasModule (path) {\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n return this._modules.isRegistered(path)\n};\n\nStore.prototype.hotUpdate = function hotUpdate (newOptions) {\n this._modules.update(newOptions);\n resetStore(this, true);\n};\n\nStore.prototype._withCommit = function _withCommit (fn) {\n var committing = this._committing;\n this._committing = true;\n fn();\n this._committing = committing;\n};\n\nObject.defineProperties( Store.prototype, prototypeAccessors );\n\n/**\n * Reduce the code which written in Vue.js for getting the state.\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.\n * @param {Object}\n */\nvar mapState = normalizeNamespace(function (namespace, states) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(states)) {\n console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(states).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedState () {\n var state = this.$store.state;\n var getters = this.$store.getters;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapState', namespace);\n if (!module) {\n return\n }\n state = module.context.state;\n getters = module.context.getters;\n }\n return typeof val === 'function'\n ? val.call(this, state, getters)\n : state[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for committing the mutation\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapMutations = normalizeNamespace(function (namespace, mutations) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(mutations)) {\n console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(mutations).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedMutation () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // Get the commit method from store\n var commit = this.$store.commit;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);\n if (!module) {\n return\n }\n commit = module.context.commit;\n }\n return typeof val === 'function'\n ? val.apply(this, [commit].concat(args))\n : commit.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for getting the getters\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} getters\n * @return {Object}\n */\nvar mapGetters = normalizeNamespace(function (namespace, getters) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(getters)) {\n console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(getters).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n // The namespace has been mutated by normalizeNamespace\n val = namespace + val;\n res[key] = function mappedGetter () {\n if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {\n return\n }\n if ((process.env.NODE_ENV !== 'production') && !(val in this.$store.getters)) {\n console.error((\"[vuex] unknown getter: \" + val));\n return\n }\n return this.$store.getters[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for dispatch the action\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapActions = normalizeNamespace(function (namespace, actions) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(actions)) {\n console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(actions).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedAction () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // get dispatch function from store\n var dispatch = this.$store.dispatch;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapActions', namespace);\n if (!module) {\n return\n }\n dispatch = module.context.dispatch;\n }\n return typeof val === 'function'\n ? val.apply(this, [dispatch].concat(args))\n : dispatch.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object\n * @param {String} namespace\n * @return {Object}\n */\nvar createNamespacedHelpers = function (namespace) { return ({\n mapState: mapState.bind(null, namespace),\n mapGetters: mapGetters.bind(null, namespace),\n mapMutations: mapMutations.bind(null, namespace),\n mapActions: mapActions.bind(null, namespace)\n}); };\n\n/**\n * Normalize the map\n * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]\n * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]\n * @param {Array|Object} map\n * @return {Object}\n */\nfunction normalizeMap (map) {\n if (!isValidMap(map)) {\n return []\n }\n return Array.isArray(map)\n ? map.map(function (key) { return ({ key: key, val: key }); })\n : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })\n}\n\n/**\n * Validate whether given map is valid or not\n * @param {*} map\n * @return {Boolean}\n */\nfunction isValidMap (map) {\n return Array.isArray(map) || isObject(map)\n}\n\n/**\n * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.\n * @param {Function} fn\n * @return {Function}\n */\nfunction normalizeNamespace (fn) {\n return function (namespace, map) {\n if (typeof namespace !== 'string') {\n map = namespace;\n namespace = '';\n } else if (namespace.charAt(namespace.length - 1) !== '/') {\n namespace += '/';\n }\n return fn(namespace, map)\n }\n}\n\n/**\n * Search a special module from store by namespace. if module not exist, print error message.\n * @param {Object} store\n * @param {String} helper\n * @param {String} namespace\n * @return {Object}\n */\nfunction getModuleByNamespace (store, helper, namespace) {\n var module = store._modulesNamespaceMap[namespace];\n if ((process.env.NODE_ENV !== 'production') && !module) {\n console.error((\"[vuex] module namespace not found in \" + helper + \"(): \" + namespace));\n }\n return module\n}\n\n// Credits: borrowed code from fcomb/redux-logger\n\nfunction createLogger (ref) {\n if ( ref === void 0 ) ref = {};\n var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;\n var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };\n var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };\n var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };\n var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };\n var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };\n var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;\n var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;\n var logger = ref.logger; if ( logger === void 0 ) logger = console;\n\n return function (store) {\n var prevState = deepCopy(store.state);\n\n if (typeof logger === 'undefined') {\n return\n }\n\n if (logMutations) {\n store.subscribe(function (mutation, state) {\n var nextState = deepCopy(state);\n\n if (filter(mutation, prevState, nextState)) {\n var formattedTime = getFormattedTime();\n var formattedMutation = mutationTransformer(mutation);\n var message = \"mutation \" + (mutation.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));\n logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);\n logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));\n endMessage(logger);\n }\n\n prevState = nextState;\n });\n }\n\n if (logActions) {\n store.subscribeAction(function (action, state) {\n if (actionFilter(action, state)) {\n var formattedTime = getFormattedTime();\n var formattedAction = actionTransformer(action);\n var message = \"action \" + (action.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);\n endMessage(logger);\n }\n });\n }\n }\n}\n\nfunction startMessage (logger, message, collapsed) {\n var startMessage = collapsed\n ? logger.groupCollapsed\n : logger.group;\n\n // render\n try {\n startMessage.call(logger, message);\n } catch (e) {\n logger.log(message);\n }\n}\n\nfunction endMessage (logger) {\n try {\n logger.groupEnd();\n } catch (e) {\n logger.log('—— log end ——');\n }\n}\n\nfunction getFormattedTime () {\n var time = new Date();\n return (\" @ \" + (pad(time.getHours(), 2)) + \":\" + (pad(time.getMinutes(), 2)) + \":\" + (pad(time.getSeconds(), 2)) + \".\" + (pad(time.getMilliseconds(), 3)))\n}\n\nfunction repeat (str, times) {\n return (new Array(times + 1)).join(str)\n}\n\nfunction pad (num, maxLength) {\n return repeat('0', maxLength - num.toString().length) + num\n}\n\nvar index = {\n version: '4.1.0',\n Store: Store,\n storeKey: storeKey,\n createStore: createStore,\n useStore: useStore,\n mapState: mapState,\n mapMutations: mapMutations,\n mapGetters: mapGetters,\n mapActions: mapActions,\n createNamespacedHelpers: createNamespacedHelpers,\n createLogger: createLogger\n};\n\nexport default index;\nexport { Store, createLogger, createNamespacedHelpers, createStore, mapActions, mapGetters, mapMutations, mapState, storeKey, useStore };\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { showError } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport { mapState } from 'vuex'\nimport { logger } from '../logger.ts'\n\nexport default {\n\tcomputed: {\n\t\t...mapState({\n\t\t\tstatusType: (state) => state.userStatus.status,\n\t\t\tstatusIsUserDefined: (state) => state.userStatus.statusIsUserDefined,\n\t\t\tcustomIcon: (state) => state.userStatus.icon,\n\t\t\tcustomMessage: (state) => state.userStatus.message,\n\t\t}),\n\n\t\t/**\n\t\t * The message displayed in the top right corner\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tvisibleMessage() {\n\t\t\tif (this.customIcon && this.customMessage) {\n\t\t\t\treturn `${this.customIcon} ${this.customMessage}`\n\t\t\t}\n\n\t\t\tif (this.customMessage) {\n\t\t\t\treturn this.customMessage\n\t\t\t}\n\n\t\t\tif (this.statusIsUserDefined) {\n\t\t\t\tswitch (this.statusType) {\n\t\t\t\t\tcase 'online':\n\t\t\t\t\t\treturn t('user_status', 'Online')\n\n\t\t\t\t\tcase 'away':\n\t\t\t\t\t\treturn t('user_status', 'Away')\n\n\t\t\t\t\tcase 'busy':\n\t\t\t\t\t\treturn t('user_status', 'Busy')\n\n\t\t\t\t\tcase 'dnd':\n\t\t\t\t\t\treturn t('user_status', 'Do not disturb')\n\n\t\t\t\t\tcase 'invisible':\n\t\t\t\t\t\treturn t('user_status', 'Invisible')\n\n\t\t\t\t\tcase 'offline':\n\t\t\t\t\t\treturn t('user_status', 'Offline')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn t('user_status', 'Set status')\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Changes the user-status\n\t\t *\n\t\t * @param {string} statusType (online / away / dnd / invisible)\n\t\t */\n\t\tasync changeStatus(statusType) {\n\t\t\ttry {\n\t\t\t\tawait this.$store.dispatch('setStatus', { statusType })\n\t\t\t} catch (err) {\n\t\t\t\tshowError(t('user_status', 'There was an error saving the new status'))\n\t\t\t\tlogger.debug(err)\n\t\t\t}\n\t\t},\n\t},\n}\n","/**\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport debounce from 'debounce'\n\n/** Has to stay below the server margin between `StatusService::REFRESH_STATUS_THRESHOLD` and `StatusService::INVALIDATE_STATUS_THRESHOLD`. */\nexport const HEARTBEAT_INTERVAL = 5 * 60 * 1000\n\nexport const AWAY_TIMEOUT = 2 * 60 * 1000\n\nexport const MOUSE_MOVE_DEBOUNCE = 2 * 1000\n\n/**\n * Send heartbeats on a fixed interval, and once more whenever the user comes back from being away.\n *\n * @param beat - Called with the current away state when a heartbeat is due\n * @return Function that stops the heartbeat and removes every timer and listener\n */\nexport function startHeartbeat(beat: (isAway: boolean) => void): () => void {\n\tlet isAway = false\n\tlet awayTimeout: ReturnType | undefined\n\n\tconst onMouseMove = debounce(() => {\n\t\tconst wasAway = isAway\n\t\tisAway = false\n\n\t\tclearTimeout(awayTimeout)\n\t\tawayTimeout = setTimeout(() => {\n\t\t\tisAway = true\n\t\t}, AWAY_TIMEOUT)\n\n\t\tif (wasAway) {\n\t\t\tbeat(isAway)\n\t\t}\n\t}, MOUSE_MOVE_DEBOUNCE, { immediate: true })\n\n\tconst interval = setInterval(() => beat(isAway), HEARTBEAT_INTERVAL)\n\twindow.addEventListener('mousemove', onMouseMove, {\n\t\tcapture: true,\n\t\tpassive: true,\n\t})\n\n\tbeat(isAway)\n\n\treturn () => {\n\t\tclearInterval(interval)\n\t\tclearTimeout(awayTimeout)\n\t\tonMouseMove.clear()\n\t\twindow.removeEventListener('mousemove', onMouseMove, { capture: true })\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport HttpClient from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Sends a heartbeat\n *\n * @param {boolean} isAway Whether or not the user is active\n * @return {Promise}\n */\nasync function sendHeartbeat(isAway) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/heartbeat?format=json')\n\tconst response = await HttpClient.put(url, {\n\t\tstatus: isAway ? 'away' : 'online',\n\t})\n\treturn response.data.ocs.data\n}\n\nexport {\n\tsendHeartbeat,\n}\n","\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport HttpClient from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Fetches all predefined statuses from the server\n *\n * @return {Promise}\n */\nasync function fetchAllPredefinedStatuses() {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/predefined_statuses?format=json')\n\tconst response = await HttpClient.get(url)\n\n\treturn response.data.ocs.data\n}\n\nexport {\n\tfetchAllPredefinedStatuses,\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { fetchAllPredefinedStatuses } from '../services/predefinedStatusService.js'\n\n// eslint-disable-next-line antfu/top-level-function\nconst state = () => ({\n\tpredefinedStatuses: [],\n})\n\nconst mutations = {\n\n\t/**\n\t * Adds a predefined status to the state\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} status The status to add\n\t */\n\taddPredefinedStatus(state, status) {\n\t\tstate.predefinedStatuses = [...state.predefinedStatuses, status]\n\t},\n}\n\nconst getters = {\n\tstatusesHaveLoaded(state) {\n\t\treturn state.predefinedStatuses.length > 0\n\t},\n}\n\nconst actions = {\n\n\t/**\n\t * Loads all predefined statuses from the server\n\t *\n\t * @param {object} vuex The Vuex components\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state -\n\t */\n\tasync loadAllPredefinedStatuses({ state, commit }) {\n\t\tif (state.predefinedStatuses.length > 0) {\n\t\t\treturn\n\t\t}\n\n\t\tconst statuses = await fetchAllPredefinedStatuses()\n\t\tfor (const status of statuses) {\n\t\t\tcommit('addPredefinedStatus', status)\n\t\t}\n\t},\n\n}\n\nexport default { state, mutations, getters, actions }\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport HttpClient from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Fetches the current user-status\n *\n * @return {Promise}\n */\nasync function fetchCurrentStatus() {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status')\n\tconst response = await HttpClient.get(url)\n\n\treturn response.data.ocs.data\n}\n\n/**\n * Fetches the current user-status\n *\n * @param {string} userId Id of the user to fetch the status\n * @return {Promise}\n */\nasync function fetchBackupStatus(userId) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/statuses/{userId}', { userId: '_' + userId })\n\tconst response = await HttpClient.get(url)\n\n\treturn response.data.ocs.data\n}\n\n/**\n * Sets the status\n *\n * @param {string} statusType The status (online / away / dnd / invisible)\n * @return {Promise}\n */\nasync function setStatus(statusType) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/status')\n\tawait HttpClient.put(url, {\n\t\tstatusType,\n\t})\n}\n\n/**\n * Sets a message based on our predefined statuses\n *\n * @param {string} messageId The id of the message, taken from predefined status service\n * @param {number | null} clearAt When to automatically clean the status\n * @return {Promise}\n */\nasync function setPredefinedMessage(messageId, clearAt = null) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/message/predefined?format=json')\n\tawait HttpClient.put(url, {\n\t\tmessageId,\n\t\tclearAt,\n\t})\n}\n\n/**\n * Sets a custom message\n *\n * @param {string} message The user-defined message\n * @param {string | null} statusIcon The user-defined icon\n * @param {number | null} clearAt When to automatically clean the status\n * @return {Promise}\n */\nasync function setCustomMessage(message, statusIcon = null, clearAt = null) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/message/custom?format=json')\n\tawait HttpClient.put(url, {\n\t\tmessage,\n\t\tstatusIcon,\n\t\tclearAt,\n\t})\n}\n\n/**\n * Clears the current status of the user\n *\n * @return {Promise}\n */\nasync function clearMessage() {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/message?format=json')\n\tawait HttpClient.delete(url)\n}\n\n/**\n * Revert the automated status\n *\n * @param {string} messageId ID of the message to revert\n * @return {Promise}\n */\nasync function revertToBackupStatus(messageId) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/revert/{messageId}', { messageId })\n\tconst response = await HttpClient.delete(url)\n\n\treturn response.data.ocs.data\n}\n\nexport {\n\tclearMessage,\n\tfetchBackupStatus,\n\tfetchCurrentStatus,\n\trevertToBackupStatus,\n\tsetCustomMessage,\n\tsetPredefinedMessage,\n\tsetStatus,\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { emit } from '@nextcloud/event-bus'\nimport {\n\tfetchBackupStatus,\n\trevertToBackupStatus,\n} from '../services/statusService.js'\n\n// eslint-disable-next-line antfu/top-level-function\nconst state = () => ({\n\t// Status (online / away / dnd / invisible / offline)\n\tstatus: null,\n\t// Whether the status is user-defined\n\tstatusIsUserDefined: null,\n\t// A custom message set by the user\n\tmessage: null,\n\t// The icon selected by the user\n\ticon: null,\n\t// When to automatically clean the status\n\tclearAt: null,\n\t// Whether the message is predefined\n\t// (and can automatically be translated by Nextcloud)\n\tmessageIsPredefined: null,\n\t// The id of the message in case it's predefined\n\tmessageId: null,\n})\n\nconst mutations = {\n\t/**\n\t * Loads the status from initial state\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.status The status type\n\t * @param {boolean} data.statusIsUserDefined Whether or not this status is user-defined\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {number} data.clearAt When to automatically clear the status\n\t * @param {boolean} data.messageIsPredefined Whether or not the message is predefined\n\t * @param {string} data.messageId The id of the predefined message\n\t */\n\tloadBackupStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) {\n\t\tstate.status = status\n\t\tstate.message = message\n\t\tstate.icon = icon\n\n\t\t// Don't overwrite certain values if the refreshing comes in via short updates\n\t\t// E.g. from talk participant list which only has the status, message and icon\n\t\tif (typeof statusIsUserDefined !== 'undefined') {\n\t\t\tstate.statusIsUserDefined = statusIsUserDefined\n\t\t}\n\t\tif (typeof clearAt !== 'undefined') {\n\t\t\tstate.clearAt = clearAt\n\t\t}\n\t\tif (typeof messageIsPredefined !== 'undefined') {\n\t\t\tstate.messageIsPredefined = messageIsPredefined\n\t\t}\n\t\tif (typeof messageId !== 'undefined') {\n\t\t\tstate.messageId = messageId\n\t\t}\n\t},\n}\n\nconst getters = {}\n\nconst actions = {\n\t/**\n\t * Re-fetches the status from the server\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @return {Promise}\n\t */\n\tasync fetchBackupFromServer({ commit }) {\n\t\ttry {\n\t\t\tconst status = await fetchBackupStatus(getCurrentUser()?.uid)\n\t\t\tcommit('loadBackupStatusFromServer', status)\n\t\t} catch {\n\t\t\t// Ignore missing user backup status\n\t\t}\n\t},\n\n\tasync revertBackupFromServer({ commit }, { messageId }) {\n\t\tconst status = await revertToBackupStatus(messageId)\n\t\tif (status) {\n\t\t\tcommit('loadBackupStatusFromServer', {})\n\t\t\tcommit('loadStatusFromServer', status)\n\t\t\temit('user_status:status.updated', {\n\t\t\t\tstatus: status.status,\n\t\t\t\tmessage: status.message,\n\t\t\t\ticon: status.icon,\n\t\t\t\tclearAt: status.clearAt,\n\t\t\t\tuserId: getCurrentUser()?.uid,\n\t\t\t})\n\t\t}\n\t},\n}\n\nexport default { state, mutations, getters, actions }\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n *\n */\nfunction dateFactory() {\n\treturn new Date()\n}\n\nexport {\n\tdateFactory,\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { formatRelativeTime, getFirstDay, t } from '@nextcloud/l10n'\nimport { dateFactory } from './dateService.js'\n\n/**\n * Calculates the actual clearAt timestamp\n *\n * @param {object | null} clearAt The clear-at config\n * @return {number | null}\n */\nexport function getTimestampForClearAt(clearAt) {\n\tif (clearAt === null) {\n\t\treturn null\n\t}\n\n\tconst date = dateFactory()\n\n\tif (clearAt.type === 'period') {\n\t\tdate.setSeconds(date.getSeconds() + clearAt.time)\n\t\treturn Math.floor(date.getTime() / 1000)\n\t}\n\tif (clearAt.type === 'end-of') {\n\t\tswitch (clearAt.time) {\n\t\t\tcase 'day':\n\t\t\t\treturn Math.floor(getEndOfDay(date).getTime() / 1000)\n\t\t\tcase 'week':\n\t\t\t\treturn Math.floor(getEndOfWeek(date).getTime() / 1000)\n\t\t}\n\t}\n\t// This is not an officially supported type\n\t// but only used internally to show the remaining time\n\t// in the Set Status Modal\n\tif (clearAt.type === '_time') {\n\t\treturn clearAt.time\n\t}\n\n\treturn null\n}\n\n/**\n * Formats a clearAt object to be human readable\n *\n * @param {object} clearAt The clearAt object\n * @return {string|null}\n */\nexport function clearAtFormat(clearAt) {\n\tif (clearAt === null) {\n\t\treturn t('user_status', 'Don\\'t clear')\n\t}\n\n\tif (clearAt.type === 'end-of') {\n\t\tswitch (clearAt.time) {\n\t\t\tcase 'day':\n\t\t\t\treturn t('user_status', 'Today')\n\t\t\tcase 'week':\n\t\t\t\treturn t('user_status', 'This week')\n\n\t\t\tdefault:\n\t\t\t\treturn null\n\t\t}\n\t}\n\n\tif (clearAt.type === 'period') {\n\t\treturn formatRelativeTime(Date.now() + clearAt.time * 1000)\n\t}\n\n\t// This is not an officially supported type\n\t// but only used internally to show the remaining time\n\t// in the Set Status Modal\n\tif (clearAt.type === '_time') {\n\t\treturn formatRelativeTime(clearAt.time * 1000)\n\t}\n\n\treturn null\n}\n\n/**\n * @param {Date} date - The date to calculate the end of the day for\n */\nfunction getEndOfDay(date) {\n\tconst endOfDay = new Date(date)\n\tendOfDay.setHours(23, 59, 59, 999)\n\treturn endOfDay\n}\n\n/**\n * Calculates the end of the week for a given date\n *\n * @param {Date} date - The date to calculate the end of the week for\n */\nfunction getEndOfWeek(date) {\n\tconst endOfWeek = getEndOfDay(date)\n\tendOfWeek.setDate(date.getDate() + ((getFirstDay() - 1 - endOfWeek.getDay() + 7) % 7))\n\treturn endOfWeek\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { emit } from '@nextcloud/event-bus'\nimport { loadState } from '@nextcloud/initial-state'\nimport { getTimestampForClearAt } from '../services/clearAtService.js'\nimport {\n\tclearMessage,\n\tfetchCurrentStatus,\n\tsetCustomMessage,\n\tsetPredefinedMessage,\n\tsetStatus,\n} from '../services/statusService.js'\n\n// eslint-disable-next-line antfu/top-level-function\nconst state = () => ({\n\t// Status (online / away / dnd / invisible / offline)\n\tstatus: null,\n\t// Whether the status is user-defined\n\tstatusIsUserDefined: null,\n\t// A custom message set by the user\n\tmessage: null,\n\t// The icon selected by the user\n\ticon: null,\n\t// When to automatically clean the status\n\tclearAt: null,\n\t// Whether the message is predefined\n\t// (and can automatically be translated by Nextcloud)\n\tmessageIsPredefined: null,\n\t// The id of the message in case it's predefined\n\tmessageId: null,\n})\n\nconst mutations = {\n\n\t/**\n\t * Sets a new status\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.statusType The new status type\n\t */\n\tsetStatus(state, { statusType }) {\n\t\tstate.status = statusType\n\t\tstate.statusIsUserDefined = true\n\t},\n\n\t/**\n\t * Sets a message using a predefined message\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.messageId The messageId\n\t * @param {number | null} data.clearAt When to automatically clear the status\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t */\n\tsetPredefinedMessage(state, { messageId, clearAt, message, icon }) {\n\t\tstate.messageId = messageId\n\t\tstate.messageIsPredefined = true\n\n\t\tstate.message = message\n\t\tstate.icon = icon\n\t\tstate.clearAt = clearAt\n\t},\n\n\t/**\n\t * Sets a custom message\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {number} data.clearAt When to automatically clear the status\n\t */\n\tsetCustomMessage(state, { message, icon, clearAt }) {\n\t\tstate.messageId = null\n\t\tstate.messageIsPredefined = false\n\n\t\tstate.message = message\n\t\tstate.icon = icon\n\t\tstate.clearAt = clearAt\n\t},\n\n\t/**\n\t * Clears the status\n\t *\n\t * @param {object} state The Vuex state\n\t */\n\tclearMessage(state) {\n\t\tstate.messageId = null\n\t\tstate.messageIsPredefined = false\n\n\t\tstate.message = null\n\t\tstate.icon = null\n\t\tstate.clearAt = null\n\t},\n\n\t/**\n\t * Loads the status from initial state\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.status The status type\n\t * @param {boolean} data.statusIsUserDefined Whether or not this status is user-defined\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {number} data.clearAt When to automatically clear the status\n\t * @param {boolean} data.messageIsPredefined Whether or not the message is predefined\n\t * @param {string} data.messageId The id of the predefined message\n\t */\n\tloadStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) {\n\t\tstate.status = status\n\t\tstate.message = message\n\t\tstate.icon = icon\n\n\t\t// Don't overwrite certain values if the refreshing comes in via short updates\n\t\t// E.g. from talk participant list which only has the status, message and icon\n\t\tif (typeof statusIsUserDefined !== 'undefined') {\n\t\t\tstate.statusIsUserDefined = statusIsUserDefined\n\t\t}\n\t\tif (typeof clearAt !== 'undefined') {\n\t\t\tstate.clearAt = clearAt\n\t\t}\n\t\tif (typeof messageIsPredefined !== 'undefined') {\n\t\t\tstate.messageIsPredefined = messageIsPredefined\n\t\t}\n\t\tif (typeof messageId !== 'undefined') {\n\t\t\tstate.messageId = messageId\n\t\t}\n\t},\n}\n\nconst getters = {}\n\nconst actions = {\n\n\t/**\n\t * Sets a new status\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {object} data The data destructuring object\n\t * @param {string} data.statusType The new status type\n\t * @return {Promise}\n\t */\n\tasync setStatus({ commit, state }, { statusType }) {\n\t\tawait setStatus(statusType)\n\t\tcommit('setStatus', { statusType })\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Update status from 'user_status:status.updated' update.\n\t * This doesn't trigger another 'user_status:status.updated'\n\t * event.\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {string} status The new status\n\t * @return {Promise}\n\t */\n\tasync setStatusFromObject({ commit }, status) {\n\t\tcommit('loadStatusFromServer', status)\n\t},\n\n\t/**\n\t * Sets a message using a predefined message\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {object} vuex.rootState The Vuex root state\n\t * @param {object} data The data destructuring object\n\t * @param {string} data.messageId The messageId\n\t * @param {object | null} data.clearAt When to automatically clear the status\n\t * @return {Promise}\n\t */\n\tasync setPredefinedMessage({ commit, rootState, state }, { messageId, clearAt }) {\n\t\tconst resolvedClearAt = getTimestampForClearAt(clearAt)\n\n\t\tawait setPredefinedMessage(messageId, resolvedClearAt)\n\t\tconst status = rootState.predefinedStatuses.predefinedStatuses.find((status) => status.id === messageId)\n\t\tconst { message, icon } = status\n\n\t\tcommit('setPredefinedMessage', { messageId, clearAt: resolvedClearAt, message, icon })\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Sets a custom message\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {object} data The data destructuring object\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {object | null} data.clearAt When to automatically clear the status\n\t * @return {Promise}\n\t */\n\tasync setCustomMessage({ commit, state }, { message, icon, clearAt }) {\n\t\tconst resolvedClearAt = getTimestampForClearAt(clearAt)\n\n\t\tawait setCustomMessage(message, icon, resolvedClearAt)\n\t\tcommit('setCustomMessage', { message, icon, clearAt: resolvedClearAt })\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Clears the status\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @return {Promise}\n\t */\n\tasync clearMessage({ commit, state }) {\n\t\tawait clearMessage()\n\t\tcommit('clearMessage')\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Re-fetches the status from the server\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @return {Promise}\n\t */\n\tasync reFetchStatusFromServer({ commit }) {\n\t\tconst status = await fetchCurrentStatus()\n\t\tcommit('loadStatusFromServer', status)\n\t},\n\n\t/**\n\t * Stores the status we got in the reply of the heartbeat\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} status The data destructuring object\n\t * @param {string} status.status The status type\n\t * @param {boolean} status.statusIsUserDefined Whether or not this status is user-defined\n\t * @param {string} status.message The message\n\t * @param {string} status.icon The icon\n\t * @param {number} status.clearAt When to automatically clear the status\n\t * @param {boolean} status.messageIsPredefined Whether or not the message is predefined\n\t * @param {string} status.messageId The id of the predefined message\n\t * @return {Promise}\n\t */\n\tasync setStatusFromHeartbeat({ commit }, status) {\n\t\tcommit('loadStatusFromServer', status)\n\t},\n\n\t/**\n\t * Loads the server from the initial state\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t */\n\tloadStatusFromInitialState({ commit }) {\n\t\tconst status = loadState('user_status', 'status')\n\t\tcommit('loadStatusFromServer', status)\n\t},\n}\n\nexport default { state, mutations, getters, actions }\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { createStore } from 'vuex'\nimport predefinedStatuses from './predefinedStatuses.js'\nimport userBackupStatus from './userBackupStatus.js'\nimport userStatus from './userStatus.js'\n\nexport default createStore({\n\tmodules: {\n\t\tpredefinedStatuses,\n\t\tuserStatus,\n\t\tuserBackupStatus,\n\t},\n\tstrict: true,\n})\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { subscribe } from '@nextcloud/event-bus'\nimport { createApp } from 'vue'\nimport UserStatus from './UserStatus.vue'\nimport store from './store/index.js'\n\nimport './user-status-icons.css'\n\nconst mountPoint = document.getElementById('user_status-menu-entry')\n\n/**\n *\n */\nfunction mountMenuEntry() {\n\tconst mountPoint = document.getElementById('user_status-menu-entry')\n\t// TODO: fix me after Core migration to Vue 3\n\t// In Vue 2 menu items were mounted in place to the menu items\n\t// In Vue 3 they are mounted inside the menu item\n\t// A workaround - replace the menu item with \"display: contents\" div\n\tconst transparentMountPoint = document.createElement('div')\n\ttransparentMountPoint.style.display = 'contents'\n\tmountPoint.replaceWith(transparentMountPoint)\n\n\tcreateApp(UserStatus)\n\t\t.use(store)\n\t\t.mount(transparentMountPoint)\n}\n\nif (mountPoint) {\n\tmountMenuEntry()\n} else {\n\tsubscribe('core:user-menu:mounted', mountMenuEntry)\n}\n\n// Register dashboard status\ndocument.addEventListener('DOMContentLoaded', function() {\n\tif (!OCA.Dashboard) {\n\t\treturn\n\t}\n\n\tOCA.Dashboard.registerStatus('status', (el) => {\n\t\tcreateApp(UserStatus, {\n\t\t\tinline: true,\n\t\t})\n\t\t\t.use(store)\n\t\t\t.mount(el)\n\t})\n})\n"],"file":"user_status-menu.mjs"} \ No newline at end of file +{"version":3,"mappings":";65BAOO,MAAMA,EAASC,KACpB,iBACA,OAAO,aAAa,EACpB,QCVK,SAASC,IAAwB,CACpC,OAAOC,EAAS,EAAG,4BACvB,CACO,SAASA,GAAY,CAExB,OAAQ,OAAO,UAAc,KAAe,OAAO,OAAW,IACxD,OACA,OAAO,WAAe,IAClB,WACA,EACd,CACO,MAAMC,GA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,EAAK,EACT,MAAMqN,CAAE,CACX,CAAC,CACF,CAAC","names":["logger","getLoggerBuilder","getDevtoolsGlobalHook","getTarget","isProxyAvailable","HOOK_SETUP","HOOK_PLUGIN_SETTINGS_SET","supported","perf","isPerformanceSupported","_a","now","ApiProxy","plugin","hook","defaultSettings","id","item","localSettingsSaveId","currentSettings","raw","data","value","pluginId","_target","prop","args","resolve","target","setupDevtoolsPlugin","pluginDescriptor","setupFn","descriptor","enableProxy","proxy","storeKey","forEachValue","obj","fn","key","isObject","isPromise","val","partial","arg","genericSubscribe","subs","options","i","resetStore","store","hot","state","installModule","resetStoreState","oldState","oldScope","wrappedGetters","computedObj","computedCache","scope","effectScope","computed","reactive","enableStrictMode","rootState","path","module","isRoot","namespace","parentState","getNestedState","moduleName","local","makeLocalContext","mutation","namespacedType","registerMutation","action","type","handler","registerAction","getter","registerGetter","child","noNamespace","_type","_payload","_options","unifyObjectStyle","payload","makeLocalGetters","gettersProxy","splitPos","localType","entry","res","err","rawGetter","watch","LABEL_VUEX_BINDINGS","MUTATIONS_LAYER_ID","ACTIONS_LAYER_ID","INSPECTOR_ID","actionId","addDevtools","app","api","COLOR_LIME_500","nodes","flattenStoreForInspectorTree","formatStoreForInspectorTree","modulePath","formatStoreForInspectorState","getStoreModule","duration","COLOR_DARK","COLOR_WHITE","TAG_NAMESPACED","extractNameFromPath","result","filter","getters","gettersKeys","storeState","tree","transformPathsToObjectTree","canThrow","leafKey","p","moduleMap","names","n","cb","Module","rawModule","runtime","rawState","prototypeAccessors$1","ModuleCollection","rawRootModule","update","this$1$1","newModule","parent","rawChildModule","targetModule","createStore","Store","plugins","strict","devtools","ref","dispatch","commit","prototypeAccessors","injectKey","useDevtools","v","sub","reject","error","newOptions","committing","mapState","normalizeNamespace","states","normalizeMap","getModuleByNamespace","mapGetters","map","isValidMap","helper","OnlineStatusMixin","t","statusType","showError","browserStorage","getBuilder","HEARTBEAT_INTERVAL","AWAY_TIMEOUT","MOUSE_MOVE_DEBOUNCE","HEARTBEAT_THROTTLE","startHeartbeat","beat","isAway","awayTimeout","onVisible","announce","force","age","onMouseMove","debounce","wasAway","interval","sendHeartbeat","url","generateOcsUrl","HttpClient","_sfc_main","NcButton","NcListItem","NcUserStatusIcon","defineAsyncComponent","__vitePreload","subscribe","unsubscribe","status","getCurrentUser","$props","_createElementBlock","_hoisted_1","_createVNode","_component_NcButton","$options","_component_NcUserStatusIcon","_normalizeClass","_ctx","_createTextVNode","_createBlock","_component_NcListItem","$data","_component_SetStatusModal","fetchAllPredefinedStatuses","mutations","actions","statuses","predefinedStatuses","fetchCurrentStatus","fetchBackupStatus","userId","setStatus","setPredefinedMessage","messageId","clearAt","setCustomMessage","message","statusIcon","clearMessage","revertToBackupStatus","statusIsUserDefined","icon","messageIsPredefined","emit","userBackupStatus","dateFactory","getTimestampForClearAt","date","getEndOfDay","getEndOfWeek","clearAtFormat","formatRelativeTime","endOfDay","endOfWeek","getFirstDay","resolvedClearAt","loadState","userStatus","mountPoint","mountMenuEntry","transparentMountPoint","createApp","UserStatus","el"],"ignoreList":[1,2,3,4,5,6],"sources":["../build/frontend/apps/user_status/src/logger.ts","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/env.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/const.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/time.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/proxy.js","../node_modules/vuex/node_modules/@vue/devtools-api/lib/esm/index.js","../node_modules/vuex/dist/vuex.esm-bundler.js","../build/frontend/apps/user_status/src/mixins/OnlineStatusMixin.js","../build/frontend/apps/user_status/src/services/heartbeatScheduler.ts","../build/frontend/apps/user_status/src/services/heartbeatService.js","../build/frontend/apps/user_status/src/UserStatus.vue","../build/frontend/apps/user_status/src/services/predefinedStatusService.js","../build/frontend/apps/user_status/src/store/predefinedStatuses.js","../build/frontend/apps/user_status/src/services/statusService.js","../build/frontend/apps/user_status/src/store/userBackupStatus.js","../build/frontend/apps/user_status/src/services/dateService.js","../build/frontend/apps/user_status/src/services/clearAtService.js","../build/frontend/apps/user_status/src/store/userStatus.js","../build/frontend/apps/user_status/src/store/index.js","../build/frontend/apps/user_status/src/menu.js"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getLoggerBuilder } from '@nextcloud/logger'\n\nexport const logger = getLoggerBuilder()\n\t.detectLogLevel()\n\t.setApp('user_status')\n\t.build()\n","export function getDevtoolsGlobalHook() {\n return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;\n}\nexport function getTarget() {\n // @ts-expect-error navigator and windows are not available in all environments\n return (typeof navigator !== 'undefined' && typeof window !== 'undefined')\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : {};\n}\nexport const isProxyAvailable = typeof Proxy === 'function';\n","export const HOOK_SETUP = 'devtools-plugin:setup';\nexport const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';\n","let supported;\nlet perf;\nexport function isPerformanceSupported() {\n var _a;\n if (supported !== undefined) {\n return supported;\n }\n if (typeof window !== 'undefined' && window.performance) {\n supported = true;\n perf = window.performance;\n }\n else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {\n supported = true;\n perf = globalThis.perf_hooks.performance;\n }\n else {\n supported = false;\n }\n return supported;\n}\nexport function now() {\n return isPerformanceSupported() ? perf.now() : Date.now();\n}\n","import { HOOK_PLUGIN_SETTINGS_SET } from './const.js';\nimport { now } from './time.js';\nexport class ApiProxy {\n constructor(plugin, hook) {\n this.target = null;\n this.targetQueue = [];\n this.onQueue = [];\n this.plugin = plugin;\n this.hook = hook;\n const defaultSettings = {};\n if (plugin.settings) {\n for (const id in plugin.settings) {\n const item = plugin.settings[id];\n defaultSettings[id] = item.defaultValue;\n }\n }\n const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;\n let currentSettings = Object.assign({}, defaultSettings);\n try {\n const raw = localStorage.getItem(localSettingsSaveId);\n const data = JSON.parse(raw);\n Object.assign(currentSettings, data);\n }\n catch (e) {\n // noop\n }\n this.fallbacks = {\n getSettings() {\n return currentSettings;\n },\n setSettings(value) {\n try {\n localStorage.setItem(localSettingsSaveId, JSON.stringify(value));\n }\n catch (e) {\n // noop\n }\n currentSettings = value;\n },\n now() {\n return now();\n },\n };\n if (hook) {\n hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {\n if (pluginId === this.plugin.id) {\n this.fallbacks.setSettings(value);\n }\n });\n }\n this.proxiedOn = new Proxy({}, {\n get: (_target, prop) => {\n if (this.target) {\n return this.target.on[prop];\n }\n else {\n return (...args) => {\n this.onQueue.push({\n method: prop,\n args,\n });\n };\n }\n },\n });\n this.proxiedTarget = new Proxy({}, {\n get: (_target, prop) => {\n if (this.target) {\n return this.target[prop];\n }\n else if (prop === 'on') {\n return this.proxiedOn;\n }\n else if (Object.keys(this.fallbacks).includes(prop)) {\n return (...args) => {\n this.targetQueue.push({\n method: prop,\n args,\n resolve: () => { },\n });\n return this.fallbacks[prop](...args);\n };\n }\n else {\n return (...args) => {\n return new Promise((resolve) => {\n this.targetQueue.push({\n method: prop,\n args,\n resolve,\n });\n });\n };\n }\n },\n });\n }\n async setRealTarget(target) {\n this.target = target;\n for (const item of this.onQueue) {\n this.target.on[item.method](...item.args);\n }\n for (const item of this.targetQueue) {\n item.resolve(await this.target[item.method](...item.args));\n }\n }\n}\n","import { getDevtoolsGlobalHook, getTarget, isProxyAvailable } from './env.js';\nimport { HOOK_SETUP } from './const.js';\nimport { ApiProxy } from './proxy.js';\nexport * from './api/index.js';\nexport * from './plugin.js';\nexport * from './time.js';\nexport function setupDevtoolsPlugin(pluginDescriptor, setupFn) {\n const descriptor = pluginDescriptor;\n const target = getTarget();\n const hook = getDevtoolsGlobalHook();\n const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;\n if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {\n hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);\n }\n else {\n const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;\n const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];\n list.push({\n pluginDescriptor: descriptor,\n setupFn,\n proxy,\n });\n if (proxy) {\n setupFn(proxy.proxiedTarget);\n }\n }\n}\n","/*!\n * vuex v4.1.0\n * (c) 2022 Evan You\n * @license MIT\n */\nimport { inject, effectScope, reactive, watch, computed } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\nvar storeKey = 'store';\n\nfunction useStore (key) {\n if ( key === void 0 ) key = null;\n\n return inject(key !== null ? key : storeKey)\n}\n\n/**\n * Get the first item that pass the test\n * by second argument function\n *\n * @param {Array} list\n * @param {Function} f\n * @return {*}\n */\nfunction find (list, f) {\n return list.filter(f)[0]\n}\n\n/**\n * Deep copy the given object considering circular structure.\n * This function caches all nested objects and its copies.\n * If it detects circular structure, use cached copy to avoid infinite loop.\n *\n * @param {*} obj\n * @param {Array} cache\n * @return {*}\n */\nfunction deepCopy (obj, cache) {\n if ( cache === void 0 ) cache = [];\n\n // just return if obj is immutable value\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n // if obj is hit, it is in circular structure\n var hit = find(cache, function (c) { return c.original === obj; });\n if (hit) {\n return hit.copy\n }\n\n var copy = Array.isArray(obj) ? [] : {};\n // put the copy into cache at first\n // because we want to refer it in recursive deepCopy\n cache.push({\n original: obj,\n copy: copy\n });\n\n Object.keys(obj).forEach(function (key) {\n copy[key] = deepCopy(obj[key], cache);\n });\n\n return copy\n}\n\n/**\n * forEach for object\n */\nfunction forEachValue (obj, fn) {\n Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });\n}\n\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\nfunction isPromise (val) {\n return val && typeof val.then === 'function'\n}\n\nfunction assert (condition, msg) {\n if (!condition) { throw new Error((\"[vuex] \" + msg)) }\n}\n\nfunction partial (fn, arg) {\n return function () {\n return fn(arg)\n }\n}\n\nfunction genericSubscribe (fn, subs, options) {\n if (subs.indexOf(fn) < 0) {\n options && options.prepend\n ? subs.unshift(fn)\n : subs.push(fn);\n }\n return function () {\n var i = subs.indexOf(fn);\n if (i > -1) {\n subs.splice(i, 1);\n }\n }\n}\n\nfunction resetStore (store, hot) {\n store._actions = Object.create(null);\n store._mutations = Object.create(null);\n store._wrappedGetters = Object.create(null);\n store._modulesNamespaceMap = Object.create(null);\n var state = store.state;\n // init all modules\n installModule(store, state, [], store._modules.root, true);\n // reset state\n resetStoreState(store, state, hot);\n}\n\nfunction resetStoreState (store, state, hot) {\n var oldState = store._state;\n var oldScope = store._scope;\n\n // bind store public getters\n store.getters = {};\n // reset local getters cache\n store._makeLocalGettersCache = Object.create(null);\n var wrappedGetters = store._wrappedGetters;\n var computedObj = {};\n var computedCache = {};\n\n // create a new effect scope and create computed object inside it to avoid\n // getters (computed) getting destroyed on component unmount.\n var scope = effectScope(true);\n\n scope.run(function () {\n forEachValue(wrappedGetters, function (fn, key) {\n // use computed to leverage its lazy-caching mechanism\n // direct inline function use will lead to closure preserving oldState.\n // using partial to return function with only arguments preserved in closure environment.\n computedObj[key] = partial(fn, store);\n computedCache[key] = computed(function () { return computedObj[key](); });\n Object.defineProperty(store.getters, key, {\n get: function () { return computedCache[key].value; },\n enumerable: true // for local getters\n });\n });\n });\n\n store._state = reactive({\n data: state\n });\n\n // register the newly created effect scope to the store so that we can\n // dispose the effects when this method runs again in the future.\n store._scope = scope;\n\n // enable strict mode for new state\n if (store.strict) {\n enableStrictMode(store);\n }\n\n if (oldState) {\n if (hot) {\n // dispatch changes in all subscribed watchers\n // to force getter re-evaluation for hot reloading.\n store._withCommit(function () {\n oldState.data = null;\n });\n }\n }\n\n // dispose previously registered effect scope if there is one.\n if (oldScope) {\n oldScope.stop();\n }\n}\n\nfunction installModule (store, rootState, path, module, hot) {\n var isRoot = !path.length;\n var namespace = store._modules.getNamespace(path);\n\n // register in namespace map\n if (module.namespaced) {\n if (store._modulesNamespaceMap[namespace] && (process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] duplicate namespace \" + namespace + \" for the namespaced module \" + (path.join('/'))));\n }\n store._modulesNamespaceMap[namespace] = module;\n }\n\n // set state\n if (!isRoot && !hot) {\n var parentState = getNestedState(rootState, path.slice(0, -1));\n var moduleName = path[path.length - 1];\n store._withCommit(function () {\n if ((process.env.NODE_ENV !== 'production')) {\n if (moduleName in parentState) {\n console.warn(\n (\"[vuex] state field \\\"\" + moduleName + \"\\\" was overridden by a module with the same name at \\\"\" + (path.join('.')) + \"\\\"\")\n );\n }\n }\n parentState[moduleName] = module.state;\n });\n }\n\n var local = module.context = makeLocalContext(store, namespace, path);\n\n module.forEachMutation(function (mutation, key) {\n var namespacedType = namespace + key;\n registerMutation(store, namespacedType, mutation, local);\n });\n\n module.forEachAction(function (action, key) {\n var type = action.root ? key : namespace + key;\n var handler = action.handler || action;\n registerAction(store, type, handler, local);\n });\n\n module.forEachGetter(function (getter, key) {\n var namespacedType = namespace + key;\n registerGetter(store, namespacedType, getter, local);\n });\n\n module.forEachChild(function (child, key) {\n installModule(store, rootState, path.concat(key), child, hot);\n });\n}\n\n/**\n * make localized dispatch, commit, getters and state\n * if there is no namespace, just use root ones\n */\nfunction makeLocalContext (store, namespace, path) {\n var noNamespace = namespace === '';\n\n var local = {\n dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ((process.env.NODE_ENV !== 'production') && !store._actions[type]) {\n console.error((\"[vuex] unknown local action type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n return store.dispatch(type, payload)\n },\n\n commit: noNamespace ? store.commit : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if ((process.env.NODE_ENV !== 'production') && !store._mutations[type]) {\n console.error((\"[vuex] unknown local mutation type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n store.commit(type, payload, options);\n }\n };\n\n // getters and state object must be gotten lazily\n // because they will be changed by state update\n Object.defineProperties(local, {\n getters: {\n get: noNamespace\n ? function () { return store.getters; }\n : function () { return makeLocalGetters(store, namespace); }\n },\n state: {\n get: function () { return getNestedState(store.state, path); }\n }\n });\n\n return local\n}\n\nfunction makeLocalGetters (store, namespace) {\n if (!store._makeLocalGettersCache[namespace]) {\n var gettersProxy = {};\n var splitPos = namespace.length;\n Object.keys(store.getters).forEach(function (type) {\n // skip if the target getter is not match this namespace\n if (type.slice(0, splitPos) !== namespace) { return }\n\n // extract local getter type\n var localType = type.slice(splitPos);\n\n // Add a port to the getters proxy.\n // Define as getter property because\n // we do not want to evaluate the getters in this time.\n Object.defineProperty(gettersProxy, localType, {\n get: function () { return store.getters[type]; },\n enumerable: true\n });\n });\n store._makeLocalGettersCache[namespace] = gettersProxy;\n }\n\n return store._makeLocalGettersCache[namespace]\n}\n\nfunction registerMutation (store, type, handler, local) {\n var entry = store._mutations[type] || (store._mutations[type] = []);\n entry.push(function wrappedMutationHandler (payload) {\n handler.call(store, local.state, payload);\n });\n}\n\nfunction registerAction (store, type, handler, local) {\n var entry = store._actions[type] || (store._actions[type] = []);\n entry.push(function wrappedActionHandler (payload) {\n var res = handler.call(store, {\n dispatch: local.dispatch,\n commit: local.commit,\n getters: local.getters,\n state: local.state,\n rootGetters: store.getters,\n rootState: store.state\n }, payload);\n if (!isPromise(res)) {\n res = Promise.resolve(res);\n }\n if (store._devtoolHook) {\n return res.catch(function (err) {\n store._devtoolHook.emit('vuex:error', err);\n throw err\n })\n } else {\n return res\n }\n });\n}\n\nfunction registerGetter (store, type, rawGetter, local) {\n if (store._wrappedGetters[type]) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] duplicate getter key: \" + type));\n }\n return\n }\n store._wrappedGetters[type] = function wrappedGetter (store) {\n return rawGetter(\n local.state, // local state\n local.getters, // local getters\n store.state, // root state\n store.getters // root getters\n )\n };\n}\n\nfunction enableStrictMode (store) {\n watch(function () { return store._state.data; }, function () {\n if ((process.env.NODE_ENV !== 'production')) {\n assert(store._committing, \"do not mutate vuex store state outside mutation handlers.\");\n }\n }, { deep: true, flush: 'sync' });\n}\n\nfunction getNestedState (state, path) {\n return path.reduce(function (state, key) { return state[key]; }, state)\n}\n\nfunction unifyObjectStyle (type, payload, options) {\n if (isObject(type) && type.type) {\n options = payload;\n payload = type;\n type = type.type;\n }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof type === 'string', (\"expects string as the type, but found \" + (typeof type) + \".\"));\n }\n\n return { type: type, payload: payload, options: options }\n}\n\nvar LABEL_VUEX_BINDINGS = 'vuex bindings';\nvar MUTATIONS_LAYER_ID = 'vuex:mutations';\nvar ACTIONS_LAYER_ID = 'vuex:actions';\nvar INSPECTOR_ID = 'vuex';\n\nvar actionId = 0;\n\nfunction addDevtools (app, store) {\n setupDevtoolsPlugin(\n {\n id: 'org.vuejs.vuex',\n app: app,\n label: 'Vuex',\n homepage: 'https://next.vuex.vuejs.org/',\n logo: 'https://vuejs.org/images/icons/favicon-96x96.png',\n packageName: 'vuex',\n componentStateTypes: [LABEL_VUEX_BINDINGS]\n },\n function (api) {\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: 'Vuex Mutations',\n color: COLOR_LIME_500\n });\n\n api.addTimelineLayer({\n id: ACTIONS_LAYER_ID,\n label: 'Vuex Actions',\n color: COLOR_LIME_500\n });\n\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Vuex',\n icon: 'storage',\n treeFilterPlaceholder: 'Filter stores...'\n });\n\n api.on.getInspectorTree(function (payload) {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n if (payload.filter) {\n var nodes = [];\n flattenStoreForInspectorTree(nodes, store._modules.root, payload.filter, '');\n payload.rootNodes = nodes;\n } else {\n payload.rootNodes = [\n formatStoreForInspectorTree(store._modules.root, '')\n ];\n }\n }\n });\n\n api.on.getInspectorState(function (payload) {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n var modulePath = payload.nodeId;\n makeLocalGetters(store, modulePath);\n payload.state = formatStoreForInspectorState(\n getStoreModule(store._modules, modulePath),\n modulePath === 'root' ? store.getters : store._makeLocalGettersCache,\n modulePath\n );\n }\n });\n\n api.on.editInspectorState(function (payload) {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n var modulePath = payload.nodeId;\n var path = payload.path;\n if (modulePath !== 'root') {\n path = modulePath.split('/').filter(Boolean).concat( path);\n }\n store._withCommit(function () {\n payload.set(store._state.data, path, payload.state.value);\n });\n }\n });\n\n store.subscribe(function (mutation, state) {\n var data = {};\n\n if (mutation.payload) {\n data.payload = mutation.payload;\n }\n\n data.state = state;\n\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: Date.now(),\n title: mutation.type,\n data: data\n }\n });\n });\n\n store.subscribeAction({\n before: function (action, state) {\n var data = {};\n if (action.payload) {\n data.payload = action.payload;\n }\n action._id = actionId++;\n action._time = Date.now();\n data.state = state;\n\n api.addTimelineEvent({\n layerId: ACTIONS_LAYER_ID,\n event: {\n time: action._time,\n title: action.type,\n groupId: action._id,\n subtitle: 'start',\n data: data\n }\n });\n },\n after: function (action, state) {\n var data = {};\n var duration = Date.now() - action._time;\n data.duration = {\n _custom: {\n type: 'duration',\n display: (duration + \"ms\"),\n tooltip: 'Action duration',\n value: duration\n }\n };\n if (action.payload) {\n data.payload = action.payload;\n }\n data.state = state;\n\n api.addTimelineEvent({\n layerId: ACTIONS_LAYER_ID,\n event: {\n time: Date.now(),\n title: action.type,\n groupId: action._id,\n subtitle: 'end',\n data: data\n }\n });\n }\n });\n }\n );\n}\n\n// extracted from tailwind palette\nvar COLOR_LIME_500 = 0x84cc16;\nvar COLOR_DARK = 0x666666;\nvar COLOR_WHITE = 0xffffff;\n\nvar TAG_NAMESPACED = {\n label: 'namespaced',\n textColor: COLOR_WHITE,\n backgroundColor: COLOR_DARK\n};\n\n/**\n * @param {string} path\n */\nfunction extractNameFromPath (path) {\n return path && path !== 'root' ? path.split('/').slice(-2, -1)[0] : 'Root'\n}\n\n/**\n * @param {*} module\n * @return {import('@vue/devtools-api').CustomInspectorNode}\n */\nfunction formatStoreForInspectorTree (module, path) {\n return {\n id: path || 'root',\n // all modules end with a `/`, we want the last segment only\n // cart/ -> cart\n // nested/cart/ -> cart\n label: extractNameFromPath(path),\n tags: module.namespaced ? [TAG_NAMESPACED] : [],\n children: Object.keys(module._children).map(function (moduleName) { return formatStoreForInspectorTree(\n module._children[moduleName],\n path + moduleName + '/'\n ); }\n )\n }\n}\n\n/**\n * @param {import('@vue/devtools-api').CustomInspectorNode[]} result\n * @param {*} module\n * @param {string} filter\n * @param {string} path\n */\nfunction flattenStoreForInspectorTree (result, module, filter, path) {\n if (path.includes(filter)) {\n result.push({\n id: path || 'root',\n label: path.endsWith('/') ? path.slice(0, path.length - 1) : path || 'Root',\n tags: module.namespaced ? [TAG_NAMESPACED] : []\n });\n }\n Object.keys(module._children).forEach(function (moduleName) {\n flattenStoreForInspectorTree(result, module._children[moduleName], filter, path + moduleName + '/');\n });\n}\n\n/**\n * @param {*} module\n * @return {import('@vue/devtools-api').CustomInspectorState}\n */\nfunction formatStoreForInspectorState (module, getters, path) {\n getters = path === 'root' ? getters : getters[path];\n var gettersKeys = Object.keys(getters);\n var storeState = {\n state: Object.keys(module.state).map(function (key) { return ({\n key: key,\n editable: true,\n value: module.state[key]\n }); })\n };\n\n if (gettersKeys.length) {\n var tree = transformPathsToObjectTree(getters);\n storeState.getters = Object.keys(tree).map(function (key) { return ({\n key: key.endsWith('/') ? extractNameFromPath(key) : key,\n editable: false,\n value: canThrow(function () { return tree[key]; })\n }); });\n }\n\n return storeState\n}\n\nfunction transformPathsToObjectTree (getters) {\n var result = {};\n Object.keys(getters).forEach(function (key) {\n var path = key.split('/');\n if (path.length > 1) {\n var target = result;\n var leafKey = path.pop();\n path.forEach(function (p) {\n if (!target[p]) {\n target[p] = {\n _custom: {\n value: {},\n display: p,\n tooltip: 'Module',\n abstract: true\n }\n };\n }\n target = target[p]._custom.value;\n });\n target[leafKey] = canThrow(function () { return getters[key]; });\n } else {\n result[key] = canThrow(function () { return getters[key]; });\n }\n });\n return result\n}\n\nfunction getStoreModule (moduleMap, path) {\n var names = path.split('/').filter(function (n) { return n; });\n return names.reduce(\n function (module, moduleName, i) {\n var child = module[moduleName];\n if (!child) {\n throw new Error((\"Missing module \\\"\" + moduleName + \"\\\" for path \\\"\" + path + \"\\\".\"))\n }\n return i === names.length - 1 ? child : child._children\n },\n path === 'root' ? moduleMap : moduleMap.root._children\n )\n}\n\nfunction canThrow (cb) {\n try {\n return cb()\n } catch (e) {\n return e\n }\n}\n\n// Base data struct for store's module, package with some attribute and method\nvar Module = function Module (rawModule, runtime) {\n this.runtime = runtime;\n // Store some children item\n this._children = Object.create(null);\n // Store the origin module object which passed by programmer\n this._rawModule = rawModule;\n var rawState = rawModule.state;\n\n // Store the origin module's state\n this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};\n};\n\nvar prototypeAccessors$1 = { namespaced: { configurable: true } };\n\nprototypeAccessors$1.namespaced.get = function () {\n return !!this._rawModule.namespaced\n};\n\nModule.prototype.addChild = function addChild (key, module) {\n this._children[key] = module;\n};\n\nModule.prototype.removeChild = function removeChild (key) {\n delete this._children[key];\n};\n\nModule.prototype.getChild = function getChild (key) {\n return this._children[key]\n};\n\nModule.prototype.hasChild = function hasChild (key) {\n return key in this._children\n};\n\nModule.prototype.update = function update (rawModule) {\n this._rawModule.namespaced = rawModule.namespaced;\n if (rawModule.actions) {\n this._rawModule.actions = rawModule.actions;\n }\n if (rawModule.mutations) {\n this._rawModule.mutations = rawModule.mutations;\n }\n if (rawModule.getters) {\n this._rawModule.getters = rawModule.getters;\n }\n};\n\nModule.prototype.forEachChild = function forEachChild (fn) {\n forEachValue(this._children, fn);\n};\n\nModule.prototype.forEachGetter = function forEachGetter (fn) {\n if (this._rawModule.getters) {\n forEachValue(this._rawModule.getters, fn);\n }\n};\n\nModule.prototype.forEachAction = function forEachAction (fn) {\n if (this._rawModule.actions) {\n forEachValue(this._rawModule.actions, fn);\n }\n};\n\nModule.prototype.forEachMutation = function forEachMutation (fn) {\n if (this._rawModule.mutations) {\n forEachValue(this._rawModule.mutations, fn);\n }\n};\n\nObject.defineProperties( Module.prototype, prototypeAccessors$1 );\n\nvar ModuleCollection = function ModuleCollection (rawRootModule) {\n // register root module (Vuex.Store options)\n this.register([], rawRootModule, false);\n};\n\nModuleCollection.prototype.get = function get (path) {\n return path.reduce(function (module, key) {\n return module.getChild(key)\n }, this.root)\n};\n\nModuleCollection.prototype.getNamespace = function getNamespace (path) {\n var module = this.root;\n return path.reduce(function (namespace, key) {\n module = module.getChild(key);\n return namespace + (module.namespaced ? key + '/' : '')\n }, '')\n};\n\nModuleCollection.prototype.update = function update$1 (rawRootModule) {\n update([], this.root, rawRootModule);\n};\n\nModuleCollection.prototype.register = function register (path, rawModule, runtime) {\n var this$1$1 = this;\n if ( runtime === void 0 ) runtime = true;\n\n if ((process.env.NODE_ENV !== 'production')) {\n assertRawModule(path, rawModule);\n }\n\n var newModule = new Module(rawModule, runtime);\n if (path.length === 0) {\n this.root = newModule;\n } else {\n var parent = this.get(path.slice(0, -1));\n parent.addChild(path[path.length - 1], newModule);\n }\n\n // register nested modules\n if (rawModule.modules) {\n forEachValue(rawModule.modules, function (rawChildModule, key) {\n this$1$1.register(path.concat(key), rawChildModule, runtime);\n });\n }\n};\n\nModuleCollection.prototype.unregister = function unregister (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n var child = parent.getChild(key);\n\n if (!child) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\n \"[vuex] trying to unregister module '\" + key + \"', which is \" +\n \"not registered\"\n );\n }\n return\n }\n\n if (!child.runtime) {\n return\n }\n\n parent.removeChild(key);\n};\n\nModuleCollection.prototype.isRegistered = function isRegistered (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n\n if (parent) {\n return parent.hasChild(key)\n }\n\n return false\n};\n\nfunction update (path, targetModule, newModule) {\n if ((process.env.NODE_ENV !== 'production')) {\n assertRawModule(path, newModule);\n }\n\n // update target module\n targetModule.update(newModule);\n\n // update nested modules\n if (newModule.modules) {\n for (var key in newModule.modules) {\n if (!targetModule.getChild(key)) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\n \"[vuex] trying to add a new module '\" + key + \"' on hot reloading, \" +\n 'manual reload is needed'\n );\n }\n return\n }\n update(\n path.concat(key),\n targetModule.getChild(key),\n newModule.modules[key]\n );\n }\n }\n}\n\nvar functionAssert = {\n assert: function (value) { return typeof value === 'function'; },\n expected: 'function'\n};\n\nvar objectAssert = {\n assert: function (value) { return typeof value === 'function' ||\n (typeof value === 'object' && typeof value.handler === 'function'); },\n expected: 'function or object with \"handler\" function'\n};\n\nvar assertTypes = {\n getters: functionAssert,\n mutations: functionAssert,\n actions: objectAssert\n};\n\nfunction assertRawModule (path, rawModule) {\n Object.keys(assertTypes).forEach(function (key) {\n if (!rawModule[key]) { return }\n\n var assertOptions = assertTypes[key];\n\n forEachValue(rawModule[key], function (value, type) {\n assert(\n assertOptions.assert(value),\n makeAssertionMessage(path, key, type, value, assertOptions.expected)\n );\n });\n });\n}\n\nfunction makeAssertionMessage (path, key, type, value, expected) {\n var buf = key + \" should be \" + expected + \" but \\\"\" + key + \".\" + type + \"\\\"\";\n if (path.length > 0) {\n buf += \" in module \\\"\" + (path.join('.')) + \"\\\"\";\n }\n buf += \" is \" + (JSON.stringify(value)) + \".\";\n return buf\n}\n\nfunction createStore (options) {\n return new Store(options)\n}\n\nvar Store = function Store (options) {\n var this$1$1 = this;\n if ( options === void 0 ) options = {};\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof Promise !== 'undefined', \"vuex requires a Promise polyfill in this browser.\");\n assert(this instanceof Store, \"store must be called with the new operator.\");\n }\n\n var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];\n var strict = options.strict; if ( strict === void 0 ) strict = false;\n var devtools = options.devtools;\n\n // store internal state\n this._committing = false;\n this._actions = Object.create(null);\n this._actionSubscribers = [];\n this._mutations = Object.create(null);\n this._wrappedGetters = Object.create(null);\n this._modules = new ModuleCollection(options);\n this._modulesNamespaceMap = Object.create(null);\n this._subscribers = [];\n this._makeLocalGettersCache = Object.create(null);\n\n // EffectScope instance. when registering new getters, we wrap them inside\n // EffectScope so that getters (computed) would not be destroyed on\n // component unmount.\n this._scope = null;\n\n this._devtools = devtools;\n\n // bind commit and dispatch to self\n var store = this;\n var ref = this;\n var dispatch = ref.dispatch;\n var commit = ref.commit;\n this.dispatch = function boundDispatch (type, payload) {\n return dispatch.call(store, type, payload)\n };\n this.commit = function boundCommit (type, payload, options) {\n return commit.call(store, type, payload, options)\n };\n\n // strict mode\n this.strict = strict;\n\n var state = this._modules.root.state;\n\n // init root module.\n // this also recursively registers all sub-modules\n // and collects all module getters inside this._wrappedGetters\n installModule(this, state, [], this._modules.root);\n\n // initialize the store state, which is responsible for the reactivity\n // (also registers _wrappedGetters as computed properties)\n resetStoreState(this, state);\n\n // apply plugins\n plugins.forEach(function (plugin) { return plugin(this$1$1); });\n};\n\nvar prototypeAccessors = { state: { configurable: true } };\n\nStore.prototype.install = function install (app, injectKey) {\n app.provide(injectKey || storeKey, this);\n app.config.globalProperties.$store = this;\n\n var useDevtools = this._devtools !== undefined\n ? this._devtools\n : (process.env.NODE_ENV !== 'production') || __VUE_PROD_DEVTOOLS__;\n\n if (useDevtools) {\n addDevtools(app, this);\n }\n};\n\nprototypeAccessors.state.get = function () {\n return this._state.data\n};\n\nprototypeAccessors.state.set = function (v) {\n if ((process.env.NODE_ENV !== 'production')) {\n assert(false, \"use store.replaceState() to explicit replace store state.\");\n }\n};\n\nStore.prototype.commit = function commit (_type, _payload, _options) {\n var this$1$1 = this;\n\n // check object-style commit\n var ref = unifyObjectStyle(_type, _payload, _options);\n var type = ref.type;\n var payload = ref.payload;\n var options = ref.options;\n\n var mutation = { type: type, payload: payload };\n var entry = this._mutations[type];\n if (!entry) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] unknown mutation type: \" + type));\n }\n return\n }\n this._withCommit(function () {\n entry.forEach(function commitIterator (handler) {\n handler(payload);\n });\n });\n\n this._subscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .forEach(function (sub) { return sub(mutation, this$1$1.state); });\n\n if (\n (process.env.NODE_ENV !== 'production') &&\n options && options.silent\n ) {\n console.warn(\n \"[vuex] mutation type: \" + type + \". Silent option has been removed. \" +\n 'Use the filter functionality in the vue-devtools'\n );\n }\n};\n\nStore.prototype.dispatch = function dispatch (_type, _payload) {\n var this$1$1 = this;\n\n // check object-style dispatch\n var ref = unifyObjectStyle(_type, _payload);\n var type = ref.type;\n var payload = ref.payload;\n\n var action = { type: type, payload: payload };\n var entry = this._actions[type];\n if (!entry) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.error((\"[vuex] unknown action type: \" + type));\n }\n return\n }\n\n try {\n this._actionSubscribers\n .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe\n .filter(function (sub) { return sub.before; })\n .forEach(function (sub) { return sub.before(action, this$1$1.state); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in before action subscribers: \");\n console.error(e);\n }\n }\n\n var result = entry.length > 1\n ? Promise.all(entry.map(function (handler) { return handler(payload); }))\n : entry[0](payload);\n\n return new Promise(function (resolve, reject) {\n result.then(function (res) {\n try {\n this$1$1._actionSubscribers\n .filter(function (sub) { return sub.after; })\n .forEach(function (sub) { return sub.after(action, this$1$1.state); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in after action subscribers: \");\n console.error(e);\n }\n }\n resolve(res);\n }, function (error) {\n try {\n this$1$1._actionSubscribers\n .filter(function (sub) { return sub.error; })\n .forEach(function (sub) { return sub.error(action, this$1$1.state, error); });\n } catch (e) {\n if ((process.env.NODE_ENV !== 'production')) {\n console.warn(\"[vuex] error in error action subscribers: \");\n console.error(e);\n }\n }\n reject(error);\n });\n })\n};\n\nStore.prototype.subscribe = function subscribe (fn, options) {\n return genericSubscribe(fn, this._subscribers, options)\n};\n\nStore.prototype.subscribeAction = function subscribeAction (fn, options) {\n var subs = typeof fn === 'function' ? { before: fn } : fn;\n return genericSubscribe(subs, this._actionSubscribers, options)\n};\n\nStore.prototype.watch = function watch$1 (getter, cb, options) {\n var this$1$1 = this;\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(typeof getter === 'function', \"store.watch only accepts a function.\");\n }\n return watch(function () { return getter(this$1$1.state, this$1$1.getters); }, cb, Object.assign({}, options))\n};\n\nStore.prototype.replaceState = function replaceState (state) {\n var this$1$1 = this;\n\n this._withCommit(function () {\n this$1$1._state.data = state;\n });\n};\n\nStore.prototype.registerModule = function registerModule (path, rawModule, options) {\n if ( options === void 0 ) options = {};\n\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n assert(path.length > 0, 'cannot register the root module by using registerModule.');\n }\n\n this._modules.register(path, rawModule);\n installModule(this, this.state, path, this._modules.get(path), options.preserveState);\n // reset store to update getters...\n resetStoreState(this, this.state);\n};\n\nStore.prototype.unregisterModule = function unregisterModule (path) {\n var this$1$1 = this;\n\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n this._modules.unregister(path);\n this._withCommit(function () {\n var parentState = getNestedState(this$1$1.state, path.slice(0, -1));\n delete parentState[path[path.length - 1]];\n });\n resetStore(this);\n};\n\nStore.prototype.hasModule = function hasModule (path) {\n if (typeof path === 'string') { path = [path]; }\n\n if ((process.env.NODE_ENV !== 'production')) {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n return this._modules.isRegistered(path)\n};\n\nStore.prototype.hotUpdate = function hotUpdate (newOptions) {\n this._modules.update(newOptions);\n resetStore(this, true);\n};\n\nStore.prototype._withCommit = function _withCommit (fn) {\n var committing = this._committing;\n this._committing = true;\n fn();\n this._committing = committing;\n};\n\nObject.defineProperties( Store.prototype, prototypeAccessors );\n\n/**\n * Reduce the code which written in Vue.js for getting the state.\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.\n * @param {Object}\n */\nvar mapState = normalizeNamespace(function (namespace, states) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(states)) {\n console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(states).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedState () {\n var state = this.$store.state;\n var getters = this.$store.getters;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapState', namespace);\n if (!module) {\n return\n }\n state = module.context.state;\n getters = module.context.getters;\n }\n return typeof val === 'function'\n ? val.call(this, state, getters)\n : state[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for committing the mutation\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapMutations = normalizeNamespace(function (namespace, mutations) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(mutations)) {\n console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(mutations).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedMutation () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // Get the commit method from store\n var commit = this.$store.commit;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);\n if (!module) {\n return\n }\n commit = module.context.commit;\n }\n return typeof val === 'function'\n ? val.apply(this, [commit].concat(args))\n : commit.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for getting the getters\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} getters\n * @return {Object}\n */\nvar mapGetters = normalizeNamespace(function (namespace, getters) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(getters)) {\n console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(getters).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n // The namespace has been mutated by normalizeNamespace\n val = namespace + val;\n res[key] = function mappedGetter () {\n if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {\n return\n }\n if ((process.env.NODE_ENV !== 'production') && !(val in this.$store.getters)) {\n console.error((\"[vuex] unknown getter: \" + val));\n return\n }\n return this.$store.getters[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n});\n\n/**\n * Reduce the code which written in Vue.js for dispatch the action\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\nvar mapActions = normalizeNamespace(function (namespace, actions) {\n var res = {};\n if ((process.env.NODE_ENV !== 'production') && !isValidMap(actions)) {\n console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');\n }\n normalizeMap(actions).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedAction () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // get dispatch function from store\n var dispatch = this.$store.dispatch;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapActions', namespace);\n if (!module) {\n return\n }\n dispatch = module.context.dispatch;\n }\n return typeof val === 'function'\n ? val.apply(this, [dispatch].concat(args))\n : dispatch.apply(this.$store, [val].concat(args))\n };\n });\n return res\n});\n\n/**\n * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object\n * @param {String} namespace\n * @return {Object}\n */\nvar createNamespacedHelpers = function (namespace) { return ({\n mapState: mapState.bind(null, namespace),\n mapGetters: mapGetters.bind(null, namespace),\n mapMutations: mapMutations.bind(null, namespace),\n mapActions: mapActions.bind(null, namespace)\n}); };\n\n/**\n * Normalize the map\n * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]\n * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]\n * @param {Array|Object} map\n * @return {Object}\n */\nfunction normalizeMap (map) {\n if (!isValidMap(map)) {\n return []\n }\n return Array.isArray(map)\n ? map.map(function (key) { return ({ key: key, val: key }); })\n : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })\n}\n\n/**\n * Validate whether given map is valid or not\n * @param {*} map\n * @return {Boolean}\n */\nfunction isValidMap (map) {\n return Array.isArray(map) || isObject(map)\n}\n\n/**\n * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.\n * @param {Function} fn\n * @return {Function}\n */\nfunction normalizeNamespace (fn) {\n return function (namespace, map) {\n if (typeof namespace !== 'string') {\n map = namespace;\n namespace = '';\n } else if (namespace.charAt(namespace.length - 1) !== '/') {\n namespace += '/';\n }\n return fn(namespace, map)\n }\n}\n\n/**\n * Search a special module from store by namespace. if module not exist, print error message.\n * @param {Object} store\n * @param {String} helper\n * @param {String} namespace\n * @return {Object}\n */\nfunction getModuleByNamespace (store, helper, namespace) {\n var module = store._modulesNamespaceMap[namespace];\n if ((process.env.NODE_ENV !== 'production') && !module) {\n console.error((\"[vuex] module namespace not found in \" + helper + \"(): \" + namespace));\n }\n return module\n}\n\n// Credits: borrowed code from fcomb/redux-logger\n\nfunction createLogger (ref) {\n if ( ref === void 0 ) ref = {};\n var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;\n var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };\n var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };\n var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };\n var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };\n var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };\n var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;\n var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;\n var logger = ref.logger; if ( logger === void 0 ) logger = console;\n\n return function (store) {\n var prevState = deepCopy(store.state);\n\n if (typeof logger === 'undefined') {\n return\n }\n\n if (logMutations) {\n store.subscribe(function (mutation, state) {\n var nextState = deepCopy(state);\n\n if (filter(mutation, prevState, nextState)) {\n var formattedTime = getFormattedTime();\n var formattedMutation = mutationTransformer(mutation);\n var message = \"mutation \" + (mutation.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));\n logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);\n logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));\n endMessage(logger);\n }\n\n prevState = nextState;\n });\n }\n\n if (logActions) {\n store.subscribeAction(function (action, state) {\n if (actionFilter(action, state)) {\n var formattedTime = getFormattedTime();\n var formattedAction = actionTransformer(action);\n var message = \"action \" + (action.type) + formattedTime;\n\n startMessage(logger, message, collapsed);\n logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);\n endMessage(logger);\n }\n });\n }\n }\n}\n\nfunction startMessage (logger, message, collapsed) {\n var startMessage = collapsed\n ? logger.groupCollapsed\n : logger.group;\n\n // render\n try {\n startMessage.call(logger, message);\n } catch (e) {\n logger.log(message);\n }\n}\n\nfunction endMessage (logger) {\n try {\n logger.groupEnd();\n } catch (e) {\n logger.log('—— log end ——');\n }\n}\n\nfunction getFormattedTime () {\n var time = new Date();\n return (\" @ \" + (pad(time.getHours(), 2)) + \":\" + (pad(time.getMinutes(), 2)) + \":\" + (pad(time.getSeconds(), 2)) + \".\" + (pad(time.getMilliseconds(), 3)))\n}\n\nfunction repeat (str, times) {\n return (new Array(times + 1)).join(str)\n}\n\nfunction pad (num, maxLength) {\n return repeat('0', maxLength - num.toString().length) + num\n}\n\nvar index = {\n version: '4.1.0',\n Store: Store,\n storeKey: storeKey,\n createStore: createStore,\n useStore: useStore,\n mapState: mapState,\n mapMutations: mapMutations,\n mapGetters: mapGetters,\n mapActions: mapActions,\n createNamespacedHelpers: createNamespacedHelpers,\n createLogger: createLogger\n};\n\nexport default index;\nexport { Store, createLogger, createNamespacedHelpers, createStore, mapActions, mapGetters, mapMutations, mapState, storeKey, useStore };\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { showError } from '@nextcloud/dialogs'\nimport { t } from '@nextcloud/l10n'\nimport { mapState } from 'vuex'\nimport { logger } from '../logger.ts'\n\nexport default {\n\tcomputed: {\n\t\t...mapState({\n\t\t\tstatusType: (state) => state.userStatus.status,\n\t\t\tstatusIsUserDefined: (state) => state.userStatus.statusIsUserDefined,\n\t\t\tcustomIcon: (state) => state.userStatus.icon,\n\t\t\tcustomMessage: (state) => state.userStatus.message,\n\t\t}),\n\n\t\t/**\n\t\t * The message displayed in the top right corner\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tvisibleMessage() {\n\t\t\tif (this.customIcon && this.customMessage) {\n\t\t\t\treturn `${this.customIcon} ${this.customMessage}`\n\t\t\t}\n\n\t\t\tif (this.customMessage) {\n\t\t\t\treturn this.customMessage\n\t\t\t}\n\n\t\t\tif (this.statusIsUserDefined) {\n\t\t\t\tswitch (this.statusType) {\n\t\t\t\t\tcase 'online':\n\t\t\t\t\t\treturn t('user_status', 'Online')\n\n\t\t\t\t\tcase 'away':\n\t\t\t\t\t\treturn t('user_status', 'Away')\n\n\t\t\t\t\tcase 'busy':\n\t\t\t\t\t\treturn t('user_status', 'Busy')\n\n\t\t\t\t\tcase 'dnd':\n\t\t\t\t\t\treturn t('user_status', 'Do not disturb')\n\n\t\t\t\t\tcase 'invisible':\n\t\t\t\t\t\treturn t('user_status', 'Invisible')\n\n\t\t\t\t\tcase 'offline':\n\t\t\t\t\t\treturn t('user_status', 'Offline')\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn t('user_status', 'Set status')\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Changes the user-status\n\t\t *\n\t\t * @param {string} statusType (online / away / dnd / invisible)\n\t\t */\n\t\tasync changeStatus(statusType) {\n\t\t\ttry {\n\t\t\t\tawait this.$store.dispatch('setStatus', { statusType })\n\t\t\t} catch (err) {\n\t\t\t\tshowError(t('user_status', 'There was an error saving the new status'))\n\t\t\t\tlogger.debug(err)\n\t\t\t}\n\t\t},\n\t},\n}\n","/**\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getBuilder } from '@nextcloud/browser-storage'\nimport debounce from 'debounce'\n\nconst browserStorage = getBuilder('user_status').clearOnLogout().persist().build()\n\n/** Has to stay below the server margin between `StatusService::REFRESH_STATUS_THRESHOLD` and `StatusService::INVALIDATE_STATUS_THRESHOLD`. */\nexport const HEARTBEAT_INTERVAL = 5 * 60 * 1000\n\nexport const AWAY_TIMEOUT = 2 * 60 * 1000\n\nexport const MOUSE_MOVE_DEBOUNCE = 2 * 1000\n\n/** Below `HEARTBEAT_INTERVAL`, so a lone tab is never suppressed and its gap to the server never grows. */\nexport const HEARTBEAT_THROTTLE = 4 * 60 * 1000\n\n/**\n * Send heartbeats on a fixed interval, and once more whenever the user comes back from being away.\n *\n * @param beat - Called with the current away state when a heartbeat is due\n * @return Function that stops the heartbeat and removes every timer and listener\n */\nexport function startHeartbeat(beat: (isAway: boolean) => void): () => void {\n\tlet isAway = false\n\tlet awayTimeout: ReturnType | undefined\n\tlet onVisible: (() => void) | undefined\n\n\tconst announce = (force = false) => {\n\t\t// NaN (missing or unparseable) and a negative age (future timestamp)\n\t\t// both fail this test, so both send\n\t\tconst age = Date.now() - Number.parseInt(browserStorage.getItem('lastHeartbeat') ?? '', 10)\n\t\tif (!force && age >= 0 && age < HEARTBEAT_THROTTLE) {\n\t\t\treturn\n\t\t}\n\t\tbrowserStorage.setItem('lastHeartbeat', String(Date.now()))\n\t\tbeat(isAway)\n\t}\n\n\tconst onMouseMove = debounce(() => {\n\t\tconst wasAway = isAway\n\t\tisAway = false\n\n\t\tclearTimeout(awayTimeout)\n\t\tawayTimeout = setTimeout(() => {\n\t\t\tisAway = true\n\t\t}, AWAY_TIMEOUT)\n\n\t\tif (wasAway) {\n\t\t\t// Coming back is real signal, so it is never throttled\n\t\t\tannounce(true)\n\t\t}\n\t}, MOUSE_MOVE_DEBOUNCE, { immediate: true })\n\n\tconst interval = setInterval(() => announce(), HEARTBEAT_INTERVAL)\n\twindow.addEventListener('mousemove', onMouseMove, {\n\t\tcapture: true,\n\t\tpassive: true,\n\t})\n\n\tif (document.visibilityState === 'hidden') {\n\t\t// A tab opened in the background has nothing to report until it is looked at\n\t\tonVisible = () => {\n\t\t\tif (document.visibilityState === 'hidden') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tdocument.removeEventListener('visibilitychange', onVisible!)\n\t\t\tannounce()\n\t\t}\n\t\tdocument.addEventListener('visibilitychange', onVisible)\n\t} else {\n\t\tannounce()\n\t}\n\n\treturn () => {\n\t\tclearInterval(interval)\n\t\tclearTimeout(awayTimeout)\n\t\tonMouseMove.clear()\n\t\twindow.removeEventListener('mousemove', onMouseMove, { capture: true })\n\t\tif (onVisible) {\n\t\t\tdocument.removeEventListener('visibilitychange', onVisible)\n\t\t}\n\t}\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport HttpClient from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Sends a heartbeat\n *\n * @param {boolean} isAway Whether or not the user is active\n * @return {Promise}\n */\nasync function sendHeartbeat(isAway) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/heartbeat?format=json')\n\tconst response = await HttpClient.put(url, {\n\t\tstatus: isAway ? 'away' : 'online',\n\t})\n\treturn response.data.ocs.data\n}\n\nexport {\n\tsendHeartbeat,\n}\n","\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport HttpClient from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Fetches all predefined statuses from the server\n *\n * @return {Promise}\n */\nasync function fetchAllPredefinedStatuses() {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/predefined_statuses?format=json')\n\tconst response = await HttpClient.get(url)\n\n\treturn response.data.ocs.data\n}\n\nexport {\n\tfetchAllPredefinedStatuses,\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { fetchAllPredefinedStatuses } from '../services/predefinedStatusService.js'\n\n// eslint-disable-next-line antfu/top-level-function\nconst state = () => ({\n\tpredefinedStatuses: [],\n})\n\nconst mutations = {\n\n\t/**\n\t * Adds a predefined status to the state\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} status The status to add\n\t */\n\taddPredefinedStatus(state, status) {\n\t\tstate.predefinedStatuses = [...state.predefinedStatuses, status]\n\t},\n}\n\nconst getters = {\n\tstatusesHaveLoaded(state) {\n\t\treturn state.predefinedStatuses.length > 0\n\t},\n}\n\nconst actions = {\n\n\t/**\n\t * Loads all predefined statuses from the server\n\t *\n\t * @param {object} vuex The Vuex components\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state -\n\t */\n\tasync loadAllPredefinedStatuses({ state, commit }) {\n\t\tif (state.predefinedStatuses.length > 0) {\n\t\t\treturn\n\t\t}\n\n\t\tconst statuses = await fetchAllPredefinedStatuses()\n\t\tfor (const status of statuses) {\n\t\t\tcommit('addPredefinedStatus', status)\n\t\t}\n\t},\n\n}\n\nexport default { state, mutations, getters, actions }\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport HttpClient from '@nextcloud/axios'\nimport { generateOcsUrl } from '@nextcloud/router'\n\n/**\n * Fetches the current user-status\n *\n * @return {Promise}\n */\nasync function fetchCurrentStatus() {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status')\n\tconst response = await HttpClient.get(url)\n\n\treturn response.data.ocs.data\n}\n\n/**\n * Fetches the current user-status\n *\n * @param {string} userId Id of the user to fetch the status\n * @return {Promise}\n */\nasync function fetchBackupStatus(userId) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/statuses/{userId}', { userId: '_' + userId })\n\tconst response = await HttpClient.get(url)\n\n\treturn response.data.ocs.data\n}\n\n/**\n * Sets the status\n *\n * @param {string} statusType The status (online / away / dnd / invisible)\n * @return {Promise}\n */\nasync function setStatus(statusType) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/status')\n\tawait HttpClient.put(url, {\n\t\tstatusType,\n\t})\n}\n\n/**\n * Sets a message based on our predefined statuses\n *\n * @param {string} messageId The id of the message, taken from predefined status service\n * @param {number | null} clearAt When to automatically clean the status\n * @return {Promise}\n */\nasync function setPredefinedMessage(messageId, clearAt = null) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/message/predefined?format=json')\n\tawait HttpClient.put(url, {\n\t\tmessageId,\n\t\tclearAt,\n\t})\n}\n\n/**\n * Sets a custom message\n *\n * @param {string} message The user-defined message\n * @param {string | null} statusIcon The user-defined icon\n * @param {number | null} clearAt When to automatically clean the status\n * @return {Promise}\n */\nasync function setCustomMessage(message, statusIcon = null, clearAt = null) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/message/custom?format=json')\n\tawait HttpClient.put(url, {\n\t\tmessage,\n\t\tstatusIcon,\n\t\tclearAt,\n\t})\n}\n\n/**\n * Clears the current status of the user\n *\n * @return {Promise}\n */\nasync function clearMessage() {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/message?format=json')\n\tawait HttpClient.delete(url)\n}\n\n/**\n * Revert the automated status\n *\n * @param {string} messageId ID of the message to revert\n * @return {Promise}\n */\nasync function revertToBackupStatus(messageId) {\n\tconst url = generateOcsUrl('apps/user_status/api/v1/user_status/revert/{messageId}', { messageId })\n\tconst response = await HttpClient.delete(url)\n\n\treturn response.data.ocs.data\n}\n\nexport {\n\tclearMessage,\n\tfetchBackupStatus,\n\tfetchCurrentStatus,\n\trevertToBackupStatus,\n\tsetCustomMessage,\n\tsetPredefinedMessage,\n\tsetStatus,\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { emit } from '@nextcloud/event-bus'\nimport {\n\tfetchBackupStatus,\n\trevertToBackupStatus,\n} from '../services/statusService.js'\n\n// eslint-disable-next-line antfu/top-level-function\nconst state = () => ({\n\t// Status (online / away / dnd / invisible / offline)\n\tstatus: null,\n\t// Whether the status is user-defined\n\tstatusIsUserDefined: null,\n\t// A custom message set by the user\n\tmessage: null,\n\t// The icon selected by the user\n\ticon: null,\n\t// When to automatically clean the status\n\tclearAt: null,\n\t// Whether the message is predefined\n\t// (and can automatically be translated by Nextcloud)\n\tmessageIsPredefined: null,\n\t// The id of the message in case it's predefined\n\tmessageId: null,\n})\n\nconst mutations = {\n\t/**\n\t * Loads the status from initial state\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.status The status type\n\t * @param {boolean} data.statusIsUserDefined Whether or not this status is user-defined\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {number} data.clearAt When to automatically clear the status\n\t * @param {boolean} data.messageIsPredefined Whether or not the message is predefined\n\t * @param {string} data.messageId The id of the predefined message\n\t */\n\tloadBackupStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) {\n\t\tstate.status = status\n\t\tstate.message = message\n\t\tstate.icon = icon\n\n\t\t// Don't overwrite certain values if the refreshing comes in via short updates\n\t\t// E.g. from talk participant list which only has the status, message and icon\n\t\tif (typeof statusIsUserDefined !== 'undefined') {\n\t\t\tstate.statusIsUserDefined = statusIsUserDefined\n\t\t}\n\t\tif (typeof clearAt !== 'undefined') {\n\t\t\tstate.clearAt = clearAt\n\t\t}\n\t\tif (typeof messageIsPredefined !== 'undefined') {\n\t\t\tstate.messageIsPredefined = messageIsPredefined\n\t\t}\n\t\tif (typeof messageId !== 'undefined') {\n\t\t\tstate.messageId = messageId\n\t\t}\n\t},\n}\n\nconst getters = {}\n\nconst actions = {\n\t/**\n\t * Re-fetches the status from the server\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @return {Promise}\n\t */\n\tasync fetchBackupFromServer({ commit }) {\n\t\ttry {\n\t\t\tconst status = await fetchBackupStatus(getCurrentUser()?.uid)\n\t\t\tcommit('loadBackupStatusFromServer', status)\n\t\t} catch {\n\t\t\t// Ignore missing user backup status\n\t\t}\n\t},\n\n\tasync revertBackupFromServer({ commit }, { messageId }) {\n\t\tconst status = await revertToBackupStatus(messageId)\n\t\tif (status) {\n\t\t\tcommit('loadBackupStatusFromServer', {})\n\t\t\tcommit('loadStatusFromServer', status)\n\t\t\temit('user_status:status.updated', {\n\t\t\t\tstatus: status.status,\n\t\t\t\tmessage: status.message,\n\t\t\t\ticon: status.icon,\n\t\t\t\tclearAt: status.clearAt,\n\t\t\t\tuserId: getCurrentUser()?.uid,\n\t\t\t})\n\t\t}\n\t},\n}\n\nexport default { state, mutations, getters, actions }\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n *\n */\nfunction dateFactory() {\n\treturn new Date()\n}\n\nexport {\n\tdateFactory,\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { formatRelativeTime, getFirstDay, t } from '@nextcloud/l10n'\nimport { dateFactory } from './dateService.js'\n\n/**\n * Calculates the actual clearAt timestamp\n *\n * @param {object | null} clearAt The clear-at config\n * @return {number | null}\n */\nexport function getTimestampForClearAt(clearAt) {\n\tif (clearAt === null) {\n\t\treturn null\n\t}\n\n\tconst date = dateFactory()\n\n\tif (clearAt.type === 'period') {\n\t\tdate.setSeconds(date.getSeconds() + clearAt.time)\n\t\treturn Math.floor(date.getTime() / 1000)\n\t}\n\tif (clearAt.type === 'end-of') {\n\t\tswitch (clearAt.time) {\n\t\t\tcase 'day':\n\t\t\t\treturn Math.floor(getEndOfDay(date).getTime() / 1000)\n\t\t\tcase 'week':\n\t\t\t\treturn Math.floor(getEndOfWeek(date).getTime() / 1000)\n\t\t}\n\t}\n\t// This is not an officially supported type\n\t// but only used internally to show the remaining time\n\t// in the Set Status Modal\n\tif (clearAt.type === '_time') {\n\t\treturn clearAt.time\n\t}\n\n\treturn null\n}\n\n/**\n * Formats a clearAt object to be human readable\n *\n * @param {object} clearAt The clearAt object\n * @return {string|null}\n */\nexport function clearAtFormat(clearAt) {\n\tif (clearAt === null) {\n\t\treturn t('user_status', 'Don\\'t clear')\n\t}\n\n\tif (clearAt.type === 'end-of') {\n\t\tswitch (clearAt.time) {\n\t\t\tcase 'day':\n\t\t\t\treturn t('user_status', 'Today')\n\t\t\tcase 'week':\n\t\t\t\treturn t('user_status', 'This week')\n\n\t\t\tdefault:\n\t\t\t\treturn null\n\t\t}\n\t}\n\n\tif (clearAt.type === 'period') {\n\t\treturn formatRelativeTime(Date.now() + clearAt.time * 1000)\n\t}\n\n\t// This is not an officially supported type\n\t// but only used internally to show the remaining time\n\t// in the Set Status Modal\n\tif (clearAt.type === '_time') {\n\t\treturn formatRelativeTime(clearAt.time * 1000)\n\t}\n\n\treturn null\n}\n\n/**\n * @param {Date} date - The date to calculate the end of the day for\n */\nfunction getEndOfDay(date) {\n\tconst endOfDay = new Date(date)\n\tendOfDay.setHours(23, 59, 59, 999)\n\treturn endOfDay\n}\n\n/**\n * Calculates the end of the week for a given date\n *\n * @param {Date} date - The date to calculate the end of the week for\n */\nfunction getEndOfWeek(date) {\n\tconst endOfWeek = getEndOfDay(date)\n\tendOfWeek.setDate(date.getDate() + ((getFirstDay() - 1 - endOfWeek.getDay() + 7) % 7))\n\treturn endOfWeek\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { emit } from '@nextcloud/event-bus'\nimport { loadState } from '@nextcloud/initial-state'\nimport { getTimestampForClearAt } from '../services/clearAtService.js'\nimport {\n\tclearMessage,\n\tfetchCurrentStatus,\n\tsetCustomMessage,\n\tsetPredefinedMessage,\n\tsetStatus,\n} from '../services/statusService.js'\n\n// eslint-disable-next-line antfu/top-level-function\nconst state = () => ({\n\t// Status (online / away / dnd / invisible / offline)\n\tstatus: null,\n\t// Whether the status is user-defined\n\tstatusIsUserDefined: null,\n\t// A custom message set by the user\n\tmessage: null,\n\t// The icon selected by the user\n\ticon: null,\n\t// When to automatically clean the status\n\tclearAt: null,\n\t// Whether the message is predefined\n\t// (and can automatically be translated by Nextcloud)\n\tmessageIsPredefined: null,\n\t// The id of the message in case it's predefined\n\tmessageId: null,\n})\n\nconst mutations = {\n\n\t/**\n\t * Sets a new status\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.statusType The new status type\n\t */\n\tsetStatus(state, { statusType }) {\n\t\tstate.status = statusType\n\t\tstate.statusIsUserDefined = true\n\t},\n\n\t/**\n\t * Sets a message using a predefined message\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.messageId The messageId\n\t * @param {number | null} data.clearAt When to automatically clear the status\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t */\n\tsetPredefinedMessage(state, { messageId, clearAt, message, icon }) {\n\t\tstate.messageId = messageId\n\t\tstate.messageIsPredefined = true\n\n\t\tstate.message = message\n\t\tstate.icon = icon\n\t\tstate.clearAt = clearAt\n\t},\n\n\t/**\n\t * Sets a custom message\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {number} data.clearAt When to automatically clear the status\n\t */\n\tsetCustomMessage(state, { message, icon, clearAt }) {\n\t\tstate.messageId = null\n\t\tstate.messageIsPredefined = false\n\n\t\tstate.message = message\n\t\tstate.icon = icon\n\t\tstate.clearAt = clearAt\n\t},\n\n\t/**\n\t * Clears the status\n\t *\n\t * @param {object} state The Vuex state\n\t */\n\tclearMessage(state) {\n\t\tstate.messageId = null\n\t\tstate.messageIsPredefined = false\n\n\t\tstate.message = null\n\t\tstate.icon = null\n\t\tstate.clearAt = null\n\t},\n\n\t/**\n\t * Loads the status from initial state\n\t *\n\t * @param {object} state The Vuex state\n\t * @param {object} data The destructuring object\n\t * @param {string} data.status The status type\n\t * @param {boolean} data.statusIsUserDefined Whether or not this status is user-defined\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {number} data.clearAt When to automatically clear the status\n\t * @param {boolean} data.messageIsPredefined Whether or not the message is predefined\n\t * @param {string} data.messageId The id of the predefined message\n\t */\n\tloadStatusFromServer(state, { status, statusIsUserDefined, message, icon, clearAt, messageIsPredefined, messageId }) {\n\t\tstate.status = status\n\t\tstate.message = message\n\t\tstate.icon = icon\n\n\t\t// Don't overwrite certain values if the refreshing comes in via short updates\n\t\t// E.g. from talk participant list which only has the status, message and icon\n\t\tif (typeof statusIsUserDefined !== 'undefined') {\n\t\t\tstate.statusIsUserDefined = statusIsUserDefined\n\t\t}\n\t\tif (typeof clearAt !== 'undefined') {\n\t\t\tstate.clearAt = clearAt\n\t\t}\n\t\tif (typeof messageIsPredefined !== 'undefined') {\n\t\t\tstate.messageIsPredefined = messageIsPredefined\n\t\t}\n\t\tif (typeof messageId !== 'undefined') {\n\t\t\tstate.messageId = messageId\n\t\t}\n\t},\n}\n\nconst getters = {}\n\nconst actions = {\n\n\t/**\n\t * Sets a new status\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {object} data The data destructuring object\n\t * @param {string} data.statusType The new status type\n\t * @return {Promise}\n\t */\n\tasync setStatus({ commit, state }, { statusType }) {\n\t\tawait setStatus(statusType)\n\t\tcommit('setStatus', { statusType })\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Update status from 'user_status:status.updated' update.\n\t * This doesn't trigger another 'user_status:status.updated'\n\t * event.\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {string} status The new status\n\t * @return {Promise}\n\t */\n\tasync setStatusFromObject({ commit }, status) {\n\t\tcommit('loadStatusFromServer', status)\n\t},\n\n\t/**\n\t * Sets a message using a predefined message\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {object} vuex.rootState The Vuex root state\n\t * @param {object} data The data destructuring object\n\t * @param {string} data.messageId The messageId\n\t * @param {object | null} data.clearAt When to automatically clear the status\n\t * @return {Promise}\n\t */\n\tasync setPredefinedMessage({ commit, rootState, state }, { messageId, clearAt }) {\n\t\tconst resolvedClearAt = getTimestampForClearAt(clearAt)\n\n\t\tawait setPredefinedMessage(messageId, resolvedClearAt)\n\t\tconst status = rootState.predefinedStatuses.predefinedStatuses.find((status) => status.id === messageId)\n\t\tconst { message, icon } = status\n\n\t\tcommit('setPredefinedMessage', { messageId, clearAt: resolvedClearAt, message, icon })\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Sets a custom message\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @param {object} data The data destructuring object\n\t * @param {string} data.message The message\n\t * @param {string} data.icon The icon\n\t * @param {object | null} data.clearAt When to automatically clear the status\n\t * @return {Promise}\n\t */\n\tasync setCustomMessage({ commit, state }, { message, icon, clearAt }) {\n\t\tconst resolvedClearAt = getTimestampForClearAt(clearAt)\n\n\t\tawait setCustomMessage(message, icon, resolvedClearAt)\n\t\tcommit('setCustomMessage', { message, icon, clearAt: resolvedClearAt })\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Clears the status\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} vuex.state The Vuex state object\n\t * @return {Promise}\n\t */\n\tasync clearMessage({ commit, state }) {\n\t\tawait clearMessage()\n\t\tcommit('clearMessage')\n\t\temit('user_status:status.updated', {\n\t\t\tstatus: state.status,\n\t\t\tmessage: state.message,\n\t\t\ticon: state.icon,\n\t\t\tclearAt: state.clearAt,\n\t\t\tuserId: getCurrentUser()?.uid,\n\t\t})\n\t},\n\n\t/**\n\t * Re-fetches the status from the server\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @return {Promise}\n\t */\n\tasync reFetchStatusFromServer({ commit }) {\n\t\tconst status = await fetchCurrentStatus()\n\t\tcommit('loadStatusFromServer', status)\n\t},\n\n\t/**\n\t * Stores the status we got in the reply of the heartbeat\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t * @param {object} status The data destructuring object\n\t * @param {string} status.status The status type\n\t * @param {boolean} status.statusIsUserDefined Whether or not this status is user-defined\n\t * @param {string} status.message The message\n\t * @param {string} status.icon The icon\n\t * @param {number} status.clearAt When to automatically clear the status\n\t * @param {boolean} status.messageIsPredefined Whether or not the message is predefined\n\t * @param {string} status.messageId The id of the predefined message\n\t * @return {Promise}\n\t */\n\tasync setStatusFromHeartbeat({ commit }, status) {\n\t\tcommit('loadStatusFromServer', status)\n\t},\n\n\t/**\n\t * Loads the server from the initial state\n\t *\n\t * @param {object} vuex The Vuex destructuring object\n\t * @param {Function} vuex.commit The Vuex commit function\n\t */\n\tloadStatusFromInitialState({ commit }) {\n\t\tconst status = loadState('user_status', 'status')\n\t\tcommit('loadStatusFromServer', status)\n\t},\n}\n\nexport default { state, mutations, getters, actions }\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { createStore } from 'vuex'\nimport predefinedStatuses from './predefinedStatuses.js'\nimport userBackupStatus from './userBackupStatus.js'\nimport userStatus from './userStatus.js'\n\nexport default createStore({\n\tmodules: {\n\t\tpredefinedStatuses,\n\t\tuserStatus,\n\t\tuserBackupStatus,\n\t},\n\tstrict: true,\n})\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { subscribe } from '@nextcloud/event-bus'\nimport { createApp } from 'vue'\nimport UserStatus from './UserStatus.vue'\nimport store from './store/index.js'\n\nimport './user-status-icons.css'\n\nconst mountPoint = document.getElementById('user_status-menu-entry')\n\n/**\n *\n */\nfunction mountMenuEntry() {\n\tconst mountPoint = document.getElementById('user_status-menu-entry')\n\t// TODO: fix me after Core migration to Vue 3\n\t// In Vue 2 menu items were mounted in place to the menu items\n\t// In Vue 3 they are mounted inside the menu item\n\t// A workaround - replace the menu item with \"display: contents\" div\n\tconst transparentMountPoint = document.createElement('div')\n\ttransparentMountPoint.style.display = 'contents'\n\tmountPoint.replaceWith(transparentMountPoint)\n\n\tcreateApp(UserStatus)\n\t\t.use(store)\n\t\t.mount(transparentMountPoint)\n}\n\nif (mountPoint) {\n\tmountMenuEntry()\n} else {\n\tsubscribe('core:user-menu:mounted', mountMenuEntry)\n}\n\n// Register dashboard status\ndocument.addEventListener('DOMContentLoaded', function() {\n\tif (!OCA.Dashboard) {\n\t\treturn\n\t}\n\n\tOCA.Dashboard.registerStatus('status', (el) => {\n\t\tcreateApp(UserStatus, {\n\t\t\tinline: true,\n\t\t})\n\t\t\t.use(store)\n\t\t\t.mount(el)\n\t})\n})\n"],"file":"user_status-menu.mjs"} \ No newline at end of file