settings-vue-settings-apps-users-management.js 52 KB

123
  1. /*! For license information please see settings-vue-settings-apps-users-management.js.LICENSE.txt */
  2. (()=>{var e,r,o,a={92652:(t,e,r)=>{"use strict";r.d(e,{J:()=>o});var n=r(31352);const o=Object.freeze({enabled:(0,n.Iu)("settings","Active apps"),disabled:(0,n.Iu)("settings","Disabled apps"),updates:(0,n.Iu)("settings","Updates"),"app-bundles":(0,n.Iu)("settings","App bundles"),featured:(0,n.Iu)("settings","Featured apps")})},38605:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=(0,r(17499).IY)().setApp("settings").detectUser().build()},97268:(e,r,o)=>{"use strict";var a=o(20144),i=o(2324),s=o(83678);const c={name:"App",beforeMount(){null!==document.getElementById("serverData")&&this.$store.commit("setServerData",JSON.parse(document.getElementById("serverData").dataset.server))}},u=(0,o(51900).Z)(c,(function(){return(0,this._self._c)("router-view")}),[],!1,null,null,null).exports;var p=o(25108);function d(t,e){for(var r in e)t[r]=e[r];return t}var l=/[!'()*]/g,h=function(t){return"%"+t.charCodeAt(0).toString(16)},f=/%2C/g,m=function(t){return encodeURIComponent(t).replace(l,h).replace(f,",")};function g(t){try{return decodeURIComponent(t)}catch(t){}return t}var y=function(t){return null==t||"object"==typeof t?t:String(t)};function v(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var r=t.replace(/\+/g," ").split("="),n=g(r.shift()),o=r.length>0?g(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}function b(t){var e=t?Object.keys(t).map((function(e){var r=t[e];if(void 0===r)return"";if(null===r)return m(e);if(Array.isArray(r)){var n=[];return r.forEach((function(t){void 0!==t&&(null===t?n.push(m(e)):n.push(m(e)+"="+m(t)))})),n.join("&")}return m(e)+"="+m(r)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var w=/\/?$/;function A(t,e,r,n){var o=n&&n.options.stringifyQuery,a=e.query||{};try{a=I(a)}catch(t){}var i={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:a,params:e.params||{},fullPath:E(e,o),matched:t?C(t):[]};return r&&(i.redirectedFrom=E(r,o)),Object.freeze(i)}function I(t){if(Array.isArray(t))return t.map(I);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=I(t[r]);return e}return t}var U=A(null,{path:"/"});function C(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function E(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||b)(n)+o}function L(t,e,r){return e===U?t===e:!!e&&(t.path&&e.path?t.path.replace(w,"")===e.path.replace(w,"")&&(r||t.hash===e.hash&&P(t.query,e.query)):!(!t.name||!e.name)&&t.name===e.name&&(r||t.hash===e.hash&&P(t.query,e.query)&&P(t.params,e.params)))}function P(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t).sort(),n=Object.keys(e).sort();return r.length===n.length&&r.every((function(r,o){var a=t[r];if(n[o]!==r)return!1;var i=e[r];return null==a||null==i?a===i:"object"==typeof a&&"object"==typeof i?P(a,i):String(a)===String(i)}))}function O(t){for(var e=0;e<t.matched.length;e++){var r=t.matched[e];for(var n in r.instances){var o=r.instances[n],a=r.enteredCbs[n];if(o&&a){delete r.enteredCbs[n];for(var i=0;i<a.length;i++)o._isBeingDestroyed||a[i](o)}}}}var R={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var r=e.props,n=e.children,o=e.parent,a=e.data;a.routerView=!0;for(var i=o.$createElement,s=r.name,c=o.$route,u=o._routerViewCache||(o._routerViewCache={}),p=0,l=!1;o&&o._routerRoot!==o;){var h=o.$vnode?o.$vnode.data:{};h.routerView&&p++,h.keepAlive&&o._directInactive&&o._inactive&&(l=!0),o=o.$parent}if(a.routerViewDepth=p,l){var f=u[s],m=f&&f.component;return m?(f.configProps&&x(m,a,f.route,f.configProps),i(m,a,n)):i()}var g=c.matched[p],y=g&&g.components[s];if(!g||!y)return u[s]=null,i();u[s]={component:y},a.registerRouteInstance=function(t,e){var r=g.instances[s];(e&&r!==t||!e&&r===t)&&(g.instances[s]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){g.instances[s]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==g.instances[s]&&(g.instances[s]=t.componentInstance),O(c)};var v=g.props&&g.props[s];return v&&(d(u[s],{route:c,configProps:v}),x(y,a,c,v)),i(y,a,n)}};function x(t,e,r,n){var o=e.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(r,n);if(o){o=e.props=d({},o);var a=e.attrs=e.attrs||{};for(var i in o)t.props&&i in t.props||(a[i]=o[i],delete o[i])}}function k(t,e,r){var n=t.charAt(0);if("/"===n)return t;if("?"===n||"#"===n)return e+t;var o=e.split("/");r&&o[o.length-1]||o.pop();for(var a=t.replace(/^\//,"").split("/"),i=0;i<a.length;i++){var s=a[i];".."===s?o.pop():"."!==s&&o.push(s)}return""!==o[0]&&o.unshift(""),o.join("/")}function _(t){return t.replace(/\/(?:\s*\/)+/g,"/")}var j=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},S=function t(e,r,n){return j(r)||(n=r||n,r=[]),n=n||{},e instanceof RegExp?function(t,e){var r=t.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)e.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return Z(t,e)}(e,r):j(e)?function(e,r,n){for(var o=[],a=0;a<e.length;a++)o.push(t(e[a],r,n).source);return Z(new RegExp("(?:"+o.join("|")+")",H(n)),r)}(e,r,n):function(t,e,r){return z(N(t,r),e,r)}(e,r,n)},T=N,M=q,D=z,F=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function N(t,e){for(var r,n=[],o=0,a=0,i="",s=e&&e.delimiter||"/";null!=(r=F.exec(t));){var c=r[0],u=r[1],p=r.index;if(i+=t.slice(a,p),a=p+c.length,u)i+=u[1];else{var d=t[a],l=r[2],h=r[3],f=r[4],m=r[5],g=r[6],y=r[7];i&&(n.push(i),i="");var v=null!=l&&null!=d&&d!==l,b="+"===g||"*"===g,w="?"===g||"*"===g,A=r[2]||s,I=f||m;n.push({name:h||o++,prefix:l||"",delimiter:A,optional:w,repeat:b,partial:v,asterisk:!!y,pattern:I?G(I):y?".*":"[^"+B(A)+"]+?"})}}return a<t.length&&(i+=t.substr(a)),i&&n.push(i),n}function $(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function q(t,e){for(var r=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(r[n]=new RegExp("^(?:"+t[n].pattern+")$",H(e)));return function(e,n){for(var o="",a=e||{},i=(n||{}).pretty?$:encodeURIComponent,s=0;s<t.length;s++){var c=t[s];if("string"!=typeof c){var u,p=a[c.name];if(null==p){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(j(p)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var d=0;d<p.length;d++){if(u=i(p[d]),!r[s].test(u))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(u)+"`");o+=(0===d?c.prefix:c.delimiter)+u}}else{if(u=c.asterisk?encodeURI(p).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):i(p),!r[s].test(u))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+u+'"');o+=c.prefix+u}}else o+=c}return o}}function B(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function G(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function Z(t,e){return t.keys=e,t}function H(t){return t&&t.sensitive?"":"i"}function z(t,e,r){j(e)||(r=e||r,e=[]);for(var n=(r=r||{}).strict,o=!1!==r.end,a="",i=0;i<t.length;i++){var s=t[i];if("string"==typeof s)a+=B(s);else{var c=B(s.prefix),u="(?:"+s.pattern+")";e.push(s),s.repeat&&(u+="(?:"+c+u+")*"),a+=u=s.optional?s.partial?c+"("+u+")?":"(?:"+c+"("+u+"))?":c+"("+u+")"}}var p=B(r.delimiter||"/"),d=a.slice(-p.length)===p;return n||(a=(d?a.slice(0,-p.length):a)+"(?:"+p+"(?=$))?"),a+=o?"$":n&&d?"":"(?="+p+"|$)",Z(new RegExp("^"+a,H(r)),e)}S.parse=T,S.compile=function(t,e){return q(N(t,e),e)},S.tokensToFunction=M,S.tokensToRegExp=D;var V=Object.create(null);function Y(t,e,r){e=e||{};try{var n=V[t]||(V[t]=S.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),n(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function J(t,e,r,n){var o="string"==typeof t?{path:t}:t;if(o._normalized)return o;if(o.name){var a=(o=d({},t)).params;return a&&"object"==typeof a&&(o.params=d({},a)),o}if(!o.path&&o.params&&e){(o=d({},o))._normalized=!0;var i=d(d({},e.params),o.params);if(e.name)o.name=e.name,o.params=i;else if(e.matched.length){var s=e.matched[e.matched.length-1].path;o.path=Y(s,i,e.path)}return o}var c=function(t){var e="",r="",n=t.indexOf("#");n>=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(o.path||""),u=e&&e.path||"/",p=c.path?k(c.path,u,r||o.append):u,l=function(t,e,r){void 0===e&&(e={});var n,o=r||v;try{n=o(t||"")}catch(t){n={}}for(var a in e){var i=e[a];n[a]=Array.isArray(i)?i.map(y):y(i)}return n}(c.query,o.query,n&&n.options.parseQuery),h=o.hash||c.hash;return h&&"#"!==h.charAt(0)&&(h="#"+h),{_normalized:!0,path:p,query:l,hash:h}}var W,Q=function(){},K={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,r=this.$router,n=this.$route,o=r.resolve(this.to,n,this.append),a=o.location,i=o.route,s=o.href,c={},u=r.options.linkActiveClass,p=r.options.linkExactActiveClass,l=null==u?"router-link-active":u,h=null==p?"router-link-exact-active":p,f=null==this.activeClass?l:this.activeClass,m=null==this.exactActiveClass?h:this.exactActiveClass,g=i.redirectedFrom?A(null,J(i.redirectedFrom),null,r):i;c[m]=L(n,g,this.exactPath),c[f]=this.exact||this.exactPath?c[m]:function(t,e){return 0===t.path.replace(w,"/").indexOf(e.path.replace(w,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(n,g);var y=c[m]?this.ariaCurrentValue:null,v=function(t){X(t)&&(e.replace?r.replace(a,Q):r.push(a,Q))},b={click:X};Array.isArray(this.event)?this.event.forEach((function(t){b[t]=v})):b[this.event]=v;var I={class:c},U=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:v,isActive:c[f],isExactActive:c[m]});if(U){if(1===U.length)return U[0];if(U.length>1||!U.length)return 0===U.length?t():t("span",{},U)}if("a"===this.tag)I.on=b,I.attrs={href:s,"aria-current":y};else{var C=tt(this.$slots.default);if(C){C.isStatic=!1;var E=C.data=d({},C.data);for(var P in E.on=E.on||{},E.on){var O=E.on[P];P in b&&(E.on[P]=Array.isArray(O)?O:[O])}for(var R in b)R in E.on?E.on[R].push(b[R]):E.on[R]=v;var x=C.data.attrs=d({},C.data.attrs);x.href=s,x["aria-current"]=y}else I.on=b}return t(this.tag,I,this.$slots.default)}};function X(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function tt(t){if(t)for(var e,r=0;r<t.length;r++){if("a"===(e=t[r]).tag)return e;if(e.children&&(e=tt(e.children)))return e}}var et="undefined"!=typeof window;function rt(t,e,r,n,o){var a=e||[],i=r||Object.create(null),s=n||Object.create(null);t.forEach((function(t){nt(a,i,s,t,o)}));for(var c=0,u=a.length;c<u;c++)"*"===a[c]&&(a.push(a.splice(c,1)[0]),u--,c--);return{pathList:a,pathMap:i,nameMap:s}}function nt(t,e,r,n,o,a){var i=n.path,s=n.name,c=n.pathToRegexpOptions||{},u=function(t,e,r){return r||(t=t.replace(/\/$/,"")),"/"===t[0]||null==e?t:_(e.path+"/"+t)}(i,o,c.strict);"boolean"==typeof n.caseSensitive&&(c.sensitive=n.caseSensitive);var p={path:u,regex:ot(u,c),components:n.components||{default:n.component},alias:n.alias?"string"==typeof n.alias?[n.alias]:n.alias:[],instances:{},enteredCbs:{},name:s,parent:o,matchAs:a,redirect:n.redirect,beforeEnter:n.beforeEnter,meta:n.meta||{},props:null==n.props?{}:n.components?n.props:{default:n.props}};if(n.children&&n.children.forEach((function(n){var o=a?_(a+"/"+n.path):void 0;nt(t,e,r,n,p,o)})),e[p.path]||(t.push(p.path),e[p.path]=p),void 0!==n.alias)for(var d=Array.isArray(n.alias)?n.alias:[n.alias],l=0;l<d.length;++l){var h={path:d[l],children:n.children};nt(t,e,r,h,o,p.path||"/")}s&&(r[s]||(r[s]=p))}function ot(t,e){return S(t,[],e)}function at(t,e){var r=rt(t),n=r.pathList,o=r.pathMap,a=r.nameMap;function i(t,r,i){var c=J(t,r,!1,e),u=c.name;if(u){var p=a[u];if(!p)return s(null,c);var d=p.regex.keys.filter((function(t){return!t.optional})).map((function(t){return t.name}));if("object"!=typeof c.params&&(c.params={}),r&&"object"==typeof r.params)for(var l in r.params)!(l in c.params)&&d.indexOf(l)>-1&&(c.params[l]=r.params[l]);return c.path=Y(p.path,c.params),s(p,c,i)}if(c.path){c.params={};for(var h=0;h<n.length;h++){var f=n[h],m=o[f];if(it(m.regex,c.path,c.params))return s(m,c,i)}}return s(null,c)}function s(t,r,n){return t&&t.redirect?function(t,r){var n=t.redirect,o="function"==typeof n?n(A(t,r,null,e)):n;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return s(null,r);var c=o,u=c.name,p=c.path,d=r.query,l=r.hash,h=r.params;if(d=c.hasOwnProperty("query")?c.query:d,l=c.hasOwnProperty("hash")?c.hash:l,h=c.hasOwnProperty("params")?c.params:h,u)return a[u],i({_normalized:!0,name:u,query:d,hash:l,params:h},void 0,r);if(p){var f=function(t,e){return k(t,e.parent?e.parent.path:"/",!0)}(p,t);return i({_normalized:!0,path:Y(f,h),query:d,hash:l},void 0,r)}return s(null,r)}(t,n||r):t&&t.matchAs?function(t,e,r){var n=i({_normalized:!0,path:Y(r,e.params)});if(n){var o=n.matched,a=o[o.length-1];return e.params=n.params,s(a,e)}return s(null,e)}(0,r,t.matchAs):A(t,r,n,e)}return{match:i,addRoute:function(t,e){var r="object"!=typeof t?a[t]:void 0;rt([e||t],n,o,a,r),r&&r.alias.length&&rt(r.alias.map((function(t){return{path:t,children:[e]}})),n,o,a,r)},getRoutes:function(){return n.map((function(t){return o[t]}))},addRoutes:function(t){rt(t,n,o,a)}}}function it(t,e,r){var n=e.match(t);if(!n)return!1;if(!r)return!0;for(var o=1,a=n.length;o<a;++o){var i=t.keys[o-1];i&&(r[i.name||"pathMatch"]="string"==typeof n[o]?g(n[o]):n[o])}return!0}var st=et&&window.performance&&window.performance.now?window.performance:Date;function ct(){return st.now().toFixed(3)}var ut=ct();function pt(){return ut}function dt(t){return ut=t}var lt=Object.create(null);function ht(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var t=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(t,""),r=d({},window.history.state);return r.key=pt(),window.history.replaceState(r,"",e),window.addEventListener("popstate",gt),function(){window.removeEventListener("popstate",gt)}}function ft(t,e,r,n){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick((function(){var a=function(){var t=pt();if(t)return lt[t]}(),i=o.call(t,e,r,n?a:null);i&&("function"==typeof i.then?i.then((function(t){At(t,a)})).catch((function(t){})):At(i,a))}))}}function mt(){var t=pt();t&&(lt[t]={x:window.pageXOffset,y:window.pageYOffset})}function gt(t){mt(),t.state&&t.state.key&&dt(t.state.key)}function yt(t){return bt(t.x)||bt(t.y)}function vt(t){return{x:bt(t.x)?t.x:window.pageXOffset,y:bt(t.y)?t.y:window.pageYOffset}}function bt(t){return"number"==typeof t}var wt=/^#\d/;function At(t,e){var r,n="object"==typeof t;if(n&&"string"==typeof t.selector){var o=wt.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(o){var a=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var r=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.left-r.left-e.x,y:n.top-r.top-e.y}}(o,a={x:bt((r=a).x)?r.x:0,y:bt(r.y)?r.y:0})}else yt(t)&&(e=vt(t))}else n&&yt(t)&&(e=vt(t));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}var It,Ut=et&&(-1===(It=window.navigator.userAgent).indexOf("Android 2.")&&-1===It.indexOf("Android 4.0")||-1===It.indexOf("Mobile Safari")||-1!==It.indexOf("Chrome")||-1!==It.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState;function Ct(t,e){mt();var r=window.history;try{if(e){var n=d({},r.state);n.key=pt(),r.replaceState(n,"",t)}else r.pushState({key:dt(ct())},"",t)}catch(r){window.location[e?"replace":"assign"](t)}}function Et(t){Ct(t,!0)}var Lt={redirected:2,aborted:4,cancelled:8,duplicated:16};function Pt(t,e){return Ot(t,e,Lt.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function Ot(t,e,r,n){var o=new Error(n);return o._isRouter=!0,o.from=t,o.to=e,o.type=r,o}var Rt=["params","query","hash"];function xt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function kt(t,e){return xt(t)&&t._isRouter&&(null==e||t.type===e)}function _t(t,e,r){var n=function(o){o>=t.length?r():t[o]?e(t[o],(function(){n(o+1)})):n(o+1)};n(0)}function jt(t,e){return St(t.map((function(t){return Object.keys(t.components).map((function(r){return e(t.components[r],t.instances[r],t,r)}))})))}function St(t){return Array.prototype.concat.apply([],t)}var Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Mt(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var Dt=function(t,e){this.router=t,this.base=function(t){if(!t)if(et){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=U,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ft(t,e,r,n){var o=jt(t,(function(t,n,o,a){var i=function(t,e){return"function"!=typeof t&&(t=W.extend(t)),t.options[e]}(t,e);if(i)return Array.isArray(i)?i.map((function(t){return r(t,n,o,a)})):r(i,n,o,a)}));return St(n?o.reverse():o)}function Nt(t,e){if(e)return function(){return t.apply(e,arguments)}}Dt.prototype.listen=function(t){this.cb=t},Dt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Dt.prototype.onError=function(t){this.errorCbs.push(t)},Dt.prototype.transitionTo=function(t,e,r){var n,o=this;try{n=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var a=this.current;this.confirmTransition(n,(function(){o.updateRoute(n),e&&e(n),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(n,a)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(n)})))}),(function(t){r&&r(t),t&&!o.ready&&(kt(t,Lt.redirected)&&a===U||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},Dt.prototype.confirmTransition=function(t,e,r){var n=this,o=this.current;this.pending=t;var a,i,s=function(t){!kt(t)&&xt(t)&&(n.errorCbs.length?n.errorCbs.forEach((function(e){e(t)})):p.error(t)),r&&r(t)},c=t.matched.length-1,u=o.matched.length-1;if(L(t,o)&&c===u&&t.matched[c]===o.matched[u])return this.ensureURL(),t.hash&&ft(this.router,o,t,!1),s(((i=Ot(a=o,t,Lt.duplicated,'Avoided redundant navigation to current location: "'+a.fullPath+'".')).name="NavigationDuplicated",i));var d,l=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r<n&&t[r]===e[r];r++);return{updated:e.slice(0,r),activated:e.slice(r),deactivated:t.slice(r)}}(this.current.matched,t.matched),h=l.updated,f=l.deactivated,m=l.activated,g=[].concat(function(t){return Ft(t,"beforeRouteLeave",Nt,!0)}(f),this.router.beforeHooks,function(t){return Ft(t,"beforeRouteUpdate",Nt)}(h),m.map((function(t){return t.beforeEnter})),(d=m,function(t,e,r){var n=!1,o=0,a=null;jt(d,(function(t,e,i,s){if("function"==typeof t&&void 0===t.cid){n=!0,o++;var c,u=Mt((function(e){var n;((n=e).__esModule||Tt&&"Module"===n[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:W.extend(e),i.components[s]=e,--o<=0&&r()})),p=Mt((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=xt(t)?t:new Error(e),r(a))}));try{c=t(u,p)}catch(t){p(t)}if(c)if("function"==typeof c.then)c.then(u,p);else{var d=c.component;d&&"function"==typeof d.then&&d.then(u,p)}}})),n||r()})),y=function(e,r){if(n.pending!==t)return s(Pt(o,t));try{e(t,o,(function(e){!1===e?(n.ensureURL(!0),s(function(t,e){return Ot(t,e,Lt.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(o,t))):xt(e)?(n.ensureURL(!0),s(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(s(function(t,e){return Ot(t,e,Lt.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return Rt.forEach((function(r){r in t&&(e[r]=t[r])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}(o,t)),"object"==typeof e&&e.replace?n.replace(e):n.push(e)):r(e)}))}catch(t){s(t)}};_t(g,y,(function(){var r=function(t){return Ft(t,"beforeRouteEnter",(function(t,e,r,n){return function(t,e,r){return function(n,o,a){return t(n,o,(function(t){"function"==typeof t&&(e.enteredCbs[r]||(e.enteredCbs[r]=[]),e.enteredCbs[r].push(t)),a(t)}))}}(t,r,n)}))}(m);_t(r.concat(n.router.resolveHooks),y,(function(){if(n.pending!==t)return s(Pt(o,t));n.pending=null,e(t),n.router.app&&n.router.app.$nextTick((function(){O(t)}))}))}))},Dt.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},Dt.prototype.setupListeners=function(){},Dt.prototype.teardown=function(){this.listeners.forEach((function(t){t()})),this.listeners=[],this.current=U,this.pending=null};var $t=function(t){function e(e,r){t.call(this,e,r),this._startLocation=qt(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,r=e.options.scrollBehavior,n=Ut&&r;n&&this.listeners.push(ht());var o=function(){var r=t.current,o=qt(t.base);t.current===U&&o===t._startLocation||t.transitionTo(o,(function(t){n&&ft(e,t,r,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Ct(_(n.base+t.fullPath)),ft(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Et(_(n.base+t.fullPath)),ft(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.ensureURL=function(t){if(qt(this.base)!==this.current.fullPath){var e=_(this.base+this.current.fullPath);t?Ct(e):Et(e)}},e.prototype.getCurrentLocation=function(){return qt(this.base)},e}(Dt);function qt(t){var e=window.location.pathname,r=e.toLowerCase(),n=t.toLowerCase();return!t||r!==n&&0!==r.indexOf(_(n+"/"))||(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Bt=function(t){function e(e,r,n){t.call(this,e,r),n&&function(t){var e=qt(t);if(!/^\/#/.test(e))return window.location.replace(_(t+"/#"+e)),!0}(this.base)||Gt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,r=Ut&&e;r&&this.listeners.push(ht());var n=function(){var e=t.current;Gt()&&t.transitionTo(Zt(),(function(n){r&&ft(t.router,n,e,!0),Ut||Vt(n.fullPath)}))},o=Ut?"popstate":"hashchange";window.addEventListener(o,n),this.listeners.push((function(){window.removeEventListener(o,n)}))}},e.prototype.push=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){zt(t.fullPath),ft(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this,o=this.current;this.transitionTo(t,(function(t){Vt(t.fullPath),ft(n.router,t,o,!1),e&&e(t)}),r)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Zt()!==e&&(t?zt(e):Vt(e))},e.prototype.getCurrentLocation=function(){return Zt()},e}(Dt);function Gt(){var t=Zt();return"/"===t.charAt(0)||(Vt("/"+t),!1)}function Zt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ht(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function zt(t){Ut?Ct(Ht(t)):window.location.hash=t}function Vt(t){Ut?Et(Ht(t)):window.location.replace(Ht(t))}var Yt=function(t){function e(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)}),r)},e.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,(function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)}),r)},e.prototype.go=function(t){var e=this,r=this.index+t;if(!(r<0||r>=this.stack.length)){var n=this.stack[r];this.confirmTransition(n,(function(){var t=e.current;e.index=r,e.updateRoute(n),e.router.afterHooks.forEach((function(e){e&&e(n,t)}))}),(function(t){kt(t,Lt.duplicated)&&(e.index=r)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Dt),Jt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=at(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!Ut&&!1!==t.fallback,this.fallback&&(e="hash"),et||(e="abstract"),this.mode=e,e){case"history":this.history=new $t(this,t.base);break;case"hash":this.history=new Bt(this,t.base,this.fallback);break;case"abstract":this.history=new Yt(this,t.base)}},Wt={currentRoute:{configurable:!0}};Jt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},Wt.currentRoute.get=function(){return this.history&&this.history.current},Jt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var r=this.history;if(r instanceof $t||r instanceof Bt){var n=function(t){r.setupListeners(),function(t){var n=r.current,o=e.options.scrollBehavior;Ut&&o&&"fullPath"in t&&ft(e,t,n,!1)}(t)};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Jt.prototype.beforeEach=function(t){return Kt(this.beforeHooks,t)},Jt.prototype.beforeResolve=function(t){return Kt(this.resolveHooks,t)},Jt.prototype.afterEach=function(t){return Kt(this.afterHooks,t)},Jt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Jt.prototype.onError=function(t){this.history.onError(t)},Jt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.push(t,e,r)}));this.history.push(t,e,r)},Jt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise((function(e,r){n.history.replace(t,e,r)}));this.history.replace(t,e,r)},Jt.prototype.go=function(t){this.history.go(t)},Jt.prototype.back=function(){this.go(-1)},Jt.prototype.forward=function(){this.go(1)},Jt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Jt.prototype.resolve=function(t,e,r){var n=J(t,e=e||this.history.current,r,this),o=this.match(n,e),a=o.redirectedFrom||o.fullPath,i=function(t,e,r){var n="hash"===r?"#"+e:e;return t?_(t+"/"+n):n}(this.history.base,a,this.mode);return{location:n,route:o,href:i,normalizedTo:n,resolved:o}},Jt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Jt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==U&&this.history.transitionTo(this.history.getCurrentLocation())},Jt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==U&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Jt.prototype,Wt);var Qt=Jt;function Kt(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}Jt.install=function t(e){if(!t.installed||W!==e){t.installed=!0,W=e;var r=function(t){return void 0!==t},n=function(t,e){var n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",R),e.component("RouterLink",K);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Jt.version="3.6.5",Jt.isNavigationFailure=kt,Jt.NavigationFailureType=Lt,Jt.START_LOCATION=U,et&&window.Vue&&window.Vue.use(Jt);var Xt=o(79753),te=o(92652),ee=o(20629),re=o(26937),ne=o(10128);o(65509);const oe=function(t){return t.replace(/\/$/,"")},ae=()=>(0,ne.confirmPassword)(),ie=(t,e)=>re.Z.get(oe(t),e),se=(t,e)=>re.Z.post(oe(t),e),ce=(t,e)=>re.Z.put(oe(t),e),ue=(t,e)=>re.Z.delete(oe(t),{params:e});var pe=o(38605),de=o(25108);const le=function(t,e){return 1===e?t.sort(((t,e)=>t.usercount-t.disabled<e.usercount-e.disabled)):t.sort(((t,e)=>t.name.localeCompare(e.name)))},he={id:"",name:"",usercount:0,disabled:0,canAdd:!0,canRemove:!0},fe={appendUsers(t,e){const r=t.users.map((t=>{let{id:e}=t;return e})),n=Object.values(e).filter((t=>{let{id:e}=t;return!r.includes(e)})),o=t.users.concat(n);t.usersOffset+=t.usersLimit,t.users=o},setPasswordPolicyMinLength(t,e){t.minPasswordLength=""!==e?e:0},initGroups(t,e){let{groups:r,orderBy:n,userCount:o}=e;t.groups=r.map((t=>Object.assign({},he,t))),t.orderBy=n,t.userCount=o,t.groups=le(t.groups,t.orderBy)},addGroup(t,e){let{gid:r,displayName:n}=e;try{if(void 0!==t.groups.find((t=>t.id===r)))return;const e=Object.assign({},he,{id:r,name:n});t.groups.push(e),t.groups=le(t.groups,t.orderBy)}catch(t){de.error("Can't create group",t)}},renameGroup(t,e){let{gid:r,displayName:n}=e;const o=t.groups.findIndex((t=>t.id===r));if(o>=0){const e=t.groups[o];e.name=n,t.groups.splice(o,1,e),t.groups=le(t.groups,t.orderBy)}},removeGroup(t,e){const r=t.groups.findIndex((t=>t.id===e));r>=0&&t.groups.splice(r,1)},addUserGroup(t,e){let{userid:r,gid:n}=e;const o=t.groups.find((t=>t.id===n)),a=t.users.find((t=>t.id===r));o&&a.enabled&&t.userCount>0&&o.usercount++,a.groups.push(n),t.groups=le(t.groups,t.orderBy)},removeUserGroup(t,e){let{userid:r,gid:n}=e;const o=t.groups.find((t=>t.id===n)),a=t.users.find((t=>t.id===r));o&&a.enabled&&t.userCount>0&&o.usercount--;const i=a.groups;i.splice(i.indexOf(n),1),t.groups=le(t.groups,t.orderBy)},addUserSubAdmin(t,e){let{userid:r,gid:n}=e;t.users.find((t=>t.id===r)).subadmin.push(n)},removeUserSubAdmin(t,e){let{userid:r,gid:n}=e;const o=t.users.find((t=>t.id===r)).subadmin;o.splice(o.indexOf(n),1)},deleteUser(t,e){const r=t.users.findIndex((t=>t.id===e));this.commit("updateUserCounts",{user:t.users[r],actionType:"remove"}),t.users.splice(r,1)},addUserData(t,e){const r=e.data.ocs.data;t.users.unshift(r),this.commit("updateUserCounts",{user:r,actionType:"create"})},enableDisableUser(t,e){let{userid:r,enabled:n}=e;const o=t.users.find((t=>t.id===r));o.enabled=n,this.commit("updateUserCounts",{user:o,actionType:n?"enable":"disable"})},updateUserCounts(t,e){let{user:r,actionType:n}=e;const o=t.groups.find((t=>"disabled"===t.id));switch(n){case"enable":case"disable":o.usercount+=r.enabled?-1:1,t.userCount+=r.enabled?1:-1,r.groups.forEach((e=>{t.groups.find((t=>t.id===e)).disabled+=r.enabled?-1:1}));break;case"create":t.userCount++,r.groups.forEach((e=>{t.groups.find((t=>t.id===e)).usercount++}));break;case"remove":r.enabled?(t.userCount--,r.groups.forEach((e=>{const r=t.groups.find((t=>t.id===e));r?r.usercount--:de.warn("User group "+e+" does not exist during user removal")}))):(o.usercount--,r.groups.forEach((e=>{t.groups.find((t=>t.id===e)).disabled--})));break;default:pe.Z.error("Unknown action type in updateUserCounts: '".concat(n,"'"))}},setUserData(t,e){let{userid:r,key:n,value:o}=e;if("quota"===n){const e=OC.Util.computerFileSize(o);t.users.find((t=>t.id===r))[n][n]=null!==e?e:o}else t.users.find((t=>t.id===r))[n]=o},resetUsers(t){t.users=[],t.usersOffset=0},setShowConfig(t,e){let{key:r,value:n}=e;t.showConfig[r]=n}},me=re.Z.CancelToken;let ge=null;const ye={state:{users:[],groups:[],orderBy:1,minPasswordLength:0,usersOffset:0,usersLimit:25,userCount:0,showConfig:{showStoragePath:!1,showUserBackend:!1,showLastLogin:!1,showNewUserForm:!1,showLanguages:!1}},mutations:fe,getters:{getUsers:t=>t.users,getGroups:t=>t.groups,getSubadminGroups:t=>t.groups.filter((t=>"admin"!==t.id&&"disabled"!==t.id)),getPasswordPolicyMinLength:t=>t.minPasswordLength,getUsersOffset:t=>t.usersOffset,getUsersLimit:t=>t.usersLimit,getUserCount:t=>t.userCount,getShowConfig:t=>t.showConfig},actions:{searchUsers(t,e){let{offset:r,limit:n,search:o}=e;return o="string"==typeof o?o:"",ie((0,Xt.generateOcsUrl)("cloud/users/details?offset={offset}&limit={limit}&search={search}",{offset:r,limit:n,search:o})).catch((e=>{re.Z.isCancel(e)||t.commit("API_FAILURE",e)}))},getUser:(t,e)=>ie((0,Xt.generateOcsUrl)("cloud/users/".concat(e))).catch((e=>{re.Z.isCancel(e)||t.commit("API_FAILURE",e)})),getUsers(t,e){let{offset:r,limit:n,search:o,group:a}=e;return ge&&ge.cancel("Operation canceled by another search request."),ge=me.source(),o="string"==typeof o?o:"",a="string"==typeof a?a:"",""!==a?ie((0,Xt.generateOcsUrl)("cloud/groups/{group}/users/details?offset={offset}&limit={limit}&search={search}",{group:encodeURIComponent(a),offset:r,limit:n,search:o}),{cancelToken:ge.token}).then((e=>{const r=Object.keys(e.data.ocs.data.users).length;return r>0&&t.commit("appendUsers",e.data.ocs.data.users),r})).catch((e=>{re.Z.isCancel(e)||t.commit("API_FAILURE",e)})):ie((0,Xt.generateOcsUrl)("cloud/users/details?offset={offset}&limit={limit}&search={search}",{offset:r,limit:n,search:o}),{cancelToken:ge.token}).then((e=>{const r=Object.keys(e.data.ocs.data.users).length;return r>0&&t.commit("appendUsers",e.data.ocs.data.users),r})).catch((e=>{re.Z.isCancel(e)||t.commit("API_FAILURE",e)}))},getGroups(t,e){let{offset:r,limit:n,search:o}=e;o="string"==typeof o?o:"";const a=-1===n?"":"&limit=".concat(n);return ie((0,Xt.generateOcsUrl)("cloud/groups?offset={offset}&search={search}",{offset:r,search:o})+a).then((e=>Object.keys(e.data.ocs.data.groups).length>0&&(e.data.ocs.data.groups.forEach((function(e){t.commit("addGroup",{gid:e,displayName:e})})),!0))).catch((e=>t.commit("API_FAILURE",e)))},getUsersFromList(t,e){let{offset:r,limit:n,search:o}=e;return o="string"==typeof o?o:"",ie((0,Xt.generateOcsUrl)("cloud/users/details?offset={offset}&limit={limit}&search={search}",{offset:r,limit:n,search:o})).then((e=>Object.keys(e.data.ocs.data.users).length>0&&(t.commit("appendUsers",e.data.ocs.data.users),!0))).catch((e=>t.commit("API_FAILURE",e)))},getUsersFromGroup(t,e){let{groupid:r,offset:n,limit:o}=e;return ie((0,Xt.generateOcsUrl)("cloud/users/{groupId}/details?offset={offset}&limit={limit}",{groupId:encodeURIComponent(r),offset:n,limit:o})).then((e=>t.commit("getUsersFromList",e.data.ocs.data.users))).catch((e=>t.commit("API_FAILURE",e)))},getPasswordPolicyMinLength:t=>!(!OC.getCapabilities().password_policy||!OC.getCapabilities().password_policy.minLength)&&(t.commit("setPasswordPolicyMinLength",OC.getCapabilities().password_policy.minLength),OC.getCapabilities().password_policy.minLength),addGroup:(t,e)=>ae().then((r=>se((0,Xt.generateOcsUrl)("cloud/groups"),{groupid:e}).then((r=>(t.commit("addGroup",{gid:e,displayName:e}),{gid:e,displayName:e}))).catch((t=>{throw t})))).catch((r=>{throw t.commit("API_FAILURE",{gid:e,error:r}),r})),renameGroup(t,e){let{groupid:r,displayName:n}=e;return ae().then((e=>ce((0,Xt.generateOcsUrl)("cloud/groups/{groupId}",{groupId:encodeURIComponent(r)}),{key:"displayname",value:n}).then((e=>(t.commit("renameGroup",{gid:r,displayName:n}),{groupid:r,displayName:n}))).catch((t=>{throw t})))).catch((e=>{throw t.commit("API_FAILURE",{groupid:r,error:e}),e}))},removeGroup:(t,e)=>ae().then((r=>ue((0,Xt.generateOcsUrl)("cloud/groups/{groupId}",{groupId:encodeURIComponent(e)})).then((r=>t.commit("removeGroup",e))).catch((t=>{throw t})))).catch((r=>t.commit("API_FAILURE",{gid:e,error:r}))),addUserGroup(t,e){let{userid:r,gid:n}=e;return ae().then((e=>se((0,Xt.generateOcsUrl)("cloud/users/{userid}/groups",{userid:r}),{groupid:n}).then((e=>t.commit("addUserGroup",{userid:r,gid:n}))).catch((t=>{throw t})))).catch((e=>t.commit("API_FAILURE",{userid:r,error:e})))},removeUserGroup(t,e){let{userid:r,gid:n}=e;return ae().then((e=>ue((0,Xt.generateOcsUrl)("cloud/users/{userid}/groups",{userid:r}),{groupid:n}).then((e=>t.commit("removeUserGroup",{userid:r,gid:n}))).catch((t=>{throw t})))).catch((e=>{throw t.commit("API_FAILURE",{userid:r,error:e}),e}))},addUserSubAdmin(t,e){let{userid:r,gid:n}=e;return ae().then((e=>se((0,Xt.generateOcsUrl)("cloud/users/{userid}/subadmins",{userid:r}),{groupid:n}).then((e=>t.commit("addUserSubAdmin",{userid:r,gid:n}))).catch((t=>{throw t})))).catch((e=>t.commit("API_FAILURE",{userid:r,error:e})))},removeUserSubAdmin(t,e){let{userid:r,gid:n}=e;return ae().then((e=>ue((0,Xt.generateOcsUrl)("cloud/users/{userid}/subadmins",{userid:r}),{groupid:n}).then((e=>t.commit("removeUserSubAdmin",{userid:r,gid:n}))).catch((t=>{throw t})))).catch((e=>t.commit("API_FAILURE",{userid:r,error:e})))},wipeUserDevices:(t,e)=>ae().then((t=>se((0,Xt.generateOcsUrl)("cloud/users/{userid}/wipe",{userid:e})).catch((t=>{throw t})))).catch((r=>t.commit("API_FAILURE",{userid:e,error:r}))),deleteUser:(t,e)=>ae().then((r=>ue((0,Xt.generateOcsUrl)("cloud/users/{userid}",{userid:e})).then((r=>t.commit("deleteUser",e))).catch((t=>{throw t})))).catch((r=>t.commit("API_FAILURE",{userid:e,error:r}))),addUser(t,e){let{commit:r,dispatch:n}=t,{userid:o,password:a,displayName:i,email:s,groups:c,subadmin:u,quota:p,language:d,manager:l}=e;return ae().then((t=>se((0,Xt.generateOcsUrl)("cloud/users"),{userid:o,password:a,displayName:i,email:s,groups:c,subadmin:u,quota:p,language:d,manager:l}).then((t=>n("addUserData",o||t.data.ocs.data.id))).catch((t=>{throw t})))).catch((t=>{throw r("API_FAILURE",{userid:o,error:t}),t}))},addUserData:(t,e)=>ae().then((r=>ie((0,Xt.generateOcsUrl)("cloud/users/{userid}",{userid:e})).then((e=>t.commit("addUserData",e))).catch((t=>{throw t})))).catch((r=>t.commit("API_FAILURE",{userid:e,error:r}))),enableDisableUser(t,e){let{userid:r,enabled:n=!0}=e;const o=n?"enable":"disable";return ae().then((e=>ce((0,Xt.generateOcsUrl)("cloud/users/{userid}/{userStatus}",{userid:r,userStatus:o})).then((e=>t.commit("enableDisableUser",{userid:r,enabled:n}))).catch((t=>{throw t})))).catch((e=>t.commit("API_FAILURE",{userid:r,error:e})))},setUserData(t,e){let{userid:r,key:n,value:o}=e;const a=["email","displayname","manager"];return-1!==["email","language","quota","displayname","password","manager"].indexOf(n)&&"string"==typeof o&&(-1===a.indexOf(n)&&o.length>0||-1!==a.indexOf(n))?ae().then((e=>ce((0,Xt.generateOcsUrl)("cloud/users/{userid}",{userid:r}),{key:n,value:o}).then((e=>t.commit("setUserData",{userid:r,key:n,value:o}))).catch((t=>{throw t})))).catch((e=>t.commit("API_FAILURE",{userid:r,error:e}))):Promise.reject(new Error("Invalid request data"))},sendWelcomeMail:(t,e)=>ae().then((t=>se((0,Xt.generateOcsUrl)("cloud/users/{userid}/welcome",{userid:e})).then((t=>!0)).catch((t=>{throw t})))).catch((r=>t.commit("API_FAILURE",{userid:e,error:r})))}};var ve=o(3255),be=(o(36144),o(25108));const we={APPS_API_FAILURE(e,r){(0,ve.x2)(t("settings","An error occurred during the request. Unable to proceed.")+"<br>"+r.error.response.data.data.message,{isHTML:!0}),be.error(e,r)},initCategories(t,e){let{categories:r,updateCount:n}=e;t.categories=r,t.updateCount=n},updateCategories(t,e){t.gettingCategoriesPromise=e},setUpdateCount(t,e){t.updateCount=e},addCategory(t,e){t.categories.push(e)},appendCategories(t,e){t.categories=e},setAllApps(t,e){t.apps=e},setError(t,e){let{appId:r,error:n}=e;Array.isArray(r)||(r=[r]),r.forEach((e=>{t.apps.find((t=>t.id===e)).error=n}))},clearError(t,e){let{appId:r,error:n}=e;t.apps.find((t=>t.id===r)).error=null},enableApp(t,e){let{appId:r,groups:n}=e;const o=t.apps.find((t=>t.id===r));o.active=!0,o.groups=n},disableApp(t,e){const r=t.apps.find((t=>t.id===e));r.active=!1,r.groups=[],r.removable&&(r.canUnInstall=!0)},uninstallApp(t,e){t.apps.find((t=>t.id===e)).active=!1,t.apps.find((t=>t.id===e)).groups=[],t.apps.find((t=>t.id===e)).needsDownload=!0,t.apps.find((t=>t.id===e)).installed=!1,t.apps.find((t=>t.id===e)).canUnInstall=!1,t.apps.find((t=>t.id===e)).canInstall=!0},updateApp(t,e){const r=t.apps.find((t=>t.id===e)),n=r.update;r.update=null,r.version=n,t.updateCount--},resetApps(t){t.apps=[]},reset(t){t.apps=[],t.categories=[],t.updateCount=0},startLoading(t,e){Array.isArray(e)?e.forEach((e=>{a.default.set(t.loading,e,!0)})):a.default.set(t.loading,e,!0)},stopLoading(t,e){Array.isArray(e)?e.forEach((e=>{a.default.set(t.loading,e,!1)})):a.default.set(t.loading,e,!1)}},Ae={enableApp(e,r){let n,{appId:o,groups:a}=r;return n=Array.isArray(o)?o:[o],ae().then((r=>(e.commit("startLoading",n),e.commit("startLoading","install"),se((0,Xt.generateUrl)("settings/apps/enable"),{appIds:n,groups:a}).then((r=>(e.commit("stopLoading",n),e.commit("stopLoading","install"),n.forEach((t=>{e.commit("enableApp",{appId:t,groups:a})})),ie((0,Xt.generateUrl)("apps/files")).then((()=>{r.data.update_required&&((0,ve.JQ)(t("settings","The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds."),{onClick:()=>window.location.reload(),close:!1}),setTimeout((function(){location.reload()}),5e3))})).catch((()=>{Array.isArray(o)||e.commit("setError",{appId:n,error:t("settings","Error: This app cannot be enabled because it makes the server unstable")})}))))).catch((t=>{e.commit("stopLoading",n),e.commit("stopLoading","install"),e.commit("setError",{appId:n,error:t.response.data.data.message}),e.commit("APPS_API_FAILURE",{appId:o,error:t})}))))).catch((t=>e.commit("API_FAILURE",{appId:o,error:t})))},forceEnableApp(t,e){let r,{appId:n,groups:o}=e;return r=Array.isArray(n)?n:[n],ae().then((()=>(t.commit("startLoading",r),t.commit("startLoading","install"),se((0,Xt.generateUrl)("settings/apps/force"),{appId:n}).then((t=>{location.reload()})).catch((e=>{t.commit("stopLoading",r),t.commit("stopLoading","install"),t.commit("setError",{appId:r,error:e.response.data.data.message}),t.commit("APPS_API_FAILURE",{appId:n,error:e})}))))).catch((e=>t.commit("API_FAILURE",{appId:n,error:e})))},disableApp(t,e){let r,{appId:n}=e;return r=Array.isArray(n)?n:[n],ae().then((e=>(t.commit("startLoading",r),se((0,Xt.generateUrl)("settings/apps/disable"),{appIds:r}).then((e=>(t.commit("stopLoading",r),r.forEach((e=>{t.commit("disableApp",e)})),!0))).catch((e=>{t.commit("stopLoading",r),t.commit("APPS_API_FAILURE",{appId:n,error:e})}))))).catch((e=>t.commit("API_FAILURE",{appId:n,error:e})))},uninstallApp(t,e){let{appId:r}=e;return ae().then((e=>(t.commit("startLoading",r),ie((0,Xt.generateUrl)("settings/apps/uninstall/".concat(r))).then((e=>(t.commit("stopLoading",r),t.commit("uninstallApp",r),!0))).catch((e=>{t.commit("stopLoading",r),t.commit("APPS_API_FAILURE",{appId:r,error:e})}))))).catch((e=>t.commit("API_FAILURE",{appId:r,error:e})))},updateApp(t,e){let{appId:r}=e;return ae().then((e=>(t.commit("startLoading",r),t.commit("startLoading","install"),ie((0,Xt.generateUrl)("settings/apps/update/".concat(r))).then((e=>(t.commit("stopLoading","install"),t.commit("stopLoading",r),t.commit("updateApp",r),!0))).catch((e=>{t.commit("stopLoading",r),t.commit("stopLoading","install"),t.commit("APPS_API_FAILURE",{appId:r,error:e})}))))).catch((e=>t.commit("API_FAILURE",{appId:r,error:e})))},getAllApps:t=>(t.commit("startLoading","list"),ie((0,Xt.generateUrl)("settings/apps/list")).then((e=>(t.commit("setAllApps",e.data.apps),t.commit("stopLoading","list"),!0))).catch((e=>t.commit("API_FAILURE",e)))),async getCategories(t){let{shouldRefetchCategories:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e||!t.state.gettingCategoriesPromise){t.commit("startLoading","categories");try{const e=ie((0,Xt.generateUrl)("settings/apps/categories"));t.commit("updateCategories",e);const r=await e;return r.data.length>0?(t.commit("appendCategories",r.data),t.commit("stopLoading","categories"),!0):(t.commit("stopLoading","categories"),!1)}catch(e){t.commit("API_FAILURE",e)}}return t.state.gettingCategoriesPromise}},Ie={state:{apps:[],categories:[],updateCount:0,loading:{},loadingList:!1,gettingCategoriesPromise:null},mutations:we,getters:{loading:t=>function(e){return t.loading[e]},getCategories:t=>t.categories,getAllApps:t=>t.apps,getUpdateCount:t=>t.updateCount,getCategoryById:t=>e=>t.categories.find((t=>t.id===e))},actions:Ae},Ue={state:{serverData:{}},mutations:{setServerData(t,e){t.serverData=e}},getters:{getServerData:t=>t.serverData},actions:{}},Ce={state:{},mutations:{},getters:{},actions:{setAppConfig(t,e){let{app:r,key:n,value:o}=e;return ae().then((t=>se((0,Xt.generateOcsUrl)("apps/provisioning_api/api/v1/config/apps/{app}/{key}",{app:r,key:n}),{value:o}).catch((t=>{throw t})))).catch((e=>t.commit("API_FAILURE",{app:r,key:n,value:o,error:e})))}}};var Ee=o(25108);a.default.use(ee.ZP);const Le={API_FAILURE(e,r){try{const e=r.error.response.data.ocs.meta.message;(0,ve.x2)(t("settings","An error occurred during the request. Unable to proceed.")+"<br>"+e,{isHTML:!0})}catch(e){(0,ve.x2)(t("settings","An error occurred during the request. Unable to proceed."))}Ee.error(e,r)}},Pe=new ee.yh({modules:{users:ye,apps:Ie,settings:Ue,oc:Ce},strict:!1,mutations:Le});o(79954);const Oe=()=>Promise.all([o.e(7874),o.e(2246),o.e(8351)]).then(o.bind(o,43089)),Re=()=>Promise.all([o.e(7874),o.e(2246),o.e(7418)]).then(o.bind(o,51170));a.default.use(Qt);const xe=document.title,ke=new Qt({mode:"history",base:(0,Xt.generateUrl)(""),linkActiveClass:"active",routes:[{path:"/:index(index.php/)?settings/users",component:Oe,props:!0,name:"users",meta:{title:()=>t("settings","Active users")},children:[{path:":selectedGroup",name:"group",meta:{title:e=>"admin"===e.params.selectedGroup?t("settings","Admins"):"disabled"===e.params.selectedGroup?t("settings","Disabled users"):decodeURIComponent(e.params.selectedGroup)},component:Oe}]},{path:"/:index(index.php/)?settings/apps",component:Re,props:!0,name:"apps",meta:{title:()=>t("settings","Your apps")},children:[{path:":category",name:"apps-category",meta:{title:async e=>{if("apps"===e.name)return t("settings","Your apps");if(te.J[e.params.category])return te.J[e.params.category];await Pe.dispatch("getCategories");const r=Pe.getters.getCategoryById(e.params.category);return r.displayName?r.displayName:void 0}},component:Re,children:[{path:":id",name:"apps-details",component:Re}]}]}]});ke.afterEach((async t=>{var e,r;const n=await(null===(e=(r=t.meta).title)||void 0===e?void 0:e.call(r,t));n?(document.title="".concat(n," - ").concat(xe),function(t){const e=document.getElementById("page-heading-level-1");e&&(e.textContent=t)}(n)):document.title=xe}));const _e=ke;a.default.use(i.default,{defaultHtml:!1}),(0,s.Z)(Pe,_e),o.nc=btoa(OC.requestToken),a.default.prototype.t=t,a.default.prototype.n=n,a.default.prototype.OC=OC,a.default.prototype.OCA=OCA,a.default.prototype.oc_userconfig=oc_userconfig,new a.default({router:_e,store:Pe,render:t=>t(u)}).$mount("#content")},83678:(t,e)=>{function r(t,e){var n={name:t.name,path:t.path,hash:t.hash,query:t.query,params:t.params,fullPath:t.fullPath,meta:t.meta};return e&&(n.from=r(e)),Object.freeze(n)}e.Z=function(t,e,n){var o=(n||{}).moduleName||"route";t.registerModule(o,{namespaced:!0,state:r(e.currentRoute),mutations:{ROUTE_CHANGED:function(e,n){t.state[o]=r(n.to,n.from)}}});var a,i=!1,s=t.watch((function(t){return t[o]}),(function(t){var r=t.fullPath;r!==a&&(null!=a&&(i=!0,e.push(t)),a=r)}),{sync:!0}),c=e.afterEach((function(e,r){i?i=!1:(a=e.fullPath,t.commit(o+"/ROUTE_CHANGED",{to:e,from:r}))}));return function(){null!=c&&c(),null!=s&&s(),t.unregisterModule(o)}}},81490:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6Ii8+Cjwvc3ZnPgo="},90888:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6IiBzdHlsZT0iZmlsbC1vcGFjaXR5OjE7ZmlsbDojZmZmZmZmIi8+Cjwvc3ZnPgo="}},i={};function s(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={id:t,loaded:!1,exports:{}};return a[t].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=a,e=[],s.O=(t,r,n,o)=>{if(!r){var a=1/0;for(p=0;p<e.length;p++){r=e[p][0],n=e[p][1],o=e[p][2];for(var i=!0,c=0;c<r.length;c++)(!1&o||a>=o)&&Object.keys(s.O).every((t=>s.O[t](r[c])))?r.splice(c--,1):(i=!1,o<a&&(a=o));if(i){e.splice(p--,1);var u=n();void 0!==u&&(t=u)}}return t}o=o||0;for(var p=e.length;p>0&&e[p-1][2]>o;p--)e[p]=e[p-1];e[p]=[r,n,o]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,r)=>(s.f[r](t,e),e)),[])),s.u=t=>(({7418:"settings-apps-view",8351:"settings-users"}[t]||t)+"-"+t+".js?v="+{2246:"fd51db25f1735b342a9e",7418:"1f136063ad170643e46c",8351:"b43c19aa978b034663c3"}[t]),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r={},o="nextcloud:",s.l=(t,e,n,a)=>{if(r[t])r[t].push(e);else{var i,c;if(void 0!==n)for(var u=document.getElementsByTagName("script"),p=0;p<u.length;p++){var d=u[p];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==o+n){i=d;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",o+n),i.src=t),r[t]=[e];var l=(e,n)=>{i.onerror=i.onload=null,clearTimeout(h);var o=r[t];if(delete r[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((t=>t(n))),e)return e(n)},h=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),c&&document.head.appendChild(i)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=8562,(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!t;)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{s.b=document.baseURI||self.location.href;var t={8562:0};s.f.j=(e,r)=>{var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=t[e]=[r,o]));r.push(n[2]=o);var a=s.p+s.u(e),i=new Error;s.l(a,(r=>{if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+e,e)}},s.O.j=e=>0===t[e];var e=(e,r)=>{var n,o,a=r[0],i=r[1],c=r[2],u=0;if(a.some((e=>0!==t[e]))){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);if(c)var p=c(s)}for(e&&e(r);u<a.length;u++)o=a[u],s.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return s.O(p)},r=self.webpackChunknextcloud=self.webpackChunknextcloud||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})(),s.nc=void 0;var c=s.O(void 0,[7874],(()=>s(97268)));c=s.O(c)})();
  3. //# sourceMappingURL=settings-vue-settings-apps-users-management.js.map?v=d14664035ccdbf2405a3