!function(t){"use strict";t(document).ready(function(){var e=t(window),a=t(document),r=t(".unysonext-scroll-to-top"),o=t(".hr-sticky-header"),i=t("[data-animate]"),n=t("html").hasclass("low-performance");window.islowperformance=n;var s=function(t,e){var a=g+l.height,r=t-e;return a>=r},l={width:0,height:0},h={width:0,height:0},d=!1,c=function(){fastdom.measure(function(){l.width=e.width(),l.height=e.height(),h.width=a.width(),h.height=a.height()}),f()},f=function(){d||requestanimationframe(u),d=!0};e.on("resize",c);var u=function(){d=!1,p.foreach(function(t){t.call(this,l.width,l.height,h.width,h.height)})},p=[],m=function(e,a,r,o){fastdom.measure(function(){var a=t(".body-content-wrapper > header + div > *:first-child, .main-content-wrapper").height(),r=t(".post-sidebar").height(),o=t(".sidebar-bg"),i=r-a;(i>0||e<980)&&(i=0),fastdom.mutate(function(){o.css("bottom",i+"px")})})};p.push(m);var g=0,v=!1,w=function(){fastdom.measure(function(){g=window.scrolly||window.pageyoffset||document.documentelement.scrolltop||document.body.scrolltop||0,l.width=e.width(),l.height=e.height(),h.width=a.width(),h.height=a.height()}),c()},c=function(){v||requestanimationframe(b),v=!0};e.on("scroll",w);var b=function(){v=!1,y.foreach(function(t){t.call(this,g)})},y=[],x=function(t){t>400?fastdom.mutate(function(){r.addclass("show-button")}):fastdom.mutate(function(){r.removeclass("show-button")})};n||y.push(x);var k=function(e){fastdom.measure(function(){var a=t(".hr-main-nav").height(),r=a-20;e>=r&&!o.hasclass("show-sticky-header")?fastdom.mutate(function(){o.addclass("show-sticky-header")}):e0){var d=t(".hr-inpage-link",s),p=t(".hr-inpage-link-item",s),t=[];d.each(function(){t.push(t(this).attr("href"))}),fastdom.measure(function(){l.width=e.width();var t=o.length&&l.width>1100?o.height():0;fastdom.mutate(function(){s.sticky({topspacing:t})})});var a=function(e){fastdom.measure(function(){var a=[];t.foreach(function(e){a.push(t(e).offset().top)});for(var r=0,i=o.length>0?parseint(o.height()):0,n=i+parseint(s.height())+10,s=0;se);s++)r=s;var d=h.height-l.height-e;d<30&&(r=a.length-1),fastdom.mutate(function(){for(s=0;s0&&fastdom.mutate(function(){e.closest(".rev_slider").revpause()})})});var l=function(e){var a="header-style-darkoverlay",r="header-style-lightoverlay";fastdom.measure(function(){var o=e.hasclass("darkonlight"),i=e.hasclass("lightondark");fastdom.mutate(function(){o?t("body").addclass(a).removeclass(r):i&&t("body").addclass(r).removeclass(a)})})};e.each(function(){t(this).bind("revolution.slide.onbeforeswap",function(t,e){window.settimeout(function(){l(e.nextslide)},400)})}),t("html:not('is-mobile'):not('is-tablet') .hr-primary-nav > li").on({mouseenter:function(){var e=t(this).children("ul, div"),a=t(this).children("a"),r=t(this);fastdom.measure(function(){"true"!=a.attr("aria-expanded")&&fastdom.mutate(function(){var o=r.siblings();o.each(function(e,a){var r=t(a).children("a"),o=t(this).children("ul, div");r.attr("aria-expanded","false"),o.attr("aria-hidden","true")}),e.attr("aria-hidden","false"),a.attr("aria-expanded","true")})})},mouseleave:function(){var e=t(this).children("ul, div"),a=t(this).children("a");fastdom.measure(function(){"false"!=a.attr("aria-expanded")&&fastdom.mutate(function(){a.attr("aria-expanded","false"),e.attr("aria-hidden","true")})})}}),t(".dropdown").each(function(e,a){fastdom.measure(function(){var e=t(a),r=e.children().length,o="dropdown-children-"+r;fastdom.mutate(function(){e.addclass(o)})})});var o=t(".hr-mobile-nav");o.on("click",function(t){fastdom.mutate(function(){o.parent().toggleclass("active")}),t.preventdefault()}),fastdom.measure(function(){var e=t(".video-wrapper.shortcode-container, .hr-project-media-video");e.length>0&&fastdom.mutate(function(){e.fitvids()})}),t('*[data-lightbox-trigger="true"]').on("click",function(e){e.preventdefault(),e.stoppropagation();var a=document.queryselectorall(".pswp")[0],r=t(this).closest('*[data-lightbox-item="true"]'),o=[];if("true"!=r.attr("data-lightbox-single")){var o=[],i=t('*[data-lightbox-item="true"]:not(.slick-cloned)',t(this).closest('*[data-lightbox-gallery="true"]'));t.each(i,function(e,a){var r=t(a).attr("data-lightbox-url"),i=t(a).attr("data-lightbox-title"),n=t(a).attr("data-image-width"),s=t(a).attr("data-image-height");o.push({src:r,w:n,h:s,title:i})});var n={index:i.index(r)}}else o.push({src:r.attr("data-lightbox-url"),w:r.attr("data-image-width"),h:r.attr("data-image-height"),title:r.attr("data-lightbox-title")});var s=new photoswipe(a,photoswipeui_default,o,n);s.init(),e.preventdefault(),e.stoppropagation()});for(var j=[{selector:".hr-project-media .carousel",config:{imagesloaded:!0,dragthreshold:20,wraparound:!0,autoplay:9e3,prevnextbuttons:!1,pagedots:!0,cellalign:"left",arrowshape:{x0:25,x1:55,y1:30,x2:65,y2:20,x3:45}}},{selector:".hr-related-posts .carousel, .hr-related-projects .carousel",config:{imagesloaded:!0,dragthreshold:20,draggable:!1,wraparound:!0,groupcells:3,autoplay:1e4,prevnextbuttons:!0,pagedots:!1,cellalign:"left",arrowshape:{x0:25,x1:55,y1:30,x2:65,y2:20,x3:45}}},{selector:".hr-image-carousel .carousel",config:""},{selector:".hr-post-slider .carousel",config:""},{selector:".hr-recentwork-element .carousel",config:""},{selector:".hr-simple-slider .carousel",config:""},{selector:".hr-hrtestimonials-element .carousel",config:""}],z=[],u=0;u0&&z.push(j[u]);var _=function(e){z.foreach(function(e){for(u=0;u0&&o.hasclass("is-showing-items")&&fastdom.mutate(function(){o.isotope("layout")})}})}()})};z.length>0&&y.push(_);var q=t(".hr-featured-blogroll-inner"),f=function(e){q.each(function(e,a){var r=t(a);r.hasclass("is-showing-items")||fastdom.measure(function(){var t=r.offset().top;s(t,500)&&fastdom.mutate(function(){var t=r.imagesloaded(function(){t.addclass("is-showing-items"),t.isotope({layoutmode:"packery",itemselector:".hr-post-preview-wrapper, .hr-month-label"})})})})})};q.length>0&&y.push(f);var m=function(e,a,r){var o=parseint(e.attr("data-num-cols")),i=parseint(e.attr("data-num-rows")),n=o*i;t(".hr-portfolio-preview-wrapper",e).each(function(e){t(this).removeclass(function(t,e){return(e.match(/(^|\s)filter-page-\s+/g)||[]).join(" ")})});var s="."+a;t(".hr-portfolio-preview-wrapper"+s,e).each(function(e){var a=parseint(e/n)+1;t(this).addclass("filter-page-"+a)}),t(".hr-portfolio-pagination .hr-current-page",e).text(r);var l=math.ceil(t(".hr-portfolio-preview-wrapper"+s,e).length/n);t(".hr-portfolio-pagination .hr-page-count",e).text(l),1==r?t(".hr-portfolio-pagination .hr-page-previous-link",e).addclass("disabled"):t(".hr-portfolio-pagination .hr-page-previous-link",e).removeclass("disabled"),r==l?t(".hr-portfolio-pagination .hr-page-next-link",e).addclass("disabled"):t(".hr-portfolio-pagination .hr-page-next-link",e).removeclass("disabled"),e.attr("data-current-page",r),e.attr("data-current-filter",a);var h=t(".hr-featured-portfolio-inner",e).isotope({itemselector:".hr-portfolio-preview-wrapper",masonry:{columnwidth:".grid-sizer"}});if(!h.hasclass("is-showing-items")){var d=h.find(".hr-portfolio-preview-wrapper");h.addclass("is-showing-items").isotope("revealitemelements",d)}var c=s+".filter-page-"+r;h.isotope({filter:c,masonry:{columnwidth:".grid-sizer"}}),h.imagesloaded().progress(function(){h.isotope("layout")})},n=t(".hr-featured-portfolio"),b=function(e){n.each(function(e,a){var r=t(a),o=r.children().first();o.hasclass("is-showing-items")||fastdom.measure(function(){var t=r.offset().top;s(t,500)&&fastdom.mutate(function(){m(r,"filter-all","1")})})})};n.length>0&&y.push(b),t(".hr-portfolio-filter-inner a").on("click",function(){t(".filter-term a").removeclass("active"),m(t(".hr-featured-portfolio.hr-builtin-portfolio"),t(this).attr("class"),1),t(this).addclass("active")}),t(".hr-portfolio-pagination .hr-page-previous-link").on("click",function(e){if(!t(this).hasclass("disabled")){var a=t(this).closest(".hr-featured-portfolio"),r=parseint(a.attr("data-current-page")),o=a.attr("data-current-filter");m(a,o,r-1)}e.preventdefault(),e.stoppropagation()}),t(".hr-portfolio-pagination .hr-page-next-link").on("click",function(e){if(!t(this).hasclass("disabled")){var a=t(this).closest(".hr-featured-portfolio"),r=parseint(a.attr("data-current-page")),o=a.attr("data-current-filter");m(a,o,r+1)}e.preventdefault(),e.stoppropagation()}),t.fn.countto=function(e){e=t.extend({},t.fn.countto.defaults,e||{});var a=math.ceil(e.speed/e.refreshinterval),r=(e.to-e.from)/a;return t(this).each(function(){function o(){s+=r,n++,fastdom.mutate(function(){t(i).html(s.tofixed(e.decimals))}),"function"==typeof e.onupdate&&e.onupdate.call(i,s),n>=a&&(clearinterval(l),s=e.to,"function"==typeof e.oncomplete&&e.oncomplete.call(i,s))}var i=this,n=0,s=e.from,l=setinterval(o,e.refreshinterval)})},t.fn.countto.defaults={from:0,to:100,speed:1e3,refreshinterval:10,decimals:0,onupdate:null,oncomplete:null};var w=t(".hr-counterbox-number"),y=function(e){w.each(function(e,a){var r=t(a);fastdom.measure(function(){if(!r.hasclass("hr-counter-completed")){var t=r.offset().top;if(s(t,0)){var e=r.attr("data-speed"),a=r.attr("data-start"),o=r.attr("data-target");fastdom.mutate(function(){r.addclass("hr-counter-completed")}),r.countto({from:parseint(a),to:parseint(o),speed:parseint(e)})}}})})};w.length>0&&y.push(y),t(window).trigger("scroll"),t(window).trigger("resize")})}(jquery);