/* * # Fomantic UI - 2.9.0-beta.293+2a71b5e * https://github.com/fomantic/Fomantic-UI * http://fomantic-ui.com/ * * Copyright 2022 Contributors * Released under the MIT license * http://opensource.org/licenses/MIT * */ !function(O,z,A,w){"use strict";O.isFunction=O.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},z=void 0!==z&&z.Math==Math?z:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.fn.visibility=function(h){var x,e=O(this),P=e.selector||"",y=(new Date).getTime(),C=[],S=h,R="string"==typeof S,V=[].slice.call(arguments,1),k=e.length,T=0;return e.each(function(){var e,o,n,i=O.isPlainObject(h)?O.extend(!0,{},O.fn.visibility.settings,h):O.extend({},O.fn.visibility.settings),t=i.className,s=i.namespace,r=i.error,c=i.metadata,a="."+s,l="module-"+s,d=O(z),u=O(this),f=[z,A].indexOf(i.context)<0?O(A).find(i.context):O(i.context),b=u.data(l),g=z.requestAnimationFrame||z.mozRequestAnimationFrame||z.webkitRequestAnimationFrame||z.msRequestAnimationFrame||function(e){setTimeout(e,0)},m=this,p=!1,v={initialize:function(){v.debug("Initializing",i),v.setup.cache(),v.should.trackChanges()&&("image"==i.type&&v.setup.image(),"fixed"==i.type&&v.setup.fixed(),i.observeChanges&&v.observeChanges(),v.bind.events()),v.save.position(),v.is.visible()||v.error(r.visible,u),i.initialCheck&&v.checkVisibility(),v.instantiate()},instantiate:function(){v.debug("Storing instance",v),u.data(l,v),b=v},destroy:function(){v.verbose("Destroying previous module"),n&&n.disconnect(),o&&o.disconnect(),d.off("load"+a,v.event.load).off("resize"+a,v.event.resize),f.off("scroll"+a,v.event.scroll).off("scrollchange"+a,v.event.scrollchange),"fixed"==i.type&&(v.resetFixed(),v.remove.placeholder()),u.off(a).removeData(l)},observeChanges:function(){"MutationObserver"in z&&(o=new MutationObserver(v.event.contextChanged),n=new MutationObserver(v.event.changed),o.observe(A,{childList:!0,subtree:!0}),n.observe(m,{childList:!0,subtree:!0}),v.debug("Setting up mutation observer",n))},bind:{events:function(){v.verbose("Binding visibility events to scroll and resize"),i.refreshOnLoad&&d.on("load"+a,v.event.load),d.on("resize"+a,v.event.resize),f.off("scroll"+a).on("scroll"+a,v.event.scroll).on("scrollchange"+a,v.event.scrollchange)}},event:{changed:function(e){v.verbose("DOM tree modified, updating visibility calculations"),v.timer=setTimeout(function(){v.verbose("DOM tree modified, updating sticky menu"),v.refresh()},100)},contextChanged:function(e){[].forEach.call(e,function(e){e.removedNodes&&[].forEach.call(e.removedNodes,function(e){(e==m||0=e.length&&O.isFunction(o)&&o()};n--;)(s=A.createElement("img")).onload=c,s.onerror=c,s.src=e[n],i.push(s)},enableCallbacks:function(){v.debug("Allowing callbacks to occur"),p=!1},disableCallbacks:function(){v.debug("Disabling all callbacks temporarily"),p=!0},should:{trackChanges:function(){return R?(v.debug("One time query, no need to bind events"),!1):(v.debug("Callbacks being attached"),!0)}},setup:{cache:function(){v.cache={occurred:{},screen:{},element:{}}},image:function(){var e=u.data(c.src);e&&(v.verbose("Lazy loading image",e),i.once=!0,i.observeChanges=!1,i.onOnScreen=function(){v.debug("Image on screen",m),v.precache(e,function(){v.set.image(e,function(){++T==k&&i.onAllLoaded.call(this),i.onLoad.call(this)})})})},fixed:function(){v.debug("Setting up fixed"),i.once=!1,i.observeChanges=!1,i.initialCheck=!0,i.refreshOnLoad=!0,h.transition||(i.transition=!1),v.create.placeholder(),v.debug("Added placeholder",e),i.onTopPassed=function(){v.debug("Element passed, adding fixed position",u),v.show.placeholder(),v.set.fixed(),i.transition&&O.fn.transition!==w&&u.transition(i.transition,i.duration)},i.onTopPassedReverse=function(){v.debug("Element returned to position, removing fixed",u),v.hide.placeholder(),v.remove.fixed()}}},create:{placeholder:function(){v.verbose("Creating fixed position placeholder"),e=u.clone(!1).css("display","none").addClass(t.placeholder).insertAfter(u)}},show:{placeholder:function(){v.verbose("Showing placeholder"),e.css("display","block").css("visibility","hidden")}},hide:{placeholder:function(){v.verbose("Hiding placeholder"),e.css("display","none").css("visibility","")}},set:{fixed:function(){v.verbose("Setting element to fixed position"),u.addClass(t.fixed).css({position:"fixed",top:i.offset+"px",left:"auto",zIndex:i.zIndex}),i.onFixed.call(m)},image:function(e,o){u.attr("src",e),i.transition?O.fn.transition!==w?u.hasClass(t.visible)?v.debug("Transition already occurred on this image, skipping animation"):u.transition(i.transition,i.duration,o):u.fadeIn(i.duration,o):u.show()}},is:{onScreen:function(){return v.get.elementCalculations().onScreen},offScreen:function(){return v.get.elementCalculations().offScreen},visible:function(){return!(!v.cache||!v.cache.element)&&!(0===v.cache.element.width&&0===v.cache.element.offset.top)},verticallyScrollableContext:function(){var e=f.get(0)!==z&&f.css("overflow-y");return"auto"==e||"scroll"==e},horizontallyScrollableContext:function(){var e=f.get(0)!==z&&f.css("overflow-x");return"auto"==e||"scroll"==e}},refresh:function(){v.debug("Refreshing constants (width/height)"),"fixed"==i.type&&v.resetFixed(),v.reset(),v.save.position(),i.checkOnRefresh&&v.checkVisibility(),i.onRefresh.call(m)},resetFixed:function(){v.remove.fixed(),v.remove.occurred()},reset:function(){v.verbose("Resetting all cached values"),O.isPlainObject(v.cache)&&(v.cache.screen={},v.cache.element={})},checkVisibility:function(e){v.verbose("Checking visibility of element",v.cache.element),!p&&v.is.visible()&&(v.save.scroll(e),v.save.calculations(),v.passed(),v.passingReverse(),v.topVisibleReverse(),v.bottomVisibleReverse(),v.topPassedReverse(),v.bottomPassedReverse(),v.onScreen(),v.offScreen(),v.passing(),v.topVisible(),v.bottomVisible(),v.topPassed(),v.bottomPassed(),i.onUpdate&&i.onUpdate.call(m,v.get.elementCalculations()))},passed:function(e,o){var n=v.get.elementCalculations();if(e&&o)i.onPassed[e]=o;else{if(e!==w)return v.get.pixelsPassed(e)>n.pixelsPassed;n.passing&&O.each(i.onPassed,function(e,o){n.bottomVisible||n.pixelsPassed>v.get.pixelsPassed(e)?v.execute(o,e):i.once||v.remove.occurred(o)})}},onScreen:function(e){var o=v.get.elementCalculations(),n=e||i.onOnScreen,t="onScreen";if(e&&(v.debug("Adding callback for onScreen",e),i.onOnScreen=e),o.onScreen?v.execute(n,t):i.once||v.remove.occurred(t),e!==w)return o.onOnScreen},offScreen:function(e){var o=v.get.elementCalculations(),n=e||i.onOffScreen,t="offScreen";if(e&&(v.debug("Adding callback for offScreen",e),i.onOffScreen=e),o.offScreen?v.execute(n,t):i.once||v.remove.occurred(t),e!==w)return o.onOffScreen},passing:function(e){var o=v.get.elementCalculations(),n=e||i.onPassing,t="passing";if(e&&(v.debug("Adding callback for passing",e),i.onPassing=e),o.passing?v.execute(n,t):i.once||v.remove.occurred(t),e!==w)return o.passing},topVisible:function(e){var o=v.get.elementCalculations(),n=e||i.onTopVisible,t="topVisible";if(e&&(v.debug("Adding callback for top visible",e),i.onTopVisible=e),o.topVisible?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.topVisible},bottomVisible:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomVisible,t="bottomVisible";if(e&&(v.debug("Adding callback for bottom visible",e),i.onBottomVisible=e),o.bottomVisible?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.bottomVisible},topPassed:function(e){var o=v.get.elementCalculations(),n=e||i.onTopPassed,t="topPassed";if(e&&(v.debug("Adding callback for top passed",e),i.onTopPassed=e),o.topPassed?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.topPassed},bottomPassed:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomPassed,t="bottomPassed";if(e&&(v.debug("Adding callback for bottom passed",e),i.onBottomPassed=e),o.bottomPassed?v.execute(n,t):i.once||v.remove.occurred(t),e===w)return o.bottomPassed},passingReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onPassingReverse,t="passingReverse";if(e&&(v.debug("Adding callback for passing reverse",e),i.onPassingReverse=e),o.passing?i.once||v.remove.occurred(t):v.get.occurred("passing")&&v.execute(n,t),e!==w)return!o.passing},topVisibleReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onTopVisibleReverse,t="topVisibleReverse";if(e&&(v.debug("Adding callback for top visible reverse",e),i.onTopVisibleReverse=e),o.topVisible?i.once||v.remove.occurred(t):v.get.occurred("topVisible")&&v.execute(n,t),e===w)return!o.topVisible},bottomVisibleReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomVisibleReverse,t="bottomVisibleReverse";if(e&&(v.debug("Adding callback for bottom visible reverse",e),i.onBottomVisibleReverse=e),o.bottomVisible?i.once||v.remove.occurred(t):v.get.occurred("bottomVisible")&&v.execute(n,t),e===w)return!o.bottomVisible},topPassedReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onTopPassedReverse,t="topPassedReverse";if(e&&(v.debug("Adding callback for top passed reverse",e),i.onTopPassedReverse=e),o.topPassed?i.once||v.remove.occurred(t):v.get.occurred("topPassed")&&v.execute(n,t),e===w)return!o.onTopPassed},bottomPassedReverse:function(e){var o=v.get.elementCalculations(),n=e||i.onBottomPassedReverse,t="bottomPassedReverse";if(e&&(v.debug("Adding callback for bottom passed reverse",e),i.onBottomPassedReverse=e),o.bottomPassed?i.once||v.remove.occurred(t):v.get.occurred("bottomPassed")&&v.execute(n,t),e===w)return!o.bottomPassed},execute:function(e,o){var n=v.get.elementCalculations(),t=v.get.screenCalculations();(e=e||!1)&&(i.continuous?(v.debug("Callback being called continuously",o,n),e.call(m,n,t)):v.get.occurred(o)||(v.debug("Conditions met",o,n),e.call(m,n,t))),v.save.occurred(o)},remove:{fixed:function(){v.debug("Removing fixed position"),u.removeClass(t.fixed).css({position:"",top:"",left:"",zIndex:""}),i.onUnfixed.call(m)},placeholder:function(){v.debug("Removing placeholder content"),e&&e.remove()},occurred:function(e){var o;e?(o=v.cache.occurred)[e]!==w&&!0===o[e]&&(v.debug("Callback can now be called again",e),v.cache.occurred[e]=!1):v.cache.occurred={}}},save:{calculations:function(){v.verbose("Saving all calculations necessary to determine positioning"),v.save.direction(),v.save.screenCalculations(),v.save.elementCalculations()},occurred:function(e){!e||v.cache.occurred[e]!==w&&!0===v.cache.occurred[e]||(v.verbose("Saving callback occurred",e),v.cache.occurred[e]=!0)},scroll:function(e){e=e+i.offset||f.scrollTop()+i.offset,v.cache.scroll=e},direction:function(){var e=v.get.scroll(),o=v.get.lastScroll(),e=o=o.top,o.bottomPassed=e.top>=o.bottom,o.topVisible=e.bottom>=o.top&&!o.topPassed,o.bottomVisible=e.bottom>=o.bottom&&!o.bottomPassed,o.pixelsPassed=0,o.percentagePassed=0,o.onScreen=(o.topVisible||o.passing)&&!o.bottomPassed,o.passing=o.topPassed&&!o.bottomPassed,o.offScreen=!o.onScreen,o.passing&&(o.pixelsPassed=e.top-o.top,o.percentagePassed=(e.top-o.top)/o.height),v.cache.element=o,v.verbose("Updated element calculations",o),o},screenCalculations:function(){var e=v.get.scroll();return v.save.direction(),v.cache.screen.top=e,v.cache.screen.bottom=e+v.cache.screen.height,v.cache.screen},screenSize:function(){v.verbose("Saving window position"),v.cache.screen={height:f.height()}},position:function(){v.save.screenSize(),v.save.elementPosition()}},get:{pixelsPassed:function(e){var o=v.get.elementCalculations();return-1