!function(a,b,c,d){a.fn.popup=function(e){var f,g=a(this),h=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.fn.popup.settings,i=g.selector||"",j=(new Date).getTime(),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var e,o=a(this),p=a(b),q=o.offsetParent(),r=h.inline?o.next(h.selector.popup):p.children(h.selector.popup).last(),s=0,t="."+h.namespace,u=h.namespace+"-module",v=h.selector,w=h.className,x=h.error,y=h.metadata,z=h.namespace,A=this,B=o.data(u);e={initialize:function(){e.debug("Initializing module",o),"hover"==h.on?o.on("mouseenter"+t,e.event.mouseenter).on("mouseleave"+t,e.event.mouseleave):o.on(h.on+""+t,e.event[h.on]),p.on("resize"+t,e.event.resize),e.instantiate()},instantiate:function(){e.verbose("Storing instance of module",e),B=e,o.data(u,B)},refresh:function(){r=h.inline?o.next(v.popup):p.children(v.popup).last(),q=o.offsetParent()},destroy:function(){e.debug("Destroying previous module"),o.off(t).removeData(u)},event:{mouseenter:function(b){var c=this;e.timer=setTimeout(function(){a.proxy(e.toggle,c)(),a(c).hasClass(w.visible)&&b.stopPropagation()},h.delay)},mouseleave:function(){clearTimeout(e.timer),o.is(":visible")&&e.hide()},click:function(b){a.proxy(e.toggle,this)(),a(this).hasClass(w.visible)&&b.stopPropagation()},resize:function(){r.is(":visible")&&e.position()}},create:function(){e.debug("Creating pop-up html");var b=o.data(y.html)||h.html,c=o.data(y.variation)||h.variation,d=o.data(y.title)||h.title,f=o.data(y.content)||o.attr("title")||h.content;b||f||d?(b||(b=h.template({title:d,content:f})),r=a("
").addClass(w.popup).addClass(c).html(b),h.inline?(e.verbose("Inserting popup element inline"),r.insertAfter(o)):(e.verbose("Appending popup element to body"),r.appendTo(a("body"))),a.proxy(h.onInit,r)()):e.error(x.content)},remove:function(){e.debug("Removing popup"),r.remove()},get:{offstagePosition:function(){var c={top:a(b).scrollTop(),bottom:a(b).scrollTop()+a(b).height(),left:0,right:a(b).width()},d={width:r.width(),height:r.outerHeight(),position:r.offset()},e={},f=[];return d.position&&(e={top:d.position.topc.bottom,right:d.position.left+d.width>c.right,left:d.position.left0?f.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(){o=a(this),e.debug("Toggling pop-up"),e.refresh(),o.hasClass(w.visible)?e.hide():(e.hideAll(),e.show())},position:function(c,d){var f,g,i=(a(b).width(),a(b).height(),o.outerWidth()),j=o.outerHeight(),k=r.width(),l=r.outerHeight(),m=h.inline?o.position():o.offset(),n=h.inline?q.outerWidth():p.outerWidth(),t=h.inline?q.outerHeight():p.outerHeight();switch(c=c||o.data(y.position)||h.position,d=d||o.data(y.arrowOffset)||h.arrowOffset,e.debug("Calculating offset for position",c),c){case"top left":f={top:"auto",bottom:t-m.top+h.distanceAway,left:m.left+d};break;case"top center":f={bottom:t-m.top+h.distanceAway,left:m.left+i/2-k/2+d,top:"auto",right:"auto"};break;case"top right":f={bottom:t-m.top+h.distanceAway,right:n-m.left-i-d,top:"auto",left:"auto"};break;case"left center":f={top:m.top+j/2-l/2,right:n-m.left+h.distanceAway-d,left:"auto",bottom:"auto"};break;case"right center":f={top:m.top+j/2-l/2,left:m.left+i+h.distanceAway+d,bottom:"auto",right:"auto"};break;case"bottom left":f={top:m.top+j+h.distanceAway,left:m.left+d,bottom:"auto",right:"auto"};break;case"bottom center":f={top:m.top+j+h.distanceAway,left:m.left+i/2-k/2+d,bottom:"auto",right:"auto"};break;case"bottom right":f={top:m.top+j+h.distanceAway,right:n-m.left-i-d,left:"auto",bottom:"auto"}}return a.extend(f,{width:r.width()+1}),r.removeAttr("style").removeClass("top right bottom left center").css(f).addClass(c).addClass(w.loading),g=e.get.offstagePosition(),g?(e.debug("Element is outside boundaries ",g),s1&&g.size()>1&&(b+=" ("+g.size()+")"),(console.group!==d||console.table!==d)&&k.length>0&&(console.groupCollapsed(b),console.table?console.table(k):a.each(k,function(a,b){console.log(b.Name+": "+b["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(b,c,g){var h,i,j;return c=c||n,g=A||g,"string"==typeof b&&B!==d&&(b=b.split(/[\. ]/),h=b.length-1,a.each(b,function(c,f){var g=c!=h?f+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(B[f])&&c!=h)B=B[f];else{if(!a.isPlainObject(B[g])||c==h)return B[f]!==d?(i=B[f],!1):B[g]!==d?(i=B[g],!1):(e.error(x.method),!1);B=B[g]}})),a.isFunction(i)?j=i.apply(g,c):i!==d&&(j=i),a.isArray(f)?f.push(j):"string"==typeof f?f=[f,j]:j!==d&&(f=j),i}},m?(B===d&&e.initialize(),e.invoke(l)):(B!==d&&e.destroy(),e.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+='
'+a.title+'
'),typeof a.content!==d&&a.content&&(b+='
'+a.content+"
")),b}}}(jQuery,window,document);