YUI.add("moodle-calendar-info",function(e,t){var n="aria-controls",r="boundingBox",i="[data-core_calendar-title]",s="calendartable",o="core_calendar-",u=".",a="eventcontent",f="delay",l="eventtitle",c="innerHTML",h=function(){h.superclass.constructor.apply(this,arguments)};e.extend(h,e.Base,{_showTimer:null,_hideTimer:null,_panel:null,_currentDay:null,initializer:function(){var t=e.one(e.config.doc.body);t.delegate(["mouseenter","focus"],this._startShow,i,this),t.delegate(["mouseleave","blur"],this._startHide,i,this)},_initOverlay:function(){return this._panel||(this._panel=new e.Overlay({headerContent:e.Node.create('<h2 class="'+l+'"/>'),bodyContent:e.Node.create('<div class="'+a+'"/>'),visible:!1,render:!0}),this._panel.get(r).addClass("calendar-event-panel")),this},_startShow:function(t){if(this._isCurrentDayVisible(t.currentTarget))return;this._cancelHide()._cancelShow()._initOverlay(),this._showTimer=setTimeout(e.bind(function(){var e=t.target.ancestor(i,!0);this._show(e)},this),this.get(f))},_show:function(t){var i=this._panel.get(r),f=e.WidgetPositionAlign,h=t.ancestor(u+s);i.one(u+l).set(c,t.getData(o+"title")),i.one(u+a).set(c,t.getData(o+"popupcontent")),this._currentDay&&this._currentDay.setAttribute(n,null),t.setAttribute(n,t.get("id")),t.appendChild(i),this._currentDay=t,this._panel.constrain(h),this._panel.set("width",h.get("offsetWidth")+"px").align(h,[f.TC,f.TC]).show(),i.setAttribute("tabindex","0").focus()},_cancelShow:function(){return this._showTimer&&clearTimeout(this._showTimer),this},_startHide:function(t){if(t.type==="blur"&&t.currentTarget.contains(t.target))return;this._cancelShow()._cancelHide(),this._hideTimer=setTimeout(e.bind(function(){this._hide()},this),this.get(f))},_hide:function(){this._panel&&this._panel.hide()},_cancelHide:function(){return this._hideTimer&&clearTimeout(this._hideTimer),this},_isCurrentDayVisible:function(e){return!this._panel||!this._panel.get("visible")?!1:e!==this._currentDay?!1:!0}},{NAME:"calendarInfo",ATTRS:{delay:{value:300}}}),e.namespace("M.core_calendar.info").init=function(e){return new h(e)}},"@VERSION@",{requires:["base","node","event-mouseenter","event-key","overlay","moodle-calendar-info-skin"]});
