(function(){"use strict";jQuery(function(t){let n=null;const c="<?php echo esc_attr( $button_text ) ?>",o="<?php echo esc_attr( $select_title ) ?>";function l(){t("#pwspfwc_plugin_icon").on("input",function(){const e=t(this).val();t("#pwspfwc_img_icon").attr("src",e)}),t("#pwspfwc_btn_reset").on("click",function(){const e=t(this).data("defaulticon");t("#pwspfwc_plugin_icon").val(e).trigger("input")}),t("#pwspfwc_btn_upload").on("click",function(e){if(e.preventDefault(),n){n.open();return}n=wp.media.frames.file_frame=wp.media({title:o,button:{text:c},library:{type:"image"},multiple:!1}),n.on("select",function(){const i=n.state().get("selection").first().toJSON(),p=i.sizes.thumbnail?i.sizes.thumbnail.url:i.url;t("#pwspfwc_plugin_icon").val(p).trigger("input")}),n.open()})}t(()=>l())})})();
