!function(a,b,c,d){a.fn.popup=function(e){var f,g=a(this),h=a(c),i=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.fn.popup.settings,j=g.selector||"",k=(new Date).getTime(),l=[],m=arguments[0],n="string"==typeof m,o=[].slice.call(arguments,1);return g.each(function(){var c,e=a(this),g=a(b),p=e.offsetParent(),q=i.inline?e.next(i.selector.popup):g.children(i.selector.popup).last(),r=0,s="."+i.namespace,t=i.namespace+"-module",u=i.selector,v=i.className,w=i.error,x=i.metadata,y=i.namespace,z=this,A=e.data(t);c={initialize:function(){c.debug("Initializing module",e),"hover"==i.on?e.on("mouseenter"+s,c.event.mouseenter).on("mouseleave"+s,c.event.mouseleave):e.on(i.on+""+s,c.event[i.on]),g.on("resize"+s,c.event.resize),c.instantiate()},instantiate:function(){c.verbose("Storing instance of module",c),A=c,e.data(t,A)},refresh:function(){q=i.inline?e.next(u.popup):g.children(u.popup).last(),p=e.offsetParent()},destroy:function(){c.debug("Destroying previous module"),e.off(s).removeData(t)},event:{mouseenter:function(b){var d=this;c.timer=setTimeout(function(){a.proxy(c.toggle,d)(),a(d).hasClass(v.visible)&&b.stopPropagation()},i.delay)},mouseleave:function(){clearTimeout(c.timer),e.is(":visible")&&c.hide()},click:function(b){a.proxy(c.toggle,this)(),a(this).hasClass(v.visible)&&b.stopPropagation()},resize:function(){q.is(":visible")&&c.position()}},create:function(){c.debug("Creating pop-up html");var b=e.data(x.html)||i.html,d=e.data(x.variation)||i.variation,f=e.data(x.title)||i.title,g=e.data(x.content)||e.attr("title")||i.content;b||g||f?(b||(b=i.template({title:f,content:g})),q=a("
").addClass(v.popup).addClass(d).html(b),i.inline?(c.verbose("Inserting popup element inline"),q.insertAfter(e)):(c.verbose("Appending popup element to body"),q.appendTo(a("body"))),a.proxy(i.onInit,q)()):c.error(w.content)},remove:function(){c.debug("Removing popup"),q.remove()},get:{offstagePosition:function(){var d={top:a(b).scrollTop(),bottom:a(b).scrollTop()+a(b).height(),left:0,right:a(b).width()},e={width:q.width(),height:q.outerHeight(),position:q.offset()},f={},g=[];return e.position&&(f={top:e.position.topd.bottom,right:e.position.left+e.width>d.right,left:e.position.left0?g.join(" "):!1},nextPosition:function(a){switch(a){case"top left":a="bottom left";break;case"bottom left":a="top right";break;case"top right":a="bottom right";break;case"bottom right":a="top center";break;case"top center":a="bottom center";break;case"bottom center":a="right center";break;case"right center":a="left center";break;case"left center":a="top center"}return a}},toggle:function(){e=a(this),c.debug("Toggling pop-up"),c.refresh(),e.hasClass(v.visible)||("click"==i.on&&c.hideAll(),c.show())},position:function(d,f){var h,j,k=(a(b).width(),a(b).height(),e.outerWidth()),l=e.outerHeight(),m=q.width(),n=q.outerHeight(),o=i.inline?e.position():e.offset(),s=i.inline?p.outerWidth():g.outerWidth(),t=i.inline?p.outerHeight():g.outerHeight();switch(d=d||e.data(x.position)||i.position,f=f||e.data(x.arrowOffset)||i.arrowOffset,c.debug("Calculating offset for position",d),d){case"top left":h={bottom:t-o.top+i.distanceAway,right:s-o.left-k-f,top:"auto",left:"auto"};break;case"top center":h={bottom:t-o.top+i.distanceAway,left:o.left+k/2-m/2+f,top:"auto",right:"auto"};break;case"top right":h={top:"auto",bottom:t-o.top+i.distanceAway,left:o.left+f};break;case"left center":h={top:o.top+l/2-n/2,right:s-o.left+i.distanceAway-f,left:"auto",bottom:"auto"};break;case"right center":h={top:o.top+l/2-n/2,left:o.left+k+i.distanceAway+f,bottom:"auto",right:"auto"};break;case"bottom left":h={top:o.top+l+i.distanceAway,right:s-o.left-k-f,left:"auto",bottom:"auto"};break;case"bottom center":h={top:o.top+l+i.distanceAway,left:o.left+k/2-m/2+f,bottom:"auto",right:"auto"};break;case"bottom right":h={top:o.top+l+i.distanceAway,left:o.left+f,bottom:"auto",right:"auto"}}return a.extend(h,{width:q.width()+1}),q.attr("class",d+" "+v.popup+" "+v.loading).css(h),j=c.get.offstagePosition(),j?(c.debug("Element is outside boundaries ",j),r0&&(console.groupCollapsed(b),console.table?console.table(l):a.each(l,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),l=[]}},invoke:function(b,e,g){var h,i,j;return e=e||o,g=z||g,"string"==typeof b&&A!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(e,f){var g=e!=h?f+b[e+1].charAt(0).toUpperCase()+b[e+1].slice(1):b;if(a.isPlainObject(A[f])&&e!=h)A=A[f];else{if(!a.isPlainObject(A[g])||e==h)return A[f]!==d?(i=A[f],!1):A[g]!==d?(i=A[g],!1):(c.error(w.method),!1);A=A[g]}})),a.isFunction(i)?j=i.apply(g,e):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},n?(A===d&&c.initialize(),c.invoke(m)):(A!==d&&c.destroy(),c.initialize())}),f!==d?f:this},a.fn.popup.settings={name:"Popup",debug:!0,verbose:!0,performance:!0,namespace:"popup",onInit:function(){},onShow:function(){},onHide:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",clicktoClose:!0,position:"top center",delay:150,inline:!0,duration:150,easing:"easeOutQuint",transition:"scale",distanceAway:0,arrowOffset:0,maxSearchDepth:10,error:{content:"Your popup has no content specified",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{arrowOffset:"arrowOffset",content:"content",html:"html",position:"position",title:"title",variation:"variation"},className:{popup:"ui popup",visible:"visible",loading:"loading"},selector:{popup:".ui.popup"},template:function(a){var b="";return typeof a!==d&&(typeof a.title!==d&&a.title&&(b+=''),typeof a.content!==d&&a.content&&(b+=''+a.content+"
")),b}}}(jQuery,window,document);