PageSourceSearch

https://www.trendkitabevi.com/template/smart/default/assets/scripts.min.js?v=1790058138

js trendkitabevi.com collected 2026-09-25 10:33:13 UTC 111,742 bytes, 1 lines download raw bytes

1var $,q_ecom_analytics=null,q_verification_code_form_submit=null;function loadJSFile(t,e=!1,a=!1,i="body",n=null){if(null!==n)$.getScript({url:t,cache:!0},function(){n()});else{var r,o;r=document.createElement("script"),o=document.getElementsByTagName(i)[0],e&&(r.async=!0),r.src=t,a&&r.setAttribute("crossorigin","*"),o.append(r)}}function loadFormElements(){$(".number-input").length>0&&$(".number-input").numberInputFilter(function(t){return/^\d*$/.test(t)}),$(".form-phone-control").intlTelInput({nationalMode:!1,formatOnDisplay:!1,autoPlaceholder:"off",autoHideDialCode:!1,initialCountry:SITE_CONFIG.defaultCountry,preferredCountries:SITE_CONFIG.preferredCountries,onlyCountries:SITE_CONFIG.onlyCountries,utilsScript:SITE_CONFIG.baseUrl+"/template/smart/default/assets/plugins/tel-input-utils.js"})}function loadPlugins(){try{($(".datepicker").length>0||$(".datepicker-2").length>0||$(".datepicker-today").length>0||$(".datepicker-3").length>0)&&(SITE_CONFIG.datepicker.load?($(".datepicker").datepicker({format:"yyyy-mm-dd",autoclose:!0,enableOnReadonly:!0,language:"tr"}),$(".datepicker-2, .datepicker-today").datepicker({format:"dd.mm.yyyy",autoclose:!0,enableOnReadonly:!0,language:"tr",startDate:"+1h"}),$(".datepicker-3").datepicker({format:"dd.mm.yyyy",autoclose:!0,enableOnReadonly:!0,language:"tr"})):($("head").append($('<link rel="stylesheet" type="text/css" />').attr("href",SITE_CONFIG.datepicker.css)),$.getScript({url:SITE_CONFIG.datepicker.js,cache:!0},function(){$(".datepicker").datepicker({format:"yyyy-mm-dd",autoclose:!0,enableOnReadonly:!0,language:"tr"}),$(".datepicker-2, .datepicker-today").datepicker({format:"dd.mm.yyyy",autoclose:!0,enableOnReadonly:!0,language:"tr",startDate:"+1h"}),$(".datepicker-3").datepicker({format:"dd.mm.yyyy",autoclose:!0,enableOnReadonly:!0,language:"tr"})}),SITE_CONFIG.datepicker.load=!0)),!SITE_CONFIG.simplebar.load&&$("*[data-simplebar]").length>0&&(SITE_CONFIG.simplebar.load=!0,loadJSFile(SITE_CONFIG.simplebar.js,!0)),$(".social-share").length>0&&$(".social-share").jsSocials({showLabel:!1,showCount:!1,shares:["twitter","facebook","linkedin","whatsapp"]}),!SITE_CONFIG.fancybox.load&&$("*[data-fancybox]").length>0&&(SITE_CONFIG.fancybox.load=!0,loadJSFile(SITE_CONFIG.fancybox.js,!0))}catch(t){}}function tableSelectAll(t,e){$(t).is(":checked")?($(e).find("input[type=checkbox]").attr("checked",!0),$(e).find("input[type=checkbox]").prop("checked",!0)):($(e).find("input[type=checkbox]").attr("checked",!1),$(e).find("input[type=checkbox]").prop("checked",!1))}function getTableCheckedList(t){var e=[];return $(t).find("tbody").find("input[type=checkbox]").each(function(t,a){if($(a).is(":checked")){var i=parseInt($(a).val());!isNaN(i)&&i>0&&e.push(i)}}),e}function safeInt(t){let e=Number(t);return Number.isNaN(e)?0:Math.trunc(e)}function isFunction(t){return"function"==typeof window[t]}function executeFunctionByName(t,e){var a=Array.prototype.slice.call(e),i=t.split(".").pop();return window[i].apply(null,a)}function showBaseLoader(){isFunction("showLoader")&&showLoader()}function hideBaseLoader(){isFunction("hideLoader")&&hideLoader()}function baseLazyLoad(){if(isFunction("themeLazyLoad"))var t=themeLazyLoad();else var t={effect:"fadeIn",threshold:500,effectTime:parseInt(SITE_CONFIG.lazyLoadEffectTime),afterLoad:function(t){t.addClass("lazy-complete")},beforeLoad:function(t){}};t.bind="event",$(".owl-carousel .lazy-load").each(function(){$(this).removeClass("lazy-load").addClass("owl-lazy")}),$(".lazy-load").lazy(t),$(".sidebar-menu-type-2, .nav-mobile, .sidebar-menu, .sidebar-menu-type-1, .sidebar-menu-left").hover(function(){$(this).find(".lazy-mobile-menu").each(function(){$(this).attr("src",$(this).data("src")),$(this).removeClass("lazy-mobile-menu")})}),$(".btn-categories, .btn-sidebar-menu, .btn-sidebar-categories, .btn-categories-show, .icon-open").click(function(){$(".lazy-mobile-menu").each(function(){$(this).attr("src",$(this).data("src")),$(this).removeClass("lazy-mobile-menu")})}),$(".mega-menu .nav-item").hover(function(){$(this).find(".lazy-mega-menu").each(function(){$(this).attr("src",$(this).data("src")),$(this).removeClass("lazy-mega-menu")})})}function customLazyLoad(t){if(isFunction("themeLazyLoad"))var e=themeLazyLoad();else var e={effect:"fadeIn",effectTime:parseInt(SITE_CONFIG.lazyLoadEffectTime),afterLoad:function(t){t.addClass("lazy-complete")}};$(t).each(function(){$(this).attr("src",$(this).data("src")),$(this).removeClass(t)}),$(t).lazy(e)}function baseImageTypes(){let t=0;try{t=window.innerWidth||$(window).width()}catch(e){}t>=992&&$('img[data-image-type="hover-image"]').each(function(){let t=$(this).data("image-1"),e=$(this).data("image-2");
1if(!t||!e){$(this).removeAttr("data-image-type"),$(this).removeAttr("data-image-1"),$(this).removeAttr("data-image-2");return}$(this).attr("onmouseover","this.src='"+e+"'"),$(this).attr("onmouseout","this.src='"+t+"'"),$(this).removeAttr("data-image-type"),$(this).removeAttr("data-image-1"),$(this).removeAttr("data-image-2")})}function toType(t){return({}).toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function ajaxFormGate(t,e,a,i,n,r,o){void 0===i&&(i=!1),void 0===n&&(n=!0),void 0===r&&(r=void 0),void 0===o&&(o=!0),n&&i&&(i=$(i).serializeArray()),i||(i=""),o&&showBaseLoader();var s=0;if("object"==typeof q_ecom_analytics)try{s=q_ecom_analytics.getTotalTime()}catch(d){}var l=0;try{l=window.innerWidth||$(window).width()}catch(c){}var u=toType(i),m={"Accept-Content-Token":SITE_CONFIG.token,"Time-Spent":s,"Window-Width":l,accept:SITE_CONFIG.accept};if($(".q-verification-code-form").length>0&&isFunction("getVerificationCodeForm")){let p=getVerificationCodeForm();m["Verification-Token"]=p.token,m["Verification-Code"]=p.code}return $.ajax({type:t,url:SITE_CONFIG.baseUrl+"/client/"+e.toString()+"/"+a.toString(),data:i,processData:"formdata"!=u,contentType:"formdata"!=u&&"application/x-www-form-urlencoded; charset=UTF-8",headers:m,success:function(t){try{var i=JSON.parse(t);if("csrf"==i.status)return window.location.reload(),!1;o&&hideBaseLoader(),void 0===r?"success"==i.status?showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,buttonTitle:LANG_HELPER.ok}):showAlert({title:LANG_HELPER.error,text:i.message||LANG_HELPER.errorMsg,status:i.status,buttonTitle:LANG_HELPER.ok}):(r(i),loadPlugins())}catch(n){o&&hideBaseLoader(),void 0===r?showAlert({title:LANG_HELPER.error,text:LANG_HELPER.errorMsg,status:"error",buttonTitle:LANG_HELPER.ok}):r({status:"error"})}try{document.dispatchEvent(new CustomEvent("client_action",{detail:{name:e.toString()+"/"+a.toString(),result:i}}))}catch(s){}},error:function(t,e,a){void 0===r?(showAlert({title:LANG_HELPER.error,text:LANG_HELPER.errorMsg,status:"error",buttonTitle:LANG_HELPER.ok}),o&&hideBaseLoader()):r({status:"error"})}}),!1}function showNativeModalWithPrefix(t){$("#native-modal-"+t).modal({show:!0,keyboard:!1}),$("#native-modal-"+t).on("hidden.bs.modal",function(e){$("#native-modal-"+t).modal("dispose"),$("#native-modal-"+t).remove()})}function onlyShowNativeModalWithPrefix(t){$("#native-modal-"+t).modal({show:!0,keyboard:!1})}function showNativeModal(t,e,a){void 0===e&&(e=[]),void 0===a&&(a=!1),showBaseLoader(),ajaxFormGate("POST","NativeModal",t,e,!1,function(t){"success"==t.status?($("body").append(t.html),showNativeModalWithPrefix(t.prefix),a&&a(t)):"auth"==t.status?showNativeModal("loginPage"):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})})}function hideNativeModal(t){$("#native-modal-"+t).modal("hide")}function userLogin(t,e){return void 0===e&&(e=!1),ajaxFormGate("POST","User","login",t,!0,function(t){"success"==t.status?(showBaseLoader(),showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,bottons:!1}),setTimeout(function(){t.redirectUrl.length>0?window.location=t.redirectUrl:window.location.reload()},1e3)):"two_factor"==t.status?showNativeModal("user2FactorLogin",[{name:"hash",value:t.message}]):showAlert({title:"warning"===t.status?" ":LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok}),void 0!==t.events&&submitMarketingEvents(t.events)}),!1}function userForgotPassword(t){return ajaxFormGate("POST","User","forgotPassword",t,!0,function(e){showAlert({title:"success"==e.status?LANG_HELPER.success:LANG_HELPER.error,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok}),"success"==e.status&&$(t).find("button[type=submit]").remove()}),!1}function userRenewPassword(t){return ajaxFormGate("POST","User","renewPassword",t,!0,function(e){"success"==e.status?(showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonList:{cart:{text:LANG_HELPER.login,value:"login",visible:!0,className:"btn-success",closeModal:!1}}},function(t){"login"==t&&(window.location=SITE_CONFIG.url+"/uye-giris")}),$(t).find("button[type=submit]").remove()):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})}),!1}function userLogout(){return ajaxFormGate("GET","User","logout","",!1,function(t){"success"==t.status?(showBaseLoader(),setTimeout(function(){window.location.reload()},1e3)):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function getUserRegisterForm(t){var e,a,i=new FormData,n=$(t).seri
1alizeArray();for(e=0;e<n.length;e++)a=n[e],i.append(a.name,a.value);let r=!1;return $(t).find(".file-input").each(function(t,e){if(0==$(e)[0].files.length){if($(e).data("is-required"))return showAlert({title:LANG_HELPER.error,text:LANG_HELPER.fillInRequiredFields,status:"error",buttonTitle:LANG_HELPER.ok}),r=!0,!1}else i.append("document_files["+t+"]",$(e)[0].files[0]),i.append("document_details["+t+"][description]",$(e).data("description"))}),!r&&i}function userRegister(t,e="register"){var a=getUserRegisterForm(t);return!!a&&(ajaxFormGate("POST","User",e,a,!1,function(a){if("verification_code"==a.status)return showVerificationCodeModal(a.token,"userRegister",[t,e]),!1;"redirect"==a.status?(showBaseLoader(),showAlert({title:LANG_HELPER.success,text:a.message,status:"success",bottons:!1}),setTimeout(function(){a.redirectUrl.length>0?window.location=a.redirectUrl:window.location.reload()},1e3)):"success"==a.status?(showAlert({title:LANG_HELPER.success,text:a.message,status:a.status,bottons:!a.redirect,buttonTitle:a.redirect?null:LANG_HELPER.ok}),$(t).find('button[type="submit"]').remove(),$(t).find("button.btn-success").remove(),a.redirect&&(showBaseLoader(),setTimeout(function(){a.redirectUrl.length>0?window.location=a.redirectUrl:window.location.reload()},1e3))):"two_factor"==a.status?showNativeModal("user2FactorLogin",[{name:"hash",value:a.message}]):showAlert({title:LANG_HELPER.error,text:a.message||LANG_HELPER.errorMsg,status:a.status,buttonTitle:LANG_HELPER.ok}),void 0!==a.events&&submitMarketingEvents(a.events)}),!1)}function userRegister2(t){return userRegister(t,"register2")}function dealerRegister(t){return userRegister(t,"dealerRegister")}function dealerRegister2(t){return userRegister(t,"dealerRegister2")}function dealerRegister3(t){return userRegister(t,"dealerRegister3")}function dealerRegister4(t){return userRegister(t,"dealerRegister4")}function contactForm(t){return ajaxFormGate("POST","Visitor","contactForm",t,!0,function(e){"success"==e.status?(showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok}),$(t).hide()):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok}),void 0!==e.events&&submitMarketingEvents(e.events)}),!1}function customContactForm(t,e="hide"){for(var a=(t=$(t)).serializeArray(),i=new FormData,n=0;n<a.length;n++)i.append(a[n].name,a[n].value);for(var r=["file_1","file_2"],n=0;n<r.length;n++){var o=r[n];o.length>0&&void 0!==t.find('input[type=file][name="'+o+'"]')[0]&&t.find('input[type=file][name="'+o+'"]')[0].files.length>0&&(i.has(o)&&i.delete(o),i.append(o,t.find('input[type=file][name="'+o+'"]')[0].files[0]))}return ajaxFormGate("POST","Visitor","customContactForm",i,!1,function(a){"success"==a.status?(showAlert({title:LANG_HELPER.success,text:a.message,status:a.status,buttonTitle:LANG_HELPER.ok}),"reset"==e?($(t).trigger("reset"),$(t)[0].reset()):$(t).hide()):showAlert({title:LANG_HELPER.error,text:a.message||LANG_HELPER.errorMsg,status:a.status,buttonTitle:LANG_HELPER.ok}),void 0!==a.events&&submitMarketingEvents(a.events)}),!1}function bankEftForm(t){return ajaxFormGate("POST","Visitor","bankEftForm",t,!0,function(e){"success"==e.status?(showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok}),$(t).hide()):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})}),!1}function orderDetailForm(t,e="",a=!0){return ajaxFormGate("POST","Order","find",t,a,function(t){"success"==t.status?$(e).html(t.html):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function selectChangeCountry(t,e,a,i,n=!1){var r=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","countryInfo",[{name:"country",value:r}],!1,function(e){"success"==e.status?($(t).find("select[name="+a+"]").html(" "),e.cities.forEach(function(e){n&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}
1),$(t).find("select[name="+i+"]").html(" "),e.districts.forEach(function(e){n&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+i+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")})):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeCity(t,e,a,i=!1){var n=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","cityInfo",[{name:"city",value:n}],!1,function(e){"success"==e.status?($(t).find("select[name="+a+"]").html(" "),e.districts.forEach(function(e){i&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")})):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeCountryV2(t,e,a,i,n,r=!1){var o=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","countryInfo",[{name:"country",value:o}],!1,function(e){"success"==e.status?($(t).find("select[name="+a+"]").html(" "),e.cities.forEach(function(e){r&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),$(t).find("select[name="+i+"]").html(" "),e.districts.forEach(function(e){r&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+i+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),n&&($(t).find("select[name="+n+"]").html(" "),e.neighborhoods.forEach(function(e){r&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+n+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}))):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeCityV2(t,e,a,i,n=!1){var r=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","cityInfo",[{name:"city",value:r}],!1,function(e){"success"==e.status?($(t).find("select[name="+a+"]").html(" "),e.districts.forEach(function(e){n&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),i&&($(t).find("select[name="+i+"]").html(" "),e.neighborhoods.forEach(function(e){n&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+i+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}))):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeDistrictV2(t,e,a,i=!1){var n=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","districtInfo",[{name:"district",value:n}],!1,function(e){"success"==e.status?($(t).find("select[name="+a+"]").html(" "),e.neighborhoods.forEach(function(e){i&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")})):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeCountryV3(t,e,a,i,n,r=!1){var o=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","countryInfo",[{name:"country",value:o}],!1,function(e){"success"==e.status?($(t).find('*[data-location-input="neighborhood"]').addClass("d-none"),$(t).find("select[name="+a+"]").html(" "),e.cities.forEach(function(e){r&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),$(t).find("select[name="+i+"]").html(" "),e.districts.forEach(function(e){r&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+i+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),n&&($(t).find("select[name="+n+"]").html(" "),e.neighborhoods.forEach(function(e){r&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+n+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")})),e.show_districts?$(t).find('*[data-location-input="district"]').removeClass("d-none"):($(t).find('*[data-location-input="district"]').addClass("d-none"),$(t).find('*[data-location-input="neighborhood"]').addClass("d-none")),e.show_zip_code?$(t).find('*[data-location-input="zip_code"]').removeClass("d-none"):$(t).find('*[data-location-input="zip_code"]').addClass("d-none"),0==e.districts.length&&$(t).find('*[data-location-input="district"]').addClass("d-none"),0==e.neighborhoods.length&&$(t).find('*[data-location-input="neighborhood"]').addClass("d-none")):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeCityV3(t,e,a,i,n=!1){var r=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","cityInfo",[{name:"city",value:r}],!1,function(e){"success"==e.status?($(t).find('*[data-location-input="neighborhood"]').addClass("d-none"),$(t).find("select[name="+a+"]").html(" "),e.districts.forEac
1h(function(e){n&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),i&&($(t).find("select[name="+i+"]").html(" "),e.neighborhoods.forEach(function(e){n&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+i+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")})),e.show_districts?$(t).find('*[data-location-input="district"]').removeClass("d-none"):($(t).find('*[data-location-input="district"]').addClass("d-none"),$(t).find('*[data-location-input="neighborhood"]').addClass("d-none")),e.show_zip_code?$(t).find('*[data-location-input="zip_code"]').removeClass("d-none"):$(t).find('*[data-location-input="zip_code"]').addClass("d-none"),0==e.districts.length&&$(t).find('*[data-location-input="district"]').addClass("d-none"),0==e.neighborhoods.length&&$(t).find('*[data-location-input="neighborhood"]').addClass("d-none")):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function selectChangeDistrictV3(t,e,a,i=!1){var n=$(t).find("select[name="+e+"]").val();ajaxFormGate("POST","Visitor","districtInfo",[{name:"district",value:n}],!1,function(e){"success"==e.status?($(t).find("select[name="+a+"]").html(" "),e.neighborhoods.forEach(function(e){i&&isNaN(parseInt(e.ID))&&(e.name=""),$(t).find("select[name="+a+"]").append('<option value="'+e.ID+'">'+e.name+"</option>")}),e.neighborhoods.length>1?$(t).find('*[data-location-input="neighborhood"]').removeClass("d-none"):$(t).find('*[data-location-input="neighborhood"]').addClass("d-none")):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},!1)}function smartCategorySearch(t){void 0===t&&(t={});var e="input[data-smart-cat-search='1']";"collection"===SITE_CONFIG.page&&(e=".collection-custom-filters input[data-smart-cat-search='1']"),CATEGORY_PAGE_DATA.k;var a=[],i=[],n=[],r="",o="",s="";if($(e+"[name='smart-cat-kategoriler[]']:checked").length>0&&$(e+"[name='smart-cat-kategoriler[]']:checked").each(function(t,e){a.push($(e).val())}),$(e+"[name='smart-cat-markalar[]']:checked").length>0&&$(e+"[name='smart-cat-markalar[]']:checked").each(function(t,e){i.push($(e).val())}),$(e+"[data-smart-cat-attribute='1']:checked").length>0&&$(e+"[data-smart-cat-attribute='1']:checked").each(function(t,e){var a=$(e).data("smart-cat-attribute-id");a.toString().length>0&&$(e).val().toString().length>0&&n.push(a.toString()+":"+$(e).val())}),"priceRangeBtn"in t){var d=parseInt($(e+"[name='smart-cat-min-price']").val()),l=parseInt($(e+"[name='smart-cat-max-price']").val());isNaN(d)&&(d=0),isNaN(l)&&(l=0),(d>0||l>0)&&(0==l&&(l="uzeri"),r=d.toString()+"-"+l.toString())}else 0==r.length&&(r=$(e+"[name='smart-cat-fiyatlar']:checked").length>0?$(e+"[name='smart-cat-fiyatlar']:checked").val():"");o=$(e+"[name='smart-cat-list']:checked").length>0?$(e+"[name='smart-cat-list']:checked").val():"",s=$(e+"[name='smart-cat-siralama']:checked").length>0?$(e+"[name='smart-cat-siralama']:checked").val():"",a=a.join(","),i=i.join(","),n=n.join(",");var c={};s.length>0&&(c.siralama=s),a.length>0&&(c.kategoriler=a),i.length>0&&(c.markalar=i),n.length>0&&(c.filtreler=n),r.length>0&&(c.fiyat=r),o.length>0&&(c.list=o);var u="";$(e+"[name='smart-cat-text']").length>0&&((u=$(e+"[name='smart-cat-text']").val().trim()).length>0?c.k=u:CATEGORY_PAGE_DATA.url.indexOf("?k=")>0&&(CATEGORY_PAGE_DATA.url=CATEGORY_PAGE_DATA.url.split("?k=")[0]));var m=CATEGORY_PAGE_DATA.url,p=-1!==m.indexOf("?")?"&":"?";c=(c=$.param(c).split("%2C").join(",")).split("%3A").join(":"),window.location=m+p+c}function smartCategoryFilters(t){return ajaxFormGate("POST","Category","filters",[{name:"key",value:t.filtreleme}],!1,function(t){if($(".p-g-mod-t-35").hide(),$(".p-g-mod-t-25.p-g-mod-t-cat-display-0").show(),$(".p-g-mod-t-26.p-g-mod-t-cat-display-0").show(),"success"==t.status){if($(".p-g-mod-t-21").length>0&&(t.counts.categories>0?($(".p-g-mod-t-21").show(),$("*[data-smart-cat-filter='sub-categories']").html(t.html.categories)):$(".p-g-mod-t-21").hide()),$(".p-g-mod-t-21").length>0&&(t.counts.brands>0?($(".p-g-mod-t-22").show(),$("*[data-smart-cat-filter='brands']").html(t.html.brands)):$(".p-g-mod-t-22").hide()),$(".p-g-mod-t-24").length>0&&(t.counts.prices>
10?($(".p-g-mod-t-24").show(),$("*[data-smart-cat-filter='price-ranges']").html(t.html.prices)):$(".p-g-mod-t-24").hide()),$(".p-g-mod-t-23").length>0){if(t.counts.attributes>0){$(".p-g-mod-t-23").show();for(var e=$(".p-g-mod-t-23")[0].outerHTML,a=0;a<t.html.attributes.length;a++){var i=t.html.attributes[a];a>0&&($(".p-g-mod-t-24").length>0?$(e).insertBefore($(".p-g-mod-t-24")):$(".p-g-mod-t-26").length>0&&$(e).insertBefore($(".p-g-mod-t-26"))),$(".p-g-mod-t-23:eq("+a.toString()+")").find(".p-g-m-h-i-title").html(i.name),$(".p-g-mod-t-23:eq("+a.toString()+")").find("*[data-smart-cat-filter='attributes']").html(i.html)}}else $(".p-g-mod-t-23").hide()}}else $(".p-g-mod-t-21").hide(),$(".p-g-mod-t-22").hide(),$(".p-g-mod-t-23").hide(),$(".p-g-mod-t-24").hide();isFunction("smartCategoryFiltersSuccess")&&smartCategoryFiltersSuccess()},!1),!1}function showSmartCategoryPopup(t){void 0===t&&(t="order"),$("body").addClass("hidden-scroll"),$(".cat-responsive-popup").removeClass("d-none"),$(".cat-responsive-popup .c-r-p-content").html(" ");var e="";"order"==t?$(".category-filter-order").length>0&&(e+=$(".category-filter-order")[0].outerHTML,$(".cat-responsive-popup .c-r-p-content").html(e),$(".cat-responsive-popup .c-r-p-content .category-filter-order").removeClass("category-filter-order").addClass("category-filter-list").addClass("category-filter-res-order")):"filter"==t&&($(".p-g-mod-t-cat-filter").length>0&&$(".p-g-mod-t-cat-filter").each(function(t,a){e+=$(a)[0].outerHTML}),$(".cat-responsive-popup .c-r-p-content").html(e),accordionCategoryTree()),$(".p-g-mod-t-26").length>0&&$(".cat-responsive-popup .c-r-p-bar").html($(".p-g-mod-t-26")[0].outerHTML)}function hideSmartCategoryPopup(){$(".cat-responsive-popup").addClass("d-none"),$("body").removeClass("hidden-scroll")}function showSmartCategoryNative(t){void 0===t&&(t="filter"),$(".cat-responsive-native .c-r-n-content").html(" ");var e="";$(".p-g-mod-t-cat-filter").length>0&&$(".p-g-mod-t-cat-filter").each(function(t,a){e+=$(a)[0].outerHTML}),$(".cat-responsive-native .c-r-n-content").html(e),$(".p-g-mod-t-26").length>0&&$(".cat-responsive-native .c-r-n-buttons").html($(".p-g-mod-t-26")[0].outerHTML)}function changeProductPageVariant(t,e,a,i,n,r,o){void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=!1);var s=a.replace("variant-","list-"),d=a.replace("variant-","eft-"),l=a.replace("variant-","discounted-"),c=a.replace("variant-","promotion-");if(0==t.variants.count)return!1;changeVariantImageSlider(e,i,r+1);let u=e=>{if(0!==$(c).length){var a=$(c).find(".price"),i=$(c).find(".rate"),n=$(c).find(".rate").find(".value"),r=!1,o="",s=0;!0===$(c).data("default-discount")&&(r=!0,o=$(c).data("default-price"),s=safeInt($(c).data("default-rate"))),e.price_dif?e.price_list.indirimli_fiyatlar.promosyon.aktif?($(c).removeClass("d-none"),i.addClass("d-none"),void 0!==t.taxExclude&&t.taxExclude?a.html(e.price_list.indirimli_fiyatlar.promosyon.kdv_haric):a.html(e.price_list.indirimli_fiyatlar.promosyon.kdv_dahil),"yuzde"==e.price_list.indirimli_fiyatlar.promosyon.tipi&&safeInt(e.price_list.indirimli_fiyatlar.promosyon.miktar)>0&&(i.removeClass("d-none"),n.html("%"+safeInt(e.price_list.indirimli_fiyatlar.promosyon.miktar)))):($(c).addClass("d-none"),a.html("")):r?($(c).removeClass("d-none"),i.addClass("d-none"),a.html(o),s>0&&(i.removeClass("d-none"),n.html("%"+s))):$(c).addClass("d-none")}};if(!n)return!1;var m=$(e);if(0==r){if(3==t.variants.count){var p=t.variants.summary[i],n=!1;Object.entries(p).forEach(function(t,e){var a=!1,i=t[0];Object.entries(t[1]).forEach(function(t,e){void 0===t.in_stock&&(e=t[0],t=t[1]);var i=m.find("a[data-variant='2'][data-variant-value='"+e.toString()+"']");t.in_stock&&(a=!0),i.removeClass("sold-out").removeClass("active")});var n=m.find("a[data-variant='1'][data-variant-value='"+i.toString()+"']");a?n.removeClass("sold-out"):n.addClass("sold-out"),n.removeClass("active")}),m.find("a[data-variant='0']").removeClass("active"),m.find("a[data-variant='0'][data-variant-value='"+i.toString()+"']").addClass("active"),m.find("select[data-variant='0']").find("option").removeAttr("selected"),m.find("select[data-variant='0']").find("option[data-variant-value='"+i.toString()+"']").prop("selected",!0);var f=m.find("select[data-variant='1']").val(),v=m.find("select[data-variant='2']").val(),h=!1;if(void 0!==p[f]&&void 0!==p[f][v]&&p[f][v].in_stock){h=!0,m.find("a[data-variant='1'][data-variant-value='"+f.toString()+"']").addClass("active"),m.find("a[data-variant='2'][data-variant-value='"+v.toString()+"']").addClass("active");var g=p[f][v];g.price_dif&&(void 0!==t.taxExclude&&t.taxExclude?($(a).html(g.price_list.fiyat_kdv_haric),$(s).html(g.price_list.piyasa_fiyati_kdv_haric),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_haric)):($(a).html(g.price_list.fiyat),$(s).html(g.price_list.piyasa_fiyati),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_dahil))),o&&void 0!==g.barcode&&$(o).html(g.barcode),u(g)}h||(m.find("select[data-variant='1']").find("option").prop("selected",!1),m.find("select[data-variant='2']").find("option").prop("selected",!1),m.find("a[data-variant='1'][data-variant-value='"+f.toString()+"']").removeClass("active"),m.find("a[data-variant='2'][data-variant-value='"+v.toString()+"']").removeClass("active"))}else if(2==t.variants.count){var p=t.variants.summary[i],n=!1;
1Object.entries(p).forEach(function(t,e){void 0===t.in_stock&&(e=t[0],t=t[1]);var a=m.find("a[data-variant='1'][data-variant-value='"+e.toString()+"']");t.in_stock?(a.removeClass("sold-out"),n=!1):a.addClass("sold-out"),a.removeClass("active")}),m.find("a[data-variant='0']").removeClass("active"),m.find("a[data-variant='0'][data-variant-value='"+i.toString()+"']").addClass("active"),m.find("select[data-variant='0']").find("option").removeAttr("selected"),m.find("select[data-variant='0']").find("option[data-variant-value='"+i.toString()+"']").prop("selected",!0);var f=m.find("select[data-variant='1']").val(),h=!1;if(void 0!==p[f]&&p[f].in_stock){h=!0,m.find("a[data-variant='1'][data-variant-value='"+f.toString()+"']").addClass("active");var g=p[f];g.price_dif&&(void 0!==t.taxExclude&&t.taxExclude?($(a).html(g.price_list.fiyat_kdv_haric),$(s).html(g.price_list.piyasa_fiyati_kdv_haric),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_haric)):($(a).html(g.price_list.fiyat),$(s).html(g.price_list.piyasa_fiyati),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_dahil))),o&&void 0!==g.barcode&&$(o).html(g.barcode),u(g)}h||m.find("select[data-variant='1']").find("option").prop("selected",!1)}else{var g=t.variants.summary[i];g.in_stock?(m.find("*[data-variant-stock='0']").removeClass("d-none").find("*[data-quantity]").html(g.quantity),m.find("a[data-variant='0']").removeClass("active"),m.find("a[data-variant='0'][data-variant-value='"+i.toString()+"']").addClass("active"),g.price_dif?void 0!==t.taxExclude&&t.taxExclude?($(a).html(g.price_list.fiyat_kdv_haric),$(s).html(g.price_list.piyasa_fiyati_kdv_haric),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_haric)):($(a).html(g.price_list.fiyat),$(s).html(g.price_list.piyasa_fiyati),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_dahil)):void 0!==t.taxExclude&&t.taxExclude&&void 0!==t.priceTaxExclude?($(a).html(t.priceTaxExclude),void 0!==t.listPriceTaxExclude&&$(s).html(t.listPriceTaxExclude),void 0!==t.eftPriceTaxExclude&&$(d).html(t.eftPriceTaxExclude),void 0!==t.discountedPriceTaxExclude&&$(l).html(t.discountedPriceTaxExclude)):($(a).html(t.price),void 0!==t.listPrice&&$(s).html(t.listPrice),void 0!==t.eftPrice&&$(d).html(t.eftPrice),void 0!==t.discountedPrice&&$(l).html(t.discountedPrice)),o&&void 0!==g.barcode&&$(o).html(g.barcode),u(g),m.find("select[data-variant='0']").find("option").removeAttr("selected"),m.find("select[data-variant='0']").find("option[data-variant-value='"+i.toString()+"']").prop("selected",!0)):m.find("a[data-variant-stock='0']").addClass("d-none"),document.dispatchEvent(new CustomEvent("change_product_variant",{detail:{variant:g}}))}}else if(1==r){if(3==t.variants.count){var y=m.find("select[data-variant='0']").val(),p=t.variants.summary[y][i],n=!1;if(Object.entries(p).forEach(function(t,e){void 0===t.in_stock&&(e=t[0],t=t[1]);var a=m.find("a[data-variant='2'][data-variant-value='"+e.toString()+"']");t.in_stock?(n=!0,a.removeClass("sold-out")):a.addClass("sold-out"),a.removeClass("active")}),!n)return!1;m.find("a[data-variant='1']").removeClass("active"),m.find("a[data-variant='1'][data-variant-value='"+i.toString()+"']").addClass("active"),m.find("select[data-variant='1']").find("option").removeAttr("selected"),m.find("select[data-variant='1']").find("option[data-variant-value='"+i.toString()+"']").prop("selected",!0);var v=m.find("select[data-variant='2']").val(),h=!1;if(void 0!==p[v]&&p[v].in_stock){h=!0,m.find("a[data-variant='2'][data-variant-value='"+v.toString()+"']").addClass("active");var g=p[v];g.price_dif&&(void 0!==t.taxExclude&&t.taxExclude?($(a).html(g.price_list.fiyat_kdv_haric),$(s).html(g.price_list.piyasa_fiyati_kdv_haric),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_haric)):($(a).html(g.price_list.fiyat),$(s).html(g.price_list.piyasa_fiyati),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_dahil))),o&&void 0!==g.barcode&&$(o).html(g.barcode),u(g)}h||m.find("select[data-variant='2']").find("option").prop("selected",!1)}else if(2==t.variants.count){var b=m.find("select[data-variant='0']").val();if(b.length>0){var g=t.variants.summary[b][i];if(!g.in_stock)return!1;g.price_dif?void 0!==t.taxExclude&&t.taxExclude?($(a).html(g.price_list.fiyat_kdv_haric),$(s).html(g.price_list.piyasa_fiyati_kdv_haric),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_haric)):($(a).html(g.price_list.fiyat),$(s).html(g.price_list.piyasa_fiyati),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_dahil)):void 0!==t.taxExclude&&t.taxExclude&&void 0!==t.priceTaxExclude?($(a).html(t.priceTaxExclude),void 0!==t.listPriceTaxExclude&&$(s).html(t.listPriceTaxExclude),void 0!==t.eftPriceTaxExclude&&$(d).html(t.eftPriceTaxExclude),void 0!==t.discountedPriceTaxExclude&&$(l).html(t.discountedPriceTaxExclude)):($(a).html(t.price),void 0!==t.listPrice&&$(s).html(t.listPrice),void 0!==t.eftPrice&&$(d).html(t.eftPrice),void 0!==t.discountedPrice&&$(l).html(t.discountedPrice)),o&&void 0!==g.barcode&&$(o).html(g.barcode),u(g)}m.find("a[data-variant='1']").removeClass("active"),m.find("a[data-variant='1'][data-variant-value='"+i.toString()+"']").addClass("active"),m.find("select[data-variant='1']").find("option").removeAttr("selected"),m.find("select[data-variant='1']").find("option[data-variant-value='"+i.toString()+"']").prop("selected",!0),document.dispatchEvent(new CustomEvent("change_product_variant",{detail:{variant:g}}))}}else if(2==r){var b=m.find("select[data-variant='0']").val(),_=m.find("select[data-variant='1']").val();if(b.length>0&&_.length>0){var g=t.variants.summary[b][_][i];if(!g.in_stock)return!1;g.price_dif?void 0!==t.taxExclude&&t.taxExclude?($(a).html(g.price_list.fiyat_kdv_haric),$(s).html(g.price_list.piyasa_fiyati_kdv_haric),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_haric)):($(a).html(g.price_list.fiyat),$(s).html(g.price_list.piyasa_fiyati),$(d).html(g.price_list.eft_fiyat),$(l).html(g.price_list.indirimli_fiyatlar.sabit_indirim.kdv_dahil)):void 0!==t.taxExclude&&t.taxExclude&&void 0!==t.priceTaxExclude?($(a).html(t.priceTaxExclude),void 0!==t.listPriceTaxExclude&&$(s).html(t.listPriceTaxExclude),void 0!==t.eftPriceTaxExclude&&$(d).html(t.eftPriceTaxExclude),void 0!==t.discountedPriceTaxExclude&&$(l).html(t.discountedPriceTaxExclude)):($(a).html(t.price),void 0!==t.listPrice&&$(s).html(t.listPrice),void 0!==t.eftPrice&&$(d).html(t.eftPrice),void 0!==t.discountedPrice&&$(l).html(t.discountedPrice)),o&&void 0!==g.barcode&&$(o).html(g.barcode),u(g)}m.find("a[data-variant='2']").removeClass("active"),m.find("a[data-variant='2'][data-variant-value='"+i.toString()+"']").addClass("active"),m.find("select[data-variant='2']").find("option").removeAttr("selected"),m.find("select[data-variant='2']").find("option[data-variant-value='"+i.toString()+"']").prop("selected",!0),document.dispatchEvent(new CustomEvent("change_product_variant",{detail:{variant:g}}))}document.dispatchEvent(new CustomEvent("select_product_variant",{detail:{seq:r}})),userProductQuantityAlertView()}function productQuantityBox(t,e,a,i,n){void 0===a&&(a=null),void 0===i&&(i="name");var r=$(e),o=1;void 0!==r.find("input["+i+"=quantity]").data("version")&&(o=parseInt(r.find("input["+i+"=quantity]").data("version")),isNaN(o)&&(o=1));var s=1,d=9999999999,l=!1,c=1,u=1,m=1;if(2===o){var p=r.find("input["+i+"=quantity]");if(void 0!==p.data("decimal")){let f=parseInt(p.data("decimal"));f>0&&(l=!0,c=Math.pow(10,f))}void 0!==p.data("min")&&(s=l?parseFloat(p.data("min")):parseInt(p.data("min"))),void 0!==p.data("decimal")&&(u=l?parseFloat(p.data("increase")):parseInt(p.data("increase"))),void 0!==p.data("initial")&&(m=l?parseFloat(p.data("initial")):parseInt(p.data("initial")))}else{var v=0;void 0!==r.find("input["+i+"=quantity]").data("quantity-type")&&(v=parseInt(r.find("input["+i+"=quantity]").data("quantity-type")),isNaN(v)&&(v=0));var h=0;void 0!==r.find("input["+i+"=quantity]").data("max-quantity")&&(h=parseInt(r.find("input["+i+"=quantity]").data("max-quantity")),isNaN(v)&&(h=0)),d=parseInt(r.find("input["+i+"=quantity]").attr("max")),isNaN(d)&&(d=9999999999),s=parseInt(r.find("input["+i+"=quantity]").attr("min")),isNaN(s)&&(s=1),16==v&&(s=.1,l=!0,u=.1,c=10)}if("change"==t){var g=window.event?a.keyCode:a.which;return 8===a.keyCode||46===a.keyCode||37===a.keyCode||39===a.keyCode||!(48>g)&&!(g>57)}if("increment"==t){if(""==r.find("input["+i+"=quantity]").val())r.find("input["+i+"=quantity]").val(m).change();else if(r.find("input["+i+"=quantity]").val()<d){if(l)var y=Math.round((parseFloat(r.find("input["+i+"=quantity]").val())+u)*c)/c;else var y=parseInt(r.find("input["+i+"=quantity]").val())+u;h>0&&y>h&&(y=h),r.find("input["+i+"=quantity]").val(y).change()}}else if("decrement"==t){if(""==r.find("input["+i+"=quantity]").val())r.find("input["+i+"=quantity]").val(m).change();else if(r.find("input["+i+"=quantity]").val()>s){if(l)var y=Math.round((parseFloat(r.find("input["+i+"=quantity]").val())-u)*c)/c;else var y=parseInt(r.find("input["+i+"=quantity]").val())-u;if(void 0!==n&&!window[n](y))return!1;r.find("input["+i+"=quantity]").val(y).change()}}}function productQuantityBoxWZero(t,e,a){void 0===a&&(a=null);var i=$(e);if("change"==t){var n=window.event?a.keyCode:a.which;return 8===a.keyCode||46===a.keyCode||37===a.keyCode||39===a.keyCode||!(48>n)&&!(n>57)}"increment"==t?""==i.find("input[name=quantity]").val()?i.find("input[name=quantity]").val(0).change():9999>i.find("input[name=quantity]").val()&&i.find("input[name=quantity]").val(parseInt(i.find("input[name=quantity]").val())+1).change():"decrement"==t&&(""==i.find("input[name=quantity]").val()?i.find("input[name=quantity]").val(0).change():i.find("input[name=quantity]").val()>0&&i.find("input[name=quantity]").val(parseInt(i.find("input[name=quantity]").val())-1).change())}function addCart(t,e,a){void 0===e&&(e="account"),void 0===a&&(a={}),"specialFieldDiv"in a||(a.specialFieldDiv="div[data-product-special-fields="+t.toString()+"]"),"specialFieldDivV2"in a||(a.specialFieldDivV2="div[data-product-special-fields-v2="+t.toString()+"]"),"multiSpecialFieldDiv"in a||!($("div[data-product-multi-special-fields="+t.toString()+"]").length>0)||(a.multiSpecialFieldDiv=$("div[data-product-multi-special-fields="+t.toString()+"]")),"pieceListDiv"in a||(a.pieceListDiv="div[data-product-piece-list-id="+t.toString()+"]"),"quantity"in a||"card"!=e||!($("div[data-product-card-quantity="+t.toString()+"]").length>0)||(a.quantity=$("div[data-product-card-quantity="+t.toString()+"] input[name=quantity]").val()),a.isBundleProduct=!1,$("div[data-product-bundle="+t.toString()+"]").length>0&&(a.isBundleProduct=!0,a.bundleProductDiv="div[data-product-bundle="+t.toString()+"]");var i,n=new FormData;if(n.append("id",t),"quantity"in a){var r=parseFloat(a.quantity);isNaN(r)&&(r=1),n.append("quantity",r)}else n.append("quantity",1);if("extraSalePrice"in a){var o=parseFloat(a.extraSalePrice);isNaN(o)&&(o=0),n.append("_extra_sale_price",o)}if("checkVariant"in a&&"variantCount"in a&&"variantDiv"in a&&a.checkVariant&&a.variantCount>0)for(var s=$(a.variantDiv),d=0;d<a.variantCount;d++){var l=s.find("select[data-variant='"+d.toString()+"']").val();if(l&&l.length>0){n.append("variant_"+(d+1).toString(),l);continue}var c=s.find("select[data-variant='"+d.toString()+"']").data("variant-name");return showAlert({title:LANG_HELPER.error,text:LANG_HELPER.variantMsg.replace("{%x%}",c),status:"error",buttonTitle:LANG_HELPER.ok}),!1}if("specialFieldDiv"in a){var u=$(a.specialFieldDiv),m=!1,p=[];u.find(".field-input").each(function(t,e){if(!m){if("4"==$(e).data("type")){var a=$(e).data("group");p.includes(a)||p.push(a)}else if("5"==$(e).data("type")){var a=$(e).data("group");p.includes(a)||p.push(a)}else{var i=$(e).val();"1"==$(e).data("required")&&0==i.length&&(m=!0,showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",$(e).attr("name")),status:"error",buttonTitle:LANG_HELPER.ok})),i.length>0&&("file"==$(e).attr("type")?n.append("special_field["+$(e).attr("name")+"]",$(e)[0].files[0]):n.append("special_field["+$(e).attr("name")+"]",i))}}});for(var f=found=options=null,d=0;d<p.length;d++){if(f=p[d],found=!1,options=[],u.find('.field-input[data-group="'+f+'"]').each(function(t,e){$(e).is(":checked")&&(options.push($(e).val()),found=!0)}),!found&&u.find('.field-input[data-group="'+f+'"][data-required="1"]').length>0){m=!0,showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",f),status:"error",buttonTitle:LANG_HELPER.ok});break}found&&n.append("special_field["+f+"]",options.join(", "))}if(m)return!1}if("specialFieldDivV2"in a){var u=$(a.specialFieldDivV2),m=!1,p=[];u.find(".field-input").each(function(t,e){if(!m){if("4"==$(e).data("type")){var a=$(e).data("group");p.includes(a)||p.push(a)}else if("5"==$(e).data("type")){var a=$(e).data("group");p.includes(a)||p.push(a)}else{var i=$(e).val();"1"==$(e).data("required")&&0==i.length&&(m=!0,showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",$(e).data("label")),status:"error",buttonTitle:LANG_HELPER.ok})),i.length>0&&("file"==$(e).attr("type")?n.append("special_field_v2["+$(e).attr("name")+"]",$(e)[0].files[0]):n.append("special_field_v2["+$(e).attr("name")+"]",i))}}});for(var f=found=options=null,v="",d=0;d<p.length;d++){if(f=p[d],found=!1,options=[],u.find('.field-input[data-group="'+f+'"]').each(function(t,e){$(e).is(":checked")&&(options.push($(e).val()),found=!0)}),!found&&u.find('.field-input[data-group="'+f+'"][data-required="1"]').length>0){m=!0,v=u.find('.field-input[data-group="'+f+'"]').data("label"),showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",v),status:"error",buttonTitle:LANG_HELPER.ok});break}found&&n.append("special_field_v2["+f+"]",options.join(", "))}if(u.find("*[data-multiple-file]").each(function(t,e){var a=$(e).data("multiple-file"),i=parseInt($(e).data("uploaded")),r=parseInt($(e).data("min-limit")),o=$(e).data("label");if(r>i){m=!0,showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",o),status:"error",buttonTitle:LANG_HELPER.ok});return}$(e).find("*[data-files]").find(".item").each(function(t,e){n.append("special_field_v2["+a+"]["+t+"][file]",$(e).find("input[data-file-content]").val()),n.append("special_field_v2["+a+"]["+t+"][count]",$(e).find("input[data-file-count]").val()),n.append("special_field_v2["+a+"]["+t+"][name]",$(e).find("input[data-file-name]").val())})}),m)return!1}if("multiSpecialFieldDiv"in a){var h=$(a.multiSpecialFieldDiv),g=!1,y=[];h.find(".field-input").each(function(t,e){if(!m){if("4"==$(e).data("type")){var a=$(e).data("group");y.includes(a)||y.push(a)}else{var i=$(e).val();"1"==$(e).data("required")&&0==i.length&&(g=!0,showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",$(e).attr("name")),status:"error",buttonTitle:LANG_HELPER.ok})),i.length>0&&("file"==$(e).attr("type")?n.append("multi_special_field["+$(e).attr("name")+"][]",$(e)[0].files[0]):n.append("multi_special_field["+$(e).attr("name")+"][]",i))}}});for(var b=mulsp_found=mulsp_options=null,d=0;d<y.length;d++){if(b=y[d],mulsp_found=!1,mulsp_options=[],h.find('.field-input[data-group="'+b+'"]').each(function(t,e){$(e).is(":checked")&&(mulsp_options.push($(e).val()),mulsp_found=!0)}),!mulsp_found&&h.find('.field-input[data-group="'+b+'"][data-required="1"]').length>0){g=!0,showAlert({title:LANG_HELPER.error,text:LANG_HELPER.specialFieldMsg.replace("{%x%}",b),status:"error",buttonTitle:LANG_HELPER.ok});break}mulsp_found&&n.append("multi_special_field["+b+"][]",mulsp_options.join(", "))}if(g)return!1}if("pieceListDiv"in a&&$(a.pieceListDiv).length>
10&&$(a.pieceListDiv+" form").serializeArray().forEach(function(t,e){n.append("piece_"+t.name,t.value)}),a.isBundleProduct){$(a.bundleProductDiv).find('*[data-bundle-element="item"]').each(function(t,e){let a=parseFloat($(e).find('[data-bundle-element="quantity"]').val());isNaN(a)&&(a=0);let i=$(e).find('[data-bundle-variant-index="0"]').val(),r=$(e).find('[data-bundle-variant-index="1"]').val(),o=$(e).find('[data-bundle-variant-index="2"]').val();i&&0!=i.length||(i=""),r&&0!=r.length||(r=""),o&&0!=o.length||(o=""),n.append("bundle["+t+"][id]",$(e).data("bundle-item-id")),n.append("bundle["+t+"][product_id]",$(e).data("bundle-product-id")),n.append("bundle["+t+"][quantity]",$(e).find('[data-bundle-element="quantity"]').val()),n.append("bundle["+t+"][variant_1]",i),n.append("bundle["+t+"][variant_2]",r),n.append("bundle["+t+"][variant_3]",o)})}return ajaxFormGate("POST","Cart","add",n,!1,function(i){if("success"==i.status){void 0!==i.events&&submitMarketingEvents(i.events);try{document.dispatchEvent(new Event("add_to_cart"))}catch(r){}try{document.dispatchEvent(new Event("cart_updated"))}catch(o){}try{"object"==typeof q_ecom_analytics&&q_ecom_analytics.event("cart")}catch(s){}if("redirectPayment"in a&&a.redirectPayment)return showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,bottons:!1}),setTimeout(function(){window.location=SITE_CONFIG.paymentUrl},1e3),!0;if("redirectCart"in a&&a.redirectCart)return showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,bottons:!1}),setTimeout(function(){window.location=SITE_CONFIG.cartUrl},1e3),!0;"hideNativeModal"in a&&hideNativeModal(a.hideNativeModal),isFunction("addCartSuccessEvent")?addCartSuccessEvent(t,e,a,n,i):showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,buttonList:{confirm:{text:LANG_HELPER.keepShopping,value:"confirm",visible:!0,className:"btn-primary btn-theme-3",closeModal:!0},cart:{text:LANG_HELPER.goCart,value:"cart",visible:!0,className:"btn-success btn-theme-4",closeModal:!1}}},function(t){"cart"==t&&(window.location=SITE_CONFIG.cartUrl)}),$("*[data-cart-count]").html(i.summary.urun),$("*[data-cart-quantity]").html(i.summary.adet),$("*[data-cart-total]").html(i.summary.tutar)}else"show-variant-box"==i.status?showNativeModal("productVariantBox",n):"redirect"==i.status?window.location.href=i.redirectUrl:(hideBaseLoader(),showAlert({title:LANG_HELPER.error,text:i.message||LANG_HELPER.errorMsg,status:i.status,buttonTitle:LANG_HELPER.ok}))}),!1}function addListToCart(t,e,a,i=!1){void 0===e&&(e="account"),void 0===a&&(a={});var n=new FormData;return t.forEach(function(t){n.append("id_list[]",t.id),void 0!==t.quantity&&n.append("quantity_list[]",t.quantity)}),i&&n.append("clear_cart","1"),ajaxFormGate("POST","Cart","addList",n,!1,function(i){if("success"==i.status){try{"object"==typeof q_ecom_analytics&&q_ecom_analytics.event("cart")}catch(r){}try{document.dispatchEvent(new Event("cart_updated"))}catch(o){}if("redirectPayment"in a&&a.redirectPayment)return showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,bottons:!1}),setTimeout(function(){window.location=SITE_CONFIG.paymentUrl},1e3),!0;if("redirectCart"in a&&a.redirectCart)return showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,bottons:!1}),setTimeout(function(){window.location=SITE_CONFIG.cartUrl},1e3),!0;"hideNativeModal"in a&&hideNativeModal(a.hideNativeModal),isFunction("addCartSuccessEvent")?addCartSuccessEvent(t,e,a,n,i):showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,buttonList:{confirm:{text:LANG_HELPER.keepShopping,value:"confirm",visible:!0,className:"btn-primary btn-theme-3",closeModal:!0},cart:{text:LANG_HELPER.goCart,value:"cart",visible:!0,className:"btn-success btn-theme-4",closeModal:!1}}},function(t){"cart"==t&&(window.location=SITE_CONFIG.cartUrl)}),$("*[data-cart-count]").html(i.summary.urun),$("*[data-cart-quantity]").html(i.summary.adet),$("*[data-cart-total]").html(i.summary.tutar)}else"show-variant-box"==i.status?showNativeModal("productVariantBox",n):(hideBaseLoader(),showAlert({title:LANG_HELPER.error,text:i.message||LANG_HELPER.errorMsg,status:i.status,buttonTitle:LANG_HELPER.ok}))}),!1}function showCartBox(t){return showNativeModal("productVariantBox",[{name:"id",value:t}]),!1}function userProductFavourite(t,e,a){void 0===a&&(a="product"),ajaxFormGate("POST","User","add"==t?"addFavoriteProduct":"removeFavouriteProduct",[{name:"id",value:e}],!1,function(i){"success"==i.status?"product"==a?"add"==t?($("*[data-favourite-product-id='"+e.toString()+"']").find(".add-favorite").removeClass("d-block").addClass("d-none"),$("*[data-favourite-product-id='"+e.toString()+"']").find(".remove-favorite").removeClass("d-none").addClass("d-block")):($("*[data-favourite-product-id='"+e.toString()+"']").find(".remove-favorite").removeClass("d-block").addClass("d-none"),$("*[data-favourite-product-id='"+e.toString()+"']").find(".add-favorite").removeClass("d-none").addClass("d-block")):"account"==a?($("*[data-user-product-id='"+e.toString()+"']").remove(),0===$("*[data-user-product-id]").length&&window.location.reload()):showAlert({title:LANG_HELPER.success,text:i.message,status:i.status,bottons:!1}
1):"auth"==i.status?showNativeModal("loginPage"):showAlert({title:LANG_HELPER.error,text:i.message||LANG_HELPER.errorMsg,status:i.status,buttonTitle:LANG_HELPER.ok}),"add"==t&&void 0!==i.events&&submitMarketingEvents(i.events)},!1)}function commentProduct(t,e,a=!1){var i=$(t).serializeArray();i[i.length]={name:"id",value:e};for(var n=new FormData,r=0;r<i.length;r++)n.append(i[r].name,i[r].value);return $(t).find("input[data-file-uploader]").each(function(t,e){n.append("file_"+(t+1),$(e)[0].files[0])}),ajaxFormGate("POST","User","commentProduct",n,!1,function(e){"success"==e.status?(showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok}),$(t).hide(),a&&hideNativeModal(a)):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})}),!1}function productCommentStars(t,e,a){var i="form[data-product-comment-form='"+t.toString()+"']";if(0==a){$(i).find("input[name=score]").val(e),$(i).find(".product-comment-stars a").removeClass("active");for(var n=e;n<=5;n++)$(i).find(".product-comment-stars .star-"+n.toString()).removeClass("active");for(var n=1;n<=parseInt(e);n++)$(i).find(".product-comment-stars .star-"+n.toString()).addClass("active")}else if(1==a){$(i).find(".product-comment-stars a").removeClass("active");for(var n=e;n<=5;n++)$(i).find(".product-comment-stars .star-"+n.toString()).removeClass("active");for(var n=1;n<=parseInt(e);n++)$(i).find(".product-comment-stars .star-"+n.toString()).addClass("active")}else if(2==a){e=parseInt($(i).find("input[name=score]").val()),$(i).find(".product-comment-stars a").removeClass("active");for(var n=e;n<=5;n++)$(i).find(".product-comment-stars .star-"+n.toString()).removeClass("active");for(var n=1;n<=parseInt(e);n++)$(i).find(".product-comment-stars .star-"+n.toString()).addClass("active")}}function adultsOnly(t){t?($("#native-modal-adults-only").modal("hide"),$(".modal-backdrop").remove(),ajaxFormGate("POST","Visitor","adultsOnly",[],!1,function(t){},!1)):window.location=SITE_CONFIG.url}function removeCart(t,e){return void 0===e&&(e="refresh-page"),ajaxFormGate("POST","Cart","remove",[{name:"id",value:t},{name:"success_action",value:e}],!1,function(t){if("success"==t.status){void 0!==t.events&&submitMarketingEvents(t.events);try{document.dispatchEvent(new Event("cart_updated"))}catch(a){}"refresh-page"==e?(showBaseLoader(),window.location.reload()):"fetch-cart-ajax"==e?(showBaseLoader(),fetchCartAjax(),$("*[data-cart-count]").html(t.summary.urun),$("*[data-cart-quantity]").html(t.summary.adet),$("*[data-cart-total]").html(t.summary.tutar)):showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})}else showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}$(function(){baseLazyLoad(),baseImageTypes(),$('a[href="javascript:;"]').length>0&&$('a[href="javascript:;"]').click(function(t){var e=!1;if($.each(this.attributes,function(){this.specified&&this.name.indexOf("data")>-1&&(e=!0)}),!e)return t.preventDefault(),!1});try{q_ecom_analytics=QEcomAnalytics(SITE_CONFIG.analytics)}catch(t){}if(smartProductSearchForm(),smartMobileProductSearchForm(),advancedProductSearchForm(),$(document).on("click",".lag-checkbox label",function(){if($(this).parent().find("input").is(":checked")){if("radio"==$(this).parent().find("input").attr("type"))$("input[name='"+$(this).parent().find("input").attr("name")+"']").attr("checked",!1),$("input[name='"+$(this).parent().find("input").attr("name")+"']").prop("checked",!1);else{var t=0;try{t=window.innerWidth||$(window).width()}catch(e){}t<991&&($(this).parent().find("input").attr("checked",!1),$(this).parent().find("input").prop("checked",!1))}}}),$(document).on("click","input[data-smart-cat-search='1'][type=checkbox], input[data-smart-cat-search='1'][type=radio]",function(){$(this).is(":radio")&&void 0!==$(this).data("checked")&&($(this).attr("checked",!1),$(this).prop("checked",!1)),smartCategorySearch()}),$(document).on("click","*[data-smart-cat-price-button]",function(){smartCategorySearch({priceRangeBtn:!0})}),$(document).on("click","*[data-smart-search-button]",function(){smartCategorySearch()}),$("#native-modal-adults-only").length>0&&$("#native-modal-adults-only").modal({backdrop:"static",keyboard:!1}),$(document).on("change","*[data-payment-box-form='address-info'] select, *[data-payment-box-form='shipping-info'] input, *[data-payment-box-form='order-info'] input",function(){onChangePaymentBoxInfo(this)}),$('*[data-payment-box-form="address-info"]').length>0&&fetchPaymentShipmentInfo(!0),$('*[data-payment-box-form="payment-info"]').length>0&&fetchPaymentMethods(),$(document).on("keydown","*[data-payment-input] .form-control",function(){removePaymentFormError($(this))}),$(document).on("change","*[data-payment-input] .form-control",function(){removePaymentFormError($(this))}),disableAutoComplete(),$(".sticky-sidebar-992-1").length>0&&document.documentElement.clientWidth>=992&&$(".sticky-sidebar-992-1 .p-g-b-c-1 .p-g-b-c-wrapper").height()>$(".sticky-sidebar-992-1 .p-g-b-c-0 .p-g-b-c-wrapper").height()){var e=new StickySidebar(".sticky-sidebar-992-1 .p-g-b-c-0 .p-g-b-c-wrapper",{topSpacing:10,bottomSpacing:20,stickyClass:"is-affixed",resizeSensor:!0,containerSelector:".sticky-sidebar-992-1",innerWrapperSelector:".p-g-b-c-inner"}),a=!1;window.onresize=function(t){document.documentElement.clientWidth<991&&!a&&(e.destroy(),a=!0)}}if($(".sticky-sidebar-992-2").length>0&&document.documentElement.clientWidth>=992&&$(".sticky-sidebar-992-2 .p-g-b-c-0 .p-g-b-c-wrapper").height()>$(".sticky-sidebar-992-2 .p-g-b-c-1 .p-g-b-c-wrapper").height()){var e=new StickySidebar(".sticky-sidebar-992-2 .p-g-b-c-1 .p-g-b-c-wrapper",{topSpacing:10,bottomSpacing:20,stickyClass:"is-affixed",resizeSensor:!0,containerSelector:".sticky-sidebar-992-2",innerWrapperSelector:".p-g-b-c-inner"}),a=!1;window.onresize=function(t){document.documentElement.clientWidth<991&&!a&&(e.destroy(),a=!0)}}var i=null;$(".carousel").each(function(){var t=$(this);$(this).on("touchstart",function(t){var e=t.originalEvent;1==e.touches.length&&(i=e.touches[0].pageX)}).on("touchmove",function(e){var a=e.originalEvent;if(null!=i){var n=a.changedTouches[0].pageX;n-i>60?(i=null,t.carousel("prev")):i-n>60&&(i=null,t.carousel("next"))}}).on("touchend",function(){i=null})}),$(document).on("change","*[data-shipping-locations-form] .form-control",function(){removeShippingLocationFormError($(this))}),accordionCategoryTree(),loadFormElements(),loadPlugins(),variantImageSlider(),$('*[data-toggle="tooltip"]').length>0&&$('*[data-toggle="tooltip"]').each(function(){var t=$(this).attr("title");(void 0==t||""==t)&&$(this).removeAttr("data-toggle")}),$(document).on({mouseenter:function(){let t=$(this).parent().find(".cpi-video");if(0==t.length)return;t.removeClass("d-none");let e=t.data("video-url"),a=t.data("video-type");t.html(' <video muted="" onloadeddata="this.play();"loop="" autoplay="" playsinline=""webkit-playsinline="">    <source src="'+e+'" type="'+a+'">    </source></video>')}
1},".mouse-over-video"),$(document).on({mouseleave:function(){$(this).addClass("d-none"),$(this).html(" ")}},"*[data-mouse-over-video]"),qCarousel()}),($=jQuery).fn.numberInputFilter=function(t){return this.on("input keydown keyup mousedown mouseup select contextmenu drop",function(){t(this.value)?(this.oldValue=this.value,this.oldSelectionStart=this.selectionStart,this.oldSelectionEnd=this.selectionEnd):this.hasOwnProperty("oldValue")?(this.value=this.oldValue,this.setSelectionRange(this.oldSelectionStart,this.oldSelectionEnd)):this.value=""})};var updateCartQuantity_Process=!1;function updateCartQuantity(t,e,a,i){if(void 0===i&&(i="refresh-page"),updateCartQuantity_Process)return!1;updateCartQuantity_Process=!0;var n=[{name:"id",value:t}],r=0;r="table"==e?$(a).val():a,n.push({name:"quantity",value:r}),ajaxFormGate("POST","Cart","updateQuantity",n,!1,function(t){if(updateCartQuantity_Process=!1,"success"==t.status){void 0!==t.events&&submitMarketingEvents(t.events);try{document.dispatchEvent(new Event("cart_updated"))}catch(n){}"refresh-page"==i?(showBaseLoader(),window.location.reload()):"fetch-cart-ajax"==i?(showBaseLoader(),fetchCartAjax()):showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})}else"table"==e&&$(a).val($(a).data("base-value")),showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})})}function fetchCartSummary(){return showBaseLoader(),ajaxFormGate("POST","Cart","summary",[],!1,function(t){hideBaseLoader(),"success"==t.status?$("*[data-cart-summary]").html(t.html):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})},!1),!1}function updateCartQuantityVId(t,e,a,i){void 0===i&&(i="refresh-page");var n=[{name:"id",value:t}],r=0;r="table"==e?$(a).val():a,n.push({name:"quantity",value:r}),ajaxFormGate("POST","Cart","updateQuantityViaProductId",n,!1,function(n){if("success"==n.status){try{document.dispatchEvent(new Event("cart_updated"))}catch(r){}"refresh-page"==i?(showBaseLoader(),window.location.reload()):"reload-cart-summary"==i?fetchCartSummary():showAlert({title:LANG_HELPER.success,text:n.message,status:n.status,buttonTitle:LANG_HELPER.ok})}else"table"==e&&$(a).val($(a).data("base-value")),showAlert({title:LANG_HELPER.error,text:n.message||LANG_HELPER.errorMsg,status:n.status,buttonTitle:LANG_HELPER.ok});void 0!==n.cart&&($('*[data-product-id="'+t.toString()+'"] *[data-product-total-price]').html(n.cart.total_price),$('*[data-product-id="'+t.toString()+'"] *[data-data-product-quantity]').val(n.cart.quantity))})}function useVoucherCode(t,e){return void 0===e&&(e="refresh-page"),ajaxFormGate("POST","Cart","useVoucherCode",t,!0,function(t){if("success"==t.status){try{document.dispatchEvent(new Event("cart_updated"))}catch(a){}"refresh-page"==e?(showBaseLoader(),window.location.reload()):"reload-cart-summary"==e?fetchCartSummary():"fetch-cart-ajax"==e?fetchCartAjax():showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})}else showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function removeVoucherCode(t){return void 0===t&&(t="refresh-page"),ajaxFormGate("POST","Cart","removeVoucherCode",[{name:"success_action",value:t}],!1,function(e){if("success"==e.status){try{document.dispatchEvent(new Event("cart_updated"))}catch(a){}"refresh-page"==t?(showBaseLoader(),window.location.reload()):"reload-cart-summary"==t?fetchCartSummary():"fetch-cart-ajax"==t?fetchCartAjax():showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok})}else showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})}),!1}function fetchPaymentCartSummary(t){void 0===t&&(t=1);var e=[{name:"payment_step",value:t}];if(1==t){var a=$("*[data-payment-box-form='address-info']").serializeArray(),i=$("*[data-payment-box-form='shipping-info']").serializeArray(),n=$("*[data-payment-box-form='order-info']").serializeArray();e=(e=(e=e.concat(a)).concat(i)).concat(n)}else if(2==t){var r=$('*[data-payment-box-form="payment-info"]').data("active-payment-method"),o=$("*[data-payment-box-form='payment-info']").find('form[data-payment-method-form="'+r.toString()+'"]').serializeArray();e=e.concat(o)}return ajaxFormGate("POST","Payment","cartSummary",e,!1,function(t){"success"==t.status?$('*[data-payment-cart="summary"]').html(t.html):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})},!1),!1}function fetchPaymentShipmentInfo(t){if(void 0===t&&(t=!1),"in_cart"==SITE_CONFIG.cartShippingType)return t&&fetchPaymentCartSummary(),!1;var e=[],a=$("*[data-payment-box-form='address-info']").serializeArray(),i=$("*[data-payment-box-form='shipping-info']").serializeArray();e=(e=e.concat(a)).concat(i);var n=!0;return $("*[data-payment-box-form='shipping-info']").find(".method").length>0?n=!1:showBaseLoader(),ajaxFormGate("POST","Payment","shipmentInfo",e,!1,function(e){$(".payment-shipping-info").addClass("d-none"),$("*[data-payment-box-form='shipping-info']").html(" "),"success"==e.status?"order"==e.type?($(".payment-shipping-times").length>0&&(e.shipping_times?$(".payment-shipping-times").addClass("has-shipping-times"):$(".payment-shipping-times").removeClass("has-shipping-times")),$(".payment-shipping-info").removeClass("d-none"),$("*[data-payment-box-form='shipping-info']").html(e.html)):t&&fetchPaymentCartSummary():t?fetchPaymentCartSummary():showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})},n),!1}function fetchPaymentShipmentTimes(){if(0==$(".payment-shipping-times").length)return!1;var t=[],e=$("*[data-payment-box-form='address-info']").serializeArray(),a=$("*[data-payment-box-form='shipping-info']").serializeArray(),i=$("*[data-payment-box-form='shipping-times']").serializeArray();return t=(t=(t=t.concat(e)).concat(a)).concat(i),$(".payment-shipping-times").addClass("d-none"),$("*[data-payment-box-form='shipping-times']").html(" "),0!=$(".payment-shipping-times.has-shipping-times").length&&(ajaxFormGate("POST","Payment","shipmentTimes",t,!1,function(t){"success"==t.status?t.show&&($(".payment-shipping-times").removeClass("d-none"),$("*[data-payment-box-form='shipping-times']").html(t.html)):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})},!1),!1)}function fetchPaymentMethodsV1(){return showBaseLoader(),fetchPaymentCartSummary(2),setTimeout(function(){var t=$('*[data-payment-box-form="payment-info"]').data("active-payment-method"),e=[];e.push({name:"payment_method",value:t}),ajaxFormGate("POST","Payment","paymentMethod",e,!1,function(e){"success"==e.status?($('*[data-payment-method-content="'+t.toString()+'"]').data("payment-method-initialize","1"),$('*[data-payment-method-content="'+t.toString()+'"]').html(e.html)):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok}),fetchPaymentCartSummary(2)},!0)},1e3),!1}function fetchPaymentMethods(){return showBaseLoader(),fetchPaymentCartSummary(2),setTimeout(function(){var t=$('*[data-payment-box-form="payment-info"]').data("active-payment-method"),e=[];e.push({name:"payment_method",value:t}),ajaxFormGate("POST","Payment","paymentMethodV2",e,!1,function(e){"success"==e.status?($('*[data-payment-method-content="'+t.toString()+'"]').data("payment-method-initialize","1"),$('*[data-payment-method-content="'+t.toString()+'"]').html(e.html)):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok}),fetchPaymentCartSummary(2)},!0)},1e3),!1}
1function onChangePaymentBoxInfo(t){var e=$(t).attr("name");return -1!==$.inArray(e,["country","city","district","neighborhood"])&&fetchPaymentShipmentInfo(),-1!==$.inArray(e,["shipment_method","gift_pack"])&&(fetchPaymentCartSummary(),fetchPaymentShipmentTimes()),!1}function removePaymentFormError(t){t.hasClass("form-phone-control")?(t.parent().parent().find("span.error").remove(),t.parent().parent().find(".form-control").removeClass("error")):(t.parent().find("span.error").remove(),t.parent().find(".form-control").removeClass("error"))}function addPaymentFormError(t,e){t.parent().find("span.error").remove(),t.parent().find(".form-control").addClass("error"),t.hasClass("form-phone-control")?t.parent().parent().append('<span class="error">'+e+"</span>"):t.parent().append('<span class="error">'+e+"</span>")}function showOrderPaymentButtons(){$(".payment-final-buttons-1").show()}function hideOrderPaymentButtons(){$(".payment-final-buttons-1").hide()}function completePaymentStep(step){if(void 0===step&&(step=1),showBaseLoader(),isFunction("completeBeforePaymentStep")&&completeBeforePaymentStep(step),1==step){var data=[{name:"payment_step",value:step}],address_info=$("*[data-payment-box-form='address-info']").serializeArray(),shipping_info=$("*[data-payment-box-form='shipping-info']").serializeArray(),shipping_times=$("*[data-payment-box-form='shipping-times']").serializeArray(),order_info=$("*[data-payment-box-form='order-info']").serializeArray();if(data=(data=(data=(data=data.concat(address_info)).concat(shipping_info)).concat(shipping_times)).concat(order_info),$("*[data-payment-box-form='extra-info']").length>0){var extra_info=$("*[data-payment-box-form='extra-info']").serializeArray();data=data.concat(extra_info)}var file_exists=!1,files=[];if($("*[data-payment-box-form='shipping-template'] #orderShipmentfile").length>0){var input_file=$("*[data-payment-box-form='shipping-template'] #orderShipmentfile")[0].files[0];void 0!==input_file&&(file_exists=!0,files.push({name:"shipment_file",value:input_file}))}if($("*[data-payment-box-form='shipping-template'] #orderInvoicefile").length>0){var input_file=$("*[data-payment-box-form='shipping-template'] #orderInvoicefile")[0].files[0];void 0!==input_file&&(file_exists=!0,files.push({name:"invoice_file",value:input_file}))}if(file_exists){for(var fdata=new FormData,i=0;i<data.length;i++)fdata.append(data[i].name,data[i].value);for(var i=0;i<files.length;i++)fdata.append(files[i].name,files[i].value);data=fdata}ajaxFormGate("POST","Payment","complete",data,!1,function(t){if(1==step){if("success"==t.status)showBaseLoader(),$(window).off("pageshow.completePaymentStep").on("pageshow.completePaymentStep",function(){hideBaseLoader()}),window.location=t.redirect;else if("empty_fields"==t.status){var e="",a=0,i="";for(var n in t.fields){var r=t.fields[n];r.status?(0==a&&(e=n),i=i+""+r.message+". ",addPaymentFormError($("*[data-payment-input='"+n+"']").find(".form-control"),r.message),a++):removePaymentFormError($("*[data-payment-input='"+n+"']").find(".form-control"))}var o=0;$("header.mobile").length>0&&"none"!=$("header.mobile").css("display")&&(o=$("header.mobile").height()),$("html, body").animate({scrollTop:$("*[data-payment-input='"+e+"']").offset().top-o}),isFunction("showInputAlert")&&showInputAlert({title:LANG_HELPER.error,text:i||LANG_HELPER.errorMsg,status:"error",buttonTitle:LANG_HELPER.ok})}else{var s=!1;void 0!==t.cart_changed&&t.cart_changed&&(s=!0),s?(showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonList:{cart:{text:LANG_HELPER.goCart,value:"cart",visible:!0,className:"btn-success btn-theme-4",closeModal:!1}}},function(t){window.location=SITE_CONFIG.cartUrl}),setTimeout(function(){window.location=SITE_CONFIG.cartUrl},1e4)):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}}},!0)}else if(2==step){var paymentId,func="paymentContentComplete"+$('*[data-payment-box-form="payment-info"]').data("active-payment-method").toString();isFunction(func)?eval(func+"()"):(hideBaseLoader(),showAlert({title:LANG_HELPER.error,text:LANG_HELPER.errorMsg,status:"error",buttonTitle:LANG_HELPER.ok}))}return!1}
1function changePaymentMethod(paymentId){if(showOrderPaymentButtons(),$('*[data-payment-box-form="payment-info"]').data("active-payment-method",paymentId),"1"==$('*[data-payment-method-content="'+paymentId.toString()+'"]').data("payment-method-initialize")){fetchPaymentCartSummary(2);var func="paymentContentMethod"+paymentId.toString();isFunction(func)&&eval(func+"()")}else fetchPaymentMethods();var temp=0;$("header.mobile").length>0&&"none"!=$("header.mobile").css("display")&&(temp=$("header.mobile").height()),$("html, body").animate({scrollTop:$(".p-g-mod-t-32").offset().top-temp})}var creditCardInstallmentsBin=[];function creditCardInstallments(t,e){var a="",i=$(a="FastPay"==t?".fastpay-payment-form":"Dealer"==t?".user-account-balance-deposit-step-2":".payment-method-form-"+e).find("input[name=card_number]").val();if(6===(i=(i=i.replace(" ","").replace(" ","").replace(" ","").replace(" ","")).substring(0,6)).length&&(void 0===creditCardInstallmentsBin[e]||creditCardInstallmentsBin[e]!==i)){creditCardInstallmentsBin[e]=i;var n=$(a).find("input[name=payment_method]").val(),r=[{name:"bin",value:i},{name:"payment_method",value:n}];if("Dealer"==t){var o=$(a).serializeArray();r=r.concat(o)}else if("FastPay"==t){var s=$(a).serializeArray();r=r.concat(s)}ajaxFormGate("POST",t,"ccInstallments",r,!1,function(t){$(a).find(".cc-installments").addClass("d-none"),$(a).find(".cc-installments .methods").html(" "),"success"==t.status&&($(a).find(".cc-installments").removeClass("d-none"),t.data.installments.forEach(function(t,i){var n="";n=0==i?n+'<div class="method cc-installment-'+i+' active" onclick="changeCreditCardInstallment('+e+", "+i+')">':n+'<div class="method cc-installment-'+i+'" onclick="changeCreditCardInstallment('+e+", "+i+')">',n+='<div class="checkbox">',n+='<div class="form-check form-check-inline">',n=0==i?n+'<input class="form-check-input" type="radio" name="card_installment" value="'+t.installment+'" checked />':n+'<input class="form-check-input" type="radio" name="card_installment" value="'+t.installment+'" />',n+="</div>",n+="</div>",n=n+'<div class="name"><div class="info">'+t.label+"</div></div>",0==i?n+='<div class="price-1">-</div>':n=n+'<div class="price-1">'+t.monthly_price_label+"</div>",n=n+'<div class="price-2">'+t.total_price_label+"</div>",n+="</div>",$(a).find(".cc-installments .methods").append(n)}))},!1)}}function changeCreditCardInstallment(t,e){var a=$(".credit-card-form-"+t);a.find(".cc-installments .methods .method").removeClass("active"),a.find(".cc-installments .methods .cc-installment-"+e).addClass("active"),a.find(".cc-installments .methods .cc-installment-"+e).find("input").prop("checked",!0),a.find(".cc-installments .methods .cc-installment-"+e).find("input").attr("checked",!0)}function completePaymentSuccess(t){showBaseLoader(),window.location=t.redirect}function printElement(t,e="A4",a="100%"){loadJSFile(SITE_CONFIG.print.js,!1,!1,"body",function(){qsEasyPrint(t,e,a)})}function createOwlCarousel(t,e){if(isFunction("owlCarouselData"))var a=owlCarouselData(e);else var a={loop:!1,nav:!0,responsiveClass:!0,dots:!0,autoplay:!0,margin:20,autoplayTimeout:1e4,autoplayHoverPause:!0,lazyLoad:!0,animateOut:"fadeOut",responsive:e};var i=$("."+t);i.on("initialized.owl.carousel",function(e){e.item.count>e.page.size&&$("."+t+"-next").addClass("active")}),i.owlCarousel(a),$("."+t+"-prev button").click(function(){i.trigger("prev.owl.carousel")}),$("."+t+"-next button").click(function(){i.trigger("next.owl.carousel")}),i.on("changed.owl.carousel",function(e){var a=e.item.count,i=e.page.size,n=e.item.index;0==a-(i+n)?$("."+t+"-next").removeClass("active"):$("."+t+"-next").addClass("active"),0==n?$("."+t+"-prev").removeClass("active"):$("."+t+"-prev").addClass("active"),baseLazyLoad(),baseImageTypes()})}function shipmentDesiCalculation(t){return ajaxFormGate("POST","Cart","shipmentDesiCalculation",t,!0,function(t){"success"==t.status?$("*[data-shipment-calculation-desi]").html(t.desi):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function shipmentPriceCalculation(t){return ajaxFormGate("POST","Cart","shipmentPriceCalculation",t,!0,function(t){"success"==t.status?($("*[data-shipment-calculation-min-price]").html(t.price),$("*[data-shipment-calculation-firms]").html(t.firms)):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function smartProductSearchForm(){if($("form[data-smart-product-search]").length>0){var t=parseInt($("form[data-smart-product-search]").data("items"));(isNaN(t)||void 0===t||""==t||"undefined"==t)&&(t=10),t<=0&&(t=10),t>50&&(t=50);
1var e=$("form[data-smart-product-search]").data("choose-action");(void 0===e||""==e||"undefined"==e)&&(e="default");var a=$("form[data-smart-product-search]").data("product-code");(void 0===a||""==a||"undefined"==a)&&(a=!1),$("form[data-smart-product-search]").easyAutocomplete({url:function(e){return SITE_CONFIG.baseUrl+"/client/Visitor/search?length="+t},getValue:function(t){return a?t.code+" - "+t.name:t.name},ajaxSettings:{dataType:"json",method:"POST",data:{dataType:"json"},headers:{"Accept-Content-Token":SITE_CONFIG.token}},preparePostData:function(t){return t.phrase=$("form[data-smart-product-search] input[name=k]").val(),t},requestDelay:300,list:{maxNumberOfElements:t,onChooseEvent:function(){if("redirect"==e){var t=$("form[data-smart-product-search]").getSelectedItemData().link;window.location=t}else{var a=$("form[data-smart-product-search]").getSelectedItemData().name;$("form[data-smart-product-search] input[type=text]").val(a),$("form[data-smart-product-search]").submit()}}}})}if($("form[data-smart-product-search-image]").length>0){var t=parseInt($("form[data-smart-product-search-image]").data("items"));(isNaN(t)||void 0===t||""==t||"undefined"==t)&&(t=10),t<=0&&(t=10),t>50&&(t=50);var e=$("form[data-smart-product-search-image]").data("choose-action");(void 0===e||""==e||"undefined"==e)&&(e="default");var a=$("form[data-smart-product-search-image]").data("product-code");(void 0===a||""==a||"undefined"==a)&&(a=!1),$("form[data-smart-product-search-image]").easyAutocomplete({url:function(e){return SITE_CONFIG.baseUrl+"/client/Visitor/search?length="+t},getValue:function(t){return a?t.code+" - "+t.name:t.name},ajaxSettings:{dataType:"json",method:"POST",data:{dataType:"json"},headers:{"Accept-Content-Token":SITE_CONFIG.token}},preparePostData:function(t){return t.phrase=$("form[data-smart-product-search-image] input[name=k]").val(),t},requestDelay:300,list:{maxNumberOfElements:t,onChooseEvent:function(){if("redirect"==e){var t=$("form[data-smart-product-search-image]").getSelectedItemData().link;window.location=t}else{var a=$("form[data-smart-product-search-image]").getSelectedItemData().name;$("form[data-smart-product-search-image] input[type=text]").val(a),$("form[data-smart-product-search-image]").submit()}}},template:{type:"custom",method:function(t,e){return"<div class='spsi-item'><img src='"+e.image+"' /> "+t+"</div>"}}})}}function smartMobileProductSearchForm(){if($("form[data-smart-mobile-product-search]").length>0){var t=$("form[data-smart-mobile-product-search]").data("choose-action");(void 0===t||""==t||"undefined"==t)&&(t="default"),$("form[data-smart-mobile-product-search]").easyAutocomplete({url:function(t){return SITE_CONFIG.baseUrl+"/client/Visitor/search"},getValue:function(t){return t.name},ajaxSettings:{dataType:"json",method:"POST",data:{dataType:"json"},headers:{"Accept-Content-Token":SITE_CONFIG.token}},preparePostData:function(t){return t.phrase=$("form[data-smart-mobile-product-search] input[name=k]").val(),t},requestDelay:300,list:{maxNumberOfElements:10,onChooseEvent:function(){if("redirect"==t){var e=$("form[data-smart-mobile-product-search]").getSelectedItemData().link;window.location=e}else{var a=$("form[data-smart-mobile-product-search]").getSelectedItemData().name;$("form[data-smart-mobile-product-search] input[type=text]").val(a),$("form[data-smart-mobile-product-search]").submit()}}}})}if($("form[data-smart-mobile-product-search-image]").length>0){var t=$("form[data-smart-mobile-product-search-image]").data("choose-action");(void 0===t||""==t||"undefined"==t)&&(t="default"),$("form[data-smart-mobile-product-search-image]").easyAutocomplete({url:function(t){return SITE_CONFIG.baseUrl+"/client/Visitor/search"},getValue:function(t){return t.name},ajaxSettings:{dataType:"json",method:"POST",data:{dataType:"json"},headers:{"Accept-Content-Token":SITE_CONFIG.token}},preparePostData:function(t){return t.phrase=$("form[data-smart-mobile-product-search-image] input[name=k]").val(),t},requestDelay:300,list:{maxNumberOfElements:10,onChooseEvent:function(){if("redirect"==t){var e=$("form[data-smart-mobile-product-search-image]").getSelectedItemData().link;window.location=e}else{var a=$("form[data-smart-mobile-product-search-image]").getSelectedItemData().name;$("form[data-smart-mobile-product-search-image] input[type=text]").val(a),$("form[data-smart-mobile-product-search-image]").submit()}}},template:{type:"custom",method:function(t,e){return"<div class='spsi-item'><img src='"+e.image+"' /> "+t+"</div>"}}})}}var advancedProductSearchForm_run=!1;function advancedProductSearchForm(){var t=$("form[data-advanced-product-search]");if(0==t.length||advancedProductSearchForm_run)return!1;advancedProductSearchForm_run=!0,t.on("focus",":input",function(){$(this).attr("autocomplete","off")});var e=50,a=15,i=parseInt(t.data("products"));isNaN(i)||(e=i);var n=parseInt(t.data("categories"));isNaN(n)||(a=n);var r=1;$(".advanced-product-search").length>0&&(r=0);var o="",s=function(){var i=t.find("input").val().trim();if(i.length<=0&&i.length>=2||i==o)return!1;o=i;var n=[{name:"keyword",value:i},{name:"max_products",value:e},{name:"max_categories",value:a},{name:"template",value:r},];ajaxFormGate("POST","Visitor","advancedSearch",n,!1,function(e){"success"==e.status&&advancedProductSearchAction(e,t)},!1)};t.find("input").keypress(function(){setTimeout(s,800)}),t.find("input").focus(function(){$(".advanced-product-search .aps-results .aps-content .items").length>0&&$(".advanced-product-search").css("display","block")}),t.find("input").click(function(){$(".advanced-product-search .aps-results .aps-content .items").length>0&&$(".advanced-product-search").css("display","block")}),$(window).scroll(function(){$(".advanced-product-search").css("display","none")})}var advancedProductSearchAction_result=[];function advancedProductSearchAction(t,e){if(advancedProductSearchAction_result=t,0==t.categories.length)return $(".advanced-product-search").length>0&&($(".advanced-product-search .aps-results").html(" "),$(".advanced-product-search").css("display","none")),!1;0==$(".advanced-product-search").length&&$("body").append(t.template);var a=$(".advanced-product-search"),i=a.find(".aps-template"),n=a.find(".aps-results");n.html(i.html()),n.find("*[data-category-list]").html(" "),n.find("*[data-content]").find("*[data-list]").html(" ");var r=e.offset().top,o=e.outerHeight();o<=3&&(o=e.find("input").outerHeight()+2),r+=o;var s=e.offset().left,d=e.width(),l=s-(a.width()-d)/2;a.css({display:"block",top:r.toString()+"px",left:l.toString()+"px"});var c=i.find("*[data-category-list]").find("*[data-item]").prop("outerHTML"),u="",m=0;for(let p of t.categories)u=(u=c).replace("{url}",p.url).replace("{index}",m).replace("{id}",p.id).replace("{name}",p.name).replace("{path}",p.path),n.find("*[data-category-list]").append(u),m++;var f=function(t){var e=advancedProductSearchAction_result.categories;if(t>e.length)return!1;var a=e[t];n.find("*[data-content]").find("*[data-list]").html(" "),n.find("*[data-content]").find("*[data-category-name]").html(a.name),n.find("*[data-content]").find("*[data-category-path]").html(a.path);var r=i.find("*[data-content]").find("*[data-list]").find("*[data-item]").prop("outerHTML"),o="";for(let s of a.products)o=(o=r).replace("{url}",s.url).replace("{id}",s.id).replace("{name}",s.name).replace("{url}",s.url).replace("{price}",s.price).replace("{list_price}",s.list_price).replace("{image}",s.image).replace("{category_name}",a.name).replace("{category_path}",a.path),s.discount_rate<=0&&(o=o.replace("list-price","list-price d-none")),n.find("*[data-content]").find("*[data-list]").append(o)};f(0),n.find("*[data-category-list]").find("*[data-item]").hover(function(){f($
1(this).data("index"))})}function fetchCartAjax(t="data-cart-products",e="data-cart-summary"){return ajaxFormGate("POST","Cart","listSummary",[],!1,function(t){hideBaseLoader(),"success"==t.status&&($("*[data-cart-products]").html(t.products),$("*[data-cart-summary]").html(t.summary))},!1),!1}function fetchAttributeValues(t,e){return ajaxFormGate("POST","Visitor","attributeValues",[{name:"attribute_id",value:t}],!1,function(t){"success"==t.status&&($(e).html(" "),t.values.forEach(function(t){$(e).append('<option value="'+t.ID+'">'+t.adi+"</option>")}))},!0),!1}function changeCustomCookie(t,e){return ajaxFormGate("POST","Visitor","changeCustomCookie",t,!1,e,!0),!1}function productPieceListDecrementControl(t){if(0==t){var e=0;return $('#product-piece-list tr[data-piece="1"]').each(function(){var t=parseInt($(this).find('input[data-type="quantity"]').val());isNaN(t)&&(t=0),t>0&&(e+=1)}),e>1}return!0}function productPieceListPriceCalculate(t,e,a){$(a+" input[data-type=quantity]").on("change",function(i){var n=$(a+" form").serializeArray();n[n.length]={name:"productId",value:t}
1,ajaxFormGate("POST","Category","calculateProductListPrice",n,!1,function(t){"success"==t.status&&($(e+" .sale-price").html(t.price),$(a+" .sale-price").html(t.price),t.list_price.length>0&&($(e+" .list-price").html(t.list_price),$(a+" .list-price").html(t.list_price)),$(e+" .sale-eft-price").html(t.eft_price),t.installments.length>0&&($(".product-page-installments").addClass("d-none"),$(t.installments).insertAfter(".product-page-installments"),$(".product-page-installments.d-none").remove()))},!1)})}function browserAlert(t){var e=$("title").text();$(window).blur(function(){$("title").text(t)}),$(window).focus(function(){$("title").text(e)})}function selectCompatibilityFilter(t,e,a){if(1>parseInt(a)){var i=$(t).serializeArray(),n=$(t).data("success-action");if((void 0===n||""==n||"undefined"==n)&&(n="default"),"default"==n){for(var r=[],o=0,s=0;s<i.length;s++){if(-1!==i[s].name.indexOf("compatibility_id")){o=i[s].value;continue}if(-1!==i[s].name.indexOf("specs")){if(0==i[s].value.trim().length)break;r.push(i[s].value)}}if(0==o||0==r.length)return!1;var d=r.join("|");if(0==d.trim().length)return!1;d=o.toString()+"|"+d;var l=$(t).attr("action"),c=-1!==l.indexOf("?")?"&":"?";l=l+c+"cpv="+d,window.location=l}else executeFunctionByName(n,[i])}else{var i=$(t).serializeArray();i[i.length]={name:"current_seq",value:e},i[i.length]={name:"next_seq",value:a},ajaxFormGate("POST","Visitor","compatibilityValues",i,!1,function(e){"success"==e.status&&$(t).find("*[data-filter-seq]").each(function(){var a=$(this),i=a.data("filter-seq");if(parseInt(i)==parseInt(e.uyumluluk.sira)){a.removeClass("d-none");var n="";e.uyumluluk.tamamlandi?selectCompatibilityFilter(t,e.uyumluluk.sira,-1):(e.uyumluluk.ozellik.toplam>1&&(n=n+'<option value="">'+LANG_HELPER.select+"</option>"),e.uyumluluk.ozellik.liste.forEach(t=>{n=n+'<option value="'+t.adi_alt+'">'+t.adi+"</option>"}),a.find("select").html(n),1==e.uyumluluk.ozellik.toplam&&selectCompatibilityFilter(t,e.uyumluluk.sira,e.uyumluluk.sonraki_sira))}else parseInt(i)>=parseInt(e.uyumluluk.sira)&&(a.addClass("d-none"),a.find("select").html(" "))})},!1)}}function orderPaymentCompleteResponse(t,e){if("success"==e.status)"redirect"==e.return_type?(showBaseLoader(),window.location=e.redirect):"html"==e.return_type?(showBaseLoader(),$('*[data-payment-final-form="'+t.toString()+'"]').html(e.html),$('*[data-payment-final-form="'+t.toString()+'"] form').submit()):"threed_verification"==e.return_type&&showNativeModal("paymentThreedVerification",[{name:"payment_id",value:t}],function(t){$("#threed-verifiication-content").html(e.html)});else if("verification_code"==e.status)return showVerificationCodeModal(e.token,"paymentContentComplete"+t.toString()),!1;else if("redirect"==e.status)showBaseLoader(),window.location=e.redirect;else{var a=!1;void 0!==e.cart_changed&&e.cart_changed&&(a=!0),a?(showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonList:{cart:{text:LANG_HELPER.goCart,value:"cart",visible:!0,className:"btn-success btn-theme-4",closeModal:!1}}},function(t){window.location=SITE_CONFIG.cartUrl}),setTimeout(function(){window.location=SITE_CONFIG.cartUrl},1e4)):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})}}function emailNewsletter(t,e,a){if(void 0===e&&(e="1"),void 0===a&&(a="-1"),1==parseInt(e)){var i="email-newsletter-form-"+Math.floor(1e4*Math.random());return $(t).addClass(i),showNativeModal("kvkkRuleApprove",[{name:"action",value:"emailNewsletter"},{name:"param1",value:"$('."+i+"')"},{name:"param2",value:"'0'"},{name:"param3",value:"'"+a+"'"},]),!1}var n=$(t).serializeArray();return n[n.length]={name:"group_id",value:a},ajaxFormGate("POST","Visitor","emailNewsletter",n,!1,function(e){"success"==e.status?($(t).find("input").val(""),showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok})):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})})}function smsNewsletter(t,e,a){if(void 0===e&&(e="1"),void 0===a&&(a="-1"),
11==parseInt(e)){var i="sms-newsletter-form-"+Math.floor(1e4*Math.random());return $(t).addClass(i),showNativeModal("kvkkRuleApprove",[{name:"action",value:"smsNewsletter"},{name:"param1",value:"$('."+i+"')"},{name:"param2",value:"'0'"},{name:"param3",value:"'"+a+"'"},]),!1}var n=$(t).serializeArray();return n[n.length]={name:"group_id",value:a},ajaxFormGate("POST","Visitor","smsNewsletter",n,!1,function(e){"success"==e.status?($(t).find("input").val(""),showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok})):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})})}function visitorProductRecommend(t){showNativeModal("visitorProductRecommend",[{name:"product_id",value:t}])}function visitorProductRecommendAction(t,e){return void 0===e&&(e=!1),ajaxFormGate("POST","Visitor","productRecommend",t,!0,function(t){"success"==t.status?(e&&hideNativeModal(e),showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})})}function userProductComment(t){showNativeModal("userProductComment",[{name:"product_id",value:t}])}function userProductPriceAlert(t,e=!1){if(!SITE_CONFIG.userIsLogin)return showNativeModal("loginPage");e||(e='div[data-product-id="'+t+'"] .variant-box');var a=[{name:"product_id",value:t}];if(e&&(e=$(e)).length>0)for(var i=0;i<3;i++){var n=e.find("select[data-variant='"+i.toString()+"']");if(0!=n.length){if((n=n.val())&&n.length>0){a.push({name:"variant_"+(i+1).toString(),value:n});continue}var r=e.find("select[data-variant='"+i.toString()+"']").data("variant-name");return showAlert({title:LANG_HELPER.error,text:LANG_HELPER.priceAlertVariantMsg.replace("{%x%}",r),status:"error",buttonTitle:LANG_HELPER.ok}),!1}}showNativeModal("userProductPriceAlert",a),loadFormElements()}function userProductPriceAlertAction(t,e){return(void 0===e&&(e=!1),SITE_CONFIG.userIsLogin)?ajaxFormGate("POST","User","productPriceAlert",t,!0,function(t){"success"==t.status?(e&&hideNativeModal(e),showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok}),void 0!==t.events&&submitMarketingEvents(t.events)}):showNativeModal("loginPage")}function userDeleteProductPriceAlert(t,e="account"){ajaxFormGate("POST","User","deleteProductPriceAlert",[{name:"id",value:t}],!1,function(a){"success"==a.status?"modal"==e?$("*[data-user-product-alert-list='"+t.toString()+"']").remove():"account"==e&&($("*[data-user-product-alert-id='"+t.toString()+"']").remove(),0===$("*[data-user-product-alert-id]").length&&window.location.reload()):"auth"==a.status?showNativeModal("loginPage"):showAlert({title:LANG_HELPER.error,text:a.message||LANG_HELPER.errorMsg,status:a.status,buttonTitle:LANG_HELPER.ok})},!1)}function userProductQuantityAlertView(){var t=$("*[data-user-product-quantity-alert]");if(0==t.length)return!1;var e="div[data-product-id] .variant-box",a="hide";e&&(e=$(e)).find(".sold-out[data-variant]").length>0&&(a="show"),"show"==a?t.removeClass("d-none"):t.addClass("d-none")}function userProductQuantityAlert(t,e=!1,a=!1){return SITE_CONFIG.userIsLogin?showNativeModal("userProductQuantityAlert",[{name:"product_id",value:t}]):showNativeModal("loginPage")}function userProductQuantityAlertCheckbox(t,e,a){if(void 0===a&&(a=""),!SITE_CONFIG.userIsLogin)return showNativeModal("loginPage");var i="remove";$(t).is(":checked")&&(i="add"),userProductQuantityAlertAction(e,a,i,!1)}function userProductQuantityAlertAction(t,e="",a="add",i=!1){return SITE_CONFIG.userIsLogin?ajaxFormGate("POST","User","productQuantityAlert",[{name:"product_id",value:t},{name:"variants",value:e},{name:"action",value:a}],!1,function(t){"success"==t.status?i&&showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok}):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok}),"add"==a&&void 0!==t.events&&submitMarketingEvents(t.events)},!1):showNativeModal("loginPage")}function preCompareList(t,e,a){void 0===e&&(e="add"),void 0===a&&(a=!1),a&&hideNativeModal(a),showNativeModal("preCompareList",[{name:"product_id",value:t},{name:"action",value:e}],function(t){if("success"==t.status){var e=parseInt(t.compare_list_count);isNaN(e)&&(e=0),0==e?$("*[data-compare-list-count]").html(""):$("*[data-compare-list-count]").html("("+e.toString()+")")}})}function compareList(t,e,a){void 0===t&&(t=""),void 0===e&&(e="show"),void 0===a&&(a=!1),a&&hideNativeModal(a),showNativeModal("compareList",[{name:"product_id",value:t},{name:"action",value:e}],function(t){if("success"==t.status){var e=parseInt(t.compare_list_count);isNaN(e)&&(e=0),0==e?$("*[data-compare-list-count]").html(""):$("*[data-compare-list-count]").html("("+e.toString()+")")}})}function shippingLocations(){showNativeModal("shippingLocations")}function saveShippingLocation(t,e){void 0===e&&(e=!1),showBaseLoader();
1var a=$(t).serializeArray();return ajaxFormGate("POST","Visitor","updateLocation",a,!1,function(t){"success"==t.status?(e&&hideNativeModal(e),t.location.length>0&&($("*[data-shipping-location]").html(t.location),$("*[data-shipping-location-tooltip]").attr("title",t.location),$("*[data-shipping-location-tooltip]").attr("data-original-title",t.location))):"empty_country"==t.status?addShippingLocationError($("*[data-location-input='country']").find(".form-control"),t.message):"empty_city"==t.status?addShippingLocationError($("*[data-location-input='city']").find(".form-control"),t.message):"empty_district"==t.status?addShippingLocationError($("*[data-location-input='district']").find(".form-control"),t.message):"empty_neighborhood"==t.status?addShippingLocationError($("*[data-location-input='neighborhood']").find(".form-control"),t.message):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function addShippingLocationError(t,e){t.parent().find("span.error").remove(),t.parent().find(".form-control").addClass("error"),t.parent().append('<span class="error">'+e+"</span>")}function removeShippingLocationFormError(t){t.parent().find("span.error").remove(),t.parent().find(".form-control").removeClass("error")}function accordionCategoryTree(){if(0==$(".accordion-category-tree").length)return!1;var t,e=$(".accordion-category-tree").find(".parent-cat");for(t=0;t<e.length;t++)e[t].addEventListener("click",function(){this.parentElement.querySelector(".sub-tree").classList.toggle("active"),this.classList.toggle("active")})}function phoneOrderRequest(t){showNativeModal("phoneOrderRequest",[{name:"product_id",value:t}])}function phoneOrderRequestAction(t,e){return void 0===e&&(e=!1),ajaxFormGate("POST","Visitor","phoneOrderRequest",t,!0,function(t){"success"==t.status?(e&&hideNativeModal(e),showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})})}function productSuggestion(t){showNativeModal("productSuggestion",[{name:"product_id",value:t}])}function productSuggestionAction(t,e){return void 0===e&&(e=!1),ajaxFormGate("POST","Visitor","productSuggestion",t,!0,function(t){"success"==t.status?(e&&hideNativeModal(e),showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})})}function approveAdultContent(t,e,a){if(!$(t).find("input[name=rule]").is(":checked")){showAlert({title:e,text:a,status:"warning",buttonTitle:LANG_HELPER.ok});return}$(t).remove(),ajaxFormGate("POST","Visitor","approveAdultContent",[],!1,function(t){},!1)}function selectAdultContentAge(t,e){e=parseInt(e),!isNaN(e)&&!(e<=0)&&($(t).remove(),ajaxFormGate("POST","Visitor","approveAdultContent",[],!1,function(t){},!1))}function showCustomThemeFile(t,e,a=!0,i=!0){void 0===t&&(t=[]),void 0===e&&(e=!1),ajaxFormGate("POST","Visitor","customThemeFile",t,!1,function(t){"success"==t.status?e&&e(t):a&&showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})},i)}function variantImageSlider(){if(0==$('*[data-variant-slide="active"]').length||0==$('*[data-variant-slide="active"]').find(".carousel-outer").length)return!1;$('*[data-variant-slide="active"]').on("slide.bs.carousel",function(t){if($(t.relatedTarget).hasClass("hide")){if("left"==t.direction){var e=-1;$(this).find(".carousel-outer .carousel-item").each(function(a,i){a>=t.to&&-1==e&&!$(this).hasClass("hide")&&(e=a)}),e>-1?$(this).carousel(e):$(this).carousel(0)}else if("right"==t.direction){var e=-1;if($(this).find(".carousel-outer .carousel-item").each(function(a,i){a<=t.to&&!$(this).hasClass("hide")&&(e=a)}),e>-1)$(this).carousel(e);else{var a=$(this).find(".carousel-outer .carousel-item").not(".hide").last(),i=$(this).find(".carousel-outer .carousel-item").index(a);$(this).carousel(i)}}return!1}return!0})}function changeVariantImageSlider(t,e,a){if(0==$('*[data-variant-slide="active"]').length)return!1;var i=$(t.replace(".variant-box","")+' *[data-variant-slide="active"]'),n="carousel",r=".carousel-outer",o=".carousel-item",s=".carousel-indicators";$('*[data-variant-slide-type="row"]').length>0&&(n="row",r=".variant-row-outer",o=".variant-row-item",s=".variant-row-indicators");var d=$(t);if(i.find(r).find(o+'[data-variant-index="'+a+'"][data-variant-value="'+e+'"]').length>0)i.find(r+" "+o).addClass("hide").removeClass("active"),i.find(s+" li").addClass("hide").removeClass("active"),i.find(r).find(o+'[data-variant-index="'+a+'"][data-variant-value="'+e+'"]').removeClass("hide"),i.find(s).find('li[data-variant-index="'+a+'"][data-variant-value="'+e+'"]').removeClass("hide"),i.find(r).find(o).not(".hide").first().addClass("active"),i.find(s).find("li").not(".hide").first().addClass("active");else{var l=!1;if(a>1)for(var c=0;c<a-1;c++){var u=d.find("select[data-variant='"+c.toString()+"']");if(0!=u.length){var m=u.val();if(m.length>0){if(i.find(r).find(o+'[data-variant-index="'+(c+1)+'"][data-variant-value="'+m+'"]').first().hasClass("hide")){if(i.find(r).find(o+'[data-variant-index="'+(c+1)+'"][data-variant-value="'+m+'"]').length>0){i.find(r+" "+o).addClass("hide").removeClass("active"),i.find(s+" li").addClass("hide").removeClass("active"),i.find(r).find(o+'[data-variant-index="'+(c+1)+'"][data-variant-value="'+m+'"]').removeClass("hide"),i.find(s).find('li[data-variant-index="'+(c+1)+'"][data-variant-value="'+m+'"]').removeClass("hide"),i.find(r).find(o).not(".hide").first().addClass("active"),i.find(s).find("li").not(".hide").first().addClass("active"),l=!0;break}}else{l=!0;break}}}}l||i.find(r).find(o).length===i.find(r).find(o+'[data-variant-index=""][data-variant-value=""]').length||(i.find(r+" "+o).addClass("hide").removeClass("active"),i.find(s+" li").addClass("hide").removeClass("active"),i.find(r).find(o+'[data-variant-index=""][data-variant-value=""]').removeClass("hide"),i.find(s).find('li[data-variant-index=""][data-variant-value=""]').removeClass("hide"),i.find(r).find(o).not(".hide").first().addClass("active"),i.find(s).find("li").not(".hide").first().addClass("active"))}}function productShipmentPrices(t,e,a){$(a).html(" ");var i=parseFloat($(e).val());if(isNaN(i)||i<=0)return!1;var n=[{name:"id",value:t},{name:"quantity",value:i}];return ajaxFormGate("POST","Cart","productShipmentPrices",n,!1,function(t){"success"==t.status&&"order"==t.type&&$(a).html(t.html)},!1),!1}function newsletterForm(t){showBaseLoader();
1var e=$(t).serializeArray();return ajaxFormGate("POST","Visitor","newsletterForm",e,!1),!1}function copyElement(t,e=!1,a=!1){var i=document.getElementById(t);navigator.clipboard.writeText(i.innerHTML),e&&showAlert({title:a||LANG_HELPER.copySuccess,text:" ",status:"success",buttonTitle:LANG_HELPER.ok})}function usePromotion(t){return ajaxFormGate("POST","Cart","usePromotion",[{name:"id",value:t}],!1,function(t){"success"==t.status?(showBaseLoader(),window.location.reload()):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})}),!1}function changeLanguage(t,e){return ajaxFormGate("POST","Visitor","changeLanguage",[{name:"code",value:t}],!1,function(t){window.location=e},!1),!1}function changeCurrency(t){return ajaxFormGate("POST","Visitor","changeCurrency",[{name:"code",value:t}],!1,function(t){window.location.reload()},!1),!1}function changeLocalization(t,e,a=!1){return ajaxFormGate("POST","Visitor","changeLocalization",[{name:"language",value:t},{name:"currency",value:e},],!1,function(t){a?window.location=a:window.location.reload()},!1),!1}function commentBlog(t,e){var a=$(t).serializeArray();return a[a.length]={name:"id",value:e},ajaxFormGate("POST","User","commentBlog",a,!1,function(e){"success"==e.status?(showAlert({title:LANG_HELPER.success,text:e.message,status:e.status,buttonTitle:LANG_HELPER.ok}),$(t)[0].reset()):showAlert({title:LANG_HELPER.error,text:e.message||LANG_HELPER.errorMsg,status:e.status,buttonTitle:LANG_HELPER.ok})}),!1}function answerBlogComment(t){var e="<div class='blog-comment-form'>"+$(".blog-comment-form.main-answer").html()+"</div>";$(".blog-comment-list .comment-box[data-comment-id="+t+"] .answer-form").toggleClass("d-none").html(e),$(".blog-comment-list .comment-box[data-comment-id="+t+"] .answer-form").find("input[name=parent_id]").val(t),$(".blog-comment-list .comment-box[data-comment-id="+t+"] .answer-form").find("textarea").val(" "),$(".blog-comment-list .comment-box[data-comment-id="+t+"] .answer-form .title").addClass("d-none")}function loadPatternGroupCol(t,e,a){!$("div[data-pattern-key="+t+"]").data("pattern-loaded")&&($("div[data-pattern-key="+t+"]").data("pattern-loaded",!0),$("div[data-pattern-key="+t+"]").html('<div class="p-g-b-c-loader"><div class="spinner-border pgbcl-spin" role="status"><span class="sr-only"> </span></div></div>'),ajaxFormGate("POST","Visitor","loadCol",[{name:"page_key",value:SITE_CONFIG.pageKey},{name:"group_id",value:e},{name:"col_id",value:a},],!1,function(e){if("success"==e.status){$("div[data-pattern-key="+t+"]").html(e.html),baseImageTypes();try{document.dispatchEvent(new Event("pattern_group_col_loaded"))}catch(a){}}},!1))}function specialFieldMultipleFileUpload(t){SITE_CONFIG.imageupload.load?isFunction("baseImageUpload")?baseImageUpload(t):setTimeout(function(){specialFieldMultipleFileUpload(t)},100):($.getScript({url:SITE_CONFIG.imageupload.js,cache:!0},function(){baseImageUpload(t)}),SITE_CONFIG.imageupload.load=!0)}function fileUploader(t){var e,a=$(t),i=$(a).data("accept");if(!(a.find('.file[data-uploaded="1"]').length>=a.data("limit"))){a.find('.file[data-uploaded="0"]').remove();var n='<div class="box file d-none" data-uploaded="0">';n=n+'<input type="file" class="d-none" accept="'+i+'" onchange="fileUploaderAction(this, \'upload\')" value="" onchange="" data-file-uploader>',n+='<img src="" alt="" />',n+='<span class="btn-trash" onclick="fileUploaderAction(this, \'remove\')" ><i class="fa fa-trash-alt"></i></span>',$(n+="</div>").insertBefore(t+" .btn-upload"),$(a).find(".file").last().find("input").click()}}function fileUploaderAction(t,e="upload"){var a=$(t).closest(".file"),i=a.closest(".file-uploader").find('.file[data-uploaded="1"]').length;if("upload"==e){if(t.files&&t.files[0]){var n=new FileReader;a.attr("data-uploaded",1),a.removeClass("d-none"),n.onload=function(t){a.find("img").attr("src",t.target.result)},n.readAsDataURL(t.files[0]),i++}}else i--;i>=a.closest(".file-uploader").data("limit")?a.closest(".file-uploader").find(".btn-upload").addClass("d-none"):a.closest(".file-uploader").find(".btn-upload").removeClass("d-none"),"remove"==e&&a.remove()}function cookieProcess(t,e,a){void 0===e.value&&(e.value=""),void 0===e.minutes&&(e.minutes=1);var i=[{name:"name",value:e.name},{name:"value",value:e.value},{name:"minutes",value:e.minutes},],n="getCookie";"set"==t?n="setCookie":"delete"==t&&(n="eraseCookie"),ajaxFormGate("POST","Visitor",n,i,!1,function(t){void 0!==a&&a(t.value)},!1)}function customAppEffects(t,e){try{if(0===parseInt(t.trigger_status)||"page_load"===t.trigger_type){e();return}if("time_on_page"===t.trigger_type)setTimeout(e,1e3*parseInt(t.trigger_time_on_page_value));else if("exit_intent"===t.trigger_type){let a=document.querySelector("body"),i,n=!1;a.addEventListener("mouseleave",t=>{(i=t.clientY)<0&&!n&&(e(),n=!0)})}else if("add_to_cart"===t.trigger_type)document.addEventListener("add_to_cart",t=>{e()},{once:!0});else if("scroll"===t.trigger_type){let r=window.innerHeight||document.documentElement.clientHeight,o=parseFloat(t.trigger_scroll_value);if("percentage"===t.trigger_scroll_type&&o>0&&(o=r*(o/100)),document.documentElement.scrollTop>=o)e();else{var s=!1;window.addEventListener("scroll",t=>{this.scrollY>o&&!s&&(s=!0,e())})}}else"click_button"===t.trigger_type?$(t.trigger_click_button_label).on("click",function(){e()}):"custom_event"===t.trigger_type&&document.addEventListener(t.trigger_custom_event_value,t=>{e()},{once:!0})}catch(d){}}function customAppScreenPosition(t){"html_element"===$(t).data("position-type")&&$($(t).data("position-element")).length>0?("after"===$(t).data("position-element-location")?$(t).insertAfter($($(t).data("position-element"))):"before"===$(t).data("position-element-location")?$(t).insertBefore($($(t).data("position-element"))):"inside_top"===$(t).data("position-element-location")?$($(t).data("position-element")).prepend($(t)):"inside_bottom"===$(t).data("position-element-location")?$($(t).data("position-element")).append($(t)):$($(t).data("position-element")).html($(t)),$(t).css("display","flex")):"html_element"!==$(t).data("position-type")&&$(t).css("display","flex"),"header"==$(t).data("position-type")?$("body").prepend($(t)):"footer"==$(t).data("position-type")&&$("body").append($(t))}function disableAutoComplete(){let t=["country","city","district","invoice_country","invoice_city","invoice_district",],e,a,i;for(let n in t)a="select[name="+(e=t[n])+"]",i="input[name="+e+"]",$(a).length>0&&$(a).prop("autocomplete","ecom-"+e.substring(0,3)),$(i).length>0&&$(i).prop("autocomplete","ecom-"+e.substring(0,3))}function formEmptyFields(t,e=[]){$(t).find(".message").remove(),$(t).find(".q-form-group").removeClass("form-error");let a,i;for(let n in e)a=e[n].name,i=e[n].message,$(t).find("*[data-input='"+a+"']").addClass("form-error"),0===$(t).find("*[data-input='"+a+"']").find(".message").length&&$(t).find("*[data-input='"+a+"']").append('<span class="message">'+i+"</span>"),$(t).find("*[data-input='"+a+"']").find(".form-control").on("change keyup",function(){$(this).closest(".q-form-group").removeClass("form-error"),$(this).closest(".q-form-group").find(".message").remove()});if($(t).find(".form-error").length>0){var r=$(t).find(".form-error").first().find(".form-control")[0];return r&&(r.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(function(){r.focus()},300)),!1}return!0}function downloadFile(t,e){var a=new XMLHttpRequest;a.open("GET",t,!0),a.responseType="blob",a.onload=function(t){var i=a.response;console.log(i.size);var n=document.createElement("a");n.href=window.URL.createObjectURL(i),n.download=e,n.click()},a.send()}function userCreateCollection(t,e){showBaseLoader();
1var a=$(t).serializeArray();return ajaxFormGate("POST","User","createCollection",a,!1,function(a){if("success"==a.status){if(hideNativeModal(e),"1"==$(t).find("input[name=urun_ekle]").val()){userAddToProductToCollection(a.collection_id,$(t).find("input[name=urun_id]").val());return}"account"===SITE_CONFIG.page&&$('*[data-collections="user"]').length>0&&("undefined"!=typeof userAccountListProductForCollection?("undefined"!=typeof userAccountCollections&&userAccountCollections(),userAccountListProductForCollection(a.collection_id)):window.location.reload())}else showAlert({title:LANG_HELPER.error,text:a.message||LANG_HELPER.errorMsg,status:a.status,buttonTitle:LANG_HELPER.ok})},!0),!1}function userProductCollection(t){if(!SITE_CONFIG.userIsLogin){showNativeModal("loginPage");return}showNativeModal("userAddProductToCollection",[{name:"product_id",value:t}])}function userAddToProductToCollection(t,e,a=!1){return 0==t?(a&&hideNativeModal(a),showNativeModal("userNewCollection",[{name:"action",value:"add_product_to_collection"},{name:"product_id",value:e}]),!1):(ajaxFormGate("POST","User","addProductToCollection",[{name:"collection_id",value:t},{name:"product_id",value:e}],!1,function(t){"success"==t.status?(a&&hideNativeModal(a),showAlert({title:LANG_HELPER.success,text:t.message,status:t.status,buttonTitle:LANG_HELPER.ok})):"auth"==t.status?showNativeModal("loginPage"):showAlert({title:LANG_HELPER.error,text:t.message||LANG_HELPER.errorMsg,status:t.status,buttonTitle:LANG_HELPER.ok})},!0),!1)}function userSaveCollection(t,e="reload"){ajaxFormGate("POST","User","saveCollection",[{name:"id",value:t}],!1,function(a){"success"==a.status?"reload"==e?window.location.reload():"toggle"==e&&($("*[data-collection-id='"+t.toString()+"'] *[data-add-collection]").addClass("d-none"),$("*[data-collection-id='"+t.toString()+"'] *[data-delete-collection]").removeClass("d-none")):"auth"==a.status?showNativeModal("loginPage"):showAlert({title:LANG_HELPER.error,text:a.message||LANG_HELPER.errorMsg,status:a.status,buttonTitle:LANG_HELPER.ok})},!1)}function userDeleteSavedCollection(t,e="reload"){ajaxFormGate("POST","User","deleteSavedCollection",[{name:"id",value:t}],!1,function(a){"success"==a.status?"reload"==e?window.location.reload():"toggle"==e?($("*[data-collection-id='"+t.toString()+"'] *[data-add-collection]").removeClass("d-none"),$("*[data-collection-id='"+t.toString()+"'] *[data-delete-collection]").addClass("d-none")):"delete-item"==e&&$("*[data-collection-id='"+t.toString()+"']").remove():showAlert({title:LANG_HELPER.error,text:a.message||LANG_HELPER.errorMsg,status:a.status,buttonTitle:LANG_HELPER.ok})},!1)}function qCarousel(){$(document).on("click",'.q-carousel a[role="button"]',function(){let t=$(this).parent(".q-carousel"),e=t.data("current-image"),a=t.data("images").split(","),i=a.length;"next"===$(this).data("slide")?e+=1:e-=1,e>i-1?e=0:e<0&&(e=i-1),t.data("current-image",e);let n=a[e];t.find("img").attr("src",n)});let t=0;$(document).on("touchstart",".q-carousel",function(e){t=e.touches[0].clientX}),$(document).on("touchend",".q-carousel",function(e){let a=e.changedTouches[0].clientX;t>a&&$(this).find('a[data-slide="next"]').click(),t<a&&$(this).find('a[data-slide="prev"]').click()})}function showVerificationCodeModal(t,e=!1,a=[]){q_verification_code_form_submit=null,showNativeModal("verificationCodeModal",[{name:"token",value:t}],function(t){e&&(q_verification_code_form_submit=function(){try{executeFunctionByName(e,a)}catch(t){console.log(t)}})})}function submitMarketingEvents(t){if(0===t.length)return;let e=[],a,i,n,r,o;for(let s=0;s<t.length;s++){a=t[s].platform,i=t[s].event_name,n=t[s].params,r=t[s].event_id,encryptedData=t[s].encrypted_data;try{if("google"===a)"undefined"!=typeof gtag&&gtag("event",i,n),"undefined"!=typeof gtm_account_defined&&((o=n).event=i,SITE_CONFIG.userId>0&&(o.userId=SITE_CONFIG.userId),dataLayer.push(o));else if("facebook"===a)"undefined"!=typeof fbq&&(r.length>2?fbq("track",i,n,{eventID:r}):fbq("track",i,n));else if("openai_ads"===a){if("undefined"!=typeof oaiq){let d={};r.length>2&&(d.event_id=r),t[s].custom_event_name&&(d.custom_event_name=t[s].custom_event_name),Object.keys(d).length>0?oaiq("measure",i,n,d):oaiq("measure",i,n)}}
1else"tiktok"===a&&"undefined"!=typeof ttq&&(r.length>2?ttq.track(i,n,{event_id:r}):ttq.track(i,n));encryptedData.length>2&&e.push({name:a,value:encryptedData}),"debug"===SITE_CONFIG.mode&&(console.log(a+" -> "+i),console.log(n),r.length>2&&console.log("event_id: "+r))}catch(l){console.log(l)}}e.length>0&&setTimeout(function(){ajaxFormGate("POST","Visitor","conversionEvents",e,!1,function(t){},!1)},500)}function qFloatNumberFormat(t,e=2){return parseFloat(Number(t||0).toFixed(e))}function qPriceRounding(t,e=0,a=0,i=2){if(t||(t=0),e<1||e>5||a<0||a>2||t<1)return t;let[n,r]=Number(t).toFixed(2).split(".");if(null==r)return t;let o=parseInt(n,10),s=+r[0],d=+r[1],l=+r,c=(t,e)=>`${t}.${e}`,u={1:[d>=5?c(n,s+"9"):c(s?n:o-1,s?s-1+"9":"99"),9===d?c(n,s+""+d):c(s?n:o-1,s?s-1+"9":"99"),c(n,s+"9"),],2:[d<5?c(n,s+"0"):c(9===s?o+1:n,9===s?"00":s+1+"0"),c(n,s+"0"),0===d?c(n,s+""+d):c(9===s?o+1:n,9===s?"00":s+1+"0"),],3:[c(l>=50?n:o-1,"99"),c(99===l?n:o-1,"99"),c(n,"99"),],4:[c(l>=40?n:o-1,"90"),c(l>=90?n:o-1,"90"),c(l<90?n:o+1,"90"),],5:[c(l>=50?o+1:n,"00"),c(n,"00"),c(0===l?n:o+1,"00"),]}[e][a];return qFloatNumberFormat(u,i)}function qFormatPrice(t,e=!0,a=!0){t=parseFloat(t||0),isNaN(t)&&(t=0);let i=t;return(i=(i=SITE_CONFIG.priceRounding.active&&a?qPriceRounding(t,parseInt(SITE_CONFIG.priceRounding.type),parseInt(SITE_CONFIG.priceRounding.direction),parseInt(SITE_CONFIG.currency.decimal)):qFloatNumberFormat(t,parseInt(SITE_CONFIG.currency.decimal))).toLocaleString("tr-TR",{minimumFractionDigits:SITE_CONFIG.currency.decimal,maximumFractionDigits:SITE_CONFIG.currency.decimal}),1==SITE_CONFIG.currency.displayType&&(i=(i=(i=i.replace(".","{dot}")).replace(",",".")).replace("{dot}",",")),e)?i+" "+SITE_CONFIG.currency.symbol:i}

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.