YUI.add("moodle-core-tooltip",function(e,t){function n(e){e||(e={}),typeof e.draggable=="undefined"&&(e.draggable=!0),typeof e.constrain=="undefined"&&(e.constrain=!0),typeof e.lightbox=="undefined"&&(e.lightbox=!1),n.superclass.constructor.apply(this,[e])}var r={CLOSEBUTTON:".closebutton"},i={PANELTEXT:"tooltiptext"},s={WAITICON:{pix:"i/loading_small",component:"moodle"}},o={};n.NAME="moodle-core-tooltip",n.CSS_PREFIX="moodle-dialogue",n.ATTRS=o,o.initialheadertext={value:""},o.initialbodytext={value:"",setter:function(t){var n,r;return n=e.Node.create("
").addClass(i.PANELTEXT),r=e.Node.create("").setAttribute("src",M.util.image_url(s.WAITICON.pix,s.WAITICON.component)).addClass("spinner"),t?(n.set("text",t),r.addClass("iconsmall")):n.addClass("content-lightbox"),n.append(r),n}},o.initialfootertext={value:null,setter:function(t){if(t)return e.Node.create("
").set("text",t)}},o.headerhandler={value:"set_header_content"},o.bodyhandler={value:"set_body_content"},o.footerhandler={value:null},o.urlmodifier={value:null},o.textcache={value:null},o.textcachesize={value:10},e.extend(n,M.core.dialogue,{bb:null,listenevents:[],textcache:null,alignpoints:[e.WidgetPositionAlign.TL,e.WidgetPositionAlign.RC],initializer:function(){return this.get("headerhandler")||this.set("headerhandler",this.set_header_content),this.get("bodyhandler")||this.set("bodyhandler",this.set_body_content),this.get("footerhandler")||this.set("footerhandler",function(){}),this.get("urlmodifier")||this.set("urlmodifier",this.modify_url),this.setAttrs({headerContent:this.get("initialheadertext"),bodyContent:this.get("initialbodytext"),footerContent:this.get("initialfootertext")}),this.hide(),this.render(),this.bb=this.get("boundingBox"),this.bb.addClass("moodle-dialogue-tooltip"),right_to_left()&&(this.alignpoints=[e.WidgetPositionAlign.TR,e.WidgetPositionAlign.LC]),this.get("textcache")||this.set("textcache",new e.Cache({max:this.get("textcachesize")})),M.cfg.developerdebug&&this.get("textcache").set("max",0),this},display_panel:function(t){var n,i,s,o,u;t.preventDefault(),t.stopPropagation(),this.cancel_events(),n=t.target.ancestor("a",!0),this.setAttrs({headerContent:this.get("initialheadertext"),bodyContent:this.get("initialbodytext"),footerContent:this.get("initialfootertext")}),this.show(),this.align(n,this.alignpoints),i=this.bb.delegate("click",this.close_panel,r.CLOSEBUTTON,this),this.listenevents.push(i),i=e.one("body").on("key",this.close_panel,"esc",this),this.listenevents.push(i),i=this.bb.on("mousedownoutside",this.close_panel,this),this.listenevents.push(i),s=e.bind(this.get("urlmodifier"),this,n.get("href"))(),u=this.get("textcache").retrieve(s),u?this._set_panel_contents(u.response):(o={method:"get",context:this,sync:!1,on:{complete:function(e,t){this._set_panel_contents(t.responseText,s)}}},e.io(s,o))},_set_panel_contents:function(t,n){var r;try{r=e.JSON.parse(t);if(r.error)return this.close_panel(),new M.core.ajaxException(r)}catch(i){return this.close_panel(),new M.core.exception(i)}e.bind(this.get("headerhandler"),this,r)(),e.bind(this.get("bodyhandler"),this,r)(),e.bind(this.get("footerhandler"),this,r)(),n&&this.get("textcache").add(n,t),this.get("buttons").header[0].focus()},set_header_content:function(e){this.set("headerContent",e.heading)},set_body_content:function(t){var n=e.Node.create("
").set("innerHTML",t.text).setAttribute("role","alert").addClass(i.PANELTEXT);this.set("bodyContent",n)},modify_url:function(e){return e.replace(/\.php\?/,"_ajax.php?")},close_panel:function(e){this.hide(),this.cancel_events(),e&&e.preventDefault()},cancel_events:function(){var e;while(this.listenevents.length)e=this.listenevents.shift(),e.detach()}}),M.core=M.core||{},M.core.tooltip=M.core.tooltip=n},"@VERSION@",{requires:["base","node","io-base","moodle-core-notification","json-parse","widget-position","widget-position-align","event-outside","cache-base"]}); YUI.add("moodle-core-dock-loader",function(e,t){var n="moodle-core-dock-loader";M.core=M.core||{},M.core.dock=M.core.dock||{},M.core.dock.ensureMoveToIconExists=function(t){if(t.one(".moveto"))return!0;var n,r=e.Node.create(''),i=t.one(".block_action"),s="t/block_to_dock",o=t.one(".header .title h2");return e.one(document.body).hasClass("dir-rtl")&&(s+="_rtl"),r.setAttribute("alt",M.util.get_string("addtodock","block")),o&&r.setAttribute("title",e.Escape.html(M.util.get_string("dockblock","block",o.getHTML()))),r.setAttribute("src",M.util.image_url(s,"moodle")),i?i.prepend(r):(n=t.one(".header .title .commands"),!n&&t.one(".header .title")&&(n=e.Node.create('
'),t.one(".header .title").append(n)),n.append(r)),!0},M.core.dock.loader=M.core.dock.loader||{},M.core.dock.loader.delegationEvents=[],M.core.dock.loader.initLoader=function(){var t=e.all(".block[data-instanceid][data-dockable]"),n=e.one(document.body),r;t.each(function(){var e=parseInt(this.getData("instanceid"),10);M.core.dock.ensureMoveToIconExists(this)}),t.some(function(e){return e.hasClass("dock_on_load")})?e.use("moodle-core-dock",function(){M.core.dock.init()}):(r=function(t){var n,r=this.ancestor(".block[data-instanceid]"),i=r.getData("instanceid");t.halt();for(n in M.core.dock.loader.delegationEvents)(e.Lang.isNumber(n)||e.Lang.isString(n))&&M.core.dock.loader.delegationEvents[n].detach();r.addClass("dock_on_load"),e.use("moodle-core-dock",function(){M.util.set_user_preference("docked_block_instance_"+i,1),M.core.dock.init()})},M.core.dock.loader.delegationEvents.push(n.delegate("click",r,".moveto")),M.core.dock.loader.delegationEvents.push(n.delegate("key",r,".moveto","enter")))}},"@VERSION@",{requires:["escape"]}); YUI.add("moodle-core-notification-dialogue",function(e,t){var n,r,i,s,o,u,a,f;n="moodle-dialogue",r="notificationBase",i=0,s="yesLabel",o="noLabel",u="title",a="question",f={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var l="Moodle dialogue",c,h=n+"-fullscreen",p=n+"-hidden",d=" [role=dialog]",v="[role=menubar]",m=".moodle-has-zindex",g='input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]';c=function(t){var n=e.clone(t);i++;var r="moodle-dialogue-"+i;n.notificationBase=e.Node.create('
').append(e.Node.create('').append(e.Node.create('
')).append(e.Node.create('
')).append(e.Node.create('
'))),e.one(document.body).append(n.notificationBase),n.additionalBaseClass&&n.notificationBase.addClass(n.additionalBaseClass),n.srcNode="#"+r,n.render=typeof n.render!="undefined"?n.render:!0,n.width=n.width||"400px",n.center=n.centered&&!0,n.centered=!1,n.COUNT=i,n.width==="auto"&&delete n.width,n.lightbox!==!1&&(n.modal=!0),delete n.lightbox,n.closeButton===!1?n.buttons=null:n.buttons=[{section:e.WidgetStdMod.HEADER,classNames:"closebutton",action:function(){this.hide()}}],c.superclass.constructor.apply(this,[n]),n.closeButton!==!1&&this.get("buttons").header[0].setAttribute("title",this.get("closeButtonTitle"))},e.extend(c,e.Panel,{_resizeevent:null,_orientationevent:null,_calculatedzindex:!1,initializer:function(t){var n;t.render&&!this.get("rendered")&&this.render(),this.makeResponsive(),this.after("visibleChange",this.visibilityChanged,this),t.center&&this.centerDialogue(),this.set("COUNT",i),this.get("modal")&&this.plug(e.M.core.LockScroll),n=this.get("boundingBox"),t.extraClasses&&e.Array.each(t.extraClasses,n.addClass,n),t.visible&&this.applyZIndex(),this.on("maskShow",this.applyZIndex),t.visible&&(this.show(),this.keyDelegation())},applyZIndex:function(){var t=1,n=1,r=this.get("boundingBox"),i=this.get("maskNode"),s=this.get("zIndex");s!==0&&!this._calculatedzindex?r.setStyle("zIndex",s):(e.all(d+", "+v+", "+m).each(function(e){var n=this.findZIndex(e);n>t&&(t=n)},this),n=(t+1).toString(),r.setStyle("zIndex",n),i.setStyle("zIndex",n),this.set("zIndex",n),this._calculatedzindex=!0)},findZIndex:function(e){var t=e.getStyle("zIndex")||e.ancestor().getStyle("zIndex");return t?parseInt(t,10):0},visibilityChanged:function(t){var n,r;t.attrName==="visible"&&(this.get("maskNode").addClass(f.LIGHTBOX),t.prevVal&&!t.newVal&&(r=this.get("boundingBox"),this._resizeevent&&(this._resizeevent.detach(),this._resizeevent=null),this._orientationevent&&(this._orientationevent.detach(),this._orientationevent=null),r.detach("key",this.keyDelegation)),!t.prevVal&&t.newVal&&(this.applyZIndex(),this.makeResponsive(),this.shouldResizeFullscreen()||this.get("draggable")&&(n="#"+this.get("id")+" ."+f.HEADER,this.plug(e.Plugin.Drag,{handles:[n]}),e.one(n).setStyle("cursor","move")),this.keyDelegation()),this.get("center")&&!t.prevVal&&t.newVal&&this.centerDialogue())},makeResponsive:function(){var t=this.get("boundingBox"),n;this.shouldResizeFullscreen()?(t.addClass(h),t.setStyles({left:null,top:null,width:null,height:null,right:null,bottom:null}),n=e.one("#"+this.get("id")+" ."+f.BODY)):this.get("responsive")&&(t.removeClass(h).setStyles({width:this.get("width"),height:this.get("height")}),n=e.one("#"+this.get("id")+" ."+f.BODY))},centerDialogue:function(){var t=this.get("boundingBox"),n=t.hasClass(p),r,i;if(this.shouldResizeFullscreen())return;n&&t.setStyle("top","-1000px").removeClass(p),r=Math.max(Math.round((t.get("winWidth")-t.get("offsetWidth"))/2),15),i=Math.max(Math.round((t.get("winHeight")-t.get("offsetHeight"))/2),15)+e.one(window).get("scrollTop"),t.setStyles({left:r,top:i}),n&&t.addClass(p)},shouldResizeFullscreen:function(){return window===window.parent&&this.get("responsive")&&Math.floor(e.one(document.body).get("winWidth"))