/*
* # Fomantic UI - 2.8.4
* https://github.com/fomantic/Fomantic-UI
* http://fomantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(V,W,M,z){"use strict";V.isFunction=V.isFunction||function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},W=void 0!==W&&W.Math==Math?W:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),V.fn.popup=function(x){var E,t=V(this),k=V(M),S=V(W),A=V("body"),F=t.selector||"",O="ontouchstart"in M.documentElement?"touchstart":"click",D=(new Date).getTime(),j=[],R=x,H="string"==typeof R,N=[].slice.call(arguments,1);return t.each(function(){var u,l,t,e,o,c,d=V.isPlainObject(x)?V.extend(!0,{},V.fn.popup.settings,x):V.extend({},V.fn.popup.settings),i=d.selector,f=d.className,h=d.error,g=d.metadata,n=d.namespace,r="."+d.namespace,a="module-"+n,m=V(this),s=V(d.context),p=V(d.scrollContext),v=V(d.boundary),b=d.target?V(d.target):m,w=0,y=!1,P=!1,C=this,T=m.data(a);c={initialize:function(){c.debug("Initializing",m),c.createID(),c.bind.events(),!c.exists()&&d.preserve&&c.create(),d.observeChanges&&c.observeChanges(),c.instantiate()},instantiate:function(){c.verbose("Storing instance",c),T=c,m.data(a,T)},observeChanges:function(){"MutationObserver"in W&&((t=new MutationObserver(c.event.documentChanged)).observe(M,{childList:!0,subtree:!0}),c.debug("Setting up mutation observer",t))},refresh:function(){d.popup?u=V(d.popup).eq(0):d.inline&&(u=b.nextAll(i.popup).eq(0),d.popup=u),d.popup?(u.addClass(f.loading),l=c.get.offsetParent(),u.removeClass(f.loading),d.movePopup&&c.has.popup()&&c.get.offsetParent(u)[0]!==l[0]&&(c.debug("Moving popup to the same offset parent as target"),u.detach().appendTo(l))):l=d.inline?c.get.offsetParent(b):c.has.popup()?c.get.offsetParent(u):A,l.is("html")&&l[0]!==A[0]&&(c.debug("Setting page as offset parent"),l=A),c.get.variation()&&c.set.variation()},reposition:function(){c.refresh(),c.set.position()},destroy:function(){c.debug("Destroying previous module"),t&&t.disconnect(),u&&!d.preserve&&c.removePopup(),clearTimeout(c.hideTimer),clearTimeout(c.showTimer),c.unbind.close(),c.unbind.events(),m.removeData(a)},event:{start:function(t){var e=V.isPlainObject(d.delay)?d.delay.show:d.delay;clearTimeout(c.hideTimer),(!P||P&&d.addTouchEvents)&&(c.showTimer=setTimeout(c.show,e))},end:function(){var t=V.isPlainObject(d.delay)?d.delay.hide:d.delay;clearTimeout(c.showTimer),c.hideTimer=setTimeout(c.hide,t)},touchstart:function(t){P=!0,d.addTouchEvents&&c.show()},resize:function(){c.is.visible()&&c.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==C||0").addClass(f.popup).data(g.activator,m).html(t),d.inline?(c.verbose("Inserting popup element inline",u),u.insertAfter(m)):(c.verbose("Appending popup element to body",u),u.appendTo(s)),c.refresh(),c.set.variation(),d.hoverable&&c.bind.popup(),d.onCreate.call(u,C)):d.popup?(V(d.popup).data(g.activator,m),c.verbose("Used popup specified in settings"),c.refresh(),d.hoverable&&c.bind.popup()):0!==b.next(i.popup).length?(c.verbose("Pre-existing popup found"),d.inline=!0,d.popup=b.next(i.popup).data(g.activator,m),c.refresh(),d.hoverable&&c.bind.popup()):c.debug("No content specified skipping display",C)},createID:function(){o=(Math.random().toString(16)+"000000000").substr(2,8),e="."+o,c.verbose("Creating unique id for element",o)},toggle:function(){c.debug("Toggling pop-up"),c.is.hidden()?(c.debug("Popup is hidden, showing pop-up"),c.unbind.close(),c.show()):(c.debug("Popup is visible, hiding pop-up"),c.hide())},show:function(t){if(t=t||function(){},c.debug("Showing pop-up",d.transition),c.is.hidden()&&(!c.is.active()||!c.is.dropdown())){if(c.exists()||c.create(),!1===d.onShow.call(u,C))return void c.debug("onShow callback returned false, cancelling popup animation");d.preserve||d.popup||c.refresh(),u&&c.set.position()&&(c.save.conditions(),d.exclusive&&c.hideAll(),c.animate.show(t))}},hide:function(t){if(t=t||function(){},c.is.visible()||c.is.animating()){if(!1===d.onHide.call(u,C))return void c.debug("onHide callback returned false, cancelling popup animation");c.remove.visible(),c.unbind.close(),c.restore.conditions(),c.animate.hide(t)}},hideAll:function(){V(i.popup).filter("."+f.popupVisible).each(function(){V(this).data(g.activator).popup("hide")})},exists:function(){return!!u&&(d.inline||d.popup?c.has.popup():1<=u.closest(s).length)},removePopup:function(){c.has.popup()&&!d.popup&&(c.debug("Removing popup",u),u.remove(),u=z,d.onRemove.call(u,C))},save:{conditions:function(){c.cache={title:m.attr("title")},c.cache.title&&m.removeAttr("title"),c.verbose("Saving original attributes",c.cache.title)}},restore:{conditions:function(){return c.cache&&c.cache.title&&(m.attr("title",c.cache.title),c.verbose("Restoring original attributes",c.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=V.isFunction(t)?t:function(){},d.transition&&V.fn.transition!==z&&m.transition("is supported")?(c.set.visible(),u.transition({animation:d.transition+" in",queue:!1,debug:d.debug,verbose:d.verbose,duration:d.duration,onComplete:function(){c.bind.close(),t.call(u,C),d.onVisible.call(u,C)}})):c.error(h.noTransition)},hide:function(t){t=V.isFunction(t)?t:function(){},c.debug("Hiding pop-up"),d.transition&&V.fn.transition!==z&&m.transition("is supported")?u.transition({animation:d.transition+" out",queue:!1,duration:d.duration,debug:d.debug,verbose:d.verbose,onComplete:function(){c.reset(),t.call(u,C),d.onHidden.call(u,C)}}):c.error(h.noTransition)}},change:{content:function(t){u.html(t)}},get:{html:function(){return m.removeData(g.html),m.data(g.html)||d.html},title:function(){return m.removeData(g.title),m.data(g.title)||d.title},content:function(){return m.removeData(g.content),m.data(g.content)||d.content||m.attr("title")},variation:function(){return m.removeData(g.variation),m.data(g.variation)||d.variation},popup:function(){return u},popupOffset:function(){return u.offset()},calculations:function(){var t,e=c.get.offsetParent(u),o=b[0],n=v[0]==W,i=d.inline||d.popup&&d.movePopup?b.position():b.offset(),r=n?{top:0,left:0}:v.offset(),a={},s=n?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0};if(a={target:{element:b[0],width:b.outerWidth(),height:b.outerHeight(),top:i.top,left:i.left,margin:{}},popup:{width:u.outerWidth(),height:u.outerHeight()},parent:{width:l.outerWidth(),height:l.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:s.top,left:s.left},width:v.width(),height:v.height()}},e.get(0)!==l.get(0)){var p=e.offset();a.target.top-=p.top,a.target.left-=p.left,a.parent.width=e.outerWidth(),a.parent.height=e.outerHeight()}return d.setFluidWidth&&c.is.fluid()&&(a.container={width:u.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=d.inline?parseInt(W.getComputedStyle(o).getPropertyValue("margin-top"),10):0,a.target.margin.left=d.inline?c.is.rtl()?parseInt(W.getComputedStyle(o).getPropertyValue("margin-right"),10):parseInt(W.getComputedStyle(o).getPropertyValue("margin-left"),10):0,t=a.screen,a.boundary={top:t.top+t.scroll.top,bottom:t.top+t.scroll.top+t.height,left:t.left+t.scroll.left,right:t.left+t.scroll.left+t.width},a},id:function(){return o},startEvent:function(){return"hover"==d.on?"mouseenter":"focus"==d.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==d.on?"mouseleave":"focus"==d.on&&"blur"},distanceFromBoundary:function(t,e){var o,n,i={};return o=(e=e||c.get.calculations()).popup,n=e.boundary,t&&(i={top:t.top-n.top,left:t.left-n.left,right:n.right-(t.left+o.width),bottom:n.bottom-(t.top+o.height)},c.verbose("Distance from boundaries determined",t,i)),i},offsetParent:function(t){var e=(t!==z?t[0]:b[0]).parentNode,o=V(e);if(e)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");e&&!r&&i&&n;)e=e.parentNode,n="none"===(o=V(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(t){var e={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(t)?(t=t.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=V.fn.popup.settings.templates.escape;return typeof t!==z&&(typeof t.title!==z&&t.title&&(t.title=o(t.title),e+='"),typeof t.content!==z&&t.content&&(t.content=o(t.content),e+=''+t.content+"
")),e}}}}(jQuery,window,document);