(()=>{var t=document.getElementById("product-options-size-container");window.loadColor=function(e,o){$.ajax({method:"POST",url:window.Lara.routes.products.loadColor,data:{_token:document.querySelector("meta[name=csrf-token]").getAttribute("value"),slug:o},beforeSend:function(){Swal.fire({title:"Ýüklenilýär",allowOutsideClick:!1,timer:500,timerProgressBar:!0,didOpen:function(){Swal.showLoading()}})},success:function(o){$(".product-options__value__color").removeClass("active"),setInterval(500,(function(){swal.close()})),e.classList.add("active");var n=o.data.product;window.Lara.productOnCart=n.data.id,function(t){var e=document.getElementById("product-sku"),o=document.getElementById("product-barcode"),n=document.getElementById("product-options-stock"),a=document.getElementById("product-price-amount"),c=document.getElementById("product-old-price-amount");if(e&&(e.innerHTML=t.data.sku),o&&(o.innerHTML=t.data.barcode),n){var r=JSON.parse(t.data.options);n.innerHTML=r.quantity}a&&(a.innerHTML="<span>".concat(t.data.price_amount," TMT</span>")),c&&t.data.old_price_amount&&(c.innerHTML="<span>".concat(t.data.old_price_amount," TMT</span>"))}(n);var a="",c=0;n.sizes.map((function(t){a+='\n                    <div class="product-options__value product-options__value__size product-options__value--large-text d-flex flex-center border cursor-pointer  lazyload '.concat(0===c?"active":"",'" onclick="loadSize(this, ').concat(t.id,')">\n                        ').concat(t.size,"\n                    </div>\n                "),c++})),t.innerHTML=a},error:function(t){console.log({exception:t})}})}})();