define(["baseView","loading","metadataEditor","metadatamanager/metadatamanagersidebar","css!./metadatamanager","emby-scroller"],function(BaseView,loading,metadataEditor){"use strict";function refresh(context,itemId){loading.show(),itemId?metadataEditor.embed(context.querySelector(".editPageInnerContent"),itemId,ApiClient.serverInfo().Id):(context.querySelector(".editPageInnerContent").innerHTML="",loading.hide())}function MetadataManagerView(view,params){BaseView.apply(this,arguments),window.MetadataEditor.setCurrentItemId(null),view.querySelector(".libraryTree").addEventListener("itemclicked",function(event){var data=event.detail;data.id!==window.MetadataEditor.getCurrentItemId()&&(window.MetadataEditor.setCurrentItemId(data.id),refresh(view,data.id))})}return Object.assign(MetadataManagerView.prototype,BaseView.prototype),MetadataManagerView.prototype.onResume=function(options){BaseView.prototype.onResume.apply(this,arguments),options.refresh&&(refresh(this.view,window.MetadataEditor.getCurrentItemId()),window.MetadataEditor.refresh(this.view))},MetadataManagerView});