1/* 01-standard-shop/modules/product/customerGroup.js */ 2 3var customerGroup={initCategoryTexts:function(container,categoryId){if(!statusData.customer_logged_in){return;} 4var $container=$(container);if($container.length===0){return;} 5frame.ajaxFormSubmitter($container,{type:'GET',url:'/'+i18nPrefix+'?page_label=ajax_customer_group&mode=category_texts&category_id='+categoryId,success:function(response){if(response.descriptions.length===0){return;} 6var descriptions=[];for(var i in response.descriptions){descriptions.push(_niInsertObjectDataInTemplate({description:response.descriptions[i]},_niRes('category.customer_group_description')));} 7$container.html(descriptions.join('')).show();}});}};; 8/* 01-standard-shop/modules/product/customerPrices.js */ 9 10var customerPrices={cacheMaxAge:300000,init:function(){customerPrices.initPrices();},initPrices:function(){if(!statusData.customer_logged_in){return;} 11var productIds=[];$('.js-prices[data-has_customer_discounts="1"]').each(function(index,product){productIds.push($(product).data('product_id'));});for(var i=0;i<=productIds.length;i++){var productId=productIds[i];var localStorageItem=localStorage.getItem(statusData.customer_id+'-'+productId);if(localStorageItem!==null){var parsedLocalStorage=$.parseJSON(localStorageItem);var now=new Date();var storedTimestamp=new Date(parsedLocalStorage.timestamp);var cacheAge=now.getTime()-storedTimestamp.getTime();if(statusData.customer_id!==parsedLocalStorage.customerId||cacheAge>this.cacheMaxAge||parsedLocalStorage.success===false){continue;} 12customerPrices.updatePrice(productId,parsedLocalStorage.price,parsedLocalStorage.priceFormatted);productIds.splice(i,1);i--;}} 13if(productIds.length>0){customerPrices.getPriceByAjax(productIds);}},getPriceByAjax:function(productIds){$.each(productIds,function(index,productId){var $priceBlock=$('.js-prices[data-has_customer_discounts="1"][data-product_id="'+productId+'"]');$priceBlock.addClass('loader');});$.ajax({url:'/'+i18nPrefix+'?page_label=ajax_customer_price',method:'POST',data:{product_ids:productIds},dataType:'json',success:function(response){if(response.success===false){return;} 14$.each(productIds,function(index,productId){if(response.prices[productId]===undefined){return;} 15var price=response.prices[productId].price;var priceFormatted=response.prices[productId].priceFormatted;customerPrices.updatePrice(productId,price,priceFormatted);var localStoragePrices={price:price,priceFormatted:priceFormatted,timestamp:new Date(),customerId:statusData.customer_id,success:true};localStorage.setItem(statusData.customer_id+'-'+productId,JSON.stringify(localStoragePrices));});},complete:function(){$.each(productIds,function(index,productId){var $priceBlocks=$('.js-prices[data-has_customer_discounts="1"]');$priceBlocks.removeClass('loader');});}});},updatePrice:function(productId,price,priceFormatted){var $priceBlock=$('.js-prices[data-has_customer_discounts="1"][data-product_id="'+productId+'"]');var basePrice=$priceBlock.data('price_amount');if(basePrice>price){$priceBlock.find('.js-customer_price').html(priceFormatted+' '+statusData.cart_currency_code);$priceBlock.find('.js-base_price').show();} 16$priceBlock.removeClass('loader');}};; 17/* 01-standard-shop/modules/product/jquery.niScroll.js */ 18 19(function($){$.niScroll={defaults:{debug:false,loadingHtml:'<div class="loader_container"></div>',padding:0,nextSelector:'a:last',contentSelector:'',pagingSelector:'',successCallback:function(){}}};$.fn.niScroll=function(options){return this.each(function(){var $this=$(this),data=$this.data('niScroll');if(data&&data.initialized){return;} 20$this.data('niScrollInstance',new NiScroll($this,options));});};var NiScroll=function($element,options){var _data=$element.data('niScroll');var _userOptions=typeof options==='function'?{callback:options}:options;var _options=$.extend({},$.niScroll.defaults,_userOptions,_data||{});var _$next=$element.find(_options.nextSelector).first();var _nextHref=null;var _$loaderContainer=$(_options.loadingHtml);var _semaphor=false;var _init=function(){_debug('info','Started niScroll');_refresh_values();$(window).scroll(_scrollBind);_scrollBind();};var _scrollBind=function(){if($(window).scrollTop()+$(window).height()>=($element.height()-_options.padding)){_debug('info','Close enough to the bottom. Initiating load');_load();}};var _refresh_values=function(){_nextHref=$.trim(_$next.attr('href'));if(_nextHref){_nextHref+='&render=ajax';} 21_$next.remove();};var _load=function(){if(_semaphor){return;} 22_semaphor=true;if(!_nextHref){_destroy();return;} 23$element.append(_$loaderContainer);_$loaderContainer.addClass('loader');_debug('info','Running ajax call. nextHref: '+_nextHref);$.ajax({type:'GET',url:_nextHref,data:{filters:this.filters,sort_by:this.sortBy,mode:this.sortMode,limit:this.limit,offset:this.offset},success:function(data){var $dom=$('<html />').html(data);var $items=$dom.find(_options.contentSelector);_$next=$dom.find(_options.nextSelector).first();_refresh_values();if($items.length){_debug('info','Items found: '+$items.length);$element.append($items).promise().done(function(){_options.successCallback();});} 24else{_debug('info','No items found. Destroy');_destroy();} 25_semaphor=false;_$loaderContainer.remove();}});};var _destroy=function(){$(window).unbind('scroll',_scrollBind);$element.removeData('niScroll');_debug('info','Removed scroll bind');};var _debug=function(method){if(_options.debug&&typeof console==='object'&&(typeof method==='object'||typeof console[method]==='function')){if(typeof method==='object'){var args=[];for(var sMethod in method){if(typeof console[sMethod]==='function'){args=method[sMethod].length?method[sMethod]:[method[sMethod]];console[sMethod].apply(console,args);} 26else{console.log.apply(console,args);}}} 27else{console[method].apply(console,Array.prototype.slice.call(arguments,1
27));}}};$element.data('niScroll',$.extend({},_data,{initialized:true,waiting:false,nextHref:_nextHref}));_init();$.extend($element.niScroll,{destroy:_destroy,data:$element.data('niScroll')});return $element;};})(jQuery);; 28/* 01-standard-shop/modules/product/product.js */ 29 30var product={imageGallery:[],discountRules:[],initExtendedFunctions:[],productFiltersCanBeEmpty:true,hasWaitlist:false,waitlistsFull:{},waitinglistMaxQuantity:0,notForSaleReason:null,optionsForSelect:{},locationAfterAddToCart:null,type:'default',isComposite:false,priceNormal:null,currencyCode:null,productVariantPrices:[],hideQuantity:false,init:function(){if(window.smoothproducts!==undefined){smoothproducts.init();} 31product.initVariant();product.initQuantity();product.initProductFilters();product.initExtended();product.runInitExtended();},runInitExtended:function(){for(var i=0;i<this.initExtendedFunctions.length;++i){$.proxy(this.initExtendedFunctions[i],this)();}},initExtended:function(){},initProductFilters:function(){if(!this.productFiltersCanBeEmpty){return;} 32var $productFilter=$('.productFilter');if($productFilter.find('select').length<1){$productFilter.css('borderBottom','none');}},initQuantity:function(){var $quantitySelect=$('[name="cart_quantity"]');var allowNegativeQuantity=$quantitySelect.data('allow_negative');var quantity=parseInt($quantitySelect.data('quantity'),10);if(isNaN(quantity)){quantity=0;} 33else{var maxPurchase=parseInt($('span[data-max_purchase]').data('max_purchase'),10);if(!isNaN(maxPurchase)&&maxPurchase>0&&maxPurchase<10){quantity=Math.min(maxPurchase,quantity);}} 34var $quantity=$('#quantity');if(quantity<=0){$('.product_in_stock').hide();} 35if(!allowNegativeQuantity&&(isNaN(quantity)||quantity<=0)){$quantity.remove();$quantity=null;} 36else if(!allowNegativeQuantity&&(quantity<$quantitySelect.find('option').length)){$quantitySelect.find('option').each(function(){if(quantity<1){$(this).remove();} 37quantity--;});} 38if($quantity){if(this.hideQuantity===false){$quantity.show();this.showCartActionsForSelected();} 39$('#inventory_date').show();} 40else{$('#add-to-cart-button').hide();if(!product.hasWaitlist){$('#variant').hide();} 41$('#cart_action_in_stock').remove();this.updateOutOfStockCartActions();}},initVariant:function(){var $variant=$('#variant');var $variantSelect=$variant.find('select');if($variantSelect.length===1){$variant.show();$variantSelect.on('change',function(){product.onChangeProductVariant(this);});this.onChangeProductVariant($variantSelect);} 42else if($variantSelect.length>1){$variant.show();$variantSelect.filter(':not(:last)').on('change',function(){product.onChangeVariantGroup();});var $lastVariantSelect=$variantSelect.last();$lastVariantSelect.on('change',function(){product.onChangeProductVariant(this);});this.onChangeVariantGroup();this.onChangeProductVariant($lastVariantSelect);}},onChangeProductVariant:function(select){if(product.hasWaitlist){product.showCartActionsForSelected();} 43var $option=$(select).find('option:selected');var productVariantId=$option.val();if($option.data('price')){$('.js-customer_price').text($option.data('price'));} 44var $addToCartButton=$('#add-to-cart-button');if(productVariantId===''){$addToCartButton.prop('disabled',true);return;} 45$addToCartButton.prop('disabled',false);var productVariantPrice=this.productVariantPrices[productVariantId];if(productVariantPrice===undefined){return;} 46$('.js-prices .js-customer_price').text(productVariantPrice+' '+this.currencyCode);},onChangeVariantGroup:function(){var $selects=$('#variant').find('select');var possibleProductVariantIds=null;$selects.each(function(){var $select=$(this);var currentlySelectedText=$select.find(':selected').text();var selectName=$select.attr('name');if(selectName){if(selectName in product.optionsForSelect){$select.html(product.optionsForSelect[selectName]);} 47else{product.optionsForSelect[selectName]=$select.find('option');}} 48var resetSelectedOption=false;var intersectingProductVariantIds;var valueToSelect=false;$select.find('option[value!=""]').each(function(){var $option=$(this);var productVariantIds=$option.val();if(productVariantIds===''){return;} 49productVariantIds=productVariantIds.split(';');
49if(possibleProductVariantIds===null){intersectingProductVariantIds=productVariantIds;} 50else{intersectingProductVariantIds=possibleProductVariantIds.filter(function(id){return productVariantIds.indexOf(id)!==-1;});} 51if(intersectingProductVariantIds.length===0){if(selectName){$option.detach();} 52else{$option.hide();} 53resetSelectedOption|=$option.prop('selected');} 54else{$option.show();if($option.text()===currentlySelectedText){valueToSelect=$option.val();}}});if(possibleProductVariantIds!==null&&possibleProductVariantIds.length===0){$select.prop('disabled',true);resetSelectedOption=true;} 55else{$select.prop('disabled',false);} 56if(resetSelectedOption){possibleProductVariantIds=[];$select.find('option[value=""]').prop('selected',true);} 57else{var $selectedOption=$select.find('option:selected');possibleProductVariantIds=$selectedOption.val();if(possibleProductVariantIds===''){possibleProductVariantIds=[];} 58else{possibleProductVariantIds=possibleProductVariantIds.split(';');}} 59if(valueToSelect){$select.find('option[value="'+valueToSelect+'"]').prop('selected','selected');}});$('#add-to-cart-button').prop('disabled',true);},inventoryDateStocks:{},getInventoryDateStock:function(productVariantId,date,callback){if(this.inventoryDateStocks[productVariantId]===undefined){this.inventoryDateStocks[productVariantId]={};} 60if(this.inventoryDateStocks[productVariantId][date]!==undefined){callback(this.inventoryDateStocks[productVariantId][date]);return;} 61$.ajax({url:'/?page_label=ajax_product&mode=inventory_date_stock',data:{product_variant_id:productVariantId,date:date},success:function(response){if(response.success){product.inventoryDateStocks[productVariantId][date]=response.inventoryDateStock;callback(product.inventoryDateStocks[productVariantId][date]);}}});},onChangeInventoryDate:function(){product.showCartActionsForSelected();},calculateDiscount:function(productAmount){var lowestAmountAfterDiscount=null;var lowestDiscountRule=null;for(var i in this.discountRules){var discountRule=this.discountRules[i];if(discountRule.quantity>1){continue;} 62var productAmountAfterDiscount=null;if(discountRule.percentage>0){productAmountAfterDiscount=(100.0-discountRule.percentage)/100.0*productAmount;} 63else if(discountRule.amount_is_discount){productAmountAfterDiscount=productAmount-discountRule.amount;if(productAmountAfterDiscount<0){productAmountAfterDiscount=0;}} 64else{productAmountAfterDiscount=discountRule.amount;} 65if(lowestAmountAfterDiscount===null||productAmountAfterDiscount<lowestAmountAfterDiscount){lowestAmountAfterDiscount=productAmountAfterDiscount;lowestDiscountRule=discountRule;}} 66return{amount:lowestAmountAfterDiscount,rule:lowestDiscountRule};},initCalculateTotalPrice:function(){this.calculateTotalPrice();},onChangeQuantity:function(){this.calculateTotalPrice();},calculateTotalPrice:function(){var totalAmount=0;$('.js-product_quantity:visible').each(function(){var $this=$(this);var thisAmount=$this.data('amount');if(thisAmount===undefined){thisAmount=$this.data('price')*100000;} 67totalAmount+=thisAmount*$this.val();});$('#calculated_total_price').html(formatAmount(totalAmount,true));},showAddToCartModal:function(){$('#add-to-cart-modal').addClass('in').show();$('#add-to-cart-modal-backdrop').addClass('in').show();$('.add-to-cart-floater').hide();},hideAddToCartModal:function(){$('#add-to-cart-modal').removeClass('in').hide();$('#add-to-cart-modal-backdrop').removeClass('in').hide();$('.add-to-cart-floater').show();},onBeforeAddToCart:function($form){return true;},addToCart:function(form,quantityInputSelector,callback){var $form=$(form);quantityInputSelector=quantityInputSelector||'';var $quantityInput=$(quantityInputSelector);if($quantityInput.length>0){var $hiddenCartQuantity=$form.find('.hidden_cart_quantity');if($hiddenCartQuantity.length===1){$hiddenCartQuantity.val($quantityInput.val());}} 68if(!this.onBeforeAddToCart($form)){$(document).trigger('cmb:addToCartFailed');return;} 69var promotionId=_niGetQueryVariable('promotion_id');if(promotionId&&$form.find('input[name="promotion_id"]').length===0){$form.append('<input type="hidden" name="promotion_id" value="'+promotionId+'" />');} 70var hasQuantity=false;$form.find('[name="cart_quantity"]:not(:disabled),[name^="multiple_products_quantity["]:not(:disabled)').each(function(){hasQuantity=parseInt($(this).val(),10)>0;return!hasQuantity;});if(!hasQuantity){return;} 71var $productId=$form.find('[name="product_id"]').val();var addedProducts=$form.closest('table').find('.added_products_for_'+$productId+':checked');var formData=$form.serialize();addedProducts.each(function(){formData+='&'+$(this).prop('name')+'='+$(this).prop('value');});var $addToCartFeedback=$form.find('.js-add_to_cart_feedback');if($addToCartFeedback.length===0){$addToCartFeedback=$('.js-add_to_cart_feedback');} 72$addToCartFeedback.empty().hide();var $loader=$form.closest('.loader_container').addClass('loader');var cleanup=function(){$loader.removeClass('loader');};$.ajax({type:'POST',url:'/'+i18nPrefix+'?page_label=ajax_minicart',data:formData,async:true,dataType:'json',success:function(response){if(response.success){if(product.locationAfterAddToCart===null){product.addToCartFeedback(response.html,$addToCartFeedback);} 73$(document).trigger('cmb:afterAddToCart',[response.added_products,response.modules]);if(callback){callback();} 74if(product.locationAfterAddToCart!==null){_niRedirectToUrl(product.locationAfterAddToCart);}} 75else{var messages='';if(response.modules!==undefined){for(var moduleData in response.modules){if(!response.modules.hasOwnProperty(moduleData)){continue;} 76var data=response.modules[moduleData];if(moduleData==='product_reservation'){if(data.outOfStock===true){$('#cart_action_in_stock').remove();product.updateOutOfStockCartActions();}} 77if(data.message!==undefined&&data.message){messages+=data.message+'<br />';}}} 78var feedbackFail=_niRes('product.add_to_cart_feedback_fail');feedbackFail=feedbackFail.replace(/{messages}/g,messages);$addToCartFeedback.append(feedbackFail);$addToCartFeedback.fadeIn('fast');$(document).trigger('cmb:addToCartFailed');}},error:ajaxErrorHandler,feedback:$addToCartFeedback,complete:cleanup});},addToCartFeedback:function(miniCartContent,$addToCartFeedback){minicart.replace(miniCartContent);if($('#add-to-cart-modal').hasClass('in')){this.hideAddToCartModal();const $feedbackModal=$('#add-to-cart-feedback-modal');$feedbackModal.find('.js-add_to_cart_feedback').append(_niRes('product.add_to_cart_feedback_success'));$feedbackModal.modal({backdrop:true,keyboard:true,show:true});} 79else{$addToCartFeedback.append(_niRes('product.add_to_cart_feedback_success'));$addToCartFeedback.fadeIn('fast');} 80minicart.flashDropdown(true);},updateOutOfStockCartActions:function(){if(product.notForSaleReason!==null){return;} 81if(product.hasWaitlist){var productId=$('[name="product_id"]').val();var productVariantId=$('[name="product_variant_id_for_'+productId+'"]').val();if(statusData.waitlist.places!==undefined&&statusData.waitlist.places[productVariantId]&&statusData.waitlist.places[productVariantId].status==='waiting'){product.showCartAction('on_waitlist',statusData.waitlist.places[productVariantId]);} 82else if(product.waitlistsFull[productVariantId]){product.showCartAction('waitlist_full');} 83else{product.showCartAction('waitlist_open');}} 84else if($('#cart_action_out_of_stock').length!==0){product.showCartAction('out_of_stock');}},showCartAction:function(status,data){var $cartActions=$('.cart-actions').empty();switch(status){case'on_waitlist':var feedback=_niRes('product.on_waitlist_'+data.type);$cartActions.append(_niRes('product.out_of_stock')).append(feedback);break;case'waitlist_full':$cartActions.append(_niRes('product.out_of_stock')).append(_niRes('product.waitlist_full'));break;case'waitlist_open':$cartActions.append(_niRes('product.out_of_stock')).append(_niRes('product.waitlist_open'));break;case'in_stock':$cartActions.append(_niRes('product.in_stock'));break;case'out_of_stock':default:$cartActions.append(_niRes('product.out_of_stock'));break;}},showCartActionsForSelected:function(){if(product.notForSaleReason!==null){return;} 85const productId=$('[name="product_id"]').val();const $productVariantSelects=$('[name="product_variant_id_for_'+productId+'"]');let productVariantId;let quantity;if($productVariantSelects.is('input')){productVariantId=$productVariantSelects.val();quantity=$('[name="cart_quantity"]').data('quantity');}
86else{const $productVariantOption=$productVariantSelects.last().find('option:selected');productVariantId=$productVariantOption.val();quantity=$productVariantOption.data('quantity');} 87const inventoryDate=$('[name="inventory_date_for_'+productId+'"]').val();if(inventoryDate!==undefined){this.getInventoryDateStock(productVariantId,inventoryDate,function(stock){if(stock){product.showCartAction('in_stock');} 88else{product.showCartAction('out_of_stock');}});return;} 89if(quantity>0){product.showCartAction('in_stock');} 90else{product.updateOutOfStockCartActions();}}};; 91/* 01-standard-shop/modules/product/productList.js */ 92 93var productList={init:function(){if($('.js-product-list').niScroll.data&&$('.js-product-list').niScroll.data.initialized){$('.js-product-list').niScroll.destroy();} 94$('.js-product-list').niScroll({debug:false,nextSelector:'a.pagination:last',contentSelector:'.product-list-item',padding:20});},initBasicSearch:function(){niSearch.$productList=$('.js-product-list');niSearch.searchTactic='doDomExtractSearch';niSearch.ajaxUrl=window.location.pathname;}};; 95/* 01-standard-shop/modules/product/smoothproducts.js */ 96 97var smoothproducts={slideTiming:300,maxWidth:null,init:function(){this.initFirstImage();this.initEventHandlers();},initFirstImage:function(){var $spWrap=$('.sp-wrap');if($spWrap.length===0){return;} 98$spWrap.append('<div class="sp-large loader_container loader"></div><div class="sp-thumbs sp-tb-active"></div>');$('.sp-wrap a').appendTo('.sp-thumbs');var largeA=$('.sp-thumbs a:first').addClass('sp-current').clone();if(largeA.length===0){return;} 99largeA.attr('href',largeA.attr('href').replace('/thumb/','/zoom/'));var largeImg=largeA.find('img').removeAttr('width').removeAttr('height');var largeImgSrc=largeImg.attr('src');largeImg.attr('src','');largeImg.on('load',function(){$(this).closest('.loader_container').removeClass('loader');});largeImg.attr('src',largeImgSrc.replace(/\/thumb(|_retina)\//,'/zoom$1/'));largeImg.attr('data-retina',largeImg.attr('data-retina').replace('/thumb_retina/','/zoom_retina/'));largeA.removeClass('sp-current').appendTo('.sp-large');$spWrap.css('display','inline-block');this.maxWidth=$('.sp-large img').width();},initEventHandlers:function(){$(document).on('click','.sp-thumbs',function(event){event.preventDefault();});$(document).on('click','.sp-tb-active a',function(event){$('.sp-current').removeClass();$('.sp-thumbs').removeClass('sp-tb-active');$('.sp-zoom').remove();$('.sp-large').css({overflow:'hidden'}).addClass('loader');$('.sp-large a').remove();var largeA=$(this).addClass('sp-current').clone();largeA.attr('href',largeA.attr('href').replace('/thumb/','/zoom/'));var largeImg=largeA.find('img').removeAttr('width').removeAttr('height');var largeImgSrc=largeImg.attr('src');largeImg.attr('src','');largeImg.on('load',function(){$(this).closest('.loader_container').removeClass('loader');});largeImg.attr('src',largeImgSrc.replace(/\/thumb(|_retina)\//,'/zoom$1/'));largeImg.attr('data-retina',largeImg.attr('data-retina').replace('/thumb_retina/','/zoom_retina/'));largeA.hide().removeClass('sp-current').appendTo('.sp-large').fadeIn(this.slideTiming,function(){$('.sp-thumbs').addClass('sp-tb-active');});event.preventDefault();});$(document).on('click','.sp-large a',function(event){var src=$(this).attr('href');$('.sp-large').append('<div class="sp-zoom"><img src="'+src+'"/></div>');$('.sp-zoom').fadeIn();$('.sp-large').css({left:0,top:0});event.preventDefault();});$('.sp-large').mousemove(function(event){var t=$('.sp-large').width();var n=$('.sp-large').height();var r=$('.sp-zoom').width();var i=$('.sp-zoom').height();var s=$(this).parent().offset();var o=event.pageX-s.left;var u=event.pageY-s.top;var a=Math.floor(o*(t-r)/t);var f=Math.floor(u*(n-i)/n);$('.sp-zoom').css({left:a,top:f});});$(document).on('click','.sp-zoom',function(){$(this).fadeOut(function(){$(this).remove();});});}};; 100/* 03-game-season-shop/modules/product/product.js */ 101 102product.OPTION_VALUE_CUSTOM='custom';product.OPTION_VALUE_NOCUSTOMIZATION='nocustomization';product.prices=[];product.initExtendedFunctions.push(function(){product.initCustomization();});product.initCustomization=function(){$('.js-customization').each(function(index){var $self=$(this).data('index',index);var $customValue=$('[name="customval"]');var hasCustom=parseInt($customValue.val(),10)===1;
102var $selectbox=$self.find('.js-customization-playername');var hasPlayerOptions=$selectbox.find('option').length>3;var $customText=$self.find('.js-customization-text');if($customText.length===0){$customText=$self.siblings('.js-customization-text');} 103if(!hasCustom){$selectbox.find('option[value="'+product.OPTION_VALUE_CUSTOM+'"]').remove();$customText.remove();$customValue.remove();} 104if(hasPlayerOptions||hasCustom){$('.js-customization').show();$selectbox.change(function(){var value=$self.find('.js-customization-playername').val();var price=product.prices[index].normal;if(value===product.OPTION_VALUE_CUSTOM&&hasCustom){$self.find('.js-customization-text input').removeAttr('disabled');$customText.show();price=product.prices[index].customization;} 105else if(value===product.OPTION_VALUE_NOCUSTOMIZATION){$customText.hide();price=product.prices[index].nocustomization;} 106else{$customText.hide();} 107if(product.isComposite){product.renderCompositePrice();} 108else{$('.price-sales').text(price+' '+product.currencyCode);} 109$(document).trigger('cmb:priceChange');});$selectbox.trigger('change');}});};product.renderCompositePrice=function(){var amount=product.priceNormal;$('.js-customization').each(function(){var $self=$(this);var $customValue=$self.find('[name="customval"]');var hasCustom=parseInt($customValue.val(),10)===1;$self.find('.js-customization-playername').each(function(){var index=parseInt($self.data('index'),10);var value=$self.find('.js-customization-playername').val();if(value===product.OPTION_VALUE_CUSTOM&&hasCustom){amount+=product.prices[index].amountCustomization;} 110else if(value===product.OPTION_VALUE_NOCUSTOMIZATION){amount-=product.prices[index].amountNoCustomization;}});});$('.price-sales').text(amount.toFixed(2).replace('.',',')+' '+product.currencyCode);};product.validateCustomization=function($form){var valid=true;$('.js-customization').each(function(){var value=$(this).find('.js-customization-playername').val();if(value===product.OPTION_VALUE_CUSTOM){frame.initFormValidator();if(!$form.valid()){valid=false;return false;}} 111$(this).find('.js-customization-property').val(value);return true;});return valid;};product.updateQuantityFromOutside=function($form){var productId=parseInt($form.find('[name="product_id"]').val(),10);if(!productId){return;} 112var outsideQuantityInput=$('#cart_quantity_for_'+productId);if(outsideQuantityInput.length===0){return;} 113$form.find('[name="cart_quantity"]').val(outsideQuantityInput.val());};product.onBeforeAddToCart=function($form){if(!product.validateCustomization($form)){return false;} 114product.updateQuantityFromOutside($form);if(this.type==='seasoncard'){var multiHallSeatmap=new MultiHallSeatmap();multiHallSeatmap.addToCartUrl='/'+i18nPrefix+'?page_label=ajax_minicart';multiHallSeatmap.openSeasonCardNameModalOnAddToCart();return false;} 115return true;};product.initBet=function(){var $form=_niRes('product.add_bet_to_cart_form');var attendanceInput=_niRes('product.add_bet_to_cart_admittance_input');$('#bet-wrapper').append(attendanceInput).append($form);};product.addBetToCart=function(form){var $form=$(form);var $loader=$form.closest('.loader_container').addClass('loader');var $feedback=$('#add_bet_to_cart_feedback').removeClass('alert-success').removeClass('alert-danger').hide();var productId=$('#product_id').val();var productVariantId=$('[name="product_variant_id_for_'+productId+'"]').val();var scoreHome=$form.find('input[name="score_home"]').val();var scoreAway=$form.find('input[name="score_away"]').val();var attendance=$('#attendance').val();if(!$.isNumeric(scoreHome)||scoreHome===''||!$.isNumeric(scoreAway)||scoreAway===''||!$.isNumeric(attendance)||attendance===''){$loader.removeClass('loader');$feedback.html(_niRes('product.bet_not_correct')).addClass('alert-danger').show();return;} 116var postData=['cart_action=add','cart_quantity=1'];postData.push('product_id['+productId+']='+productId);postData.push('product_variant_id_for_'+productId+'='+productVariantId);postData.push('properties['+productId+'][bet][score_home]='+scoreHome);postData.push('properties_save['+productId+'][bet][score_home]=1');postData.push('properties['+productId+'][bet][score_away]='+scoreAway);postData.push('properties_save['+productId+'][bet][score_away]=1');postData.push('properties['+productId+'][bet][attendance]='+attendance);postData.push('properties_save['+productId+'][bet][attendance]=1');$.ajax({type:'POST',url:'/'+i18nPrefix+'?page_label=ajax_minicart',data:postData.join('&'),async:true,dataType:'json',success:function(response){if(response.success){var $new_form=$(_niRes('product.add_bet_to_cart_form'));$new_form.find('input[name="product_id"]').val(productId);$form.find('input').prop('disabled',true);$('#attendance').prop('disabled',true);$form.find('button').remove();$form.parent().append($new_form);minicart.update(response.num_products);$feedback.html(_niRes('product.bet_added_to_cart')).addClass('alert-success').show();} 117else{$feedback.html(_niRes('product.add_bet_to_cart_failure')).addClass('alert-danger').show();}},error:function(){$feedback.html(_niRes('product.add_bet_to_cart_failure')).addClass('alert-danger').show();},complete:function(){$loader.removeClass('loader');}});};;
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.