define("user_picker",["cla_select2"],function(e){return function(e){function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="/components/",n(n.s="./assets/js/user_picker.js")}({"./assets/js/user_picker.js":function(e,n,t){t(1),t("./web/intranet/js/user_picker.js"),e.exports=null},"./web/intranet/js/user_picker.js":function(e,n){window.UserPicker_SetUser=function(e,n,t){var r=jq_$(e);return r.html(),r.append('<option selected value="'+n+'">'+_.escape(t)+"</option>"),r.change(),r.trigger("cla-user-change"),!0},window.UserPicker_DeleteSelected=function(e){var n=jq_$(e);return n.val(""),n.trigger("change"),!1},window.UserPicker_InitSelect2Single=function(e,n,t,r){var a=jq_$(e),i=a.parent(".js-picker-input-group"),o=i.find(".js-input-group-append .js-input-btn"),s="calc(100% - "+o.getHiddenOffsetWidth()+"px)";a.select2({placeholder:t,minimumInputLength:3,allowClear:r,width:s,ajax:{url:"/intranet/common/user_picker_popup.php?json=1"+n,dataType:"json",delay:250,data:function(e){return{keywords:e.term,page:e.page,page_size:50,st:50*(e.page-1)}},processResults:function(e,n){return n.page=n.page||1,{results:e.data,pagination:{more:50*n.page<e.total}}},escapeMarkup:function(e){var n=document.createElement("span");return n.textContent=e,n.innerHTML}}})},window.UserPicker_InitSelect2SUGRE=function(e,n,t,r,a){var i=jq_$(e),o=String;if(a){o="calc(100% - "+(i.siblings(".js-input-btn").getHiddenOffsetWidth()+4)+"px)"}else o="100%";i.select2({placeholder:t,minimumInputLength:1,width:o,allowClear:r,ajax:{url:"/intranet/common/common_perms_owners_popup.php?json=1"+n,dataType:"json",data:function(e){return{query:e.term}},processResults:function(e){return jQuery.each(e.data,function(n,t){e.data[n]={id:t[0]+"_"+t[1],text:e.suggestions[n]}}),{results:e.data}},escapeMarkup:function(e){var n=document.createElement("span");return n.textContent=e,n.innerHTML}}})},window.UserPicker_InitSelect2=function(e,n,t){var r=jq_$(e);r.select2({placeholder:t,minimumInputLength:1,ajax:{url:"/intranet/common/user_picker_popup.php?json=1&multi=1"+n,dataType:"json",data:function(e){return{keywords:e.term,page:e.page,page_size:50,st:50*(e.page-1)}},processResults:function(e,n){return n.page=n.page||1,{results:e.data,pagination:{more:50*n.page<e.total}}},escapeMarkup:function(e){var n=document.createElement("span");return n.textContent=e,n.innerHTML}}})},window.UserPicker_AddUser=function(e,n,t){var r=jq_$(e),a=jQuery("option[value="+n+"]",r);if(a.size()>0){if(a.prop("selected"))return!1;a.prop("selected",!0)}else r.append(jQuery("<option>&nbsp; &nbsp; &nbsp; </option>").val(n).text(t).prop("selected",!0));return r.change(),r.trigger("cla-user-change"),!0}},1:function(n,t){n.exports=e}})});
//# sourceMappingURL=user_picker.js.map