YUI.add("moodle-core-event",function(e,o){var n,t,r,c;if(M.core=M.core||{},n=!!M.core.event,M.core.event=M.core.event||{FILTER_CONTENT_UPDATED:"filter-content-updated",EDITOR_CONTENT_RESTORED:"editor-content-restored",FORM_SUBMIT_AJAX:"form-submit-ajax"},M.core.globalEvents=M.core.globalEvents||{FORM_ERROR:"form_error",BLOCK_CONTENT_UPDATED:"block_content_updated"},!n){for(r in t={emitFacade:!0,defaultFn:function(e){},preventedFn:function(e){},stoppedFn:function(e){}},M.core.event)M.core.event.hasOwnProperty(r)&&null===e.getEvent(M.core.event[r])&&e.publish(M.core.event[r],t);for(r in M.core.globalEvents)M.core.globalEvents.hasOwnProperty(r)&&null===e.Global.getEvent(M.core.globalEvents[r])&&e.Global.publish(M.core.globalEvents[r],e.merge(t,{broadcast:!0}));c=function(o,n){new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){e instanceof Element&&e.matches(o)&&n(e)})})}).observe(document,{childList:!0,subtree:!0})},require(["core_form/events"],function(n){c("form",function(o){e.one(o).on(M.core.event.FORM_SUBMIT_AJAX,function(e){e&&e.fallbackHandled||n.notifyFormSubmittedByJavascript(o,window.skipValidation,!0)})})})}},"@VERSION@",{requires:["event-custom"]});YUI.add("moodle-core-widget-focusafterclose",function(t,e){function i(){t.after(this._bindUIFocusAfterHide,this,"bindUI"),this.get("rendered")&&this._bindUIFocusAfterHide()}i.ATTRS={focusOnPreviousTargetAfterHide:{value:!1},focusAfterHide:{value:null,type:t.Node}},i.prototype={_uiHandlesFocusAfterHide:[],_showFocusAfterHide:null,_previousTargetFocusAfterHide:null,initializer:function(){this.get("focusOnPreviousTargetAfterHide")&&this.show&&(this._showFocusAfterHide=this.show,this.show=function(e){this._showFocusAfterHide.apply(this,arguments),this._previousTargetFocusAfterHide=null,e&&e.currentTarget&&(this._previousTargetFocusAfterHide=e.currentTarget)})},destructor:function(){new t.EventHandle(this.uiHandleFocusAfterHide).detach()},_bindUIFocusAfterHide:function(){new t.EventHandle(this.uiHandleFocusAfterHide).detach(),this.uiHandleFocusAfterHide=[this.after("visibleChange",this._afterHostVisibleChangeFocusAfterHide)]},_afterHostVisibleChangeFocusAfterHide:function(){this.get("visible")||this._attemptFocus(this._previousTargetFocusAfterHide)||this._attemptFocus(this.get("focusAfterHide"))},_attemptFocus:function(e){e=t.one(e);return!!(e=e&&e.ancestor('input:not([type="hidden"]), a[href], button, textarea, select, [tabindex], [contenteditable="true"]',!0))&&(e.focus(),!0)}},t.namespace("M.core").WidgetFocusAfterHide=i},"@VERSION@",{requires:["base-build","widget"]});/* YUI 3.17.2 (build 9c3c78e) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("plugin",function(e,t){function n(t){!this.hasImpl||!this.hasImpl(e.Plugin.Base)?n.superclass.constructor.apply(this,arguments):n.prototype.initializer.apply(this,arguments)}n.ATTRS={host:{writeOnce:!0}},n.NAME="plugin",n.NS="plugin",e.extend(n,e.Base,{_handles:null,initializer:function(e){this._handles=[]},destructor:function(){if(this._handles)for(var e=0,t=this._handles.length;e').append(s.Node.create('').append(s.Node.create('
')).append(s.Node.create('
')).append(s.Node.create('
'))),e.attachmentPoint=e.attachmentPoint||document.body,s.one(e.attachmentPoint).append(e.notificationBase),e.srcNode="#"+t,delete e.buttons,i.superclass.constructor.apply(this,[e])},s.Panel,{_resizeevent:null,_orientationevent:null,_calculatedzindex:!"form",_currentMaskNodeId:null,_originalPosition:null,_hiddenSiblings:null,hideIfNotForm:function(){null===this.get("boundingBox").one("form")&&this.hide()},initializer:function(){var e,t;!1!==this.get("closeButton")&&(e=this.get("closeButtonTitle"),this.get("buttons").header[0].setAttribute("title",e),this.get("buttons").header[0].setAttribute("aria-label",e)),this.setStdModContent(s.WidgetStdMod.HEADER,'
'+this.get("headerContent")+"
",s.WidgetStdMod.REPLACE),this._hiddenSiblings=[],this.get("render")&&this.render(),this.after("visibleChange",this.visibilityChanged,this),this.get("center")&&this.centerDialogue(),this.get("modal")&&(this.get(d).set("aria-hidden","true"),this.plug(s.M.core.LockScroll)),this.set("focusOn",s.Array(this.get("focusOn")).filter(function(e){return"focusoutside"!==e.eventName})),s.one("document").on("orientationchange",function(){this.centerDialogOnVisible()},this),s.one("window").on("resize",function(){this.centerDialogOnVisible()},this),this.centerDialogOnDialogSizeChange(this),(e=this.get("boundingBox")).addClass(a),s.Array.each(this.get("extraClasses"),e.addClass,e),this.get("visible")&&(this.applyZIndex(),this.applyAndTrapFocus(),this.get("modal")&&this.setAccessibilityVisible()),this.on("maskShow",this.applyZIndex),this.on("maskShow",function(){var e,t=s.one(s.config.win),i=this.get("boundingBox");this.get("center")||(this._originalPosition=i.getXY()),e=this.get("maskNode"),this._currentMaskNodeId!==e.get("_yuid")&&(this._currentMaskNodeId=e.get("_yuid"),e.on("click",this.hideIfNotForm,this)),"fixed"!==i.getStyle("position")&&i.setStyles({top:t.get("scrollTop"),left:t.get("scrollLeft")})},this),e=this.get("notificationBase"),""!==(t=this.get("additionalBaseClass"))&&e.addClass(t),this.after("destroyedChange",function(){this.get(d).remove(!0)},this)},applyZIndex:function(){var e,t=1040,i=this.get("boundingBox"),o=this.get("maskNode"),n=this.get("zIndex");0===n||this._calculatedzindex?(s.all(" [role=dialog], [role=menubar], ."+a).each(function(e){e=this.findZIndex(e);t'),e=i.Node.create('
').append(i.Node.create('
'+this.get("message")+"
")).append(i.Node.create('
').append(t)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,e,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'
'+this.get("title")+"
",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this)),(e=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(e.on("click",this.submit,this))},submit:function(){new i.EventHandle(this._closeEvents).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:"Moodle alert",CSS_PREFIX:"moodle-dialogue",ATTRS:{title:{validator:i.Lang.isString,value:"Alert"},message:{validator:i.Lang.isString,value:"Confirm"},yesLabel:{validator:i.Lang.isString,setter:function(t){return t=t||"OK"},value:"OK"}}}),M.core.alert=e},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});YUI.add("moodle-core-notification-exception",function(o,e){var a;M.core=M.core||{},o.extend(a=function(i){var t=o.mix({},i);t.width=t.width||M.cfg.developerdebug?Math.floor(o.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,o.Array.each(["message","name","fileName","lineNumber","stack"],function(e){t[e]=i[e]}),a.superclass.constructor.apply(this,[t])},M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(e){var i=this,t=this.get("hideTimeoutDelay"),a=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(o.WidgetStdMod.HEADER,'
'+o.Escape.html(e.name)+"
",o.WidgetStdMod.REPLACE),e=o.Node.create('
').append(o.Node.create('
'+o.Escape.html(this.get("message"))+"
")).append(o.Node.create('")).append(o.Node.create('")).append(o.Node.create('")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),t&&(this._hideTimeout=setTimeout(function(){i.hide()},t)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=o.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){var i;"visible"===e.attrName&&e.prevVal&&!e.newVal&&(this._keypress&&this._keypress.detach(),i=this,setTimeout(function(){i.destroy()},1e3))}},{NAME:"Moodle exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=o.Escape.html(e).split("\n"),a=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$");for(i in t)t[i]=t[i].replace(a,"
ln: $4
$3
$1
");return t.join("\n")},value:""},hideTimeoutDelay:{validator:o.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});YUI.add("moodle-core-notification-ajaxexception",function(a,e){var t;M.core=M.core||{},a.extend(t=function(e){e.name=e.name||M.util.get_string("error","moodle"),e.closeButton=!0,t.superclass.constructor.apply(this,[e])},M.core.notification.info,{_keypress:null,initializer:function(e){var t=this,i=this.get("hideTimeoutDelay"),o=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(a.WidgetStdMod.HEADER,'
'+a.Escape.html(e.name)+"
",a.WidgetStdMod.REPLACE),e=a.Node.create('
').append(a.Node.create('
'+a.Escape.html(this.get("error"))+"
")).append(a.Node.create('")).append(a.Node.create('")).append(a.Node.create('")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(a.WidgetStdMod.BODY,e,a.WidgetStdMod.REPLACE),i&&(this._hideTimeout=setTimeout(function(){t.hide()},i)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=a.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){var t;"visible"===e.attrName&&e.prevVal&&!e.newVal&&((t=this)._keypress.detach(),setTimeout(function(){t.destroy()},1e3))}},{NAME:"Moodle AJAX exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:a.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return e=null!==e?''+e.replace(M.cfg.wwwroot,"")+"":e},value:null},hideTimeoutDelay:{validator:a.Lang.isNumber,value:null}}}),M.core.ajaxException=t},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});YUI.add("moodle-filter_glossary-autolinker",function(c,e){var t=function(){t.superclass.constructor.apply(this,arguments)};c.extend(t,c.Base,{overlay:null,alertpanels:{},initializer:function(){var i=this;require(["core/event"],function(o){c.delegate("click",function(e){e.preventDefault();var n,t=c.Node.create('
'),e=new c.Overlay({headerContent:"",bodyContent:t});window.require(["core/templates"],function(e){e.renderPix("i/loading","core").then(function(e){t.append(e)})}),(i.overlay=e).render(c.one(document.body)),n=this.getAttribute("href").replace("showentry.php","showentry_ajax.php"),c.io(n,{method:"get",context:i,on:{success:function(e,t){this.display_callback(t.responseText,o)},failure:function(e,t){var o=t.statusText;M.cfg.developerdebug&&(t.statusText+=" ("+n+")"),new M.core.exception({message:o})}}})},c.one(document.body),"a.glossary.autolink.concept")})},display_callback:function(e,t){var o,n,i,r,a,l;try{if((o=c.JSON.parse(e)).success){for(n in this.overlay.hide(),o.entries)a=o.entries[n].definition+o.entries[n].attachments,i=new M.core.alert({title:o.entries[n].concept,draggable:!0,message:a,modal:!1,yesLabel:M.util.get_string("ok","moodle")}),t.notifyFilterContentUpdated(i.get("boundingBox").getDOMNode()),c.Node.one("#id_yuialertconfirm-"+i.get("COUNT")).focus(),r="#moodle-dialogue-"+i.get("COUNT"),i.on("complete",this._deletealertpanel,this,r),c.Object.isEmpty(this.alertpanels)||(l=this._getLatestWindowPosition(),c.Node.one(r).setXY([l[0]+10,l[1]+10])),this.alertpanels[r]=c.Node.one(r).getXY();return!0}o.error&&new M.core.ajaxException(o)}catch(s){new M.core.exception(s)}return!1},_getLatestWindowPosition:function(){var t=[0,0];return c.Object.each(this.alertpanels,function(e){e[0]>t[0]&&(t=e)}),t},_deletealertpanel:function(e,t){delete this.alertpanels[t]}},{NAME:"Glossary filter autolinker",ATTRS:{url:{validator:c.Lang.isString,value:M.cfg.wwwroot+"/mod/glossary/showentry.php"},name:{validator:c.Lang.isString,value:"glossaryconcept"},options:{getter:function(){return{width:this.get("width"),height:this.get("height"),menubar:this.get("menubar"),location:this.get("location"),scrollbars:this.get("scrollbars"),resizable:this.get("resizable"),toolbar:this.get("toolbar"),status:this.get("status"),directories:this.get("directories"),fullscreen:this.get("fullscreen"),dependent:this.get("dependent")}},readOnly:!0},width:{value:600},height:{value:450},menubar:{value:!1},location:{value:!1},scrollbars:{value:!0},resizable:{value:!0},toolbar:{value:!0},status:{value:!0},directories:{value:!1},fullscreen:{value:!1},dependent:{value:!0}}}),M.filter_glossary=M.filter_glossary||{},M.filter_glossary.init_filter_autolinking=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","io-base","json-parse","event-delegate","overlay","moodle-core-event","moodle-core-notification-alert","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]});