require.config({paths:{"xwiki-selectize":"../../../../../../resources/uicomponents/suggest/xwiki.selectize.js?v=12.6"}});define("xwiki-selectize-utils",["jquery"],function(a){var b=function(d,e){return function(f){if(f.length<e.limit){return d.call(null,e).then(function(g){if(a.isArray(g)){f.push.apply(f,g.slice(0,e.limit-f.length));f.sort(c)}return f},function(){return a.Deferred().resolve(f)})}else{return f}}};var c=function(d,e){return d.label.localeCompare(e.label)};return{loadSuggestions:function(d,e){return d.reduce(function(g,f){return g.then(b(f,e))},a.Deferred().resolve([]))}}});define("xwiki-suggestUsers",["jquery","xwiki-selectize-utils","xwiki-selectize"],function(e,b){var d=function(h){return{create:true,load:function(i,j){g(h.attr("data-userScope"),{input:i,limit:10,}).done(j).fail(j)},loadSelected:function(i,j){g(h.attr("data-userScope"),{input:i,exactMatch:true}).done(j).fail(j)}}};var g=function(h,i){if(h==="LOCAL_AND_GLOBAL"){return a(i)}else{if(h==="GLOBAL_ONLY"){return f(i)}else{return c(i)}}};var a=function(h){return b.loadSuggestions([c,f],h)};var f=function(h){return c(e.extend(h,{wiki:"global"}))};var c=function(h){return e.getJSON(XWiki.currentDocument.getURL("get"),e.extend(h,{xpage:"uorgsuggest",media:"json",uorg:"user"}))};e.fn.suggestUsers=function(h){return this.each(function(){e(this).xwikiSelectize(e.extend(d(e(this)),h))})};return{loadUsers:g}});define("xwiki-suggestGroups",["jquery","xwiki-selectize-utils","xwiki-selectize"],function(f,a){var d=function(h){return{create:true,load:function(i,j){b(h.attr("data-userScope"),{input:i,limit:10}).done(j).fail(j)},loadSelected:function(i,j){b(h.attr("data-userScope"),{input:i,exactMatch:true}).done(j).fail(j)}}};var b=function(h,i){if(XWiki.currentWiki!==XWiki.mainWiki&&h!=="LOCAL_ONLY"){return c(i)}else{return g(i)}};var c=function(h){return a.loadSuggestions([g,e],h)};var e=function(h){return g(f.extend(h,{wiki:"global"}))};var g=function(h){return f.getJSON(XWiki.currentDocument.getURL("get"),f.extend(h,{xpage:"uorgsuggest",media:"json",uorg:"group"}))};f.fn.suggestGroups=function(h){return this.each(function(){f(this).xwikiSelectize(f.extend(d(f(this)),h))})}});require(["jquery","xwiki-suggestUsers","xwiki-suggestGroups","xwiki-events-bridge"],function(a){var b=function(d,e){var c=a((e&&e.elements)||document);c.find(".suggest-users").suggestUsers();c.find(".suggest-groups").suggestGroups()};a(document).on("xwiki:dom:updated",b);XWiki.domIsLoaded&&b()});