'+(void 0===n?'':n)+''+("undefined"===t||void 0===t?"undefined":t)+''+e+"
";return"media"===s&&(r=r+'
'),r+="
"}},{key:"update_smush_ids",value:function(e){if(void 0!==wp_smushit_data.unsmushed&&wp_smushit_data.unsmushed.length>0){var t=wp_smushit_data.unsmushed.indexOf(e);t>-1&&wp_smushit_data.unsmushed.splice(t,1)}if(void 0!==wp_smushit_data.resmush&&wp_smushit_data.resmush.length>0){var n=wp_smushit_data.resmush.indexOf(e);n>-1&&wp_smushit_data.resmush.splice(n,1)}}}],(n=[{key:"start",value:function(){this.button.attr("disabled","disabled"),this.button.addClass("wp-smush-started"),this.bulk_start(),this.single_start()}},{key:"bulk_start",value:function(){this.is_bulk&&(jQuery(".wp-smush-bulk-wrapper").hide(),jQuery(".sui-notice-top").remove(),jQuery(".wp-smush-bulk-progress-bar-wrapper .sui-notice-warning").hide(),0>=jQuery("div.smush-final-log .smush-bulk-error-row").length&&jQuery("div.smush-final-log").hide(),jQuery(".bulk-smush-wrapper .wp-smush-bulk-progress-bar-wrapper").show())}},{key:"single_start",value:function(){this.is_bulk||(this.show_loader(),this.status.removeClass("error"))}},{key:"enable_button",value:function(){this.button.prop("disabled",!1),jQuery(".wp-smush-all").removeAttr("disabled"),jQuery("button.wp-smush-scan, a.wp-smush-lossy-enable, button.wp-smush-resize-enable, button#wp-smush-save-settings").removeAttr("disabled")}},{key:"show_loader",value:function(){e.progress_bar(this.button,wp_smush_msgs.smushing,"show")}},{key:"hide_loader",value:function(){e.progress_bar(this.button,wp_smush_msgs.smushing,"hide")}},{key:"single_done",value:function(){if(!this.is_bulk){this.hide_loader();var t=this;this.request.done(function(n){if(void 0!==n.data){var i=t.status.parent();i.find(".smush-stats-wrapper");n.data.status&&(i.find(".smush-status-links").remove(),t.status.replaceWith(n.data.status)),e.membership_validity(n.data),n.success&&"Not processed"!==n.data?(t.status.removeClass("sui-hidden"),t.button.parent().removeClass("unsmushed").addClass("smushed"),t.button.remove()):(t.status.addClass("error"),t.status.html(n.data.error_msg),t.status.show()),i.append(n.data.stats),e.update_image_stats(n.data.new_size)}t.enable_button()}).fail(function(e){t.status.html(e.data),t.status.addClass("error"),t.enable_button()})}}},{key:"sync_stats",value:function(){var t=jQuery("div.wp-smush-bulk-progress-bar-wrapper div.wp-smush-count.tc"),n=t.html();t.html(wp_smush_msgs.sync_stats),jQuery.ajax({type:"GET",url:this.url,data:{action:"get_stats"},success:function(t){t&&void 0!==t&&(t=t.data,jQuery.extend(wp_smushit_data,{count_images:t.count_images,count_smushed:t.count_smushed,count_total:t.count_total,count_resize:t.count_resize,count_supersmushed:t.count_supersmushed,savings_bytes:t.savings_bytes,savings_conversion:t.savings_conversion,savings_resize:t.savings_resize,size_before:t.size_before,size_after:t.size_after}),e.update_stats(this.smush_type))}}).always(function(){return t.html(n)})}},{key:"bulk_done",value:function(){if(this.is_bulk){this.enable_button();var e=jQuery(".sui-summary-smush .smush-stats-icon");if(0===this.ids.length)e.addClass("sui-hidden"),jQuery(".bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").show(),jQuery(".wp-smush-bulk-wrapper").hide(),jQuery(".wp-smush-bulk-progress-bar-wrapper").hide();else{e.removeClass("sui-icon-loader sui-loading sui-hidden").addClass("sui-icon-info sui-warning");var t=jQuery(".bulk-smush-wrapper .wp-smush-resmush-notice");t.length>0?t.show():jQuery(".bulk-smush-wrapper .wp-smush-remaining").show()}jQuery(".wp-resmush.wp-smush-action, .wp-smush-scan").removeAttr("disabled")}}},{key:"is_resolved",value:function(){return"resolved"===this.deferred.state()}},{key:"free_exceeded",value:function(){var e=jQuery(".wp-smush-bulk-progress-bar-wrapper");e.addClass("wp-smush-exceed-limit"),e.find(".sui-progress-block .wp-smush-cancel-bulk").addClass("sui-hidden"),e.find(".sui-progress-block .wp-smush-all").removeClass("sui-hidden"),e.find("i.sui-icon-loader").addClass("sui-icon-info").removeClass("sui-icon-loader").removeClass("sui-loading")}},{key:"update_remaining_count",value:function(){if(this.is_bulk_resmush){var e=jQuery(".wp-smush-resmush-notice .wp-smush-remaining-count");e.length&&void 0!==this.ids&&e.html(this.ids.length)}else{var t=jQuery(".bulk-smush-wrapper .wp-smush-remaining-count");t.length&&void 0!==this.ids&&t.html(this.ids.length)}var n=jQuery(".smush-sidenav .wp-smush-remaining-count");n.length&&void 0!==this.ids&&(this.ids.length>0?n.html(this.ids.length):(jQuery(".sui-summary-smush .smush-stats-icon").addClass("sui-hidden"),n.removeClass("sui-tag sui-tag-warning").html("")))}},{key:"update_progress",value:function(t){if(this.is_bulk_resmush||this.is_bulk){var n="";t&&void 0!==t.data&&void 0!==t.data.stats&&e.update_localized_stats(t.data.stats,this.smush_type),this.is_bulk_resmush?(t.success&&(wp_smushit_data.resmush.length>0?jQuery(".wp-smush-images-remaining").html(wp_smushit_data.resmush.length):0===wp_smushit_data.resmush.length&&0===this.ids.length&&(jQuery(".bulk-resmush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").removeClass("sui-hidden"),jQuery(".wp-smush-resmush-wrap, .wp-smush-bulk-progress-bar-wrapper").hide())),void 0!==this.ids&&void 0!==this.total&&this.total>0&&(n=(this.smushed+this.errors.length)/this.total*100)):n=(this.smushed+this.errors.length)/this.total*100,0===this.ids.length&&("nextgen"!==this.smush_type&&this.sync_stats(),jQuery(".bulk-smush-wrapper .wp-smush-all-done, .wp-smush-pagespeed-recommendation").show(),jQuery(".wp-smush-bulk-wrapper").hide()),this.update_remaining_count(),this._update_progress(this.smushed+this.errors.length,WP_Smush.helpers.precise_round(n,1)),e.update_stats(this.smush_type)}}},{key:"_update_progress",value:function(e,t){(this.is_bulk||this.is_bulk_resmush)&&(jQuery("span.wp-smush-images-percent").html(t+"%"),jQuery(".bulk-smush-wrapper .wp-smush-progress-inner").css("width",t+"%"),jQuery(".bulk-smush-wrapper .sui-progress-state-text").find("span:first-child").html(e).find("span:last-child").html(this.total))}},{key:"continue",value:function(){var e=this.button.attr("continue_smush");return void 0===e&&(e=!0),"false"!==e&&e||(e=!1),e&&this.ids.length>0&&this.is_bulk}},{key:"increment_errors",value:function(e){this.errors.push(e)}},{key:"increment_smushed",value:function(e){this.smushed=this.smushed+1}},{key:"call_ajax",value:function(){var t="";this.current_id=this.is_bulk?this.ids.shift():this.button.data("id"),e.update_smush_ids(this.current_id);var n=this.button.parent().find("#_wp_smush_nonce");n&&(t=n.val());var i=this;return this.request=e.ajax(this.is_bulk_resmush,this.current_id,this.url,t).done(function(t){if(void 0===t.success||void 0!==t.success&&!1===t.success&&void 0!==t.data&&"limit_exceeded"!==t.data.error){i.increment_errors(i.current_id);var n=e.prepare_error_row(t.data.error_message,t.data.file_name,t.data.thumbnail,i.current_id,i.smush_type);i.log.show(),i.errors.length>5?jQuery(".smush-bulk-errors-actions").removeClass("sui-hidden"):i.log.find(".smush-bulk-errors").append(n)}else void 0!==t.success&&t.success&&i.increment_smushed(i.current_id);(e.membership_validity(t.data),void 0===t.data||"limit_exceeded"!==t.data.error||i.is_resolved())?i.is_bulk?i.update_progress(t):0===i.ids.length&&i.sync_stats():(document.getElementById("bulk_smush_warning").classList.remove("sui-hidden"),i.button.attr("continue_smush",!1),wp_smushit_data.unsmushed.unshift(i.current_id),i.ids.unshift(i.current_id),i.free_exceeded());i.single_done()}).always(function(){i.continue()&&i.is_bulk?i.call_ajax():i.deferred.resolve()}),this.deferred.errors=this.errors,this.deferred}},{key:"run",value:function(){this.is_bulk&&this.ids.length>0&&this.call_ajax(),this.is_bulk||this.call_ajax()}},{key:"bind_deferred_events",value:function(){var e=this;this.deferred.done(function(){if(e.button.removeAttr("continue_smush"),e.errors.length){var t=wp_smush_msgs.error_in_bulk.replace("{{errors}}",e.errors.length).replace("{{total}}",e.total).replace("{{smushed}}",e.smushed);jQuery(".wp-smush-all-done").addClass("sui-notice-warning").removeClass("sui-notice-success").find("p").html(t)}e.bulk_done(),jQuery(".wp-smush-all:not(.wp-smush-finished), .wp-smush-scan").removeAttr("disabled")})}},{key:"cancel_ajax",value:function(){var t=this;jQuery(".wp-smush-cancel-bulk").on("click",function(){t.button.attr("continue_smush",!1),t.sync_stats(),e.update_stats(this.smush_type),t.request.abort(),t.enable_button(),t.button.removeClass("wp-smush-started"),wp_smushit_data.unsmushed.unshift(t.current_id),jQuery(".wp-smush-bulk-wrapper").show(),jQuery(".wp-smush-bulk-progress-bar-wrapper").hide()})}}])&&s(t.prototype,n),r&&s(t,r),e}();t.a=r},function(e,t,n){var i;
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*/
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*/
!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,s){"use strict";var r=[],o=n.document,a=Object.getPrototypeOf,u=r.slice,l=r.concat,c=r.push,d=r.indexOf,h={},p=h.toString,f=h.hasOwnProperty,m=f.toString,g=m.call(Object),v={},y=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},_=function(e){return null!=e&&e===e.window},w={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var i,s,r=(n=n||o).createElement("script");if(r.text=e,t)for(i in w)(s=t[i]||t.getAttribute&&t.getAttribute(i))&&r.setAttribute(i,s);n.head.appendChild(r).parentNode.removeChild(r)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?h[p.call(e)]||"object":typeof e}var k=function(e,t){return new k.fn.init(e,t)},C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function S(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!y(e)&&!_(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}k.fn=k.prototype={jquery:"3.4.1",constructor:k,length:0,toArray:function(){return u.call(this)},get:function(e){return null==e?u.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(e){return this.pushStack(k.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(u.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n