jQuery(document).ready(function(e){e(document).on("click",".upload-image",function(t){t.preventDefault();let n=e(this).prev(".image-url"),l=wp.media({title:"Select Image",button:{text:"Use Image"},multiple:!1});l.on("select",function(){let e=l.state().get("selection").first().toJSON();n.val(e.url).trigger("change")}),l.open()})});