(function(){"use strict";page.using={texts:["button_text","xsel_text","xsel_sendtoreps_text"]};var e,t,n;page.commandBindings=$.extend(page.commandBindings,{Send:o,Cancel:i});page.onLoad=function(){e=this.popup;e.setTitle($t("TXT_xsel_sendtoreps_text_0"));n=e.__data;r();s()};function r(){t={queryName:n.name}}function s(){$("#contents").utml({data:t,itemOptions:{parent:page}})}function o(){var t=$u("#sendTo").first().getValue();if(!u8.tools.isArray(t)){t=[t]}t=u8.services.reps.toRepId(t);t=t.filter(function(e){return!!e});if(t.length==0){return u8.services.notification.error($t("TXT_xsel_sendtoreps_text_8"))}var r=$u("#queryName").first().getValue(),s={queryName:n.uri?n.uri:n.name,queryLookupScope:n.queryLookupScope,toRepIds:t,queryTargetName:r,notifyMessage:$c("notifyReps")?$t("TXT_xsel_sendtoreps_text_10"):null,overwriteExisting:$c("overwriteExisting")?true:false};u8.request("QueryChannel.SendToReps",{request:s},function(t,n){var r=n.response;if(!r||n.error){return}e.close()})}function i(){e.close({cancel:true})}})();