var academic_pro_file_frame;jQuery(function(a){jQuery(document).on("click","input.select-img",function(b){var c=a(this);b.preventDefault();var d=wp.media.controller.Library.extend({defaults:_.defaults({id:"tpiw-insert-image",title:c.data("uploader_title"),allowLocalEdits:!1,displaySettings:!0,displayUserSettings:!1,multiple:!1,library:wp.media.query({type:"image"})},wp.media.controller.Library.prototype.defaults)});academic_pro_file_frame=wp.media.frames.academic_pro_file_frame=wp.media({button:{text:jQuery(this).data("uploader_button_text")},state:"tpiw-insert-image",states:[new d],multiple:!1}),academic_pro_file_frame.on("select",function(){var a=academic_pro_file_frame.state("tpiw-insert-image"),b=a.get("selection"),d=a.display(b.first()).toJSON(),e=b.first().toJSON();d=wp.media.string.props(d,e);var f=c.siblings(".img"),g=d.src;f.val(g);var h=c.siblings(".tpiw-preview-wrap");h.show(),h.find("img").attr("src",g)}),academic_pro_file_frame.open()})});