export const __webpack_esm_id__=59601;export const __webpack_esm_ids__=[2998,59601];export const __webpack_esm_modules__={59601(e,t,n){n.d(t,{D:()=>r});var o=n(22723),c=n(2998);const r={USER:"user",SERVER:"server"};function s(e){let t=r.USER,n=[],s=[],d=[],u=!0,a=[];return{updateActiveTabId:function(n){t=n,e.emitSync("activeTabIdUpdated",l())},getActiveTabId:l,onActiveTabIdUpdated:function(t){return e.subscribeSync("activeTabIdUpdated",e=>t(e))},getFiles:U,addFile:function(t){const n=U();n.push(t),m(n),e.emitSync("fileAdded",(0,o.cloneDeep)(t))},updateFiles:m,onFilesUpdated:function(t){return e.subscribeSync("filesUpdated",e=>t(e))},getImportedResources:f,updateImportedResources:function(t){n=t,e.emitSync("importedResourcesUpdated",f()),e.emitSync("resourcesUpdated",R())},onImportedResourcesUpdated:function(t){return e.subscribeSync("importedResourcesUpdated",e=>t(e))},getResources:R,onResourcesUpdated:function(t){return e.subscribeSync("resourcesUpdated",e=>t(e))},updateShowLoader:function(t){u=t,e.emitSync("showLoaderUpdated",p())},getShowLoader:p,onShowLoaderUpdated:function(t){return e.subscribeSync("showLoaderUpdated",e=>t(e))},updateSelectedFilesNames:function(t){a=(0,o.cloneDeep)(t),e.emitSync("selectedFilesNamesUpdated",i())},getSelectedFilesNames:i,onSelectedFilesNamesUpdated:function(t){return e.subscribeSync("selectedFilesNamesUpdated",e=>t(e))},updateResourceForUpload:function(e){const t=b(),n=t.find(({name:t})=>t===e.name);n?Object.assign(n,e):t.push(e),S(t)},getResourceForUpload:function(e){return(0,o.cloneDeep)(s.find(({name:t})=>t===e))},updateResourcesForUpload:S,getResourcesForUpload:b,onResourcesForUploadChanged:function(t){return e.subscribeSync("resourcesForUploadChanged",e=>t(e))}};function i(){return(0,o.cloneDeep)(a)}function p(){return u}function l(){return t}function m(t){d=(0,o.cloneDeep)(t),e.emitSync("filesUpdated",U())}function U(){return(0,o.cloneDeep)(d)}function f(){return(0,o.cloneDeep)(n)||[]}function R(){const e=f();let t=b();const n=[],o=[];return e.forEach(({name:e})=>{const r=t.find(({name:t})=>t===e);r&&(r.status===c.I.UPLOADED?n.push(r):o.push(r))}),n.length>0&&(t=t.filter(({name:e})=>!n.some(({name:t})=>t===e)),S(t,!1)),e.filter(({name:e})=>!o.some(t=>e===t)).concat(t)}function S(t,n=!0){s=(0,o.cloneDeep)(t),e.emitSync("resourcesForUploadChanged",b()),n&&e.emitSync("resourcesUpdated",R())}function b(){return(0,o.cloneDeep)(s)||[]}}angular.module("graphdb.framework.import.services.importcontext",[]).factory("ImportContextService",s),s.$inject=["EventEmitterService"]},2998(e,t,n){n.d(t,{I:()=>o});const o={NONE:"NONE",UPLOADING:"UPLOADING",UPLOAD_ERROR:"UPLOAD_ERROR",UPLOADED:"UPLOADED",PENDING:"PENDING",IMPORTING:"IMPORTING",DONE:"DONE",ERROR:"ERROR",INTERRUPTING:"INTERRUPTING"}}};
//# sourceMappingURL=59601.bd07748fb4b9a90d51ba.bundle.js.map