!function(a,b,c,d){"use strict";a.fn.popup=function(e){var f,g=a(this),h=a(c),i=g.selector||"",j=("ontouchstart"in c.documentElement,(new Date).getTime()),k=[],l=arguments[0],m="string"==typeof l,n=[].slice.call(arguments,1);return g.each(function(){var c,g,o,p=a.isPlainObject(e)?a.extend(!0,{},a.fn.popup.settings,e):a.extend({},a.fn.popup.settings),q=p.selector,r=p.className,s=p.error,t=p.metadata,u=p.namespace,v="."+p.namespace,w="module-"+u,x=a(this),y=a(p.context),z=p.target?a(p.target):x,A=a(b),B=a("body"),C=0,D=this,E=x.data(w);o={initialize:function(){o.debug("Initializing module",x),o.refresh(),"click"==p.on?x.on("click"+v,o.toggle):o.get.startEvent()&&x.on(o.get.startEvent()+v,o.event.start).on(o.get.endEvent()+v,o.event.end),p.target&&o.debug("Target set to element",z),A.on("resize"+v,o.event.resize),o.exists()?p.hoverable&&o.bind.popup():o.create(),o.instantiate()},instantiate:function(){o.verbose("Storing instance of module",o),E=o,x.data(w,E)},refresh:function(){c=p.popup?a(p.popup):p.inline?z.next(p.selector.popup):!1,g=p.popup?c.offsetParent():p.inline?z.offsetParent():B},destroy:function(){o.debug("Destroying previous module"),c&&!p.preserve&&o.remove(),x.off(v).removeData(w)},event:{start:function(){var b=a.isPlainObject(p.delay)?p.delay.show:p.delay;clearTimeout(o.hideTimer),o.showTimer=setTimeout(function(){!o.is.hidden()||o.is.active()&&o.is.dropdown()||o.show()},b)},end:function(){var b=a.isPlainObject(p.delay)?p.delay.hide:p.delay;clearTimeout(o.showTimer),o.hideTimer=setTimeout(function(){o.is.visible()&&o.hide()},b)},resize:function(){o.is.visible()&&o.set.position()}},create:function(){var b=x.data(t.html)||p.html,e=x.data(t.variation)||p.variation,f=x.data(t.title)||p.title,g=x.data(t.content)||x.attr("title")||p.content;b||g||f?(o.debug("Creating pop-up html"),b||(b=p.templates.popup({title:f,content:g})),c=a("
").addClass(r.popup).addClass(e).html(b),e&&c.addClass(e),p.inline?(o.verbose("Inserting popup element inline",c),c.insertAfter(x)):(o.verbose("Appending popup element to body",c),c.appendTo(y)),p.hoverable&&o.cache===d&&o.bind.popup(),a.proxy(p.onCreate,c)()):0!==z.next(p.selector.popup).size()?(o.verbose("Pre-existing popup found, reverting to inline"),p.inline=!0,o.refresh()):o.error(s.content,D)},toggle:function(){o.debug("Toggling pop-up"),o.is.hidden()?(o.debug("Popup is hidden, showing pop-up"),o.unbind.close(),o.hideAll(),o.show()):(o.debug("Popup is visible, hiding pop-up"),o.hide())},show:function(a){a=a||function(){},o.debug("Showing pop-up",p.transition),p.preserve||p.popup||o.refresh(),o.exists()||o.create(),c&&o.set.position()&&(o.save.conditions(),o.animate.show(a))},hide:function(a){a=a||function(){},x.removeClass(r.visible),o.unbind.close(),o.is.visible()&&(o.restore.conditions(),o.animate.hide(a))},hideAll:function(){a(q.popup).filter(":visible").popup("hide")},hideGracefully:function(b){b&&0===a(b.target).closest(q.popup).size()?(o.debug("Click occurred outside popup hiding popup"),o.hide()):o.debug("Click was inside popup, keeping popup open")},exists:function(){return c?p.inline||p.popup?0!==c.size():c.closest(y).size():!1},remove:function(){o.debug("Removing popup"),c.remove()},save:{conditions:function(){o.cache={title:x.attr("title")},o.cache.title&&x.removeAttr("title"),o.verbose("Saving original attributes",o.cache.title)}},restore:{conditions:function(){return o.cache&&o.cache.title&&(x.attr("title",o.cache.title),o.verbose("Restoring original attributes",o.cache.title)),!0}},animate:{show:function(b){b=b||function(){},x.addClass(r.visible),p.transition&&a.fn.transition!==d&&x.transition("is supported")?c.transition(p.transition+" in",p.duration,function(){o.bind.close(),a.proxy(b,D)()}):c.stop().fadeIn(p.duration,p.easing,function(){o.bind.close(),a.proxy(b,D)()}),a.proxy(p.onShow,D)()},hide:function(b){b=b||function(){},o.debug("Hiding pop-up"),p.transition&&a.fn.transition!==d&&x.transition("is supported")?c.transition(p.transition+" out",p.duration,function(){o.reset(),b()}):c.stop().fadeOut(p.duration,p.easing,function(){o.reset(),b()}),a.proxy(p.onHide,D)()}},get:{startEvent:function(){return"hover"==p.on?"mouseenter":"focus"==p.on?"focus":!1},endEvent:function(){return"hover"==p.on?"mouseleave":"focus"==p.on?"blur":!1},offstagePosition:function(){var d={top:a(b).scrollTop(),bottom:a(b).scrollTop()+a(b).height(),left:0,right:a(b).width()},e={width:c.width(),height:c.outerHeight(),offset:c.offset()},f={},g=[];return e.offset&&(f={top:e.offset.topd.bottom,right:e.offset.left+e.width>d.right,left:e.offset.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}},set:{position:function(e,f){var h,i,j=(a(b).width(),a(b).height(),z.outerWidth()),k=z.outerHeight(),l=c.outerWidth(),m=c.outerHeight(),n=g.outerWidth(),q=g.outerHeight(),u=p.distanceAway,v=z[0],w=p.inline?parseInt(b.getComputedStyle(v).getPropertyValue("margin-top"),10):0,y=p.inline?parseInt(b.getComputedStyle(v).getPropertyValue("margin-left"),10):0,A=p.inline||p.popup?z.position():z.offset();switch(e=e||x.data(t.position)||p.position,f=f||x.data(t.offset)||p.offset,p.inline&&(o.debug("Adding targets margin to calculation"),"left center"==e||"right center"==e?(f+=w,u+=-y):"top left"==e||"top center"==e||"top right"==e?(f+=y,u-=w):(f+=y,u+=w)),o.debug("Calculating popup positioning",e),e){case"top left":h={top:"auto",bottom:q-A.top+u,left:A.left+f,right:"auto"};break;case"top center":h={bottom:q-A.top+u,left:A.left+j/2-l/2+f,top:"auto",right:"auto"};break;case"top right":h={bottom:q-A.top+u,right:n-A.left-j-f,top:"auto",left:"auto"};break;case"left center":h={top:A.top+k/2-m/2+f,right:n-A.left+u,left:"auto",bottom:"auto"};break;case"right center":h={top:A.top+k/2-m/2+f,left:A.left+j+u,bottom:"auto",right:"auto"};break;case"bottom left":h={top:A.top+k+u,left:A.left+f,bottom:"auto",right:"auto"};break;case"bottom center":h={top:A.top+k+u,left:A.left+j/2-l/2+f,bottom:"auto",right:"auto"};break;case"bottom right":h={top:A.top+k+u,right:n-A.left-j-f,left:"auto",bottom:"auto"}}return h===d&&o.error(s.invalidPosition),c.css(h).removeClass(r.position).addClass(e).addClass(r.loading),i=o.get.offstagePosition(),i?(o.debug("Element is outside boundaries",i),C0&&(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,e){var g,h,i,j=E;return c=c||n,e=D||e,"string"==typeof b&&j!==d&&(b=b.split(/[\. ]/),g=b.length-1,a.each(b,function(c,e){var f=c!=g?e+b[c+1].charAt(0).toUpperCase()+b[c+1].slice(1):b;if(a.isPlainObject(j[f])&&c!=g)j=j[f];else{if(j[f]!==d)return h=j[f],!1;if(!a.isPlainObject(j[e])||c==g)return j[e]!==d?(h=j[e],!1):!1;j=j[e]}})),a.isFunction(h)?i=h.apply(e,c):h!==d&&(i=h),a.isArray(f)?f.push(i):f!==d?f=[f,i]:i!==d&&(f=i),h}},m?(E===d&&o.initialize(),o.invoke(l)):(E!==d&&o.destroy(),o.initialize())}),f!==d?f:this},a.fn.popup.settings={name:"Popup",debug:!1,verbose:!1,performance:!1,namespace:"popup",onCreate:function(){},onRemove:function(){},onShow:function(){},onHide:function(){},variation:"",content:!1,html:!1,title:!1,on:"hover",closable:!0,context:"body",position:"top left",delay:{show:50,hide:0},target:!1,popup:!1,inline:!1,preserve:!0,hoverable:!1,duration:200,easing:"easeOutQuint",transition:"scale",distanceAway:0,offset:0,maxSearchDepth:10,error:{content:"Your popup has no content specified",invalidPosition:"The position you specified is not a valid position",method:"The method you called is not defined.",recursion:"Popup attempted to reposition element to fit, but could not find an adequate position."},metadata:{content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",animating:"animating",dropdown:"dropdown",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(a){var b=/[&<>"'`]/g,c=/[&<>"'`]/,d={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},e=function(a){return d[a]};return c.test(a)?a.replace(b,e):a},popup:function(b){var c="",e=a.fn.popup.settings.templates.escape;return typeof b!==d&&(typeof b.title!==d&&b.title&&(b.title=e(b.title),c+='
'+b.title+"
"),typeof b.content!==d&&b.content&&(b.content=e(b.content),c+='
'+b.content+"
")),c}}},a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}})}(jQuery,window,document);