PageSourceSearch

https://www.fcsg.ch/cdn/shop/t/48/assets/product-trikots.js?v=43866975236264579261787151190

js fcsg.ch collected 2026-09-25 04:03:29 UTC 37,760 bytes, 2 lines download raw bytes

1$(document).ready(function(){window.aico_percentage_discount&&window.aico_percentage_discount!=0&&$(".active-product").each(function(){const $activeProduct=$(this);if($activeProduct.hasClass("aico-discount-applied"))return;$activeProduct.addClass("aico-discount-applied");const main_price_el=$activeProduct.find(".product_trikot_price_wrap .tprice_main .tprice_main_amount");let main_price=parseFloat(main_price_el.attr("data-amount")),main_compare_price=parseFloat(main_price_el.attr("data-compare-amount"));if(!isNaN(main_price)){if(!main_compare_price){const discountedPrice=applyAicoDiscount(main_price);main_price_el.html(discountedPrice),$activeProduct.find(".product_trikot_price_wrap .tprice_main .tprice_main_amount").attr("data-amount",discountedPrice),window.location.href.includes("/pages/shop")&&$activeProduct.find(".product_trikot_price_wrap").length&&($activeProduct.find(".product-form #price_item_discount").length||$activeProduct.find(".product-form").append(`<input id="price_item_discount" type="hidden" name="properties[_price_item_discount]" value="${discountedPrice}">`))}updateTrikotTotal($activeProduct.parent("div"),"onload")}});const initSlickSlider=()=>{$(".section-trikot-product .product__media_wrap").each(function(){const $grid=$(this);$grid.hasClass("slick-initialized")||$grid.slick({dots:!1,infinite:!1,speed:300,slidesToShow:1,arrows:!0})})},initSlickSliderMobile=()=>{$(".section-trikot-product .product__mobile_media-list .product__media_wrap").each(function(){const $gridMobile=$(this);$gridMobile.is(":visible")&&($gridMobile.hasClass("slick-initialized")?$gridMobile.slick("setPosition"):$gridMobile.slick({dots:!1,infinite:!1,speed:300,slidesToShow:1,arrows:!0}))})};initSlickSlider(),initSlickSliderMobile(),$(window).resize(()=>{initSlickSlider(),initSlickSliderMobile()}),$(document).on("click",".featured-product .pro__variants_list .pro__variants_single a",function(e){e.preventDefault();const $this=$(this);$this.parents(".active-product").find(".pro__variants_list .pro__variants_single a").removeClass("active"),$this.addClass("active");const productHandle=$this.closest(".pro__variants_single").data("handle");get_trikot(productHandle,$this)});function get_trikot(productHandle,$this){const url=`/products/${productHandle}?section_id=dynamic-trikot-product`;fetch(url).then(res=>res.text()).then(html=>{const doc=new DOMParser().parseFromString(html,"text/html"),newSection=doc.querySelector(".section-trikot-product"),media_gallery=newSection.querySelector("media-gallery"),mobile_media_gallery=newSection.querySelector(".product__mobile_media-list"),Innerinfo=newSection.querySelector("product-info");if(newSection){const trikot_section=$(".active-product.featured-product");trikot_section.removeClass(function(index,className){return(className.match(/\btrikot_\S+/g)||[]).join(" ")});let dynamic_classname=doc.querySelector('input[name="trikot_class_name"]').value,dynamic_print_font=doc.querySelector('input[name="trikot_class_name"]').getAttribute("data-print-font");if(trikot_section.addClass(dynamic_classname),trikot_section.attr("data-print-font",dynamic_print_font),trikot_section.find("media-gallery").replaceWith(media_gallery),trikot_section.find("product-info").replaceWith(Innerinfo),initSlickSlider(),initSlickSliderMobile(),typeof customer<"u"){const btn_individual=trikot_section.find(".button_add_individual");individual_option(btn_individual),trikot_section.find(".product__media_wrap").hasClass("slick-initialized")&&trikot_section.find(".product__media_wrap").slick("slickGoTo",1)}$("body").hasClass("template-name--team-member-detail")&&get_player_trikot(),initVerbandCupBatchAutoSelect(trikot_section)}}).catch(err=>console.error("Section render error:",err))}function initVerbandCupBatchAutoSelect($scope){($scope&&$scope.length?$scope:$(".active-product")).each(function(){const $badgesTabs=$(this).find(".badges-tabs");if(!$badgesTabs.length)return;const $weiss=$badgesTabs.find('[data-tab="spielpaarung-weiss"]'),$schwarz=$badgesTabs.find('[data-tab="spielpaarung-schwarz"]');if(!$weiss.length&&!$schwarz.length||$badgesTabs.find('[data-tab="verband-cup-batch"]').hasClass("active")||$weiss.hasClass("active")||$schwarz.hasClass("active"))return;let $firstSpielpaarung;$weiss.length&&$schwarz.length?$firstSpielpaarung=$weiss.index()<$schwarz.index()?$weiss:$schwarz:$firstSpielpaarung=$weiss.length?$weiss:$schwarz,$firstSpielpaarung.trigger("click")})}$(document).on("click",".trikots-tabs:not(.badges-tabs) .tab",function(){const $this=$(this),$activeProduct=$(this).closest(".active-product");$activeProduct.find(".trikots-tabs:not(.badges-tabs) .tab").removeClass("active"),$(this).addClass("active");let tabValue=$(this).attr("data-tab"),pro_type="Flock",active_badge_tab=$activeProduct.find(".trikots-tabs.badges-tabs .tab.active").attr("data-tab");var flag=0;tabValue!="Ohne"&&flag++,active_badge_tab!="Ohne Badge"&&typeof active_badge_tab<"u"&&flag++,flag==0?($activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").removeClass("hidden"),$activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").addClass("hidden"),$activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.tag_trikot_product").addClass("hidden")):$('[data-tab="alles-oder-nichts"]').hasClass("active")?($activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").addClass("hidden"),$activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").addClass("hidden"),$activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.tag_trikot_product").removeClass("hidden")):($activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").addClass("hidden"),$activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.tag_trikot_product").addClass("hidden"),$activeProduct.find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").removeClass("hidden"));let closestProductInfo=$(this).closest("product-info"),product_form__error_message_wrapper=$(closestProductInfo).find(".product-form__error-message-wrapper"),product_form__error_message=$(closestProductInfo).find(".product-form__error-message");if(product_form__error_message_wrapper.attr("hidden",!0),product_form__error_message.text(""),$activeProduct.find(".trikots-contents:not(.badges-contents) .hidden_product_input").removeClass("active"),$activeProduct.find('.trikots-contents .hidden_product_input[data-content="'+tabValue+'"]').addClass("active"),tabValue=="spieler"||tabValue=="individuell"){if($activeProduct.find(".product__media-list").each(function(){const $mediaItems=$(this).find(".product__media-item"),$mediaItems_spieler
1=$mediaItems.eq(1).find(".pro_spieler_main");$mediaItems.eq(1).length&&($mediaItems.removeClass("is-active"),$mediaItems.eq(1).addClass("is-active"))}),$activeProduct.find(".product__media_wrap").hasClass("slick-initialized")&&$activeProduct.find(".product__media_wrap").slick("slickGoTo",1),$(".trikot-product .mainProduct-wrapper .product__media-wrapper .slider").hasClass("slick-initialized")&&$(".trikot-product .mainProduct-wrapper .product__media-wrapper .slider").slick("slickGoTo",1),tabValue=="individuell"&&typeof customer<"u"&&!$("body").hasClass("template-name--team-member-detail")){let birthdate=customer.birthdate||"01.01.1979",year=Number(birthdate.split(".")[2]),isBetween2000and2009=year>=2e3&&year<=2009,last_name=customer.last_name||"",birthyear=birthdate.slice(-2);isBetween2000and2009&&(birthyear=79),$activeProduct.find("#individuell_modal .individuell-nummer-text").val(birthyear),$activeProduct.find("#individuell_modal .individual_list li").removeClass("active"),$activeProduct.find('#individuell_modal .individual_list li[data-val="'+birthyear+'"]').addClass("active"),$activeProduct.find("#individuell_modal .individuell-name").val(last_name)}tabValue=="spieler"&&$("body").hasClass("template-name--team-member-detail")&&get_player_trikot()}else{const secondImage=$activeProduct.find(".product__media-list .product__media-item").eq(1).find("img").attr("data-zoom-image");$activeProduct.find(".product__media-list .product__media-item").eq(1).find("img").attr("src",secondImage);const MobileSecondImage=$activeProduct.find(".product__mobile_media-list .product__media-item").eq(1).find("img").attr("data-zoom-image");$activeProduct.find(".product__mobile_media-list .product__media-item").eq(1).find("img").attr("src",MobileSecondImage),$activeProduct.find(".product__media-list").each(function(){$(this).find(".product__media-item").removeClass("is-active"),$(this).find(".product__media-item").eq(0).addClass("is-active")}),$activeProduct.find(".product__media_wrap").hasClass("slick-initialized")&&$activeProduct.find(".product__media_wrap").slick("slickGoTo",0),$(".trikot-product .mainProduct-wrapper .product__media-wrapper .slider").hasClass("slick-initialized")&&$(".trikot-product .mainProduct-wrapper .product__media-wrapper .slider").slick("slickGoTo",0),$activeProduct.find(".individuell-nummer").val(""),$activeProduct.find(".individuell-name").val(""),$activeProduct.find(".individuell-nummer-text").val(""),$activeProduct.find(".individuell-name-text").val(""),$activeProduct.find(".individual_options .individual_list li").removeClass("active"),$activeProduct.find(".hidden_product_input[data-content='individuell'] input[type='checkbox']").prop("checked",!1),$activeProduct.find(".hidden_product_input[data-content='individuell-name'] input[type='checkbox']").prop("checked",!1),$activeProduct.find(".pro_spieler_name").text(""),$activeProduct.find(".pro_spieler_no").text(""),$activeProduct.find(".spieler-nummer").val(""),$activeProduct.find(".spieler-name").val(""),$activeProduct.find(".custom-dropdown-main-wrap .custom-dropdown-list li").removeClass("active"),$activeProduct.find('.hidden_product_input[data-content="spieler"] .select__select').val("0").change(),$activeProduct.find(".product-form .properties_flock").val("");const type_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item[data-type='${pro_type}']`);type_price_item.removeClass("active"),type_price_item.attr("data-amount",""),type_price_item.text("")}updateTrikotTotal($this)});let activeBadges=[];$(document).off("click.badges").on("click.badges",".badges-tabs .tab",function(){const $this=$(this);if($this.hasClass("disabled"))return;const $activeProduct=$this.closest(".active-product");let tabValue=$this.attr("data-tab"),tabName=$this.attr("data-name"),pro_type="Badge";if(tabName){$activeProduct.find(".badges-tabs .tab[data-tab='Ohne Badge']").removeClass("active"),$this.hasClass("disabled")||$(this).toggleClass("active");const badge_product=$activeProduct.find(".badges-contents .hidden_product_input[data-content='"+tabValue+"'] input[type='checkbox']");badge_product.prop("checked",function(i,val){return!val});const price=badge_product.attr("data-price");let amount=badge_product.attr("data-amount");const pro_tag=badge_product.attr("data-tag"),pro_content=badge_product.attr("data-content");
1if(price&&pro_content){const selected_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item[data-handle='${pro_content}']`);$(this).hasClass("active")?(window.aico_percentage_discount&&window.aico_percentage_discount!=0&&(amount=applyAicoDiscount(amount)),selected_price_item.text(" + CHF "+amount),selected_price_item.attr("data-type",pro_type),selected_price_item.attr("data-amount",amount),selected_price_item.addClass("active"),activeBadges.includes(tabName)||activeBadges.push(tabName)):(selected_price_item.text(""),selected_price_item.attr("data-type",""),selected_price_item.attr("data-amount",""),selected_price_item.removeClass("active"),activeBadges=activeBadges.filter(item=>item!==tabName))}$activeProduct.find(".product-form .properties_badges").val(activeBadges.join(", ")),activeBadges.length==0&&$activeProduct.find(".badges-tabs .tab[data-tab='Ohne Badge']").addClass("active")}else{$activeProduct.find(".badges-tabs .tab").removeClass("active"),$(this).addClass("active"),activeBadges=[],$activeProduct.find(".product-form .properties_badges").val(""),$activeProduct.find(".badges-contents .hidden_product_input input[type='checkbox']").prop("checked",!1);const type_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item[data-type='${pro_type}']`);type_price_item.text(""),type_price_item.attr("data-amount",""),type_price_item.removeClass("active")}let active_trikot_tab=$activeProduct.find(".trikots-tabs:not(.badges-tabs) .tab.active").attr("data-tab");var flag=0;tabName!="Ohne Badge"&&activeBadges.length>0&&flag++,active_trikot_tab!="Ohne"&&flag++,flag==0?($(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").removeClass("hidden"),$(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").addClass("hidden"),$(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.tag_trikot_product").addClass("hidden")):$('[data-tab="alles-oder-nichts"]').hasClass("active")?($(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").addClass("hidden"),$(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").addClass("hidden"),$(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.tag_trikot_product").removeClass("hidden")):($(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").addClass("hidden"),$(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.tag_trikot_product").addClass("hidden"),$(this).parents(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").removeClass("hidden")),tabValue=="brack-super-league"&&$this.hasClass("active")&&$('.badges-tabs [data-tab="alles-oder-nichts"]').addClass("disabled"),tabValue=="brack-super-league"&&!$this.hasClass("active")&&$('.badges-tabs [data-tab="alles-oder-nichts"]').removeClass("disabled"),tabValue=="alles-oder-nichts"&&$this.hasClass("active")&&$('.badges-tabs [data-tab="brack-super-league"]').addClass("disabled"),tabValue=="alles-oder-nichts"&&!$this.hasClass("active")&&$('.badges-tabs [data-tab="brack-super-league"]').removeClass("disabled");const $verbandCupBatch=$activeProduct.find('.badges-tabs [data-tab="verband-cup-batch"]'),$spielpaarungWeiss=$activeProduct.find('.badges-tabs [data-tab="spielpaarung-weiss"]'),$spielpaarungSchwarz=$activeProduct.find('.badges-tabs [data-tab="spielpaarung-schwarz"]');if(tabValue=="Ohne Badge"&&($('.badges-tabs [data-tab="alles-oder-nichts"]').removeClass("disabled"),$('.badges-tabs [data-tab="brack-super-league"]').removeClass("disabled"),$spielpaarungWeiss.removeClass("disabled"),$spielpaarungSchwarz.removeClass("disabled")),tabValue==="spielpaarung-weiss"||tabValue==="spielpaarung-schwarz"){if($this.hasClass("active")){const $other=tabValue==="spielpaarung-weiss"?$spielpaarungSchwarz:$spielpaarungWeiss;$other.hasClass("active")&&$other.trigger("click"),$verbandCupBatch.length&&!$verbandCupBatch.hasClass("active")&&$verbandCupBatch.trigger("click")}else if(!$spielpaarungWeiss.hasClass("active")&&!$spielpaarungSchwarz.hasClass("active")&&$verbandCupBatch.hasClass("active")){$verbandCupBatch.trigger("click");const cascadeMsg="Die beiden Badges sind nur zusammen verf\xFCgbar.",$errorWrapper=$activeProduct.find(".product-form__error-message-wrapper"),$errorMsg=$activeProduct.find(".product-form__error-message");$errorWrapper.removeAttr("hidden"),$errorMsg.text(cascadeMsg),setTimeout(function(){$errorMsg.text()===cascadeMsg&&($errorWrapper.attr("hidden",!0),$errorMsg.text(""))},5e3)}}if(tabValue==="verband-cup-batch")if($this.hasClass("active")){if(!$spielpaarungWeiss.hasClass("active")&&!$spielpaarungSchwarz.hasClass("active")){let $firstSpielpaarung;$spielpaarungWeiss.length&&$spielpaarungSchwarz.length?$firstSpielpaarung=$spielpaarungWeiss.index()<$spielpaarungSchwarz.index()?$spielpaarungWeiss:$spielpaarungSchwarz:$spielpaarungWeiss.length?$firstSpielpaarung=$spielpaarungWeiss:$spielpaarungSchwarz.length&&($firstSpielpaarung=$spielpaarungSchwarz),$firstSpielpaarung&&$firstSpielpaarung.length&&$firstSpielpaarung.trigger("click")}}else $spielpaarungWeiss.hasClass("active")&&$spielpaarungWeiss.trigger("click"),$spielpaarungSchwarz.hasClass("active")&&$spielpaarungSchwarz.trigger("click");updateTrikotTotal($this)}),$(document).on("change keyup focusout",".individuell-nummer",function(){var $this=$(this),n=$(this).val();n<0?$this.parents(".active-product").find(".individuell-nummer").val(0):n>99&&$this.parents(".active-product").find(".individuell-nummer").val(99),$this.next("span").find("span").text($(this).val().length),$this.parents(".active-product").find(".pro_spieler_no").text(n)}),$(document).on("change keyup focusout",".individuell-name",function(){let $this=$(this),txtInput=$(this).val(),txtInput_lower=txtInput.toLowerCase(),badWord="fuck";if(txtInput_lower.indexOf(badWord)!=-1){let txtInputnew=txtInput_lower.replace(badWord,"");$this.parents(".active-product").find(".individuell-name").val(txtInputnew),$this.parents(".active-product").find(".pro_spieler_name").text(txtInputnew),$this.next("span").find("span").text(txtInputnew.length)}else $this.parents(".active-product").find(".individuell-name").val(txtInput),$this.parents(".active-product").find(".pro_spieler_name").text(txtInput),$this.next("span").find("span").text(txtInput.length)}),$(document).on("click",".active-product .custom-dropdown-main-wrap .custom-dropdown-selected-wrap",function(){$(this).parent().toggleClass("active")}),$(document).on("click",".custom-dropdown-main-wrap .custom-dropdown-list li",function(){spilier_option($(this))}),$(document).on("change",".product-form__input--dropdown .select select",function(){const $activeProduct=$(this).closest(".active-product");var name=$(this).attr("name"),index=$(this).attr("option-index"),price=$("option:selected",this).attr("data-price"),$this=$(this),value=$(this).val();if(value&&value!=0){var arr=[],name=[];arr=value.split(" - "),arr.length>
11&&arr[1]?name=arr[1].split(" "):name=[],$activeProduct.find(".individuell-nummer").val(""),$activeProduct.find(".individuell-name").val(""),$activeProduct.find(".individuell-nummer-text").val(""),$activeProduct.find(".individuell-name-text").val(""),$activeProduct.find(".hidden_product_input[data-content='individuell'] input[type='checkbox']").prop("checked",!1),$activeProduct.find(".hidden_product_input[data-content='individuell-name'] input[type='checkbox']").prop("checked",!1),$activeProduct.find(".product-form .properties_flock").val(value)}let closestProductInfo=$(this).closest("product-info"),product_form__error_message_wrapper=$(closestProductInfo).find(".product-form__error-message-wrapper"),product_form__error_message=$(closestProductInfo).find(".product-form__error-message");product_form__error_message_wrapper.attr("hidden",!0),product_form__error_message.text("")}),typeof customer<"u"&&!$("body").hasClass("template-name--team-member-detail")&&($(".active-product").each(function(){const $activeProduct=$(this),$this=$activeProduct.find(".button_add_individual");individual_option($this),$activeProduct.find(".product__media_wrap").hasClass("slick-initialized")&&$activeProduct.find(".product__media_wrap").slick("slickGoTo",1)}),$(".trikot-product .mainProduct-wrapper .product__media-wrapper .slider").hasClass("slick-initialized")&&$(".trikot-product .mainProduct-wrapper .product__media-wrapper .slider").slick("slickGoTo",1)),$("body").hasClass("template-name--team-member-detail")&&get_player_trikot();function get_player_trikot(){if(subscribe("player-news-loaded",function(response_data){if(response_data.length>0){let attributes=response_data[0].attributes,last_name=attributes.lastName,jerseyNo=79;var is_staff=attributes.crmTags.some(function(crmTags){return crmTags.name==="Staff"});is_staff?$(".section-trikot-product").addClass("hidden"):($(".section-trikot-product .gradient").removeClass("hidden"),$(".section-trikot-product").removeClass("hidden"));for(var c=0;c<attributes.customFields.length;c++)attributes.customFields[c].locale=="de_CH"&&attributes.customFields[c].name=="Trikotnummer"&&attributes.customFields[c].value&&(jerseyNo=attributes.customFields[c].value);let customerProducts=attributes.customerProducts||"",trikot_product_handle="",trikot_product;customerProducts!=""&&customerProducts.length>0&&(trikot_product_handle=customerProducts[0].urlHandle||""),window.player={jersey_number:jerseyNo,last_name};var isWoman=attributes.customerGroups.some(function(customerGroups){return customerGroups.name==="Frauen"});if(isWoman&&trikot_product_handle==""&&(trikot_product_handle="product-706"),$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+jerseyNo+'"]').length>0&&!isWoman){$(".active-product .trikots-tabs:not(.badges-tabs) .tab").removeClass("active"),$('.active-product .trikots-tabs [data-tab="spieler"]').addClass("active"),$(".active-product .trikots-contents .product-form__input").removeClass("active"),$('.active-product .trikots-contents [data-content="spieler"]').addClass("active"),$(".active-product").find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").addClass("hidden"),$(".active-product").find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").removeClass("hidden"),$(".active-product").find("#spieler-nummer").val(""),$(".active-product").find("#spieler-name").val(""),$(".active-product").find("#spieler-nummer").val(jerseyNo),$(".active-product").find("#spieler-name").val(last_name),$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+jerseyNo+'"]').addClass("active");let $this=$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+jerseyNo+'"].active');spilier_option($this),$(".section-trikot-product .product__media_wrap").hasClass("slick-initialized")&&$(".section-trikot-product .product__media_wrap").slick("slickGoTo",1)}trikot_product_handle!=""&&(trikot_product_handle=="goalietrikot-heim-2526"&&(trikot_product_handle="product-705"),get_trikot(trikot_product_handle,$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+jerseyNo+'"].active')))}}),typeof player<"u"&&$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+player.jersey_number+'"]').length>0){$(".active-product .trikots-tabs:not(.badges-tabs) .tab").removeClass("active"),$('.active-product .trikots-tabs [data-tab="spieler"]').addClass("active"),$(".active-product .trikots-contents .product-form__input").removeClass("active"),$('.active-product .trikots-contents [data-content="spieler"]').addClass("active"),$(".active-product").find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.normal_product").addClass("hidden"),$(".active-product").find(".product__info-wrapper").find(".stock_wrap").children(".delivery_note.trikot_product").removeClass("hidden"),$(".active-product").find("#spieler-nummer").val(""),$(".active-product").find("#spieler-name").val(""),$(".active-product").find("#spieler-nummer").val(player.jersey_number),$(".active-product").find("#spieler-name").val(player.last_name),$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+player.jersey_number+'"]').addClass("active");let $this=$('.active-product .custom-dropdown-main-wrap .custom-dropdown-list li[data-index="'+player.jersey_number+'"].active');spilier_option($this),$(".section-trikot-product .product__media_wrap").hasClass("slick-initialized")&&$(".section-trikot-product .product__media_wrap").slick("slickGoTo",1)}}$(document).on("click",".button_add_individual",function(){individual_option($(this))});function spilier_option($this){const $activeProduct=$this.closest(".active-product");$activeProduct.find(".custom-dropdown-main-wrap .custom-dropdown-list li").removeClass("active"),$this.addClass("active");let price=$this.attr("data-price"),amount=$this.attr("data-amount");window.aico_percentage_discount&&window.aico_percentage_discount!=0&&(amount=applyAicoDiscount(amount)),price=" + CHF "+amount;const pro_tag=$this.parent().attr("data-tag"),pro_type=$this.parent().attr("data-type");if(price&&pro_tag){const type_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item.active[data-type='${pro_type}']`);type_price_item.length>0&&(type_price_item.text(""),type_price_item.attr("data-type",""),type_price_item.attr("data-amount",""),type_price_item.removeClass("active"));const selected_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item[data-handle='${pro_tag}']`);selected_price_item.text(price),selected_price_item.attr("data-type",pro_type),selected_price_item.attr("data-amount",amount),selected_price_item.addClass("active"),updateTrikotTotal($this)}$(settings.objModalCloseBtn).trigger("click");let txtInput=$this.attr("data-val");if(txtInput){let parts=txtInput.split("-"),spieler_nummer="",spieler_name="";parts[0]&&(spieler_nummer=parts[0],$activeProduct.find(".spieler-nummer").val(spieler_nummer)),parts[1]&&(spieler_name=parts.slice(1).join("-").trim(),$activeProduct.find(".spieler-name").val(spieler_name));const canvasId=$activeProduct.find("#canvas-wrapper canvas").attr("id"),secondImage=$activeProduct.find(".product__media-list .product__media-item").eq(1).find("img").attr("data-zoom-image"),secondImageSelector=$activeProduct.find(".product__media-list .product__media-item").eq(1).find("img"),MobileImageSelector=$activeProduct.find(".product__mobile_media-list .product__media-item").eq(1).find("img");canvasId&&(renderTshirtPreview({canvasId,imageUrl:secondImage,playerName:spieler_name,playerNumber:spieler_nummer,injectIntoSelector:secondImageSelector,options:{numberOffsetX:0}}),renderTshirtPreview({canvasId,imageUrl:secondImage,playerName:spieler_name,playerNumber:spieler_nummer,injectIntoSelector:MobileImageSelector,options:{numberOffsetX:0}}))}const $select=$activeProduct.find('.hidden_product_input[data-content="spieler"] select.select__select');$select.find(`option[value="${txtInput}"]`).length&&$select.val(txtInput).trigger("change")}function individual_option($this){const $activeProduct=$this.closest(".active-product");let no=$activeProduct.find("#individuell-nummer-text").val(),name=$activeProduct.find("#individuell-name-text").val(),flag=0;if(no==""&&name==""&&flag++,flag==0){$this.siblings(".error_wrapper").find(".error").text(""),$activeProduct.find("#individuell-nummer").val(no),$activeProduct.find("#individuell-name").val(name),$activeProduct.find(".pro_spieler_name").text(name),$activeProduct.find(".pro_spieler_no").text(no),$activeProduct.find(".product-form .properties_flock").val(""+no+" "+name);const individuell_no_checkbox=$activeProduct.find(".hidden_product_input[data-content='individuell'] input[type='checkbox']");individuell_no_checkbox.prop("checked",!1);const individuell_name_checkbox=$activeProduct.find(".hidden_product_input[data-content='individuell-name'] input[type='checkbox']");individuell_name_checkbox.prop("checked",!1);var individuell_no_checked="";if($activeProduct.find(".modalWrapper .individual_options").length>0){let var_id=$activeProduct.find(".modalWrapper .individual_options").find(".individual_list li.active").data("variantid");
1no&&(individuell_no_checked=$activeProduct.find(".hidden_product_input[data-content='individuell'] input[type='checkbox'][data-variantid='"+var_id+"']"),individuell_no_checked.prop("checked",!0)),individuell_name_checkbox.length&&name&&individuell_name_checkbox.prop("checked",!0)}else typeof customer>"u"&&no&&(individuell_no_checkbox.prop("checked",!0),individuell_no_checked=individuell_no_checkbox),individuell_name_checkbox.length&&name&&individuell_name_checkbox.prop("checked",!0);$activeProduct.find(".spieler-nummer").val(""),$activeProduct.find(".spieler-name").val(""),$activeProduct.find(".custom-dropdown-main-wrap .custom-dropdown-list li").removeClass("active"),$activeProduct.find(".product-form__input--dropdown[data-content='spieler'] .select__select").val("0").trigger("change"),$(settings.objModalCloseBtn).trigger("click");const type_price_item=$activeProduct.find(".product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item.active[data-type='Flock']");type_price_item.length>0&&(type_price_item.text(""),type_price_item.attr("data-type",""),type_price_item.attr("data-amount",""),type_price_item.removeClass("active")),applyIndividuellPrice(individuell_name_checkbox,$activeProduct),applyIndividuellPrice(individuell_no_checked,$activeProduct),updateTrikotTotal($this);const canvasId=$activeProduct.find("#canvas-wrapper canvas").attr("id"),secondImage=$activeProduct.find(".product__media-list .product__media-item").eq(1).find("img").attr("data-zoom-image"),secondImageSelector=$activeProduct.find(".product__media-list .product__media-item").eq(1).find("img"),MobileImageSelector=$activeProduct.find(".product__mobile_media-list .product__media-item").eq(1).find("img");canvasId&&(renderTshirtPreview({canvasId,imageUrl:secondImage,playerName:name,playerNumber:no,injectIntoSelector:secondImageSelector,options:{numberOffsetX:0}}),renderTshirtPreview({canvasId,imageUrl:secondImage,playerName:name,playerNumber:no,injectIntoSelector:MobileImageSelector,options:{numberOffsetX:0}}))}else $this.siblings(".error_wrapper").find(".error").text("Nummer oder Name werden ben\xF6tigt")}$(document).on("click",".button--personalisieren",function(){const $activeProduct=$(this).closest(".active-product");$activeProduct.find(".product__info-wrapper.grid__item").addClass("active"),$activeProduct.find(".grid__item.product__media-wrapper").addClass("active"),setTimeout(()=>{initSlickSliderMobile()},100)}),subscribe(PUB_SUB_EVENTS.variantChange,event=>{const sectionId=event?.data?.sectionId;if(!sectionId)return;const $this=$(`product-info[data-section="${sectionId}"]`);updateTrikotTotal($this)});function applyIndividuellPrice(checkboxEl,$activeProduct){if(!checkboxEl)return!1;if(checkboxEl.prop("checked")){const pro_tag=checkboxEl.attr("data-tag"),pro_type=checkboxEl.attr("data-type"),pro_price=checkboxEl.attr("data-price");let pro_amount=checkboxEl.attr("data-amount");window.aico_percentage_discount&&window.aico_percentage_discount!=0&&(pro_amount=applyAicoDiscount(pro_amount));const selected_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item[data-handle='${pro_tag}']`);selected_price_item.text(pro_price),selected_price_item.attr("data-type",pro_type),selected_price_item.attr("data-amount",pro_amount),selected_price_item.addClass("active")}}function updateTrikotTotal($this,$type=null){let $activeProduct=$this.closest(".active-product");$activeProduct.length==0&&($activeProduct=$this.find(".active-product"));const main_price_el=$activeProduct.find(".product_trikot_price_wrap .tprice_main .tprice_main_amount");if(main_price_el.length===0)return;var main_price=parseFloat(main_price_el.attr("data-amount"));if(isNaN(main_price))return;let total_main_amount=0;var main_compare_price=parseFloat(main_price_el.attr("data-compare-amount"));window.aico_percentage_discount&&window.aico_percentage_discount!=0&&main_compare_price&&(main_price=parseFloat(main_price_el.attr("data-main-amount")),main_price=applyAicoDiscount(main_price));const active_price=$activeProduct.find(".product__buy-button-wrap").first().find(".tprice_extra_wrap .hidden-price-item.active");active_price.length>0?$activeProduct.find(".product_trikot_price_wrap .gross_price_wrap").removeClass("hide_total"):$activeProduct.find(".product_trikot_price_wrap .gross_price_wrap").addClass("hide_total");let total_amount=parseFloat(main_price);active_price.each(function(){const pro_content=$(this).data("handle"),selected_price_item=$activeProduct.find(`.product_trikot_price_wrap .tprice_extra_wrap .hidden-price-item[data-handle='${pro_content}']`);var dataAmount=$(this).data("amount"),amount=dataAmount!==""&&dataAmount!==void 0&&!isNaN(parseFloat(dataAmount))?parseFloat(dataAmount):parseFloat($(this).data("main-amount")),main_amount=parseFloat($(this).data("main-amount"));isNaN(amount)||(window.aico_percentage_discount&&window.aico_percentage_discount!=0&&(amount=applyAicoDiscount(amount),amount=Number(amount),selected_price_item.text(" + CHF "+amount.toFixed(2)),selected_price_item.addClass("active")),total_amount+=amount,total_main_amount+=main_amount)}),total_amount=total_amount.toFixed(2);const total_amount_currency=`${Currency} ${total_amount}`;$activeProduct.find(".product_trikot_price_wrap .gross_price_wrap .tprice_total_amount").text(total_amount);const HasDiscountPrice=$activeProduct.find(".af-price .af-discount-price");waitForDiscountPrice($activeProduct,function($HasDiscountPrice){const total_main_amount_formatted=parseFloat($(".tp_og_amount").data("og-amount"))+total_main_amount,total_main_amount_currency=`${Currency} ${total_main_amount_formatted.toFixed(2)}`;$activeProduct.find(".product__info-container .price .af-strike-price").text(total_main_amount_currency),$activeProduct.find(".product__info-wrapper .af-discount-price-inner").text(total_amount_currency)},function(){$activeProduct.find(".price .price__regular .price-item--regular").text(total_amount_currency)})}function waitForDiscountPrice($activeProduct,callback,fallback){let checks=0;const maxChecks=15,checkInterval=setInterval(()=>{checks++;const $discount=$activeProduct.find(".af-price .af-discount-price");$discount.length?(clearInterval(checkInterval),callback($discount)):checks>=maxChecks&&(clearInterval(checkInterval),typeof fallback=="function"&&fallback())},200);setTimeout(()=>clearInterval(checkInterval),3e3)}function renderTshirtPreview({canvasId,imageUrl,playerName,playerNumber,injectIntoSelector=null,options={}}){const canvas=document.getElementById(canvasId),ctx=canvas.getContext("2d"),image=new Image;image.crossOrigin="anonymous",image.src=imageUrl,image.onload=()=>{const printFontWrapper=canvas.closest("[data-print-font]"),printFont=(options.printFont||printFontWrapper&&printFontWrapper.getAttribute("data-print-font")||"Outlast").trim(),draw=()=>{ctx.clearRect(0,0,canvas.width,canvas.height),ctx.drawImage(image,0,0,canvas.width,canvas.height);const topPadding=370,vw=window.innerWidth/100,NumberfontSize=9*vw,NamefontSize=1.4*vw,trikotColorMap={trikot_white:"#ffffff",trikot_green:"#007c3e",trikot_orange:"#fb843f",trikot_black:"#000000"};let defaultTextColor="#007c3e";const wrapper=canvas.closest("."+Object.keys(trikotColorMap).join(", ."));if(wrapper){const matchedClass=Object.keys(trikotColorMap).find(cls=>wrapper.classList.contains(cls));matchedClass&&(defaultTextColor=trikotColorMap[matchedClass])}const textColor=options.textColor||defaultTextColor;ctx.fillStyle=textColor;const centerX=canvas.width/2,drawInkCentered=(text,x,y)=>{ctx.textAlign="left";const m=ctx.measureText(text),inkCentreFromOrigin=(m.actualBoundingBoxRight-m.actualBoundingBoxLeft)/2;ctx.fillText(text,x-inkCentreFromOrigin,y)},numberOffsetX=options.numberOffsetX!==void 0?options.numberOffsetX:0;ctx.font=`220px "${printFont}"`,drawInkCentered(String(playerNumber),centerX+numberOffsetX,topPadding),ctx.font=`30px "${printFont}"`;const nameTop=topPadding+50;if(drawInkCentered(playerName.toUpperCase(),centerX,nameTop),injectIntoSelector){const imgData=canvas.toDataURL("image/png");$(injectIntoSelector).attr("src",imgData),$(injectIntoSelector).parent('a[data-fancybox="gallery"]').attr("data-src",
1imgData)}};console.log("printFont",printFont),document.fonts&&typeof document.fonts.load=="function"?Promise.all([document.fonts.load(`bold 220px "${printFont}"`),document.fonts.load(`normal 30px "${printFont}"`)]).then(draw).catch(draw):draw()}}$(document).on("click",".active-product .individual_options .individuell-nummer-text",function(){const $activeProduct=$(this).closest(".active-product");$activeProduct.find(".individual_options .individual_list").slideDown(),$activeProduct.find(".individual_options .individual_list").addClass("open-dropdown")}),$(document).on("click",".active-product .individual_options .individual_list li",function(){const $activeProduct=$(this).closest(".active-product");let num_val=$(this).find("span").text(),num_sku=$(this).data("variant_sku"),variant_id=$(this).data("variantid");$activeProduct.find(".individual_options .individual_list li").removeClass("active"),$(this).addClass("active"),$activeProduct.find(".individual_options .individuell-nummer-text").val(num_val),$activeProduct.find(".individual_options .individual_list").slideUp(),$activeProduct.find(".individual_options .individual_list").removeClass("open-dropdown")}),$(document).on("click",".individual_options .close_icon",function(){const $activeProduct=$(this).closest(".active-product");$activeProduct.find(".individual_options .individual_list li").removeClass("active"),$activeProduct.find(".individual_options .individuell-nummer-text").val(""),$activeProduct.find(".individual_options .individual_list").slideUp(),$activeProduct.find(".individual_options .individual_list").removeClass("open-dropdown")}),initVerbandCupBatchAutoSelect()});
2//# sourceMappingURL=/cdn/shop/t/48/assets/product-trikots.js.map?v=43866975236264579261787151190

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.