!function(t,e){"use strict";if(void 0!==e){var a,i=e.views=e.views||{},n=i.MediaField,s=i.MediaItem,d=i.MediaList;a=i.ImageField=n.extend({createList:function(){this.list=new d({controller:this.controller,itemView:s.extend({className:"rwmb-image-item",template:e.template('\n\t\t\t\t\t\t<input type="hidden" name="{{{ data.controller.fieldName }}}" value="{{{ data.id }}}" class="rwmb-media-input">\n\t\t\t\t\t\t<div class="rwmb-file-icon">\n\t\t\t\t\t\t\t<# if ( \'image\' === data.type && data.sizes ) { #>\n\t\t\t\t\t\t\t\t<# if ( data.sizes[data.controller.imageSize] ) { #>\n\t\t\t\t\t\t\t\t\t<img src="{{{ data.sizes[data.controller.imageSize].url }}}">\n\t\t\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t\t\t<img src="{{{ data.sizes.full.url }}}">\n\t\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t\t<# if ( data.image && data.image.src && data.image.src !== data.icon ) { #>\n\t\t\t\t\t\t\t\t\t<img src="{{ data.image.src }}" />\n\t\t\t\t\t\t\t\t<# } else { #>\n\t\t\t\t\t\t\t\t\t<img src="{{ data.icon }}" />\n\t\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t\t<# } #>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="rwmb-image-overlay"></div>\n\t\t\t\t\t\t<div class="rwmb-image-actions">\n\t\t\t\t\t\t\t<a class="rwmb-image-edit rwmb-edit-media" title="{{{ i18nRwmbMedia.edit }}}" href="{{{ data.editLink }}}" target="_blank">\n\t\t\t\t\t\t\t\t<span class="dashicons dashicons-edit"></span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<a href="#" class="rwmb-image-delete rwmb-remove-media" title="{{{ i18nRwmbMedia.remove }}}">\n\t\t\t\t\t\t\t\t<span class="dashicons dashicons-no-alt"></span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t')})})}}),e.$document.on("mb_ready",function(e){t(e.target).find(".rwmb-custom_image_advanced").each(m)}).on("clone",".rwmb-custom_image_advanced",m)}else console.error("rwmb is not defined");function m(){var e=t(this),i=e.data("view");i||(i=new a({input:this}),e.siblings(".rwmb-media-view").remove(),e.after(i.el),e.data("view",i))}}(jQuery,rwmb);