YUI.add("moodle-block_xp-rulepicker",function(i,e){var t={INFO:"info",PREFIX:"block_xp-rulepicker",RULE:"rule"},d=".rule",o=function(){o.superclass.constructor.apply(this,arguments)};i.namespace("M.block_xp").RulePicker=i.extend(o,M.core.dialogue,{prepared:!1,initializer:function(){this.publish("picked")},close:function(){this.hide()},display:function(){this.prepared||this.prepare(),this.show()},picked:function(e){e.preventDefault(),this.close(),this.fire("picked",e.currentTarget.getData("id"))},prepare:function(){var e="<div>";e=i.Handlebars.compile('<div> {{#rules}} <div class="{{../CSS.RULE}}" data-id="{{id}}" tabindex="0" role="button"       aria-describedby="block_xp_rulepicker_rule_title_{{id}}">   <h3 id="block_xp_rulepicker_rule_title_{{id}}">{{ name }}</h3>   {{#info}}   <div class="{{../../CSS.INFO}}">     {{ . }}   </div>   {{/info}} </div> {{/rules}}</div>'),this.getStdModNode(i.WidgetStdMod.HEADER).prepend(i.Node.create("<h1>"+this.get("title")+"</h1>")),e=i.Node.create(e({CSS:t,rules:this.get("rules")})),this.setStdModContent(i.WidgetStdMod.BODY,e,i.WidgetStdMod.REPLACE),this.get("boundingBox").one(".moodle-dialogue-wrap").addClass("moodle-dialogue-content"),this.get("boundingBox").delegate("click",this.picked,d,this),this.get("boundingBox").delegate("key",this.picked,"32, 13",d,this),this.prepared=!0}},{NAME:e,CSS_PREFIX:t.PREFIX,ATTRS:{rules:{validator:i.Lang.isObject,value:null}}}),i.Base.modifyAttrs(i.namespace("M.block_xp.RulePicker"),{modal:{value:!0},render:{value:!0},title:{valueFn:function(){return M.util.get_string("pickaconditiontype","block_xp")}},visible:{value:!1},width:{value:"500px"}}),i.namespace("M.block_xp.RulePicker").init=function(e){return new o(e)}},"@VERSION@",{requires:["base","node","handlebars","moodle-core-notification-dialogue"]});