1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 2(function($,Drupal,drupalSettings){'use strict';let isAttached=false;Drupal.behaviors.nppeBazaarVoiceRatingsPaginate={attach:function(context,settings){if(!context.once){context.once=true;var screenWidth=window.innerWidth;$("#bvCGC ul li.pager__item a",context).on('click',function(){$(document).ajaxSuccess(function(event,data){if(screenWidth>1139){var headerSectionHeight=0;var bannerHeight=0;var headerHeight=0;var headerSection=document.getElementsByClassName('component-header-sticky')[0];if(headerSection)headerSectionHeight=headerSection.scrollHeight;var banner=document.querySelector('.sticky-banner.is--desktop.sticky');if(banner)bannerHeight=banner.scrollHeight;var header=document.querySelector('.sticky-header.is--desktop.sticky');if(header)headerHeight=header.scrollHeight;var gridItemRef=document.getElementById('bvCGC');var rect=gridItemRef.getBoundingClientRect();var offset=window.scrollY+rect.top-headerSectionHeight-bannerHeight-headerHeight-120;$([document.documentElement,document.body]).animate({scrollTop:offset},'fast');}});});}}};Drupal.behaviors.nppeBazaarVoiceRatingsApi={attach:function(context,settings){if(!isAttached){isAttached=true;if(window.drupalSettings.hasOwnProperty("bv_api")){var bvScript='https://apps.bazaarvoice.com/deployments/'+window.drupalSettings.bv_api.brand_instance+'/'+window.drupalSettings.bv_api.site_id+'/'+window.drupalSettings.bv_api.environment+'/'+window.drupalSettings.bv_api.currentLanguage+'/bv.js';$.getScript(bvScript,function(data,textStatus,jqxhr){console.log('bv script loaded');});}$(document).on('click',".lightbox",function(){var imgsrc=$(this).attr('data-photoimg');$(".rating-history-block-wrapper").append("<div class='img-popup'><span class='close-lightbox'></span><img src='"+imgsrc+"'></div>");$(".close-lightbox, .img-popup").click(function(){$(".img-popup").fadeOut(500,function(){$(this).remove();}).addClass("lightboxfadeout");});$(".img-popup").fadeIn(500);});$(document).on('click',".review",function(){var vote=$(this).attr('data-vote');var id=$(this).attr('data-reviewid');$.ajax({url:'/nppe_bazaar_voice_ratings_api/api/feedback',type:'get',crossDomain:true,data:{FORMAT:'json',apiversion:'5.4',ContentId:id,ContentType:"review",FeedbackType:'helpfulness',PassKey:window["drupalSettings"].bv_api_key,Vote:vote},dataType:'json',success:function(data){if(data.HasErrors==false)$('#response'+id).text('Thank y
2ou. Your feedback has been saved.');}});});function setReviewStars(){jQuery('.review-stats').each(function(){var a=parseInt($(this).find(".star-avg").text(),10);var b=5;var c=(a/b)*100;$(this).find('.stars-inner').css('width',c+'%');});}jQuery(document).ready(function(){jQuery(document).ajaxComplete(function(){setReviewStars();jQuery(".ajax-progress").remove();});});setReviewStars();jQuery('.bar-rate-one').each(function(){var barCount=parseInt($(this).find(".avgrating").text(),10);var barValue=5;var barResult=(barCount/barValue)*100;$(this).find('.stars-inner-bar').css('width',barResult+'%');});var response=Drupal.t("Thank you. Your feedback has been saved.");var num=parseInt($(".of-our-customers").text(),10);var numTruncated=parseFloat(num).toFixed(0);var numText=Drupal.t("of our customers recommend this product.");jQuery('.of-our-customers').empty().append(numTruncated,'%',numText);var numbar=parseInt($(".results-avg .avgrating").text(),10);var numTruncatedbar=parseFloat(numbar).toFixed(2);jQuery('.results-avg .avgrating').empty().append(numTruncatedbar);jQuery('.bv-submission-button').on('click',function(){var productid=$(this).attr('data-productid');$BV.ui('rr','submit_review',{productId:productid});});var x=parseInt($(".count").text(),10);var y=5;var z=(x/y)*100;jQuery(".count-bars").css('width',z+'%');jQuery('.count-1').each(function(){var barCountone=parseInt($(".count-1").text(),10);var barCountonevalue=$(this).attr('data-reviewcount');var barCountoneres=(barCountone/barCountonevalue)*100;jQuery(".count-1").css('width',barCountoneres+'%');});jQuery('.count-2').each(function(){var barCounttwo=parseInt($(".count-2").text(),10);var barCounttwovalue=$(this).attr('data-reviewcount');var barCounttwores=(barCounttwo/barCounttwovalue)*100;jQuery(".count-2").css('width',barCounttwores+'%');});jQuery('.count-3').each(function(){var barCountthr=parseInt($(".count-3").text(),10);var barCountthrvalue=$(this).attr('data-reviewcount');var Barcountthrres=(barCountthr/barCountthrvalue)*100;jQuery(".count-3").css('width',Barcountthrres+'%');});jQuery('.count-4').each(function(){var barCountfour=parseInt($(".count-4").text(),10);var barCountfourvalue=$(this).attr('data-reviewcount');var Barcountfourres=(barCountfour/barCountfourvalue)*100;jQuery(".count-4").css('width',Barcountfourres+'%');});jQuery('.count-5').each(function(){var barCountfive=parseInt($(".count-5").text(),10);var barCountfivevalue=$(this).attr('data-reviewcount');var Barcountfiveres=(barCountfive/barCountfivevalue)*100;jQuery(".count-5").css('width',Barcountfiveres+'%');});function setReviewcountStars(){$.fn.countstars=function(){return $(this).each(function(){const rating=$(this).data("rating");const numStars=$(this).data("numStars");const fullStar='<i class="fas fa-star"></i>'.repeat(Math.floor(rating));const halfStar=(rating%1!==0)?'<i class="fas fa-star-half-alt"></i>':'';const noStar='<i class="far fa-star"></i>'.repeat(Math.floor(numStars-rating));$(this).html(`${fullStar}${halfStar}${noStar}`);});};$(function(){$('.countstars').countstars();});}jQuery(document).ready(function(){jQuery(document).ajaxComplete(function(){setReviewcountStars();jQuery(".ajax-progress").remove();});});setReviewcountStars();jQuery(document).ready(function(){if(jQuery('.review-stats').height()==0){jQuery('.dsu-product--stars-rating').remove();jQuery('#BVRRContainer').remove();jQuery('#BVRRSummaryContainer').remove();jQuery('#BVRRSearchContainer').remove();}else{jQuery('.dsu-product--stars-rating').show();jQuery('#BVRRContainer').show();jQuery('#BVRRSummaryContainer').show();jQuery('#BVRRSearchContainer').show();}});jQuery(".btn-buynow").click(function(){window.bvCallback=function(BV){BV.pixel.trackConversion({"type":"button","label":"btn-buynow","value":"value"});};});jQuery(document).ready(function(){var lcode=Drupal.t("en_uk");var title='{{ title }}';var productId=$(this).attr('data-reviewid');var productPageURL='{{ url }}';var productDescription='{{ product_description}}';var productImageURL='{{ product_img_url }}';var brandName='{{ brand }}';var productReviewers=$(this).attr('data-reviewcount');var productreviewsAvg=$(this).attr('data-rating');var productreviewsRecommended=$(this).attr('data-recommend');var bvCGC=jQuery('#bvCGC');window.bvDCC={catalogData:{locale:lcode,catalogProducts:[{"productId":productId,"productName":title,"productDescription":productDescription,"productImageURL":productImageURL,"productPageURL":productPageURL,"brandName":brandName,"upcs":["724742001735","724742006907","077320775406","077320775307"],"manufacturerPartNumbers":["mpn1","mpn2","mpn3","mpn4","mpn5"],"eans":["0724742001735","0724742006907","0077320775406","0077320775307"],"isbns":["9781891830754","9781603090506","9781891830716","9781603090254"],"modelNumbers":["model1","model2","model3","model4"],"family":"F02","inactive":false}]}};window.bvCallback=function(BV){BV.pixel.trackEvent("CatalogUpdate",{type:'Product',locale:window.bvDCC.catalogData.locale,catalogProducts:window.bvDCC.catalogData.catalogProducts});var prodId=jQuery("#bvCGC").attr("data-productid");var inViewData={productId:prodId,bvProduct:'RatingsAndReviews'};BV.pixel.trackInView(inViewData,{minPixels:250,containerId:'bvCGC'});};window.bvCallback=function(BV){BV.pixel.trackViewedCGC({productId:prodId,bvProduct:'RatingsAndReviews',categoryId:prodId,rootCategoryId:prodId},{minPixels:100,minTime:5000,containerId:'bvCGC'});var pageViewData={bvProduct:'RatingsAndReviews',productId,brand:brandName,type:'Product',numReviews:productReviewers,avgRating:productreviewsAvg,percentRecommended:productreviewsRecommended};BV.pixel.trackPageView(pageViewData);var defaultPageViewData={productId,brand:brandName,type:'Product'};var rrPageViewData=clone(pageViewData,{bvProduct:'RatingsAndReviews',numReviews:productReviewers,avgRating:productreviewsAvg,percentRecommended:productreviewsRecommended});BV.pixel.trackPageView(rrPageViewData);var aaPageViewData=clone(defaultPageViewData,{bvProduct:'AskAndAnswer'});BV.pixel.trackPageView(aaPageViewData);BV.pixel.trackImpression({productId,contentType:'review',bvProduct:'RatingsAndReviews',brand:brandName});BV.pixel.trackImpression({contentId:productId,productId,contentType:'review',bvProduct:'RatingsAndReviews',brand:brandName});var prodId=jQuery("#bvCGC").attr("data-productid");var inViewData={productId:prodId,bvProduct:'RatingsAndReviews'};BV.pixel.trackInView(inViewData,{minPixels:250,containerId:'bvCGC'});BV.pixel.trackViewedCGC({productId:prodId,bvProduct:'RatingsAndReviews',categoryId:prodId,rootCategoryId:prodId},{minPixels:100,minTime:5000,containerId:'bvCGC'});BV.pixel.trackEvent('Feature',{type:'Used',name:conversionData,brand:featureObject.brandName,productId,bvProduct:productId,categoryId:featureObject.categoryId,detail1,detail2});BV.pixel.trackConversion(conversionData);BV.pixel.trackTransaction(transactionData);$("#sort").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'sort',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'mostHelpful',detail2:''});});$("#bv-content-search-btn").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'submit',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'review',detail2:''});});$("#ItemWriteReviewLnk").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'write',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'review',detail2:''});});$("#ReviewcCnt").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'link',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'review_count',detail2:'PrimaryRatingSummary'});});$("#Stars_n").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'filter',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'stars',detail2:3});});$("#no").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'Helpfulness',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'Negative',detail2:''});});$("#yes").click(function(){BV.pixel.trackEvent('Feature',{type:'Used',name:'helpfulness',brand:brandName,productId,bvProduct:'RatingsAndReviews',detail1:'positive',detail2:''});});};});$(function(){var items=$(".nppe-bv-api-product-reviews-wrappers .views-rows");var numItems=items.length;var perPage=items;var startindex=0;var totalPages=Math.floor(numItems/perPage);var currentPage=Math.ceil(startindex/perPage);if(!(numItems>4)){$('.pagination-info').text((startindex+1)+" - "+(numItems));items.slice(perPage+1).hide();}else{$('.pagination-info').text((startindex+1)+" - "+(perPage*(startindex+1)));items.slice(perPage+1).hide();}});}}};})(jQuery,Drupal);; 3(function($,Drupal){Drupal.AjaxCommands.prototype.offset=function(ajax,response){const element=document.querySelector(response.selector);const offset=parseInt(response.offset)+parseInt(element.offsetHeight);window.scroll(0,offset);};})(jQuery,Drupal);; 4(function(Drupal,drupalSettings){const swEnabled=drupalSettings.nppe_service_worker?.enabled??true;if('serviceWorker' in navigator)if(swEnabled)window.addEventListener('load',function(){navigator.serviceWorker.register('/sw.js').then(function(registration){console.log('ServiceWorker registration successful with scope: ',registration.scope);},function(err){console.log('ServiceWorker registration failed: ',err);});});else disableServiceWorkers();function disableServiceWorkers(){navigator.serviceWorker.getRegistrations().then((registrations)=>{registrations.forEach((registration)=>{registration.unregister().then(()=>{console.log('Service Worker unregistered:',registration.scope);});});}).catch((err)=>{console.error('Error during Service Worker unregistration:',err);});navigator.serviceWorker.register=function(){console.warn('Service Worker registration blocked');return Promise.resolve({unregister:()=>Promise.resolve(),active:null,installing:null,waiting:null,scope:'/'});};if('caches' in window)caches.keys().then((cacheNames)=>{return Promise.all(cacheNames.map((cacheName)=>caches.delete(cacheName)));});}})(Drupal,drupalSettings);; 5(function(Drupal){const cookieName='SubmenuBanner_hidden';function getCookie(name){const value="; "+document.cookie;const parts=value.split("; "+name+"=");if(parts.length==2)return parts.pop().split(";").shift();}function setCookie(name,value,days){let expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toUTCString();}document.cookie=name+"="+(value||"")+expires+"; path=/";}if(getCookie(cookieName)){const style=document.createElement('style');style.textContent='.block-nppe-submenu-banner{display:none !important;}';document.head.appendChild(style);}Drupal.behaviors.nppeSubmenuBanner={attach:function(context,settings){const $submenuWrapper=document.querySelector('.block-nppe-submenu-banner');if(!$submenuWrapper)return;const $submenuClose=$submenuWrapper.querySelector('.submenu-close');$submenuClose.addEventListener('click',function(){$submenuWrapper.classList.add('hide');setCookie(cookieName,'true',30);});}};})(Drupal);;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.