var SF={};
(function(){
"use strict";
SF.page={
init: function (){
jQuery.browser={};
jQuery.browser.mozilla=/mozilla/.test(navigator.userAgent.toLowerCase())&&!/webkit/.test(navigator.userAgent.toLowerCase());
jQuery.browser.webkit=/webkit/.test(navigator.userAgent.toLowerCase());
jQuery.browser.opera=/opera/.test(navigator.userAgent.toLowerCase());
jQuery.browser.msie=/msie/.test(navigator.userAgent.toLowerCase());
jQuery.browser.msieMobile10=/iemobile\/10\.0/.test(navigator.userAgent.toLowerCase());
var deviceAgent=navigator.userAgent.toLowerCase(),
agentID=deviceAgent.match(/(iphone|ipod|ipad|android|iemobile)/);
if(agentID){
body.addClass("mobile-browser");
}else{
body.addClass("standard-browser");
}
if(jQuery.browser.msie&&(parseInt(jQuery.browser.version, 10) <=10)){
body.addClass("browser-ie");
}
if(jQuery.browser.mozilla){
body.addClass('browser-ff');
}
if(jQuery.browser.opera){
body.addClass("browser-opera");
}
if(body.hasClass("woocommerce-page")&&!body.hasClass("woocommerce")){
body.addClass("woocommerce");
}
jQuery('.portfolio-items:not(.carousel-items),.blog-items:not(.carousel-items),article.type-portfolio,article.type-post,article.type-team,.spb_video_widget,.infocus-item,.recent-posts,.full-width-detail').fitVids();
jQuery('.beam-me-up').on('click', 'a', function(e){
e.preventDefault();
jQuery('body,html').animate({scrollTop: 0}, 800);
});
}};
SF.superSearch={
init: function(){
var deviceAgent=navigator.userAgent.toLowerCase(),
agentID=deviceAgent.match(/(iphone|ipod|ipad|android|iemobile)/);
jQuery('.search-options .ss-dropdown').on('click', function(e){
e.preventDefault();
var option=jQuery(this),
dropdown=option.find('ul');
jQuery('.ss-dropdown ul').removeClass('show-dropdown');
if(isMobileAlt){
if(dropdown.hasClass('show-dropdown')){
dropdown.removeClass('show-dropdown');
}else{
dropdown.addClass('show-dropdown');
}}else{
if(dropdown.hasClass('show-dropdown')){
dropdown.css('top', 30).removeClass('show-dropdown');
}else{
dropdown.css('top', -10).addClass('show-dropdown');
}}
});
jQuery('.ss-option').on('click', function(e){
e.preventDefault();
var thisOption=jQuery(this),
selectedOption=thisOption.attr('data-attr_value'),
parentOption=thisOption.parent().parent().parent();
parentOption.find('li').removeClass('selected');
thisOption.parent().addClass('selected');
parentOption.attr('data-attr_value', selectedOption);
parentOption.find('span').text(thisOption.text());
setTimeout(function(){
thisOption.parents('ul').first().css('top', 30).removeClass('show-dropdown');
}, 100);
});
jQuery('.swift-search-link').on('click', function(e){
e.preventDefault();
var superSearch=jQuery('#super-search');
if(!superSearch.is(":visible")){
superSearch.slideDown(400);
}});
jQuery('.swift-search-link-alt').on('click', function(e){
e.preventDefault();
var superSearch=jQuery('#super-search');
if(!superSearch.is(":visible")){
jQuery('body,html').animate({scrollTop: 0}, 200);
superSearch.slideDown(400);
}});
jQuery('.super-search-go').on('click', function(e){
e.preventDefault();
var parentSearch=jQuery(this).parents('.sf-super-search').first(),
filterURL=SF.superSearch.urlBuilder(parentSearch),
homeURL=jQuery(this).attr('data-home_url'),
shopURL=jQuery(this).attr('data-shop_url');
if(filterURL.indexOf("product_cat") >=0){
location.href=homeURL + filterURL;
}else{
location.href=shopURL + filterURL;
}});
jQuery('.super-search-close').on('click', function(e){
e.preventDefault();
jQuery('#super-search').slideUp(300);
});
},
urlBuilder: function(searchInstance){
var queryString="";
jQuery(searchInstance).find('.search-options .ss-dropdown').each(function(){
var attr=jQuery(this).attr('id');
var attrValue=jQuery(this).attr('data-attr_value');
if(attrValue!==""){
if(attr==="product_cat"){
if(queryString===""){
queryString +="?product_cat=" + attrValue;
}else{
queryString +="&product_cat=" + attrValue;
}}else{
if(queryString===""){
queryString +="?filter_" + attr + "=" + attrValue;
}else{
queryString +="&filter_" + attr + "=" + attrValue;
}}
}});
jQuery('.search-options input').each(function(){
var attr=jQuery(this).attr('name');
var attrValue=jQuery(this).attr('value');
if(queryString===""){
queryString +="?"+ attr + "=" + attrValue;
}else{
queryString +="&" + attr + "=" + attrValue;
}});
return queryString;
}};
var navSearch=jQuery('#nav-search').find('input'),
navSearchLink=jQuery('.nav-search-link'),
miniHeader=jQuery('#mini-header'),
miniHeaderSearch=jQuery('#mini-search').find('input'),
miniHeaderSearchLink=jQuery('.mini-search-link');
SF.header={
init: function(){
if(body.hasClass('header-overlay')){
SF.header.headerOverlaySet();
$window.smartresize(function(){
SF.header.headerOverlaySet();
});
}
SF.header.miniHeaderInit();
navSearchLink.on('click', function(e){
if(jQuery('#container').width() > 979||body.hasClass('responsive-fixed')){
e.preventDefault();
navSearch.animate({
opacity: 1,
width: 140
}, 200);
navSearch.focus();
}});
navSearch.focus(function(){
if(jQuery('#container').width() > 979||body.hasClass('responsive-fixed')){
navSearch.css('display', 'inline-block').animate({
opacity: 1,
width: 140
}, 200);
}});
navSearch.blur(function(){
if(jQuery('#container').width() > 979||body.hasClass('responsive-fixed')){
jQuery(this).animate({
opacity: 0,
width: 1
}, 200);
setTimeout(function(){
navSearch.css('display', 'none');
}, 300);
}});
miniHeaderSearchLink.on('click', function(e){
e.preventDefault();
miniHeaderSearch.animate({
opacity: 1,
width: 140
}, 200);
miniHeaderSearch.focus();
});
miniHeaderSearch.focus(function(){
jQuery(this).animate({
opacity: 1,
width: 140
}, 200);
});
miniHeaderSearch.blur(function(){
jQuery(this).animate({
opacity: 0,
width: 1
}, 200);
});
jQuery(window).scroll(function(){
if((jQuery(this).scrollTop() > 300)&&!body.hasClass('has-mini-header')){
SF.header.miniHeaderShow();
}else if((jQuery(this).scrollTop() < 250)&&body.hasClass('has-mini-header')){
SF.header.miniHeaderHide();
}});
jQuery('.mobile-search-link').on('click', function(){
var isVisible=jQuery('.mobile-search-form').is(":visible");
jQuery('.mobile-search-form').slideToggle();
if(isVisible){
jQuery('.mobile-search-link').removeClass('active');
}else{
jQuery('.mobile-search-form input').focus();
jQuery('.mobile-search-link').addClass('active');
}});
},
miniHeaderInit: function(){
miniHeader.find('a[title="home"]').html('');
},
miniHeaderShow: function(){
body.addClass('has-mini-header');
miniHeader.css('display', 'block');
miniHeader.animate({
"top": "0"
}, 400);
},
miniHeaderHide: function(){
body.removeClass('has-mini-header');
miniHeader.animate({
"top": "-80"
}, 400);
setTimeout(function(){
miniHeader.css('display', 'none');
}, 600);
},
headerOverlaySet: function(){
var headerWrapHeight=jQuery('.header-wrap').height();
if(jQuery('#main-container').find('#swift-slider').length===0&&jQuery('#main-container').find('.home-slider-wrap').length===0&&jQuery('#page-wrap').find('.page-heading').length===0){
jQuery('.inner-page-wrap').animate({
'padding-top': headerWrapHeight + 20
}, 300);
}else{
jQuery('.page-heading').animate({
'padding-top': headerWrapHeight + 25
}, 300);
}}
};
SF.nav={
init: function(){
var lastAjaxSearchValue="",
searchTimer=false;
jQuery("ul.sub-menu").parent().addClass('parent');
jQuery('.menu li.parent > a').on('click', function(e){
if((jQuery('#container').width() < 1024&&body.hasClass('mh-tabletland'))||(jQuery('#container').width() < 767&&!body.hasClass('mh-tabletland'))||body.hasClass('standard-browser')){
return e;
}
var directDropdown=jQuery(this).parent().find('ul.sub-menu').first();
if(directDropdown.css('opacity')==1){
return e;
}else{
e.preventDefault();
}});
jQuery("nav").find(".menu li.parent").not(".no-hover").hoverIntent({
over: function(){
if((jQuery('#container').width() > 1024&&body.hasClass('mh-tabletland'))||(jQuery('#container').width() > 767&&!body.hasClass('mh-tabletland'))||body.hasClass('responsive-fixed')){
jQuery(this).find('ul.sub-menu,.mega-menu-sub').first().fadeIn(200);
}},
out:function(){
if((jQuery('#container').width() > 1024&&body.hasClass('mh-tabletland'))||(jQuery('#container').width() > 767&&!body.hasClass('mh-tabletland'))||body.hasClass('responsive-fixed')){
jQuery(this).find('ul.sub-menu,.mega-menu-sub').first().fadeOut(150);
}},
timeout: 0
});
jQuery(".shopping-bag-item").live("mouseenter", function(){
jQuery(this).find('ul.sub-menu').first().fadeIn(200);
}).live("mouseleave", function(){
if((jQuery('#container').width() > 1024&&body.hasClass('mh-tabletland'))||(jQuery('#container').width() > 767&&!body.hasClass('mh-tabletland'))||body.hasClass('responsive-fixed')){
jQuery(this).find('ul.sub-menu').first().fadeOut(150);
}});
jQuery('a.show-main-nav').on('click', function(e){
e.preventDefault();
if(jQuery('#main-navigation').is(':visible')){
jQuery('.header-overlay .header-wrap').css('position', '');
}else{
jQuery('.header-overlay .header-wrap').css('position', 'relative');
}
jQuery('#main-navigation').toggle();
});
$window.smartresize(function(){
if((jQuery('#container').width() > 1024&&body.hasClass('mh-tabletland'))||(jQuery('#container').width() > 767&&!body.hasClass('mh-tabletland'))||body.hasClass('responsive-fixed')){
jQuery('#main-navigation').css('display', '');
var menus=jQuery('nav').find('ul.menu');
menus.each(function(){
jQuery(this).css("display", "");
});
}});
var currentLanguage=jQuery('li.aux-languages').find('.current-language').html();
if(currentLanguage!==""){
jQuery('li.aux-languages > a').html(currentLanguage);
}
jQuery('li.menu-search a').on('click', function(e){
e.preventDefault();
var subSearchMenu=jQuery(this).parent().find('.sub-menu'),
menuContainer=jQuery(this).closest('nav');
if(!subSearchMenu.hasClass('show-dropdown')){
subSearchMenu.addClass('show-dropdown');
subSearchMenu.fadeIn(200);
subSearchMenu.find('input').focus();
}else{
if((jQuery('#container').width() > 1024&&body.hasClass('mh-tabletland'))||(jQuery('#container').width() > 767&&!body.hasClass('mh-tabletland'))||body.hasClass('responsive-fixed')){
subSearchMenu.removeClass('show-dropdown').fadeOut(150);
}}
});
jQuery('.ajax-search-form input[name=s]').on('keyup', function(e){
var searchvalue=e.currentTarget.value;
clearTimeout(searchTimer);
if(lastAjaxSearchValue!=jQuery.trim(searchvalue)&&searchvalue.length >=3){
searchTimer=setTimeout(function(){
SF.nav.ajaxSearch(e);
}, 400);
}});
},
hideNav: function(subnav){
setTimeout(function(){
if(subnav.css("opacity")==="0"){
subnav.css("display", "none");
}}, 300);
},
ajaxSearch: function(e){
var searchInput=jQuery(e.currentTarget),
searchValues=searchInput.parents('form').serialize() + '&action=sf_ajaxsearch',
results=jQuery('.ajax-search-results'),
loadingIndicator=jQuery('.ajax-search-wrap .ajax-loading');
jQuery.ajax({
url: ajaxurl,
type: "POST",
data: searchValues,
beforeSend: function(){
loadingIndicator.fadeIn(50);
},
success: function(response){
if(response===0){
response="";
}else{
results.html(response);
}},
complete: function(){
loadingIndicator.fadeOut(200);
results.slideDown(400);
}});
}};
SF.woocommerce={
init: function(){
jQuery('figcaption .add_to_cart_button').on('click', function(){
var button=jQuery(this);
var added_text=button.attr("data-added_text");
button.addClass("product-added");
button.text(added_text);
});
jQuery('.show-products-link').on('click', function(e){
e.preventDefault();
var linkHref=jQuery(this).attr('href').replace('?', ''),
currentURL=document.location.href.replace(/\/page\/\d+/, ''),
currentQuery=document.location.search;
if(currentQuery.indexOf('?show') >=0){
window.location=jQuery(this).attr('href');
}else if(currentQuery.indexOf('?') >=0){
window.location=currentURL + '&' + linkHref;
}else{
window.location=currentURL + '?' + linkHref;
}});
jQuery('ul.products li').hover(function(){
var imageOverlay=jQuery(this).find('.image-overlay');
imageOverlay.animate({
top: jQuery(this).height()*-1
}, 400);
}, function(){
var imageOverlay=jQuery(this).find('.image-overlay');
imageOverlay.animate({
top: 0
}, 400);
});
if(jQuery.fn.imagesLoaded){
$window.smartresize(function(){
});
}
jQuery('.shipping-calculator-form input').keypress(function(e){
if(e.which==10||e.which==13){
jQuery(".update-totals-button button").click();
}});
},
productSetup: function(){
jQuery('ul.products').each(function(){
var products=jQuery(this);
products.imagesLoaded(function(){
setTimeout(function(){
var product=products.find('li.type-product').first();
var productImageHeight=product.find('.product-image > img').height();
if(jQuery('#container').width() <=1024&&product.find('figure > figcaption').is(":visible")){
productImageHeight=productImageHeight + 20;
}
if(!productImageHeight||productImageHeight===0){
productImageHeight=270;
}
products.find('li.type-product').each(function(){
jQuery(this).find('figure').css('padding-bottom', productImageHeight + 'px');
});
SF.woocommerce.resizeCarousel();
}, 300);
});
});
},
productSetupResize: function(){
var products=jQuery('ul.products');
var productImageHeight=products.find('li.type-product').first().find('.product-image > img').height();
if(jQuery('#container').width() <=1024&&jQuery(this).find('figure > figcaption').is(":visible")){
productImageHeight=productImageHeight + 20;
}
products.find('li.type-product').each(function(){
jQuery(this).find('figure').css('padding-bottom', productImageHeight + 'px');
});
},
productCarousel: function(){
var products=jQuery('.product-carousel');
products.addClass('carousel-wrap');
var carousel=products.find('ul.products');
carousel.each(function(){
var thisCarousel=jQuery(this),
carouselItems=thisCarousel.find("> li").length,
carouselWrap=thisCarousel.parent().parent(),
carouselPrev=carouselWrap.find('.prev'),
carouselNext=carouselWrap.find('.next'),
carouselColumns=parseInt(carouselWrap.attr("data-columns"), 10),
itemCount=thisCarousel.children().length;
if(carouselItems <=carouselColumns){
thisCarousel.parents('.product-carousel').addClass('carousel-disabled');
carouselWrap.addClass('carousel-inactive');
thisCarousel.find('> li:first').css('margin-left', '0');
return;
}
if(isMobileAlt&&jQuery(window).width() <=480){
carouselColumns=2;
}else if(isMobileAlt&&jQuery(window).width() <=320){
carouselColumns=1;
}
thisCarousel.imagesLoaded(function (){
thisCarousel.carouFredSel({
items:carouselColumns,
scroll:{
visible:{
width: thisCarousel.find("> li:first").width(),
min: 1,
max: carouselColumns
},
easing:"easeInOutCubic",
duration:800,
pauseOnHover:true
},
auto:{
play:false
},
prev:{
button:carouselPrev,
key:"left"
},
next:{
button:carouselNext,
key:"right"
},
onCreate:function(){
carouselWrap.addClass('carousel-active');
SF.widgets.resizeAssets();
SF.woocommerce.resizeCarousel();
$window.smartresize(function(){
SF.woocommerce.resizeCarousel();
});
}});
});
});
},
resizeCarousel: function(){
var carousel=jQuery('.product-carousel').find('.products');
carousel.each(function(){
var thisCarousel=jQuery(this),
carouselItem=thisCarousel.find('li'),
carouselWrap=thisCarousel.parent().parent(),
itemWidth=carouselItem.width() + carouselItem.css('margin-left'),
visible=parseInt(carouselWrap.attr("data-columns"), 10);
if(carouselWrap.hasClass('carousel-disabled')){
return;
}
if(jQuery('#container').width() < 460&&body.hasClass('responsive-fluid')){
visible=1;
}else if(jQuery('#container').width() < 768&&body.hasClass('responsive-fluid')){
visible=2;
}
thisCarousel.trigger("configuration", {
items:{
width:itemWidth
},
scroll:{
items: visible
}});
});
},
variations: function(){
jQuery('.variations select').each(function(){
var variationSelect=jQuery(this);
variationSelect.live("change", function(){
if(jQuery('#sf-included').hasClass('has-productzoom')){
jQuery('#product-img-slider').flexslider(0);
setTimeout(function(){
jQuery('.product-slider-image').each(function(){
jQuery(this).data('zoom-image', jQuery(this).parent().find('a.zoom').attr('href'));
});
var currentImage=jQuery('#product-img-slider li:first').find('.product-slider-image');
currentImage.parent().trigger('zoom.destroy');
SF.woocommerce.productZoom(currentImage);
}, 500);
}else{
jQuery('#product-img-slider').flexslider(0);
setTimeout(function(){
var flexViewport=jQuery('#product-img-slider').find('.flex-viewport'),
flexsliderHeight=flexViewport.find('ul.slides').css('height');
flexViewport.animate({
'height': flexsliderHeight
}, 300);
}, 500);
}});
});
},
productZoom: function(zoomObject){
zoomObject.parent().zoom({
duration: 400
});
}};
SF.flexSlider={
init: function(){
if(jQuery('.recent-posts').length > 0){
SF.flexSlider.thumb();
}
jQuery('#product-img-nav').flexslider({
animation: "slide",
directionNav: true,
controlNav: false,
animationLoop: false,
slideshow: false,
itemWidth: 70,
itemMargin: 20,
asNavFor: '#product-img-slider'
});
var currentImage="";
jQuery('#product-img-slider').flexslider({
animation: "slide",
controlNav: false,
smoothHeight: true,
animationLoop: false,
slideshow: false,
touch: !hasProductZoom,
sync: "#product-img-nav",
start: function(productSlider){
if(hasProductZoom){
if(productSlider.slides){
currentImage=productSlider.slides.eq(productSlider.currentSlide).find('.product-slider-image');
SF.woocommerce.productZoom(currentImage);
}else{
currentImage=jQuery('#product-img-slider').find('.product-slider-image');
SF.woocommerce.productZoom(currentImage);
}}
},
before: function(productSlider){
if(hasProductZoom){
currentImage.parent().trigger('zoom.destroy');
}},
after: function(productSlider){
if(hasProductZoom){
var currentImage=productSlider.slides.eq(productSlider.currentSlide).find('.product-slider-image');
currentImage.parent().trigger('zoom.destroy');
SF.woocommerce.productZoom(currentImage);
}}
});
jQuery('.item-slider').flexslider({
animation: "slide",
slideDirection: "horizontal",
slideshow: true,
slideshowSpeed: 6000,
animationDuration: 500,
smoothHeight: true,
directionNav: true,
controlNav: true,
keyboardNav: false,
mousewheel: false,
prevText: "Prev",
nextText: "Next",
pausePlay: true,
pauseText: '',
playText: '',
randomize: false,
slideToStart: 0,
animationLoop: true,
pauseOnAction: true,
pauseOnHover: false,
controlsContainer: "",
manualControls: "",
start: function(){},
before: function(){},
after: function(){},
end: function(){}});
jQuery('#swift-slider').flexslider({
animation: "slide",
slideDirection: "horizontal",
slideshow: false,
slideshowSpeed: 8000,
animationDuration: 600,
directionNav: true,
controlNav: false,
keyboardNav: false,
mousewheel: false,
prevText: "Prev",
nextText: "Next",
pausePlay: false,
animationLoop: true,
pauseOnAction: true,
pauseOnHover: true,
start: function(postsSlider){
jQuery('.swift-slider-loading').fadeOut(200);
if(postsSlider.slides){
postsSlider.slides.eq(postsSlider.currentSlide).addClass('flex-active-slide');
if(postsSlider.slides.eq(postsSlider.currentSlide).has('.flex-caption-large')){
var chart=postsSlider.slides.eq(postsSlider.currentSlide).find('.fw-chart');
if(body.hasClass("browser-ie")){
chart=postsSlider.slides.eq(postsSlider.currentSlide).find('.chart');
}
chart.each(function(){
var countValue=parseInt(jQuery(this).attr('data-count'), 10);
jQuery(this).data('easyPieChart').update(80);
jQuery(this).find('span').replaceWith("0");
jQuery(this).find('span').animateNumber(countValue);
});
}
postsSlider.slides.eq(postsSlider.currentSlide).find('.comment-chart:not(.fw-chart) span').replaceWith("0");
}},
before: function(postsSlider){
if(postsSlider.slides){
if(postsSlider.slides.eq(postsSlider.currentSlide).has('.flex-caption-large')){
var chart=postsSlider.slides.eq(postsSlider.currentSlide).find('.fw-chart');
if(body.hasClass("browser-ie")){
chart=postsSlider.slides.eq(postsSlider.currentSlide).find('.chart');
}
chart.each(function(){
jQuery(this).data('easyPieChart').update(0);
jQuery(this).find('span').replaceWith("0");
});
}
setTimeout(function(){
postsSlider.slides.eq(postsSlider.currentSlide).addClass('flex-active-slide');
if(postsSlider.slides.eq(postsSlider.currentSlide).has('.flex-caption-large')){
var chart=postsSlider.slides.eq(postsSlider.currentSlide).find('.fw-chart');
if(body.hasClass("browser-ie")){
chart=postsSlider.slides.eq(postsSlider.currentSlide).find('.chart');
}
chart.each(function(){
var countValue=parseInt(jQuery(this).attr('data-count'), 10);
jQuery(this).data('easyPieChart').update(80);
jQuery(this).find('span').animateNumber(countValue);
});
}}, 1000);
}}
});
jQuery('.content-slider').each(function(){
var sliderAnimation=jQuery(this).attr('data-animation');
var autoplay=jQuery(this).attr('data-autoplay');
autoplay=((autoplay==="yes") ? true:false);
jQuery(this).flexslider({
animation: sliderAnimation,
slideshow: autoplay,
slideshowSpeed: 6000,
animationDuration: 1000,
smoothHeight: true,
directionNav: true,
controlNav: false
});
});
jQuery('#swift-slider li').each(function(){
jQuery(this).find('.chart').each(function(){
jQuery(this).easyPieChart({
animate: 1000,
size: 70,
barColor: jQuery(this).attr('data-barcolor'),
trackColor: 'transparent',
scaleColor: false
});
jQuery(this).find('span').replaceWith("0");
});
});
jQuery('#swift-slider li').hover(function(){
jQuery(this).find('.flex-caption-details').removeClass('closing');
jQuery(this).find('.flex-caption-details').addClass('open');
}, function(){
jQuery(this).find('.flex-caption-details').addClass('closing');
jQuery(this).find('.flex-caption-details').removeClass('open');
});
jQuery('.caption-details-inner').on('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function(){
var chart=jQuery(this).find('.chart');
if(jQuery(this).parent().hasClass('closing')){
chart.each(function(){
jQuery(this).data('easyPieChart').update(0);
jQuery(this).find('span').replaceWith("0");
});
jQuery(this).parent().removeClass('closing');
}else if(jQuery(this).parent().hasClass('open')){
chart.each(function(){
var countValue=parseInt(jQuery(this).attr('data-count'), 10);
jQuery(this).data('easyPieChart').update(80);
jQuery(this).find('span').animateNumber(countValue);
});
}});
},
thumb: function(){
jQuery('.thumb-slider').flexslider({
animation: "fade",
slideDirection: "horizontal",
slideshow: true,
slideshowSpeed: 6000,
animationDuration: 600,
directionNav: true,
controlNav: false,
keyboardNav: false
});
}};
var portfolioContainer=jQuery('.portfolio-wrap').find('.filterable-items');
SF.portfolio={
init: function(){
SF.portfolio.standardSetup();
SF.portfolio.setItemHeight();
$window.smartresize(function(){
SF.portfolio.windowResized();
});
jQuery('.filtering li').each(function(){
var itemCount=0;
var filter=jQuery(this),
filterName=jQuery(this).find('a').attr('class'),
portfolioItems=jQuery(this).parent().parent().parent().next('.filterable-items');
portfolioItems.find('li').each(function(){
if(jQuery(this).hasClass(filterName)){
filter.addClass('has-items');
itemCount++;
}});
if(jQuery(this).hasClass('all')){
itemCount=portfolioItems.children('li').length;
jQuery(this).find('.item-count').text(itemCount);
}else{
jQuery(this).find('.item-count').text(itemCount);
}});
jQuery('.filtering li').on('click', 'a', function(e){
e.preventDefault();
jQuery(this).parent().parent().find('li').removeClass('selected');
jQuery(this).parent().addClass('selected');
var selector=jQuery(this).attr('data-filter');
var portfolioItems=jQuery(this).parent().parent().parent().parent().next('.filterable-items');
portfolioItems.isotope({ filter: selector });
});
jQuery('.filter-wrap > a').on('click', function(e){
e.preventDefault();
jQuery(this).parent().find('.filter-slide-wrap').slideToggle();
});
},
standardSetup: function(){
portfolioContainer.isotope({
animationEngine: 'best-available',
animationOptions: {
duration: 300,
easing: 'easeInOutQuad',
queue: false
},
resizable: true,
layoutMode: 'fitRows'
});
SF.flexSlider.thumb();
portfolioContainer.isotope("layout");
},
setItemHeight: function(){
if(!portfolioContainer.hasClass('single-column')){
portfolioContainer.children().css('min-height','0');
portfolioContainer.equalHeights();
portfolioContainer.isotope("layout");
}},
windowResized: function(){
if(!portfolioContainer.hasClass('single-column')){
SF.portfolio.setItemHeight();
}}
};
var blogItems=jQuery('.blog-wrap').find('.blog-items'),
masonryPagination=jQuery('.blog-wrap').find('.masonry-pagination');
SF.blog={
init: function(){
if(blogItems.hasClass('masonry-items')){
jQuery('.masonry-items').fitVids();
SF.blog.masonrySetup();
blogItems.imagesLoaded(function (){
blogItems.animate({opacity: 1}, 800);
masonryPagination.fadeIn(1000);
SF.blog.masonrySetup();
});
SF.flexSlider.thumb();
blogItems.isotope("layout");
$window.smartresize(function(){
SF.blog.windowResized();
});
}else{
SF.flexSlider.thumb();
}
jQuery('.blog-slideout-trigger').on('click', function(e){
e.preventDefault();
var blogWrap=jQuery(this).parent().parent().parent().parent();
var filterPanel=blogWrap.find('.filter-wrap .filter-slide-wrap');
var auxType=jQuery(this).attr('data-aux');
blogWrap.find('.aux-list li').addClass('span2');
blogWrap.find('.aux-list li a span').each(function(){
jQuery(this).html(jQuery(this).html().replace("(","").replace(")",""));
});
if(jQuery(this).parent().hasClass('selected')&&!filterPanel.is(':animated')){
blogWrap.find('.blog-aux-options li').removeClass('selected');
filterPanel.slideUp(400);
return;
}
blogWrap.find('.blog-aux-options li').removeClass('selected');
jQuery(this).parent().addClass('selected');
if(filterPanel.is(':visible')){
filterPanel.slideUp(400);
setTimeout(function(){
blogWrap.find('.aux-list').css('display', 'none');
blogWrap.find('.aux-'+auxType).css('display', 'block');
filterPanel.slideDown();
}, 600);
}else{
blogWrap.find('.aux-list').css('display', 'none');
blogWrap.find('.aux-'+auxType).css('display', 'block');
filterPanel.slideDown();
}});
},
masonrySetup: function(){
blogItems.isotope({
itemSelector:'.blog-item',
masonry:{
columnWidth:0
},
animationEngine: 'best-available',
animationOptions: {
duration: 300,
easing: 'easeInOutQuad',
queue: false
},
transformsEnabled: false,
resizable: true
});
},
windowResized: function(){
blogItems.isotope("layout");
}};
SF.carouselWidgets={
init: function(){
var carousel=jQuery('.carousel-items');
carousel.each(function(){
var carouselInstance=jQuery('#'+jQuery(this).attr('id')),
carouselWrap=jQuery(this).parent().parent(),
carouselItems=carouselInstance.find("> li").length,
carouselPrev=carouselInstance.parent().parent().find('.prev'),
carouselNext=carouselInstance.parent().parent().find('.next'),
carouselColumns=parseInt(carouselInstance.attr("data-columns"), 10);
if(carouselItems <=carouselColumns){
carouselInstance.find('> li:first').css('margin-left', '0');
carouselInstance.fitVids();
SF.flexSlider.thumb();
carouselWrap.addClass('carousel-inactive');
return;
}
carouselInstance.imagesLoaded(function (){
jQuery(this).carouFredSel({
items:carouselColumns,
scroll:{
visible:{
width: carousel.find("> li:first").width(),
min: 1,
max: carouselColumns
},
easing:"easeOutQuart",
duration:1000,
pauseOnHover:true
},
auto:{
play:false
},
prev:{
button:carouselPrev,
key:"left"
},
next:{
button:carouselNext,
key:"right"
},
onCreate:function(){
jQuery(this).fitVids();
SF.flexSlider.thumb();
SF.carouselWidgets.resizeCarousels();
carouselWrap.addClass('carousel-active');
$window.smartresize(function(){
SF.carouselWidgets.resizeCarousels();
});
}});
});
});
},
resizeCarousels: function(){
var carousel=jQuery('.carousel-items');
carousel.each(function(){
var carouselItem=jQuery(this).find('.carousel-item');
var itemWidth=carouselItem.width() + carouselItem.css('margin-left');
var visible=parseInt(carousel.parent().parent().attr("data-columns"), 10);
if(jQuery('#container').width() < 460&&body.hasClass('responsive-fluid')){
visible=1;
}else if(jQuery('#container').width() < 768&&body.hasClass('responsive-fluid')){
visible=2;
}
carousel.trigger("configuration", {
items:{
width:itemWidth
},
scroll:{
items: visible
}});
});
}};
SF.widgets={
init: function(){
if(sfIncluded.hasClass('has-chart')){
jQuery('.chart-shortcode').each(function(){
jQuery(this).easyPieChart({
animate: 1000,
lineCap: 'square',
lineWidth: jQuery(this).attr('data-linewidth'),
size: jQuery(this).attr('data-size'),
barColor: jQuery(this).attr('data-barcolor'),
trackColor: jQuery(this).attr('data-trackcolor'),
scaleColor: false
});
});
}
SF.widgets.accordion();
SF.widgets.tabs();
SF.widgets.toggle();
SF.widgets.introAnimations();
if(sfIncluded.hasClass('has-imagebanner')){
SF.widgets.imageBanners();
}
SF.widgets.resizeAssets();
$window.smartresize(function(){
SF.widgets.resizeAssets();
});
jQuery('[rel=tooltip]').tooltip();
},
resizeAssets: function(){
var carousels=jQuery('.carousel-active .carousel-items,.carousel-active .products');
var assets=jQuery('.alt-bg');
var assetWidth=0;
if(jQuery('#container').width() < 460&&body.hasClass('responsive-fluid')){
assetWidth=jQuery('#container').width() - 40;
carousels.find('.carousel-item,.product').each(function(){
jQuery(this).css("width", assetWidth + "px");
});
}else if(jQuery('#container').width() < 768&&body.hasClass('responsive-fluid')){
if(carousels.hasClass('testimonials')){
assetWidth=jQuery('#container').width() - 40;
}else{
assetWidth=Math.floor(jQuery('#container').width() / 2) - 35;
}
carousels.find('.carousel-item,.product').each(function(){
jQuery(this).css("width", assetWidth + "px");
});
}else if(body.hasClass('responsive-fluid')){
carousels.find('.carousel-item,.product').each(function(){
jQuery(this).css("width", "");
});
}
if(jQuery('#container').width() < 768&&body.hasClass('responsive-fluid')){
assetWidth=jQuery('#container').width();
assets.each(function(){
jQuery(this).css("width", assetWidth + "px");
});
}else{
assets.each(function(){
jQuery(this).css("width", "");
});
}},
accordion: function(){
jQuery('.spb_accordion').each(function(){
var spb_tabs,
active_tab=false,
active_attr=parseInt(jQuery(this).attr('data-active'), 10);
if(jQuery.type(active_attr)==="number"){ active_tab=active_attr; }
spb_tabs=jQuery(this).find('.spb_accordion_wrapper').accordion({
header: "> div > h3",
autoHeight: true,
collapsible: true,
active: active_tab,
heightStyle: "content"
});
});
},
tabs: function(){
jQuery('.spb_tabs').each(function(){
jQuery(this).find('.tab-pane').first().addClass('active');
});
jQuery('.spb_tour').each(function(){
jQuery(this).find('.tab-pane').first().addClass('active');
});
},
toggle: function(){
jQuery(".spb_toggle").click(function(){
if(jQuery(this).hasClass('spb_toggle_title_active')){
jQuery(this).removeClass('spb_toggle_title_active').next().slideUp(500);
}else{
jQuery(this).addClass('spb_toggle_title_active').next().slideDown(500);
}});
jQuery('.spb_toggle_content').each(function(){
if(jQuery(this).next().is('h4.spb_toggle')===false){
jQuery('
').insertAfter(this);
}});
},
initSkillBars: function(){
SF.widgets.animateSkillBars();
jQuery(window).scroll(function(){
SF.widgets.animateSkillBars();
});
},
animateSkillBars: function(){
jQuery('.progress:in-viewport').each(function(){
var progressBar=jQuery(this),
progressValue=progressBar.find('.bar').attr('data-value');
if(!progressBar.hasClass('animated')){
progressBar.addClass('animated');
progressBar.find('.bar').animate({
width: progressValue + "%"
}, 600, function(){
progressBar.find('.bar-text').fadeIn(400);
});
}});
},
charts: function(){
SF.widgets.animateCharts();
jQuery(window).scroll(function(){
SF.widgets.animateCharts();
});
},
animateCharts: function(){
jQuery('.chart-shortcode:in-viewport').each(function(){
if(!jQuery(this).hasClass('animated')){
jQuery(this).addClass('animated');
var animatePercentage=parseInt(jQuery(this).attr('data-animatepercent'), 10);
jQuery(this).data('easyPieChart').update(animatePercentage);
}});
},
introAnimations: function(){
if(!isMobileAlt){
jQuery('.sf-animation').each(function(){
var animatedItem=jQuery(this),
itemAnimation=animatedItem.data('animation'),
itemDelay=animatedItem.data('delay');
animatedItem.appear(function(){
if(itemAnimation=='fade-from-left'){
animatedItem.delay(itemDelay).animate({
'opacity':1,
'left':'0px'
}, 600, 'easeOutCubic');
}else if(itemAnimation=='fade-from-right'){
animatedItem.delay(itemDelay).animate({
'opacity':1,
'right':'0px'
}, 600, 'easeOutCubic');
}else if(itemAnimation=='fade-from-bottom'){
if(animatedItem.hasClass('image-banner-content')){
animatedItem.delay(itemDelay).animate({
'opacity':1,
'bottom':'50%'
}, 1000, 'easeOutCubic');
}else{
animatedItem.delay(itemDelay).animate({
'opacity':1,
'bottom':'0px'
}, 600, 'easeOutCubic');
}}else if(itemAnimation=='fade-in'){
animatedItem.delay(itemDelay).animate({
'opacity':1
}, 600, 'easeOutCubic');
}else if(itemAnimation=='grow'){
setTimeout(function(){
animatedItem.addClass('sf-animate');
}, itemDelay);
}else{
setTimeout(function(){
animatedItem.addClass('sf-animate');
}, itemDelay);
}}, {accX: 0, accY: -150}, 'easeInCubic');
});
}},
imageBanners: function(){
jQuery('.sf-image-banner').each(function(){
jQuery(this).find('.image-banner-content').vCenter();
});
}};
SF.teamMembers={
init: function(){
var team=jQuery('.team-members');
team.imagesLoaded(function (){
jQuery('.team-members').equalHeights();
});
jQuery(window).on("debouncedresize", function(){
jQuery('.team-members').children().css('min-height','0');
jQuery('.team-members').equalHeights();
});
}};
SF.lightbox={
init: function(){
var lightboxSocial={};
if(lightboxSharing){
lightboxSocial={
facebook: true,
twitter: true,
googleplus: true,
pinterest: {
source: "https://pinterest.com/pin/create/bookmarklet/?url={URL}",
text: "Share on Pinterest"
}};}
var galleryArr=[];
jQuery('[data-rel^="ilightbox["]').each(function (){
var attr=this.getAttribute("data-rel");
if(jQuery.inArray(attr, galleryArr)==-1){
galleryArr.push(attr);
}});
jQuery.each(galleryArr, function (b, c){
jQuery('[data-rel="' + c + '"]').iLightBox({
skin: lightboxSkin,
social: {
buttons: lightboxSocial
},
path: 'horizontal',
thumbnails: {
maxWidth: 120,
maxHeight: 120
},
controls: {
arrows: lightboxControlArrows,
thumbnail: lightboxThumbs
}});
});
}};
SF.map={
init:function(){
var maps=jQuery('.map-canvas');
maps.each(function(index, element){
var mapContainer=element,
mapAddress=mapContainer.getAttribute('data-address'),
mapZoom=mapContainer.getAttribute('data-zoom'),
mapType=mapContainer.getAttribute('data-maptype'),
pinLogoURL=mapContainer.getAttribute('data-pinimage');
SF.map.getCoordinates(mapAddress, mapContainer, mapZoom, mapType, pinLogoURL);
});
SF.map.fullscreenMap();
$window.smartresize(function(){
SF.map.fullscreenMap();
});
jQuery('ul.nav-tabs li a').click(function(){
var thisTabHref=jQuery(this).attr('href');
if(jQuery(thisTabHref).find('.spb_gmaps_widget').length > 0){
map.init();
}});
},
getCoordinates: function(address, mapContainer, mapZoom, mapType, pinLogoURL){
var geocoder, geocodeReturn;
geocoder=new google.maps.Geocoder();
geocoder.geocode({
'address': address
}, function(results, status){
if(status==google.maps.GeocoderStatus.OK){
var mapTypeIdentifier="",
companyPos="",
mapCoordinates=results[0].geometry.location,
latitude=results[0].geometry.location.lat(),
longitude=results[0].geometry.location.lng();
if(mapType==="satellite"){
mapTypeIdentifier=google.maps.MapTypeId.SATELLITE;
}else if(mapType==="terrain"){
mapTypeIdentifier=google.maps.MapTypeId.TERRAIN;
}else if(mapType==="hybrid"){
mapTypeIdentifier=google.maps.MapTypeId.HYBRID;
}else{
mapTypeIdentifier=google.maps.MapTypeId.ROADMAP;
}
var latlng=new google.maps.LatLng(latitude, longitude);
var settings={
zoom: parseInt(mapZoom, 10),
scrollwheel: false,
center: latlng,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
mapTypeId: mapTypeIdentifier
};
var mapInstance=new google.maps.Map(mapContainer, settings);
var companyMarker="";
if(pinLogoURL){
var companyLogo=new google.maps.MarkerImage(pinLogoURL,
new google.maps.Size(150,75),
new google.maps.Point(0,0),
new google.maps.Point(75,75)
);
companyPos=new google.maps.LatLng(latitude, longitude);
companyMarker=new google.maps.Marker({
position: mapCoordinates,
map: mapInstance,
icon: companyLogo
});
}else{
companyPos=new google.maps.LatLng(latitude, longitude);
companyMarker=new google.maps.Marker({
position: mapCoordinates,
map: mapInstance
});
}
google.maps.event.addListener(companyMarker, 'click', function(){
window.location.href='http://maps.google.com/maps?q='+companyPos;
});
google.maps.event.addDomListener(window, 'resize', function(){
mapInstance.setCenter(companyPos);
});
}else{
var alert;
alert('Geocode was not successful for the following reason: ' + status);
}});
},
fullscreenMap: function(){
var fullscreenMap=jQuery('.fullscreen-map'),
container=jQuery('#page-wrap'),
mapOffset=container.offset().left,
windowWidth=jQuery(window).width();
if(windowWidth > 768){
mapOffset=mapOffset;
}else{
mapOffset=20;
}
fullscreenMap.find('.map-canvas').css('width', windowWidth);
fullscreenMap.css('margin-left', '-' + mapOffset + 'px');
}};
SF.reloadFunctions={
init:function(){
var deviceAgent=navigator.userAgent.toLowerCase(),
appleAgentID=deviceAgent.match(/(iphone|ipod|ipad)/);
jQuery('img[title]').each(function(){
jQuery(this).removeAttr('title');
});
if(!appleAgentID){
jQuery('embed').show();
}
jQuery('.animate-top').on('click', function(e){
e.preventDefault();
jQuery('body,html').animate({scrollTop: 0}, 800);
});
},
load:function(){
var deviceAgent=navigator.userAgent.toLowerCase(),
agentID=deviceAgent.match(/(iphone|ipod|ipad|android|iemobile)/);
if(!agentID){
jQuery('.tooltip').each(function(){
jQuery(this).css('marginLeft', '-' + Math.round((jQuery(this).outerWidth(true) / 2)) + 'px');
});
jQuery('.comment-avatar').hover(function(){
jQuery(this).find('.tooltip').stop().animate({
bottom: '44px',
opacity: 1
}, 500, 'easeInOutExpo');
}, function(){
jQuery(this).find('.tooltip').stop().animate({
bottom: '25px',
opacity: 0
}, 400, 'easeInOutExpo');
});
jQuery('.grid-image').hover(function(){
jQuery(this).find('.tooltip').stop().animate({
bottom: '85px',
opacity: 1
}, 500, 'easeInOutExpo');
}, function(){
jQuery(this).find('.tooltip').stop().animate({
bottom: '65px',
opacity: 0
}, 400, 'easeInOutExpo');
});
}}
};
var $window=jQuery(window),
body=jQuery('body'),
sfIncluded=jQuery('#sf-included'),
sfOptionParams=jQuery('#sf-option-params'),
deviceAgent=navigator.userAgent.toLowerCase(),
isMobileAlt=deviceAgent.match(/(iphone|ipod|ipad|android|iemobile)/),
lightboxControlArrows=sfOptionParams.data('lightbox-nav')==="arrows" ? true:false,
lightboxThumbs=sfOptionParams.data('lightbox-thumbs') ? true:false,
lightboxSkin=sfOptionParams.data('lightbox-skin')==="dark" ? "metro-black":"metro-white",
lightboxSharing=sfOptionParams.data('lightbox-sharing') ? true:false,
hasProductZoom=jQuery('#sf-included').hasClass('has-productzoom')&&!body.hasClass('mobile-browser') ? true:false;
SF.onReady={
init: function(){
SF.page.init();
SF.superSearch.init();
SF.header.init();
SF.nav.init();
if(sfIncluded.hasClass('has-products')||body.hasClass('woocommerce-cart')||body.hasClass('woocommerce-account')){
SF.woocommerce.init();
}
if(sfIncluded.hasClass('has-team')){
SF.teamMembers.init();
}
SF.lightbox.init();
if(sfIncluded.hasClass('has-carousel')){
SF.carouselWidgets.init();
SF.woocommerce.productCarousel();
}
SF.widgets.init();
if(sfIncluded.hasClass('has-parallax')){
SF.parallax.init();
}
SF.reloadFunctions.init();
}};
SF.onLoad={
init: function(){
SF.flexSlider.init();
if(sfIncluded.hasClass('has-portfolio')){
SF.portfolio.init();
}
if(sfIncluded.hasClass('has-blog')){
SF.blog.init();
}
if(sfIncluded.hasClass('has-chart')){
SF.widgets.charts();
}
if(sfIncluded.hasClass('has-progress-bar')){
SF.widgets.initSkillBars();
}
if(sfIncluded.hasClass('has-map')){
SF.map.init();
}
SF.reloadFunctions.load();
SF.woocommerce.variations();
}};
jQuery(document).ready(SF.onReady.init);
jQuery(window).load(SF.onLoad.init);
})(jQuery);
(function($,sr){
"use strict";
var debounce=function (func, threshold, execAsap){
var timeout;
return function debounced (){
var obj=this, args=arguments;
function delayed (){
if(!execAsap){
func.apply(obj, args);
timeout=null;
}}
if(timeout){
clearTimeout(timeout);
}else if(execAsap){
func.apply(obj, args);
}
timeout=setTimeout(delayed, threshold||100);
};};
jQuery.fn[sr]=function(fn){ return fn ? this.bind('resize', debounce(fn)):this.trigger(sr); };})(jQuery,'smartresize');
(function($){
"use strict";
$.fn.equalHeights=function(px){
$(this).each(function(){
var currentTallest=0;
$(this).children().each(function(){
if($(this).height() > currentTallest){ currentTallest=$(this).height(); }});
if(!px&&Number.prototype.pxToEm){
currentTallest=currentTallest.pxToEm();
}
if($.browser.msie&&$.browser.version===6.0){
(this).children().css({'height': currentTallest});
}
$(this).children().css({'min-height': currentTallest});
});
return this;
};})(jQuery);
(function($){
"use strict";
$.easyPieChart=function(el, options){
var addScaleLine, animateLine, drawLine, easeInOutQuad, renderBackground, renderScale, renderTrack,
_this=this;
this.el=el;
this.$el=$(el);
this.$el.data("easyPieChart", this);
this.init=function(){
var percent;
_this.options=$.extend({}, $.easyPieChart.defaultOptions, options);
percent=parseInt(_this.$el.data('percent'), 10);
_this.percentage=0;
_this.canvas=$("").get(0);
_this.$el.append(_this.canvas);
if(typeof G_vmlCanvasManager!=="undefined"&&G_vmlCanvasManager!==null){
G_vmlCanvasManager.initElement(_this.canvas);
}
_this.ctx=_this.canvas.getContext('2d');
if(window.devicePixelRatio > 1.5){
$(_this.canvas).css({
width: _this.options.size,
height: _this.options.size
});
_this.canvas.width *=2;
_this.canvas.height *=2;
_this.ctx.scale(2, 2);
}
_this.ctx.translate(_this.options.size / 2, _this.options.size / 2);
_this.$el.addClass('easyPieChart');
_this.$el.css({
width: _this.options.size,
height: _this.options.size,
lineHeight: "" + _this.options.size + "px"
});
_this.update(percent);
return _this;
};
this.update=function(percent){
if(_this.options.animate===false){
return drawLine(percent);
}else{
if(percent===0){
return animateLine(0, 0);
}else{
return animateLine(_this.percentage, percent);
}}
};
renderScale=function(){
var i, _i, _results;
_this.ctx.fillStyle=_this.options.scaleColor;
_this.ctx.lineWidth=1;
_results=[];
for (i=_i=0; _i <=24; i=++_i){
_results.push(addScaleLine(i));
}
return _results;
};
addScaleLine=function(i){
var offset;
offset=i % 6===0 ? 0:_this.options.size * 0.017;
_this.ctx.save();
_this.ctx.rotate(i * Math.PI / 12);
_this.ctx.fillRect(_this.options.size / 2 - offset, 0, -_this.options.size * 0.05 + offset, 1);
return _this.ctx.restore();
};
renderTrack=function(){
var offset;
offset=_this.options.size / 2 - _this.options.lineWidth / 2;
if(_this.options.scaleColor!==false){
offset -=_this.options.size * 0.08;
}
_this.ctx.beginPath();
_this.ctx.arc(0, 0, offset, 0, Math.PI * 2, true);
_this.ctx.closePath();
_this.ctx.strokeStyle=_this.options.trackColor;
_this.ctx.lineWidth=_this.options.lineWidth;
return _this.ctx.stroke();
};
renderBackground=function(){
if(_this.options.trackColor!==false){
return renderTrack();
}};
drawLine=function(percent){
var offset;
renderBackground();
_this.ctx.strokeStyle=$.isFunction(_this.options.barColor) ? _this.options.barColor(percent):_this.options.barColor;
_this.ctx.lineCap=_this.options.lineCap;
_this.ctx.lineWidth=_this.options.lineWidth;
offset=_this.options.size / 2 - _this.options.lineWidth / 2;
if(_this.options.scaleColor!==false){
offset -=_this.options.size * 0.08;
}
_this.ctx.save();
_this.ctx.rotate(-Math.PI / 2);
_this.ctx.beginPath();
_this.ctx.arc(0, 0, offset, 0, Math.PI * 2 * percent / 100, false);
_this.ctx.stroke();
return _this.ctx.restore();
};
animateLine=function(from, to){
var currentStep, fps, steps;
fps=30;
steps=fps * _this.options.animate / 1000;
currentStep=0;
_this.options.onStart.call(_this);
_this.percentage=to;
if(_this.animation){
clearInterval(_this.animation);
_this.animation=false;
}
_this.animation=setInterval(function(){
_this.ctx.clearRect(-_this.options.size / 2, -_this.options.size / 2, _this.options.size, _this.options.size);
renderBackground.call(_this);
drawLine.call(_this, [easeInOutQuad(currentStep, from, to - from, steps)]);
currentStep++;
if((currentStep / steps) > 1){
clearInterval(_this.animation);
_this.animation=false;
return _this.options.onStop.call(_this);
}}, 1000 / fps);
return _this.animation;
};
easeInOutQuad=function(t, b, c, d){
var easeIn, easing;
easeIn=function(t){
return Math.pow(t, 2);
};
easing=function(t){
if(t < 1){
return easeIn(t);
}else{
return 2 - easeIn((t / 2) * -2 + 2);
}};
t /=d / 2;
return c / 2 * easing(t) + b;
};
return this.init();
};
$.easyPieChart.defaultOptions={
barColor: '#ef1e25',
trackColor: '#f2f2f2',
scaleColor: false,
lineCap: 'round',
size: 110,
lineWidth: 3,
animate: false,
onStart: $.noop,
onStop: $.noop
};
$.fn.easyPieChart=function(options){
return $.each(this, function(i, el){
var $el;
$el=$(el);
if(!$el.data('easyPieChart')){
return $el.data('easyPieChart', new $.easyPieChart(el, options));
}});
};
return void 0;
})(jQuery);
(function($){
"use strict";
$.fn.animateNumber=function(to){
var $ele=$(this),
num=parseInt($ele.html(), 10),
up=to > num,
num_interval=Math.abs(num - to) / 90;
var loop=function(){
num=up ? Math.ceil(num+num_interval):Math.floor(num-num_interval);
if((up&&num > to)||(!up&&num < to)){
num=to;
clearInterval(animation);
}
$ele.html(num);
};
var intervalTime=to <=5 ? intervalTime=100:to <=25 ? intervalTime=50:to <=50 ? intervalTime=25:10;
var animation=setInterval(loop, intervalTime);
};})(jQuery);
(function($){
"use strict";
$.belowthefold=function(element, settings){
var fold=$(window).height() + $(window).scrollTop();
return fold <=$(element).offset().top - settings.threshold;
};
$.abovethetop=function(element, settings){
var top=$(window).scrollTop();
return top >=$(element).offset().top + $(element).height() - settings.threshold;
};
$.rightofscreen=function(element, settings){
var fold=$(window).width() + $(window).scrollLeft();
return fold <=$(element).offset().left - settings.threshold;
};
$.leftofscreen=function(element, settings){
var left=$(window).scrollLeft();
return left >=$(element).offset().left + $(element).width() - settings.threshold;
};
$.inviewport=function(element, settings){
return !$.rightofscreen(element, settings)&&!$.leftofscreen(element, settings)&&!$.belowthefold(element, settings)&&!$.abovethetop(element, settings);
};
$.extend($.expr[':'], {
"below-the-fold": function(a){
return $.belowthefold(a, {threshold:0});
},
"above-the-top": function(a){
return $.abovethetop(a, {threshold:0});
},
"left-of-screen": function(a){
return $.leftofscreen(a, {threshold:0});
},
"right-of-screen": function(a){
return $.rightofscreen(a, {threshold:0});
},
"in-viewport": function(a){
return $.inviewport(a, {threshold:0});
}});
})(jQuery);
(function ($){
'use strict';
$.fn.extend({
customSelect: function (options){
if(typeof document.body.style.maxHeight==='undefined'){
return this;
}
var defaults={
customClass: 'customSelect',
mapClass: true,
mapStyle: true
},
options=$.extend(defaults, options),
prefix=options.customClass,
changed=function ($select,customSelectSpan){
var currentSelected=$select.find(':selected'),
customSelectSpanInner=customSelectSpan.children(':first'),
html=currentSelected.html()||' ';
customSelectSpanInner.html(html);
if(currentSelected.attr('disabled')){
customSelectSpan.addClass(getClass('DisabledOption'));
}else{
customSelectSpan.removeClass(getClass('DisabledOption'));
}
setTimeout(function (){
customSelectSpan.removeClass(getClass('Open'));
$(document).off('mouseup.'+getClass('Open'));
}, 60);
},
getClass=function(suffix){
return prefix + suffix;
};
return this.each(function (){
var $select=$(this),
customSelectInnerSpan=$('').addClass(getClass('Inner')),
customSelectSpan=$('');
$select.after(customSelectSpan.append(customSelectInnerSpan));
customSelectSpan.addClass(prefix);
if(options.mapClass){
customSelectSpan.addClass($select.attr('class'));
}
if(options.mapStyle){
customSelectSpan.attr('style', $select.attr('style'));
}
$select
.addClass('hasCustomSelect')
.on('update', function (){
changed($select,customSelectSpan);
var selectBoxWidth=parseInt($select.outerWidth(), 10) -
(parseInt(customSelectSpan.outerWidth(), 10) -
parseInt(customSelectSpan.width(), 10));
customSelectSpan.css({
display: 'inline-block'
});
var selectBoxHeight=customSelectSpan.outerHeight();
if($select.attr('disabled')){
customSelectSpan.addClass(getClass('Disabled'));
}else{
customSelectSpan.removeClass(getClass('Disabled'));
}
customSelectInnerSpan.css({
width: selectBoxWidth,
display: 'inline-block'
});
$select.css({
'-webkit-appearance': 'menulist-button',
width: customSelectSpan.outerWidth(),
position: 'absolute',
opacity: 0,
height: selectBoxHeight,
fontSize: customSelectSpan.css('font-size')
});
})
.on('change', function (){
customSelectSpan.addClass(getClass('Changed'));
changed($select,customSelectSpan);
})
.on('keyup', function (e){
if(!customSelectSpan.hasClass(getClass('Open'))){
$select.blur();
$select.focus();
}else{
if(e.which==13||e.which==27){
changed($select,customSelectSpan);
}}
})
.on('mousedown', function (e){
customSelectSpan.removeClass(getClass('Changed'));
})
.on('mouseup', function (e){
if(!customSelectSpan.hasClass(getClass('Open'))){
if($('.'+getClass('Open')).not(customSelectSpan).length>0&&typeof InstallTrigger!=='undefined'){
$select.focus();
}else{
customSelectSpan.addClass(getClass('Open'));
e.stopPropagation();
$(document).one('mouseup.'+getClass('Open'), function (e){
if(e.target!=$select.get(0)&&$.inArray(e.target,$select.find('*').get()) < 0){
$select.blur();
}else{
changed($select,customSelectSpan);
}});
}}
})
.focus(function (){
customSelectSpan.removeClass(getClass('Changed')).addClass(getClass('Focus'));
})
.blur(function (){
customSelectSpan.removeClass(getClass('Focus')+' '+getClass('Open'));
})
.hover(function (){
customSelectSpan.addClass(getClass('Hover'));
}, function (){
customSelectSpan.removeClass(getClass('Hover'));
})
.trigger('update');
});
}});
})(jQuery);
(function($){
$.fn.appear=function(fn, options){
var settings=$.extend({
data: undefined,
one: true,
accX: 0,
accY: 0
}, options);
return this.each(function(){
var t=$(this);
t.appeared=false;
if(!fn){
t.trigger('appear', settings.data);
return;
}
var w=$(window);
var check=function(){
if(!t.is(':visible')){
t.appeared=false;
return;
}
var a=w.scrollLeft();
var b=w.scrollTop();
var o=t.offset();
var x=o.left;
var y=o.top;
var ax=settings.accX;
var ay=settings.accY;
var th=t.height();
var wh=w.height();
var tw=t.width();
var ww=w.width();
if(y + th + ay >=b &&
y <=b + wh + ay &&
x + tw + ax >=a &&
x <=a + ww + ax){
if(!t.appeared) t.trigger('appear', settings.data);
}else{
t.appeared=false;
}};
var modifiedFn=function(){
t.appeared=true;
if(settings.one){
w.unbind('scroll', check);
var i=$.inArray(check, $.fn.appear.checks);
if(i >=0) $.fn.appear.checks.splice(i, 1);
}
fn.apply(this, arguments);
};
if(settings.one) t.one('appear', settings.data, modifiedFn);
else t.bind('appear', settings.data, modifiedFn);
w.scroll(check);
$.fn.appear.checks.push(check);
(check)();
});
};
$.extend($.fn.appear, {
checks: [],
timeout: null,
checkAll: function(){
var length=$.fn.appear.checks.length;
if(length > 0) while (length--) ($.fn.appear.checks[length])();
},
run: function(){
if($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
$.fn.appear.timeout=setTimeout($.fn.appear.checkAll, 20);
}});
$.each(['append', 'prepend', 'after', 'before', 'attr',
'removeAttr', 'addClass', 'removeClass', 'toggleClass',
'remove', 'css', 'show', 'hide'], function(i, n){
var old=$.fn[n];
if(old){
$.fn[n]=function(){
var r=old.apply(this, arguments);
$.fn.appear.run();
return r;
}}
});
})(jQuery);
(function($){$.fn.vCenter=function(){return this.each(function(){var height=$(this).outerHeight();$(this).css('margin-bottom',-height/2);});};})(jQuery);
(function($){$.fn.vCenterTop=function(){return this.each(function(){var height=$(this).outerHeight();$(this).css('margin-top',-height/2);});};})(jQuery);
window.addComment=function(a){function b(a){if(s&&(l=i(q.cancelReplyId),m=i(q.commentFormId),l)){l.addEventListener("touchstart",d),l.addEventListener("click",d);for(var b,f=c(a),g=0,h=f.length;g1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document);
EasyCookie=(function(){var EPOCH='Thu, 01-Jan-1970 00:00:01 GMT',RATIO=1000*60*60*24,KEYS=['expires','path','domain'],esc=escape,un=unescape,doc=document,me;var get_now=function(){var r=new Date();r.setTime(r.getTime());return r;}
var cookify=function(c_key,c_val){var i,key,val,r=[],opt=(arguments.length>2)?arguments[2]:{};r.push(esc(c_key)+'='+esc(c_val));for(i=0;i2)?arguments[2]:{},now=get_now(),expire_at,cfg={};if(opt.expires){opt.expires*=RATIO;cfg.expires=new Date(now.getTime()+opt.expires);cfg.expires=cfg.expires.toGMTString();}
var keys=['path','domain','secure'];for(i=0;i0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){return n(t,this.pop()).apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier,e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=o;else if(c){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+N.toString(t));r._attachCancellationCallback(t)})}catch(t){return t}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?N.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!=(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(H(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);N.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),N.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&W){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=w(a),l=c.length-1;l>=0;--l){var u=c[l];if(!U.test(u)){var p=u.match(M);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var h=c[0],l=0;l0&&(s="\n"+a[l-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}tt("warning",o)||E(o,"",!0)}}function g(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(N.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function k(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(t){I.throwLater(t)}"unhandledRejection"===t?tt(t,n,r)||i||E(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():N.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){return t.length<41?t:t.substr(0,38)+"..."}function T(){return"function"==typeof it}function P(t){var e=t.match(rt);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}function R(t,e){if(T()){for(var n,r,i=t.stack.split("\n"),o=e.stack.split("\n"),s=-1,a=-1,c=0;cs||0>a||!n||!r||n!==r||s>=a||(nt=function(t){if(B.test(t))return!0;var e=P(t);return!!(e&&e.fileName===n&&s<=e.line&&e.line<=a)})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,N=t("./util"),H=N.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,M=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,Q=null,$=!1,G=!(0==N.env("BLUEBIRD_DEBUG")||!N.env("BLUEBIRD_DEBUG")&&"development"!==N.env("NODE_ENV")),z=!(0==N.env("BLUEBIRD_WARNINGS")||!G&&!N.env("BLUEBIRD_WARNINGS")),X=!(0==N.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!N.env("BLUEBIRD_LONG_STACK_TRACES")),W=0!=N.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(z||!!N.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){k("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),k("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:N.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:N.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&T()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return N.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!N.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return N.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!N.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),N.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!N.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),Y=function(){return N.isNode?function(){return process.emit.apply(process,arguments)}:N.global?function(t){var e="on"+t.toLowerCase(),n=N.global[e];return!!n&&(n.apply(N.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(t){I.throwLater(t),e=!0}var n=!1;try{n=J(t,Z[t].apply(null,arguments))}catch(t){I.throwLater(t),n=!0}return n||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,W=ot.warnings,N.isObject(n)&&"wForgottenReturn"in n&&(W=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;N.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),m(r),N.notEnumerableProp(t,"stack",g(n,r)),N.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,Q=e;var n=Error.captureStackTrace;return nt=function(t){return B.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,Q=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(t){i="stack"in t}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(D=function(t){console.warn(t)},N.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"[33m":"[31m";console.warn(n+t+"[0m\n")}:N.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:z,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(t){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new u("late cancellation observer");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function c(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,n,s,o).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0==(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0==(33554432&y))return 0!=(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}return++this._totalResolved>=o&&(null!==a?this._filter(r,a):this._resolve(r),!0)},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e.try=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return p("expecting an object but got A catch statement predicate "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=O(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new g("expecting a function but got "+f.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(b),l=this._target(),u=l._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!=(50397184&u)){var h,_,d=l._settlePromiseCtx;0!=(33554432&u)?(_=l._rejectionHandler0,h=t):0!=(16777216&u)?(_=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new m("late cancellation observer"),l._attachExtraTrace(_),h=e),v.invoke(d,l,{handler:null===p?h:"function"==typeof h&&f.domainBind(p,h),promise:a,receiver:r,value:_})}else l._addCallbacks(t,e,a,r,p);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===h?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:f.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:f.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=j(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0==(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!=(33554432&o))this._fulfill(r._value());else if(0!=(16777216&o))this._reject(r._reason());else{var c=new m("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,!!e&&i),this._reject(t)},i.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0==(65536&i)){r._pushContext();var o;e===w?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=S,o.e=new g("cannot .spread() a non-array: "+f.classString(n))):o=O(t).call(e,n);var s=r._popContext();0==(65536&(i=r._bitField))&&(o===C?r._reject(n):o===S?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!=(134217728&a);0!=(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!=(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!=(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,f.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!=(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){return x.deprecated("Promise.defer","new Promise"),{promise:new i(b),resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,j,p,x),t("./bind")(i,b,j,x),t("./cancel")(i,E,p,x),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,b,v,c),i.Promise=i,i.version="3.4.7",t("./map.js")(i,E,p,j,b,x),t("./call_get.js")(i),t("./using.js")(i,p,j,F,b,x),t("./timers.js")(i,b,x),t("./generators.js")(i,p,b,j,n,x),t("./nodeify.js")(i),t("./promisify.js")(i,b),t("./props.js")(i,E,j,p),t("./race.js")(i,b,j,p),t("./reduce.js")(i,E,p,j,b,x),t("./settle.js")(i,E,x),t("./some.js")(i,E,p),t("./filter.js")(i,b),t("./each.js")(i,b),t("./any.js")(i),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(b)),x.setBounds(d.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");return c.isArray,c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function t(n,o){var a=r(this._values,this._promise);if(a instanceof e){a=a._target();var l=a._bitField;if(this._values=a,0==(50397184&l))return this._promise._setAsyncGuaranteed(),a._then(t,this._reject,void 0,this,o);if(0==(33554432&l))return 0!=(16777216&l)?this._reject(a._reason()):this._cancel();a=a._value()}if(null===(a=c.asArray(a))){var u=i("expecting an array or an iterable object but got "+c.classString(a)).reason();return void this._promise._rejectCallback(u,!1)}return 0===a.length?void(-5===o?this._resolveEmptyArray():this._resolve(s(o))):void this._iterate(a)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0==(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!=(33554432&s)?this._promiseFulfilled(c._value(),a):0!=(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var u=s[c],f=s[c+1],_=u+e;if(r===j)t[_]=j(u,p,u,f,e,i);else{var d=r(f,function(){return j(u,p,u,f,e,i)});h.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return h.toFastProperties(t),t}function u(t,e,n){return j(t,e,void 0,t,null,n)}var p={},h=t("./util"),f=t("./nodeback"),_=h.withAppended,d=h.maybeWrapAsError,v=h.canEvaluate,y=t("./errors").TypeError,g={__isPromisified__:!0},m=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],b=new RegExp("^(?:"+m.join("|")+")$"),w=function(t){return h.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},C=function(t){return t.replace(/([$])/,"\\$")},j=v?void 0:c;e.promisify=function(t,e){if("function"!=typeof t)throw new y("expecting a function but got "+h.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?p:e.context,o=!!e.multiArgs,s=u(t,n,o);return h.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new y("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r="Async");var i=e.filter;"function"!=typeof i&&(i=w);var o=e.promisifier;if("function"!=typeof o&&(o=j),!h.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=h.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var n;if(this._isMap)n=h(this._values);else{n={};for(var r=this.length(),i=0,o=this.length();o>i;++i)n[this._values[i+r]]=this._values[i]}return this._resolve(n),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=i===o?Array(this._length):0===i?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){return"function"!=typeof e?r("expecting a function but got "+f.classString(e)):new a(t,e,n,i).promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;(o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div");new MutationObserver(function(){t.classList.toggle("foo"),n=!1}).observe(r,e);var i=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),i()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection;t("./util").inherits(i,n),i.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values)
;!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(t){return l.e=t,l}}function s(t){try{return p.call(t,"_promise0")}catch(t){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(t){return a(t)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,g=_.tryCatch,m={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==m?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var m=r(d);m instanceof e&&(d=m._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=F;return F=null,t.apply(this,arguments)}catch(t){return P.e=t,P}}function i(t){return F=t,r}function o(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!x.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return x.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=x.names(t.prototype),n=x.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&x.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return D.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(t){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(t){}}function m(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)}function b(t){return y(t)&&x.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=x.names(t),i=0;i10||t[0]>0}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(t){B.lastLineError=t}e.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise),function(t){window.NggPaginatedGallery=function(e,n){this.displayed_gallery_id=e,this.container=t(n),this.container_name=n,this.get_displayed_gallery_obj=function(){var t="gallery_"+this.displayed_gallery_id;return void 0!==window.galleries[t]&&window.galleries[t]},this.enable_ajax_pagination=function(){var e=this;t("body").on("click","a.ngg-browser-prev, a.ngg-browser-next",function(r){var i=!0;t(this).parents(n).each(function(){if(t(this).data("nextgen-gallery-id")!=e.displayed_gallery_id)return!0;i=!1}),i||(r.preventDefault(),window.ngg_ajax_operaton_count++,t("body, a").css("cursor","wait"),t.get(t(this).attr("href"),function(n){if(window.ngg_ajax_operaton_count--,window.ngg_ajax_operaton_count<=0&&(window.ngg_ajax_operaton_count=0,t("body, a").css("cursor","auto")),n){var r=t(n),i=!1;r.find(e.container_name).each(function(){return!!i||(t(this).data("nextgen-gallery-id")!=e.displayed_gallery_id||void(i=t(this)))}),i&&e.container.each(function(){var n=t(this);if(n.data("nextgen-gallery-id")!=e.displayed_gallery_id)return!0;var r=t(i.html()),o=r.find("img").toArray().map(function(e){return new Promise(function(n,r){var i=new Image;i.src=e.src,t(i).on("load",n)})});return Promise.all(o).then(function(){n.html(r),t(document).trigger("refreshed")}),!0})}}))})};var r=this.get_displayed_gallery_obj();r&&void 0!==r.display_settings.ajax_pagination&&parseInt(r.display_settings.ajax_pagination)&&this.enable_ajax_pagination(),void 0===window.ngg_ajax_operation_count&&(window.ngg_ajax_operaton_count=0)}}(jQuery);
jQuery(function(t){var a=function(){var a=t("a.use_imagebrowser_effect");a.click(function(a){a.preventDefault();var i=!0,n=t(this),e=n.attr("data-image-id"),r=n.attr("data-image-slug"),o=n.attr("data-imagebrowser-url"),c=window.location.toString();c=c.split("/"+photocrati_ajax.ngg_param_slug+"/").shift(),"/"===c.substr(-1)&&(c=c.substr(0,c.length-1)),e=r||e;try{e||(e=parseInt(n.parents(".ngg-gallery-thumbnail-box").attr("id").match(/\d+/).join("")))}catch(t){i=!1}i&&(c=o.replace("%STUB%",e),window.location=c)}),a.length>0&&setTimeout(function(){a.each(function(){this.onclick=null})},200)};t(this).bind("refreshed",a),a()});
function nextgen_lightbox_filter_selector(e,t){if(nextgen_lightbox_settings&&nextgen_lightbox_settings.context){var n=nextgen_lightbox_settings.context;"all_images"==n?t=t.add(e("a > img").parent()):"all_images_direct"==n?t=t.add(e("a[href] > img").parent().filter(function(){var t=e(this).attr("href").toLowerCase(),n=t.substring(t.length-3),g=t.substring(t.length-4);return"jpg"==n||"gif"==n||"png"==n||"tiff"==g||"jpeg"==g})):"nextgen_and_wp_images"==n&&(t=t.add(e('a > img[class*="wp-image-"]').parent())),t=t.not(".gallery_link"),t=t.not(".use_imagebrowser_effect")}return t};
eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('The requested content cannot be loaded.
Please try again later.
');
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win=="function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
d.titlePosition=="float"?'':''+s+"
":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j);
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type=="image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b(''),t=b(''),u=b(''),f=b(''));D=b('').append('').appendTo(f);
D.append(j=b(''),E=b(''),n=b(''),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}};
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
jQuery(function(n){var e=function(){nextgen_lightbox_filter_selector(n,n(".ngg-fancybox")).fancybox({titlePosition:"inside",onComplete:function(){n("#fancybox-wrap").css("z-index",1e4)}})};n(window).bind("refreshed",e),e()});