jQuery(document).ready(function(a){"use strict";a(".wpsr-reviews-wrapper").each(function(){var r=("."+a(this).attr("class")).match(/wpsr-reviews-(\d+)/),e=null;r&&(e=r[1]);var i=window.wpsr_ajax_params.upload_url,s={action:"wpsr_review_resize_images",id:e,platforms:document.querySelector(".wpsr-reviews-".concat(e)).getAttribute("data-platforms").split(","),nonce:window.wpsr_ajax_params&&window.wpsr_ajax_params.wpsr_nonce?window.wpsr_ajax_params.wpsr_nonce:""};a.ajax({url:window.wpsr_ajax_params.ajax_url,type:"post",data:s}).done(function(r){if(r){var e=r.match(/({[^{}]+})/g),s=JSON.parse(e);s.images_data&&jQuery(".wpsr-all-reviews").find(".wpsr-review-template").each(function(r){var e,t=a(this),w=t.attr("data-source_id"),n=t.attr("data-media_id"),p=t.attr("data-image_resize"),o=t.attr("data-review_platform");if(n){n=n.toString();var _=(e=window.wpsr_ajax_params&&window.wpsr_ajax_params.image_settings&&window.wpsr_ajax_params.image_settings.image_format?window.wpsr_ajax_params.image_settings.image_format:"",["jpg","webp"].includes(e)?e:"jpg");if(o&&w&&s.images_data.includes(n)){var m=i+"/"+o+"/"+w+"/"+n+"_"+p+"."+_;t.find(".wpsr-reviewer-avatar").attr("src",m),t.find(".wpsr-reviewer-image-url").removeClass("wpsr-reviewer-image-animation")}}})}}).fail(function(a){console.error(a)}).always(function(){})})});